pcbjam/scripts/kicad
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Gergő Törcsvári 80468e7c5b
Phase B: main-thread sleep parks its context; the real D blocker is DOM entries
wasm/shims/context_sleep.cpp: a main-thread nanosleep whose frame stands on a
scheduler context that OWNS the stack arms a mailbox wake and yield_parks that
context instead of suspending the stack in place. It lives in the sleep
primitive rather than in tool_manager.cpp on purpose - KiCad and the wx core
stay untouched (CLAUDE.md's fork rule) and the whole K7 class moves at once,
not just TOOL_MANAGER::RunSynchronousAction's spin loop.

MEASURED AT D-ON, and it is NOT what unblocks Phase D. The four canvas-tool
specs still fail, but the trace now names a different cause: the fatal swap is
old=<libcontext ROOT> new=<tool coroutine> with mouseEventHandlerFunc above it
- a DOM mouse handler entering wasm DIRECTLY on the main stack, bypassing the
tick. So one coroutine is entered two ways: by the tick through the dispatch
context as a STAR TRANSFER, and by DOM handlers as a DIRECT SYMMETRIC SWAP. A
capture written by one path cannot be rewound by the other -> index out of
bounds in doRewind. That is section 7 rule 5 (partial migration is worse than
none) in its purest measured form, and it is why the harness stays green: its
coroutines are only ever entered from one place.

So the next increment is the DOM event entries (mouse/key/wheel/resize must
hand their events to the dispatch context as the tick does), not another park
site. It subsumes the one-root work too: with no dispatch on the main stack,
resolve_root_identity() always answers "the running context".

Landing state: STAR_DISPATCH=0, kicad 139 passed / 1 (pre-existing occ-probe)
= baseline, with the sleep shim in and inert.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBjomQfKyRa3jBdeAKpmTw
2026-08-10 10:14:19 +02:00
..
audit-merged-symbols.sh cvpcb-wasm: link CvPcb as third kiface — eeschema Assign Footprints opens in WASM; serial-inline footprint list load fixes pool-task-vs-JS-bridge deadlock 2026-07-17 18:00:13 +02:00
build-calculator.sh refactor(build): fold calculator into unified docker/build.sh dispatch 2026-05-29 16:01:18 +02:00
build-eeschema.sh feat(schematic): eeschema WASM build + e2e harness 2026-05-29 16:01:17 +02:00
build-gerbview.sh feat: gerbview WASM port 2026-06-03 14:23:57 +02:00
build-kicad-target.sh Phase B: main-thread sleep parks its context; the real D blocker is DOM entries 2026-08-10 10:14:19 +02:00
build-kicad_editor.sh feat(wasm): kicad_editor — merge the pcbnew+eeschema kifaces into ONE bundle (Part 2) 2026-07-02 17:56:02 +02:00
build-kicad_tools.sh feat: kicad_tools headless CLI 2026-07-10 19:09:01 +02:00
build-ngspice_service.sh eeschema simulator: lazy ngspice_service worker — static sharedspice (XSPICE registry + CIDER), init_dll ifdef, e2e both engines 2026-07-19 15:59:21 +02:00
build-occ_service.sh feat(wasm): occ-split — lazy occ_service worker; kicad_editor drops OCC (−31%) 2026-07-03 12:39:58 +02:00
build-pcbnew.sh feat(schematic): eeschema WASM build + e2e harness 2026-05-29 16:01:17 +02:00
build-pl_editor.sh feat: pl_editor WASM port + browser file dialog fixes 2026-06-01 10:30:56 +02:00