velxio/frontend/src/__tests__
David Montero Crespo 47adb0b1c8 fix(chipbus): Galaksija boots + displays + types live in the browser
The gallery example loaded but the Z80 never visibly ran: the screen stayed
frozen on garbage. Two multi-chip async-load races, neither caught by the
existing headless tests (which drive RESET manually and attach the display
before boot):

1. RESET edge-vs-level race. The Z80 only left reset on the RISING edge of
   RESET (a pin watch). In the browser the 7 chips instantiate asynchronously,
   so the small power-on-reset chip releases RESET before the larger Z80 has
   registered its watch -> the edge is lost and the CPU stays in reset forever.
   Fix: on_clock samples the RESET level (hardware-accurate; RESET is
   level-sensitive) so a missed edge self-corrects. An undriven RESET reads low,
   so the CPU safely stays in reset until something drives it high.
   Repro/guard: chipbus-galaksija-reset-race (race ordering must still boot).

2. Display-snoop load-order race. galaksija-display was a passive write-snoop;
   the ROM paints the screen ONCE at boot then idles, so a display that comes up
   late misses every write and shows stale content forever. A snoop cannot
   recover writes it never saw. Fix: fold the screen into the RAM chip
   (galaksija-ram-display) and render from the ACTUAL video RAM (0x2800-0x2BFF,
   internal 0x0800 with A0-A12 wiring) on a ~30 fps timer - correct regardless
   of load order, exactly how the real machine scans video RAM.
   Repro/guard: chipbus-galaksija-display-snoop-race (late snoop shows nothing)
   + chipbus-galaksija-ram-display (renders even when first paint is post-boot).

The example now has 6 chips (RAM+display merged, gdisp dropped), 76 wires.
Verified live in the browser: boots to "@'READY", shows the ">" prompt, and
pressing A echoes ">A_" through keyboard -> Z80 -> video RAM -> display. The
full chipbus suite is 45/45.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:47:30 -03:00
..
__snapshots__ test(snapshots): refresh smart-ui-eyes netlist after circuit was wired 2026-05-23 08:28:08 +02:00
fixtures fix(chipbus): Galaksija boots + displays + types live in the browser 2026-06-05 15:47:30 -03:00
helpers fix(stop): preserve display state on Stop, only blank on Reset 2026-05-26 18:54:17 +02:00
AVRSimulator.test.ts
PinManager.test.ts
RP2040Simulator.test.ts Add HD44780Decoder and various I2C sketches 2026-05-12 14:26:33 -03:00
SignalRouter.test.ts fix(esp32): LEDC signal IDs are 71-86 per ESP32 TRM, not 72-87 2026-05-17 05:42:52 +02:00
ammeter-waveform.test.ts feat(sim): Phase 1c G+F3 — retire legacy CircuitScheduler / eecircuit-engine 2026-05-15 21:46:34 +02:00
arduino-arduino-spi.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
arduino-esp32-uart.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
arduino-pico-digital.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
arduino-pico-i2c.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
arduino-pico-mixed-uart.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
attiny85-simulation.test.ts
avr-uart-tx-waveform.test.ts feat(avr/uart): synthesize bit-level TX waveform on PD1/PE1 2026-05-22 19:49:43 +02:00
board-kinds-coverage.test.ts test(board-coverage): accept the 6 new STM32 variant boards as uncovered 2026-05-31 08:37:58 +02:00
board-removal-running-reconcile.test.ts refactor(sim): single-board example load rebuilds from scratch 2026-05-31 23:23:41 +02:00
capacitor-charge-transient.test.ts feat(sim): Phase 1d #3 + #5 — WASM pre-boot on mount + delete dead wire* utils 2026-05-15 22:24:31 +02:00
chipbus-buskernel.test.ts feat(chipbus): Phase 2 - synchronous settle kernel (settle-before-read) 2026-06-05 02:36:54 -03:00
chipbus-buslogic.test.ts feat(chipbus): Phase 1 - 4-valued logic + drive-strength tri-state buses 2026-06-05 02:18:47 -03:00
chipbus-busnets.test.ts feat(chipbus): Phase 1 - 4-valued logic + drive-strength tri-state buses 2026-06-05 02:18:47 -03:00
chipbus-galaksija-boot.test.ts test(chipbus): a real Galaksija (1983 Z80 home computer) boots over the bus 2026-06-05 11:55:28 -03:00
chipbus-galaksija-computer.test.ts feat(chipbus): Galaksija home computer gallery example + browser perf throttle 2026-06-05 13:49:33 -03:00
chipbus-galaksija-display-snoop-race.test.ts fix(chipbus): Galaksija boots + displays + types live in the browser 2026-06-05 15:47:30 -03:00
chipbus-galaksija-display.test.ts feat(chipbus): Galaksija home computer gallery example + browser perf throttle 2026-06-05 13:49:33 -03:00
chipbus-galaksija-keyboard.test.ts feat(chipbus): Galaksija keyboard - type BASIC over the bus 2026-06-05 14:37:42 -03:00
chipbus-galaksija-ram-display.test.ts fix(chipbus): Galaksija boots + displays + types live in the browser 2026-06-05 15:47:30 -03:00
chipbus-galaksija-reset-race.test.ts fix(chipbus): Galaksija boots + displays + types live in the browser 2026-06-05 15:47:30 -03:00
chipbus-netkey.test.ts feat(chipbus): Phase 0 - net-identity shared key for chip-to-chip buses 2026-06-05 01:18:08 -03:00
chipbus-twochip-integration.test.ts feat(chipbus): Phase 1 - 4-valued logic + drive-strength tri-state buses 2026-06-05 02:18:47 -03:00
chipbus-z80-ram-decode.test.ts test(chipbus): Phase 3 core - Z80 + ROM + RAM + address decode over the bus 2026-06-05 10:23:57 -03:00
chipbus-z80-rom-boot.test.ts test(chipbus): live proof - a real Z80 boots from a ROM over the bus 2026-06-05 10:07:26 -03:00
circuit-simulation-service.test.ts fix(circuit-sim): stop() guard + drop edges with no V-source post-rebuild 2026-05-20 03:49:29 +02:00
circuit-verifier.test.ts Add end-to-end tests for ESP32 I2C functionality and circuit verification 2026-05-12 16:55:15 -03:00
component-metadata-bmp280.test.ts test(metadata): drill into components array for BMP280 lookup 2026-05-09 23:52:36 +02:00
component-to-spice.test.ts test: align photoresistor-sensor fixtures + snapshots with 603b791 alias 2026-05-19 18:29:21 -03:00
components-metadata-integrity.test.ts test(sim): Phase 1d-tests J + C — vitest.config.ts + components-metadata integrity 2026-05-15 22:58:12 +02:00
dual-arduino-digital.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
dual-arduino-hw-uart.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
dual-arduino-multi-protocol.test.ts Add end-to-end tests for ESP32 I2C functionality and circuit verification 2026-05-12 16:55:15 -03:00
dual-arduino-software-serial.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
dual-esp32-uart.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
dual-pico-digital.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
dual-pico-multi-protocol.test.ts Add end-to-end tests for ESP32 I2C functionality and circuit verification 2026-05-12 16:55:15 -03:00
dual-pico-serial-passthrough.test.ts Add end-to-end tests for ESP32 I2C functionality and circuit verification 2026-05-12 16:55:15 -03:00
epaper-part-integration.test.ts
esp32-dht22-flow.test.ts test(esp32): add hardResetPinStates to PinManager mocks in 6 test files 2026-05-28 19:31:43 +02:00
esp32-integration.test.ts test(esp32): add hardResetPinStates to PinManager mocks in 6 test files 2026-05-28 19:31:43 +02:00
esp32-multi-servo-gpio-matrix.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
esp32-rectifier-integration.test.ts
esp32-servo-pot.test.ts test(esp32): add hardResetPinStates to PinManager mocks in 6 test files 2026-05-28 19:31:43 +02:00
esp32-wifi-bluetooth.test.ts test(esp32): add hardResetPinStates to PinManager mocks in 6 test files 2026-05-28 19:31:43 +02:00
esp32-wifi-compile.test.ts
esp32-wifi-webserver-integration.test.ts test(esp32): add hardResetPinStates to PinManager mocks in 6 test files 2026-05-28 19:31:43 +02:00
esp32c3-blink.test.ts fix(tests): update mocks + assertions for PinManager API changes 2026-05-19 04:52:30 +02:00
esp32c3-simulation.test.ts fix(tests): update mocks + assertions for PinManager API changes 2026-05-19 04:52:30 +02:00
esp32c3-wifi-bluetooth.test.ts test(esp32): add hardResetPinStates to PinManager mocks in 6 test files 2026-05-28 19:31:43 +02:00
examples-all-buckets-smoke.test.ts test(sim): Phase 1d-tests B — smoke test 100-days + epaper + picow-wifi + circuits 2026-05-15 23:05:33 +02:00
examples-analog-live.test.ts feat(sim): Phase 1d #2 + #9 — convergence helpers in Worker + enable LM358 subckt 2026-05-15 22:17:06 +02:00
examples-analog.test.ts feat(sim): Phase 1d #2 + #9 — convergence helpers in Worker + enable LM358 subckt 2026-05-15 22:17:06 +02:00
examples-circuits.test.ts
examples-digital.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
examples-gallery-smoke.test.ts feat(sim): Phase 1d #1 — gallery smoke test imports real examples + shared helper 2026-05-15 22:11:28 +02:00
examples-netlist-snapshot.test.ts test(sim): Phase 1d-tests A — netlist snapshots for every gallery example 2026-05-15 23:00:14 +02:00
examples-pico-doom.test.ts fix(examples/pico-doom): wire ILI9341 power + MISO 2026-05-14 23:22:31 -03:00
firmware-loader.test.ts
flip-flop-parts.test.ts
i2c-complex-scenarios.test.ts Add HD44780Decoder and various I2C sketches 2026-05-12 14:26:33 -03:00
i2c-esp32-multiboard-bridge.test.ts feat(i2c): cross-board bridging across all velxio boards (AVR/RP2040/ESP32 xtensa+riscv) 2026-05-12 17:51:39 -03:00
i2c-esp32-real-firmware.test.ts feat(i2c): cross-board bridging across all velxio boards (AVR/RP2040/ESP32 xtensa+riscv) 2026-05-12 17:51:39 -03:00
i2c-interconnect-bridge.test.ts Add HD44780Decoder and various I2C sketches 2026-05-12 14:26:33 -03:00
i2c-lcd-coupling-gap.test.ts Add HD44780Decoder and various I2C sketches 2026-05-12 14:26:33 -03:00
i2c-multi-board-slave-gap.test.ts feat(i2c): cross-board bridging across all velxio boards (AVR/RP2040/ESP32 xtensa+riscv) 2026-05-12 17:51:39 -03:00
i2c-real-firmware.test.ts Add HD44780Decoder and various I2C sketches 2026-05-12 14:26:33 -03:00
install-libraries.test.ts
instruments.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
integration.test.ts
interactive-parts.test.ts
interconnect-routing.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
issue-122-micropython-esp32.test.ts
library-compile.integration.test.ts ci: Phase 1d-tests I + K + L — workflow hardening + nightly library-compile 2026-05-15 23:19:11 +02:00
load-example-transitions.test.ts feat(sim): Stop halts custom chips + LEDs go dark; retro chip examples go board-less 2026-06-04 04:32:44 +02:00
load-ngspice-for-node.test.ts feat(sim): Phase 1c F1 — NgSpiceNodeAdapter runs real WASM in Node tests 2026-05-15 20:49:39 +02:00
logic-families.test.ts feat(sim): Phase 3 — logic families (TTL/CMOS-5V/LVCMOS33/AVR_HC/Schmitt) 2026-05-15 16:42:11 +02:00
logic-gate-parts.test.ts
mega-emulation.test.ts Add HD44780Decoder and various I2C sketches 2026-05-12 14:26:33 -03:00
mixed-mode-bjt-switch-integration.test.ts feat(sim): Phase 1c G+F3 — retire legacy CircuitScheduler / eecircuit-engine 2026-05-15 21:46:34 +02:00
mixed-mode-scheduler.test.ts feat(sim): Phase 1c A4+A5 — scheduler depends on SolverPort 2026-05-15 19:24:12 +02:00
motor-parts.test.ts
multi-board-integration.test.ts test(frontend): fix 2 test-mock bugs that blocked the deploy gate 2026-05-28 19:26:21 +02:00
netlist-builder.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
ngspice-interactive.test.ts feat(sim/spice): vendor ngspice+XSpice WASM and add NgSpiceInteractive client (Phase 1a) 2026-05-15 16:14:50 +02:00
ngspice-node-adapter.test.ts feat(sim): Phase 1c F1 — NgSpiceNodeAdapter runs real WASM in Node tests 2026-05-15 20:49:39 +02:00
oscilloscope-trigger.test.ts feat(scope/trigger): add Auto / Normal / Single-shot trigger modes 2026-05-22 21:11:03 +02:00
part-simulators-coverage.test.ts test(sim): Phase 1d-tests E + F — part simulator coverage + solver determinism 2026-05-15 23:10:05 +02:00
phase-2-device-models.test.ts feat(sim): Phase 2.1 — migrate MOSFETs to VDMOS macro-models 2026-05-15 17:03:49 +02:00
phase-2-lm358-subckt.test.ts feat(sim): Phase 2.2 — vendor LM358 macro-model subckt (asset only) 2026-05-15 17:28:46 +02:00
phase-4-wire-resistance.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
pi-single-board-examples.test.ts feat(examples): add single-board Raspberry Pi 3/4/5 GPIO examples 2026-06-02 04:36:58 +02:00
pi3-pico-uart.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
piSlaveScanner.test.ts feat(pi): pluggable slave handler + canvas wire detection for I2C/SPI/UART 2026-05-18 16:26:37 +02:00
picow-cyw43-integration.test.ts
pin-position-rotation.test.ts fix(canvas): wires off pins after rotation — wrapper offset was (4,6) instead of (6,6) 2026-05-26 15:16:04 +02:00
pin-resolver-phase1b.test.ts feat(sim): Phase 1b skeleton — SPICE-resolved PinResolver + active-path detection 2026-05-15 16:38:30 +02:00
pin-resolver.test.ts feat(sim): introduce PinResolver abstraction (Phase 0 of mixed-mode rewrite) 2026-05-15 15:50:09 +02:00
protocol-parts.test.ts
rp2040-pio-servo.test.ts
sensor-parts.test.ts
serial-batching.test.ts
simulation-parts.test.ts test(joystick): update fixture to direction-style xValue / yValue 2026-05-22 18:59:49 +02:00
simulation.test.ts
solver-determinism.test.ts test(sim): Phase 1d-tests E + F — part simulator coverage + solver determinism 2026-05-15 23:10:05 +02:00
solver-perf-baseline.test.ts test(sim): Phase 1d-tests D + G — board-kind coverage matrix + perf baseline 2026-05-15 23:13:48 +02:00
solver-port-contract.test.ts feat(sim): Phase 1c A2+A3 — NgSpiceWorkerAdapter + FakeSolverAdapter 2026-05-15 19:21:46 +02:00
spice-ac.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-active.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-avr-mixed.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-digital.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-mosfet-diag.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-mosfet-pwm.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-npn-switch-diag.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-npn-switch-integration.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-passive.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-rectifier-integration.test.ts feat(sim): Phase 1c G+F3 — retire legacy CircuitScheduler / eecircuit-engine 2026-05-15 21:46:34 +02:00
spice-rectifier-live-repro.test.ts feat(sim): Phase 1c G+F3 — retire legacy CircuitScheduler / eecircuit-engine 2026-05-15 21:46:34 +02:00
spice-relaxation-oscillator.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-relay-integration.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-signal-generator-tran.test.ts feat(sim): Phase 1c G+F3 — retire legacy CircuitScheduler / eecircuit-engine 2026-05-15 21:46:34 +02:00
spice-smoke.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
spice-transient.test.ts feat(sim): Phase 1c F2 — migrate 22 SPICE test files to NgSpiceNodeAdapter 2026-05-15 21:23:53 +02:00
ssd168x-decoder.test.ts
ssd1306-render.test.ts
triple-pico-digital-chain.test.ts refactor(esp32): retire ledc_update + broadcastPwm + channelGpioMemo 2026-05-19 04:05:34 +02:00
uc8159c-decoder.test.ts
undo-redo.test.ts
virtual-i2c-devices.test.ts
voltmeter-waveform.test.ts feat(sim): Phase 1c G+F3 — retire legacy CircuitScheduler / eecircuit-engine 2026-05-15 21:46:34 +02:00
waveform-stats.test.ts