web-ide icon indicating copy to clipboard operation
web-ide copied to clipboard

Test of Builtin Memory chip hanging in Chrome

Open kebasye opened this issue 10 months ago • 3 comments

Tool

Hardware Simulator

Interface

Website (https://nand2tetris.github.io/web-ide)

Contact Details

[email protected]

What happened?

Working on Chrome under Mac/Sonoma, I consistently hang the browser running the standard test for the Memory chip. This happens at the keyboard test, somewhere in this section:

set address 24576, echo "Click the Keyboard icon and hold down the 'K' key (uppercase) until you see the next message...", // It's important to keep holding the key down since if the system is busy, // the memory will zero itself before being outputted.

while out <> 75 { tick, tock, // tick, tock prevents hang if sync. parts used in KB path. }

clear-echo, output;

The echo doesn't show up in the interface and the rest of the interface becomes non-responsive (can't enable/disable keyboard, pause/reset test script, scroll, etc.). Pressing K has no effect. Eventually, Chrome puts up the "page not responsive" dialog with options "Wait" and "Exit page." Waiting doesn't help.

When I replaced the comma at the end of the echo with a semicolon, the echo did show up when I stepped through the test. The next step, which seems to be the while loop, clear-echo, and output, hung as before. I had the keyboard enabled and was holding down the K key, but it was still hung.

Chrome: Version 133.0.6943.54 (Official Build) (arm64) Mac: M2 running Sonoma - 14.1.1 (23B81)

Additional Comments

Thanks for a terrific tool!

Do you want to try to fix this bug?

  • [ ] I want to try to add this feature!

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

kebasye avatar Feb 07 '25 21:02 kebasye

I also ran into this. This only happens if you don't use browser storage.

emilesilvis avatar May 29 '25 19:05 emilesilvis

What does it mean "Click the Keyboard icon and hold down the 'K' key (uppercase) until you see the next message..."?

I can't find a keyboard icon.

e-rairigh avatar Jul 21 '25 19:07 e-rairigh

You can work around the bug (at least in chromium) by ignoring the instruction to keep the key pressed down. Instead, press the key once at a time until you see the correct value show up in the simulator. If it shows nothing or just Shift, try again. I found that holding down the Shift and pressing the k two or three times worked. It only needs to register the key once to complete the loop and continue the test. You then need to do the same for Y later in the test.

Following the given instructions (a) hurt my fingers and (b) turned my laptop into a room heater. Eventually, I had to kill the app.

At least for chromium, the instructions are completely wrong.

Note that it may be that following my workaround can lead to the problem the instructions try to prevent. But it is at least possible to successfully complete the test (or to unsuccessfully complete it) with the workaround. (I ran this three or four times with and without errors and didn't experience the zeroing problem.)

[Edit]

6.16.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 10 Sep 2025 00:38:07 +0000 x86_64 GNU/Linux

cfr42 avatar Oct 07 '25 20:10 cfr42