| Filename | Latest commit message | Latest commit date |
|---|---|---|
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 |
||
| .. | ||
| debugging | ||
| features | ||
| research | ||
| build.md | ||
| ci-build-slowness-findings.md | ||
| README.md | ||
| wasm-exceptions-experiment.md | ||
Documentation Map
A central index of the documentation in this repo. The goal of the project is to build KiCad with WASM and run it in a browser.
Note: per-area
README.mdfiles stay next to the code they describe (they're linked below). Cross-cutting guides live underdocs/. Per-feature design notes live underfeatures/.
Start here
- Project README — overview, prerequisites, quick start, project structure
- CLAUDE.md — project/agent context and contribution conventions
Build
- docs/build.md — Docker-based KiCad WASM build system (two-phase build, outputs, memory)
- docker/README.md — Docker build environment, branch-specific containers, troubleshooting
- wasm/README.md — WASM compatibility layer (overrides/shims without patching KiCad)
Debugging & Asyncify
- docs/debugging/DEBUG.md — debugging guide: Asyncify stalls vs crashes, shim/codegen coupling, stub-bisection
- docs/debugging/learning.md — Asyncify + consecutive modal dialogs: the lock pattern
- docs/research/threading_1.md — deep dive: the Asyncify single-slot
currDatacollision bug and the fix - docs/research/threading_2.md — external research: JSPI/WasmFX/state-machine alternatives, QEMU analysis
Architecture
- wasm/README.md — WASM compatibility layer structure
- web/README.md — web app (create/open KiCad projects), tech stack, URL routing, WASM artifact serving
Testing
- tests/README.md — Playwright test infrastructure, element registry, logs, screenshots
- tests/WHATWORKS.md — wxWidgets-in-WASM feature coverage matrix and KiCad readiness
- tests/GL_README.md — Emscripten legacy GL immediate-mode quirks (color-per-vertex)
- tests/gal-regression/README.md — GAL visual regression suite (native OpenGL vs WebGL WASM)
Feature design docs
Per-feature design notes and porting records live under features/:
- web-init — web app spec
- schematic — eeschema WASM bring-up
- symbol-editor — symbol editor (eeschema kiface launcher)
- gerbview — Gerber viewer port
- pl-editor — page-layout editor port (incl. file-dialog usability fixes)
- browser-tools — tool-activation / coroutine deep dives
- fix-asyncify-O2-and-modal-promise-rejection — RTree wasm overflow bug investigation
Archived / historical
features/archive/ holds docs whose work is done or superseded
(each carries a status banner):