2025-11-29 16:19:13 +01:00
|
|
|
# Makefile for wxWidgets WASM test apps
|
|
|
|
|
# Uses the local wxWidgets build
|
2025-11-29 22:15:56 +01:00
|
|
|
#
|
|
|
|
|
# Usage:
|
|
|
|
|
# make -f Makefile.wasm # Optimized release build
|
|
|
|
|
# make -f Makefile.wasm DEBUG=1 # Debug build with DWARF symbols and source maps
|
2025-11-28 14:24:53 +01:00
|
|
|
|
|
|
|
|
WXCONFIG = ../../build-wasm/wxwidgets-universal/wx-config
|
|
|
|
|
TOOLS_ROOT = ../../wxwidgets/build/wasm
|
wip: nested-asyncify fix, wxAuiToolBar registration, tests, research docs
Main-repo side of a multi-part WIP covering the KiCad WASM tool-selection
and nested-Asyncify work. Submodule commits are in kicad@f6e9239aaa
(libcontext hygiene) and wxwidgets@bb80f91e8b (auibar registration +
dialog diagnostics).
## scripts/common/inject-dyncall-shims.sh
Wrap Asyncify.handleSleep / allocateData to save-and-restore Asyncify.currData
around each EM_ASYNC_JS sleep. This fixes the nested Asyncify collision where
a fiber swap that fired during a modal's event loop clobbered currData, and
the modal's later doRewind used the fiber's buffer and hit "RuntimeError:
index out of bounds". Root cause documented as Emscripten Issue #9153
(wontfix upstream).
Diagnostic-rewind logging (forcedBottomOfCallStack, callStack traces) is
retained to help future debugging of Asyncify state corruption.
## tests/
- tests/playwright-kicad.config.ts: add `channel: 'chrome'` for the
chromium project so --project=chromium --headed uses system Chrome
(real GPU) instead of SwiftShader on ARM Mac. Also switch trace to
retain-on-failure + screenshot on-failure for easier E2E debugging.
- tests/kicad/pcbnew.spec.ts: replace `tool.checked` assertions with a
label-suffix check (`[checked]`) since our auibar registration encodes
checked state in the label (no schema change to the registry).
- tests/apps/Makefile.wasm: add `coroutine-nested` build target + include
it in the all: list.
- tests/apps/standalone/coroutine/: kicad_coroutine_harness.h + test app
reproducing KiCad COROUTINE semantics against real libcontext.
- tests/apps/standalone/coroutine-nested/: nested_test.cpp reproduces the
EM_ASYNC_JS-modal + fiber-swap nesting bug in isolation. 8 scenarios
from baseline_modal_alone through nested_fibers_inside_modal.
- tests/e2e/coroutine.spec.ts + coroutine-nested.spec.ts: Playwright specs
that load the standalone apps and assert all case cases pass via
[COROUTINE_TEST] SUMMARY log parsing.
## research/ and features/browser-tools/
Three background docs capturing the investigation trajectory:
- features/browser-tools/0001-kicad-wasm-tool-activation-investigation.md
Early investigation: why tools don't activate; initial dynCall-empty-
callback hypothesis.
- features/browser-tools/0002-wasm-coroutine-deep-dive.md
Deep dive on Asyncify internals, fiber API, QEMU's coroutine-wasm
reference implementation.
- features/browser-tools/0003-wxauitoolbar-registration-fix.md
The narrow fix: why wxAuiToolBar needs a registration block, where to
add it, what the fallback plan is.
- research/threading_1.md: corrected root-cause analysis after reading
runtime logs — nested-Asyncify currData collision, Emscripten #9153.
- research/threading_2.md: extended research on alternative approaches
(JSPI/WasmFX/state-machines) and why they don't help here.
## Submodule pointer updates
kicad: f6e9239aaa (wip: libcontext WASM hygiene cleanup)
wxwidgets: bb80f91e8b (wip: wxAuiToolBar element-registry registration +
dialog diagnostics)
## Open threads not yet in scope
- Firefox/Chrome divergent behavior: "indirect call signature mismatch"
traps in Firefox vs renderer crash in system Chrome (tracked in
plans/peaceful-hugging-pnueli.md and the research docs).
- E2E pixel-diff for Draw Lines fails because the test's diff region does
not cover where the line is actually drawn; tool activation works, the
line is visible in test-results/pcbnew-draw-lines-02-after-drawing.png.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:58:16 +02:00
|
|
|
KICAD_ROOT = ../../kicad
|
2025-11-28 14:24:53 +01:00
|
|
|
|
|
|
|
|
CXX = em++
|
|
|
|
|
WX_CXXFLAGS := $(shell $(WXCONFIG) --cxxflags)
|
|
|
|
|
|
2025-11-29 16:19:13 +01:00
|
|
|
# Libraries for GL apps (minimal_test uses OpenGL)
|
|
|
|
|
WX_LDFLAGS_GL := $(shell $(WXCONFIG) --libs base,core,gl,aui)
|
|
|
|
|
|
|
|
|
|
# Libraries for non-GL apps (standalone tests don't need GL)
|
|
|
|
|
WX_LDFLAGS_NOGL := $(shell $(WXCONFIG) --libs base,core,aui)
|
2025-11-28 14:24:53 +01:00
|
|
|
|
2025-12-03 11:27:00 +01:00
|
|
|
# Libraries for HTML apps (htmlwin_test needs html)
|
|
|
|
|
WX_LDFLAGS_HTML := $(shell $(WXCONFIG) --libs base,core,html)
|
|
|
|
|
|
|
|
|
|
# Libraries for STC apps (stc_test needs stc)
|
|
|
|
|
WX_LDFLAGS_STC := $(shell $(WXCONFIG) --libs base,core,stc)
|
|
|
|
|
|
2025-12-03 16:57:02 +01:00
|
|
|
# Libraries for PropGrid apps (propgrid_test needs propgrid)
|
|
|
|
|
WX_LDFLAGS_PROPGRID := $(shell $(WXCONFIG) --libs base,core,propgrid)
|
|
|
|
|
|
2025-12-03 17:16:14 +01:00
|
|
|
# Libraries for AUI apps (auinotebook needs aui)
|
|
|
|
|
WX_LDFLAGS_AUI := $(shell $(WXCONFIG) --libs base,core,aui)
|
|
|
|
|
|
|
|
|
|
# Libraries for ADV apps (wizard, calendar need adv)
|
|
|
|
|
WX_LDFLAGS_ADV := $(shell $(WXCONFIG) --libs base,core,adv)
|
|
|
|
|
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
# Libraries for XML apps (xml_test needs xml)
|
|
|
|
|
WX_LDFLAGS_XML := $(shell $(WXCONFIG) --libs base,core,xml)
|
|
|
|
|
|
2025-11-29 22:15:56 +01:00
|
|
|
# Debug or Release build
|
|
|
|
|
ifdef DEBUG
|
|
|
|
|
# Debug: DWARF info, source maps, minimal optimization
|
|
|
|
|
CXXFLAGS = -g -O0 $(WX_CXXFLAGS)
|
|
|
|
|
DEBUG_LDFLAGS = -g -gsource-map
|
|
|
|
|
else
|
|
|
|
|
# Release: optimized
|
|
|
|
|
CXXFLAGS = -O2 $(WX_CXXFLAGS)
|
|
|
|
|
DEBUG_LDFLAGS =
|
|
|
|
|
endif
|
2025-11-28 20:14:59 +01:00
|
|
|
|
2025-11-29 16:19:13 +01:00
|
|
|
# Base Emscripten flags (for all apps)
|
2025-11-29 18:42:27 +01:00
|
|
|
# ASYNCIFY enables blocking modal dialogs (ShowModal waits for user)
|
|
|
|
|
# ASYNCIFY_IMPORTS tells Emscripten which imported JS functions can unwind the stack
|
2025-12-03 10:19:50 +01:00
|
|
|
# - startModal: for modal dialogs
|
|
|
|
|
# - js_writeTextToClipboard, js_readTextFromClipboard, js_clipboardHasText, js_clearClipboard: for clipboard
|
2025-12-04 11:06:33 +01:00
|
|
|
# - js_enumerateFonts: for font enumeration via Local Font Access API
|
2025-11-29 16:19:13 +01:00
|
|
|
BASE_LDFLAGS = -sALLOW_MEMORY_GROWTH -sERROR_ON_UNDEFINED_SYMBOLS=0 \
|
2025-11-29 18:42:27 +01:00
|
|
|
-s "EXPORTED_RUNTIME_METHODS=['HEAPU8','HEAP8','HEAP32','ccall']" \
|
|
|
|
|
-sASYNCIFY=1 \
|
|
|
|
|
-sASYNCIFY_STACK_SIZE=8192 \
|
2025-12-04 11:06:33 +01:00
|
|
|
-sASYNCIFY_IMPORTS=['startModal','js_writeTextToClipboard','js_readTextFromClipboard','js_clipboardHasText','js_clearClipboard','js_enumerateFonts']
|
2025-11-28 20:14:59 +01:00
|
|
|
|
2025-11-29 16:19:13 +01:00
|
|
|
# GL-specific flags
|
|
|
|
|
EM_GL_FLAGS = -sLEGACY_GL_EMULATION -sMAX_WEBGL_VERSION=2
|
2025-12-27 14:06:23 +01:00
|
|
|
GL_SHIM = ../../wasm/shims/gl_immediate_shim.js
|
2025-11-28 21:22:09 +01:00
|
|
|
|
2025-11-29 16:19:13 +01:00
|
|
|
# LDFLAGS for GL apps (minimal_test)
|
2025-11-29 22:15:56 +01:00
|
|
|
LDFLAGS_GL = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(EM_GL_FLAGS) --js-library=$(GL_SHIM) $(WX_LDFLAGS_GL)
|
2025-11-29 16:19:13 +01:00
|
|
|
|
|
|
|
|
# LDFLAGS for non-GL apps (standalone tests)
|
2025-11-29 22:15:56 +01:00
|
|
|
LDFLAGS_NOGL = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(WX_LDFLAGS_NOGL)
|
2025-11-28 14:24:53 +01:00
|
|
|
|
2025-12-03 11:27:00 +01:00
|
|
|
# LDFLAGS for HTML apps (htmlwin_test)
|
|
|
|
|
LDFLAGS_HTML = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(WX_LDFLAGS_HTML)
|
|
|
|
|
|
|
|
|
|
# LDFLAGS for STC apps (stc_test)
|
|
|
|
|
LDFLAGS_STC = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(WX_LDFLAGS_STC)
|
|
|
|
|
|
2025-12-03 16:57:02 +01:00
|
|
|
# LDFLAGS for PropGrid apps (propgrid_test)
|
|
|
|
|
LDFLAGS_PROPGRID = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(WX_LDFLAGS_PROPGRID)
|
|
|
|
|
|
2025-12-03 17:16:14 +01:00
|
|
|
# LDFLAGS for AUI apps (auinotebook)
|
|
|
|
|
LDFLAGS_AUI = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(WX_LDFLAGS_AUI)
|
|
|
|
|
|
|
|
|
|
# LDFLAGS for ADV apps (wizard, calendar)
|
|
|
|
|
LDFLAGS_ADV = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(WX_LDFLAGS_ADV)
|
|
|
|
|
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
# LDFLAGS for XML apps (xml_test)
|
|
|
|
|
LDFLAGS_XML = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) $(WX_LDFLAGS_XML)
|
|
|
|
|
|
2025-12-15 11:47:50 +01:00
|
|
|
# LDFLAGS for pthread test - uses dynamic PTHREAD_POOL_SIZE to match hardware_concurrency
|
|
|
|
|
# This fixes the KiCad deadlock: pre-warm enough workers for all threads
|
|
|
|
|
LDFLAGS_PTHREAD = $(DEBUG_LDFLAGS) $(BASE_LDFLAGS) -pthread \
|
|
|
|
|
-sPTHREAD_POOL_SIZE='navigator.hardwareConcurrency' \
|
|
|
|
|
-sPTHREAD_POOL_SIZE_STRICT=0 \
|
|
|
|
|
$(WX_LDFLAGS_NOGL)
|
|
|
|
|
|
wip: nested-asyncify fix, wxAuiToolBar registration, tests, research docs
Main-repo side of a multi-part WIP covering the KiCad WASM tool-selection
and nested-Asyncify work. Submodule commits are in kicad@f6e9239aaa
(libcontext hygiene) and wxwidgets@bb80f91e8b (auibar registration +
dialog diagnostics).
## scripts/common/inject-dyncall-shims.sh
Wrap Asyncify.handleSleep / allocateData to save-and-restore Asyncify.currData
around each EM_ASYNC_JS sleep. This fixes the nested Asyncify collision where
a fiber swap that fired during a modal's event loop clobbered currData, and
the modal's later doRewind used the fiber's buffer and hit "RuntimeError:
index out of bounds". Root cause documented as Emscripten Issue #9153
(wontfix upstream).
Diagnostic-rewind logging (forcedBottomOfCallStack, callStack traces) is
retained to help future debugging of Asyncify state corruption.
## tests/
- tests/playwright-kicad.config.ts: add `channel: 'chrome'` for the
chromium project so --project=chromium --headed uses system Chrome
(real GPU) instead of SwiftShader on ARM Mac. Also switch trace to
retain-on-failure + screenshot on-failure for easier E2E debugging.
- tests/kicad/pcbnew.spec.ts: replace `tool.checked` assertions with a
label-suffix check (`[checked]`) since our auibar registration encodes
checked state in the label (no schema change to the registry).
- tests/apps/Makefile.wasm: add `coroutine-nested` build target + include
it in the all: list.
- tests/apps/standalone/coroutine/: kicad_coroutine_harness.h + test app
reproducing KiCad COROUTINE semantics against real libcontext.
- tests/apps/standalone/coroutine-nested/: nested_test.cpp reproduces the
EM_ASYNC_JS-modal + fiber-swap nesting bug in isolation. 8 scenarios
from baseline_modal_alone through nested_fibers_inside_modal.
- tests/e2e/coroutine.spec.ts + coroutine-nested.spec.ts: Playwright specs
that load the standalone apps and assert all case cases pass via
[COROUTINE_TEST] SUMMARY log parsing.
## research/ and features/browser-tools/
Three background docs capturing the investigation trajectory:
- features/browser-tools/0001-kicad-wasm-tool-activation-investigation.md
Early investigation: why tools don't activate; initial dynCall-empty-
callback hypothesis.
- features/browser-tools/0002-wasm-coroutine-deep-dive.md
Deep dive on Asyncify internals, fiber API, QEMU's coroutine-wasm
reference implementation.
- features/browser-tools/0003-wxauitoolbar-registration-fix.md
The narrow fix: why wxAuiToolBar needs a registration block, where to
add it, what the fallback plan is.
- research/threading_1.md: corrected root-cause analysis after reading
runtime logs — nested-Asyncify currData collision, Emscripten #9153.
- research/threading_2.md: extended research on alternative approaches
(JSPI/WasmFX/state-machines) and why they don't help here.
## Submodule pointer updates
kicad: f6e9239aaa (wip: libcontext WASM hygiene cleanup)
wxwidgets: bb80f91e8b (wip: wxAuiToolBar element-registry registration +
dialog diagnostics)
## Open threads not yet in scope
- Firefox/Chrome divergent behavior: "indirect call signature mismatch"
traps in Firefox vs renderer crash in system Chrome (tracked in
plans/peaceful-hugging-pnueli.md and the research docs).
- E2E pixel-diff for Draw Lines fails because the test's diff region does
not cover where the line is actually drawn; tool activation works, the
line is visible in test-results/pcbnew-draw-lines-02-after-drawing.png.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:58:16 +02:00
|
|
|
# Coroutine harness flags - mirror KiCad's fiber-related runtime needs
|
|
|
|
|
COROUTINE_BASE_LDFLAGS = -sALLOW_MEMORY_GROWTH -sERROR_ON_UNDEFINED_SYMBOLS=0 \
|
|
|
|
|
-s "EXPORTED_RUNTIME_METHODS=['HEAPU8','HEAP8','HEAP32','ccall']" \
|
|
|
|
|
-sASYNCIFY=1 \
|
|
|
|
|
-sASYNCIFY_STACK_SIZE=65536 \
|
|
|
|
|
-sASYNCIFY_IMPORTS=['startModal','js_writeTextToClipboard','js_readTextFromClipboard','js_clipboardHasText','js_clearClipboard','js_enumerateFonts','emscripten_fiber_swap']
|
|
|
|
|
LDFLAGS_COROUTINE = $(DEBUG_LDFLAGS) $(COROUTINE_BASE_LDFLAGS) $(WX_LDFLAGS_NOGL)
|
|
|
|
|
|
2025-11-28 14:24:53 +01:00
|
|
|
JS = $(TOOLS_ROOT)/wx.js
|
|
|
|
|
HTML = $(TOOLS_ROOT)/template.html
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
# wxWidgets library directory - used as dependency to rebuild when libs change
|
|
|
|
|
WX_LIB_DIR = ../../build-wasm/wxwidgets-universal/lib
|
|
|
|
|
# Key library that changes when wxWidgets is rebuilt
|
|
|
|
|
WX_CORE_LIB = $(WX_LIB_DIR)/libwx_wasmunivu_core-3.2-emscripten.a
|
|
|
|
|
|
2025-11-29 16:19:13 +01:00
|
|
|
# Standalone directories
|
|
|
|
|
S = standalone
|
|
|
|
|
|
|
|
|
|
all: minimal_test.html \
|
|
|
|
|
$(S)/menu/menu_test.html \
|
|
|
|
|
$(S)/clipboard/clipboard_test.html \
|
|
|
|
|
$(S)/filedialog/filedialog_test.html \
|
|
|
|
|
$(S)/layout/layout_test.html \
|
|
|
|
|
$(S)/aui/aui_test.html \
|
|
|
|
|
$(S)/toolbar/toolbar_test.html \
|
|
|
|
|
$(S)/grid/grid_test.html \
|
|
|
|
|
$(S)/dialog/dialog_test.html \
|
|
|
|
|
$(S)/timer/timer_test.html \
|
2025-12-03 11:27:00 +01:00
|
|
|
$(S)/tree/tree_test.html \
|
|
|
|
|
$(S)/dataview/dataview_test.html \
|
|
|
|
|
$(S)/htmlwin/htmlwin_test.html \
|
2025-12-03 15:51:44 +01:00
|
|
|
$(S)/stc/stc_test.html \
|
2025-12-03 16:33:27 +01:00
|
|
|
$(S)/print/print_test.html \
|
2025-12-03 16:57:02 +01:00
|
|
|
$(S)/dnd/dnd_test.html \
|
|
|
|
|
$(S)/propgrid/propgrid_test.html \
|
|
|
|
|
$(S)/pickers/pickers_test.html \
|
|
|
|
|
$(S)/collapsible/collapsible_test.html \
|
|
|
|
|
$(S)/listctrl/listctrl_test.html \
|
2025-12-03 17:16:14 +01:00
|
|
|
$(S)/infobar/infobar_test.html \
|
|
|
|
|
$(S)/dataviewvirtual/dataviewvirtual_test.html \
|
|
|
|
|
$(S)/auinotebook/auinotebook_test.html \
|
|
|
|
|
$(S)/wizard/wizard_test.html \
|
|
|
|
|
$(S)/gridedit/gridedit_test.html \
|
2025-12-03 17:58:47 +01:00
|
|
|
$(S)/calendar/calendar_test.html \
|
|
|
|
|
$(S)/gridrenderers/gridrenderers_test.html \
|
|
|
|
|
$(S)/printpreview/printpreview_test.html \
|
|
|
|
|
$(S)/bitmapbuttons/bitmapbuttons_test.html \
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
$(S)/specialized/specialized_test.html \
|
|
|
|
|
$(S)/validators/validators_test.html \
|
|
|
|
|
$(S)/ownerdrawn/ownerdrawn_test.html \
|
|
|
|
|
$(S)/popup/popup_test.html \
|
|
|
|
|
$(S)/xml/xml_test.html \
|
2025-12-04 11:06:33 +01:00
|
|
|
$(S)/wasmedge/wasmedge_test.html \
|
|
|
|
|
$(S)/fontenum/fontenum_test.html \
|
|
|
|
|
$(S)/textdecor/textdecor_test.html \
|
|
|
|
|
$(S)/bitmask/bitmask_test.html \
|
2025-12-14 13:28:43 +01:00
|
|
|
$(S)/regions/regions_test.html \
|
2025-12-14 16:10:08 +01:00
|
|
|
$(S)/maximize/maximize_test.html \
|
2025-12-15 11:47:50 +01:00
|
|
|
$(S)/earlysize/earlysize_test.html \
|
2025-12-15 14:34:43 +01:00
|
|
|
$(S)/threadpool/threadpool_test.html \
|
2026-03-22 12:48:05 +01:00
|
|
|
$(S)/logerror/logerror_test.html \
|
wip: nested-asyncify fix, wxAuiToolBar registration, tests, research docs
Main-repo side of a multi-part WIP covering the KiCad WASM tool-selection
and nested-Asyncify work. Submodule commits are in kicad@f6e9239aaa
(libcontext hygiene) and wxwidgets@bb80f91e8b (auibar registration +
dialog diagnostics).
## scripts/common/inject-dyncall-shims.sh
Wrap Asyncify.handleSleep / allocateData to save-and-restore Asyncify.currData
around each EM_ASYNC_JS sleep. This fixes the nested Asyncify collision where
a fiber swap that fired during a modal's event loop clobbered currData, and
the modal's later doRewind used the fiber's buffer and hit "RuntimeError:
index out of bounds". Root cause documented as Emscripten Issue #9153
(wontfix upstream).
Diagnostic-rewind logging (forcedBottomOfCallStack, callStack traces) is
retained to help future debugging of Asyncify state corruption.
## tests/
- tests/playwright-kicad.config.ts: add `channel: 'chrome'` for the
chromium project so --project=chromium --headed uses system Chrome
(real GPU) instead of SwiftShader on ARM Mac. Also switch trace to
retain-on-failure + screenshot on-failure for easier E2E debugging.
- tests/kicad/pcbnew.spec.ts: replace `tool.checked` assertions with a
label-suffix check (`[checked]`) since our auibar registration encodes
checked state in the label (no schema change to the registry).
- tests/apps/Makefile.wasm: add `coroutine-nested` build target + include
it in the all: list.
- tests/apps/standalone/coroutine/: kicad_coroutine_harness.h + test app
reproducing KiCad COROUTINE semantics against real libcontext.
- tests/apps/standalone/coroutine-nested/: nested_test.cpp reproduces the
EM_ASYNC_JS-modal + fiber-swap nesting bug in isolation. 8 scenarios
from baseline_modal_alone through nested_fibers_inside_modal.
- tests/e2e/coroutine.spec.ts + coroutine-nested.spec.ts: Playwright specs
that load the standalone apps and assert all case cases pass via
[COROUTINE_TEST] SUMMARY log parsing.
## research/ and features/browser-tools/
Three background docs capturing the investigation trajectory:
- features/browser-tools/0001-kicad-wasm-tool-activation-investigation.md
Early investigation: why tools don't activate; initial dynCall-empty-
callback hypothesis.
- features/browser-tools/0002-wasm-coroutine-deep-dive.md
Deep dive on Asyncify internals, fiber API, QEMU's coroutine-wasm
reference implementation.
- features/browser-tools/0003-wxauitoolbar-registration-fix.md
The narrow fix: why wxAuiToolBar needs a registration block, where to
add it, what the fallback plan is.
- research/threading_1.md: corrected root-cause analysis after reading
runtime logs — nested-Asyncify currData collision, Emscripten #9153.
- research/threading_2.md: extended research on alternative approaches
(JSPI/WasmFX/state-machines) and why they don't help here.
## Submodule pointer updates
kicad: f6e9239aaa (wip: libcontext WASM hygiene cleanup)
wxwidgets: bb80f91e8b (wip: wxAuiToolBar element-registry registration +
dialog diagnostics)
## Open threads not yet in scope
- Firefox/Chrome divergent behavior: "indirect call signature mismatch"
traps in Firefox vs renderer crash in system Chrome (tracked in
plans/peaceful-hugging-pnueli.md and the research docs).
- E2E pixel-diff for Draw Lines fails because the test's diff region does
not cover where the line is actually drawn; tool activation works, the
line is visible in test-results/pcbnew-draw-lines-02-after-drawing.png.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:58:16 +02:00
|
|
|
$(S)/retinascale/retinascale_test.html \
|
|
|
|
|
$(S)/coroutine/coroutine_test.html \
|
|
|
|
|
$(S)/coroutine-nested/nested_test.html
|
2025-11-29 16:19:13 +01:00
|
|
|
|
|
|
|
|
# Main test app (uses GL)
|
|
|
|
|
minimal_test.o: minimal_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
minimal_test.html: minimal_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_GL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Menu test (no GL)
|
|
|
|
|
$(S)/menu/menu_test.o: $(S)/menu/menu_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/menu/menu_test.html: $(S)/menu/menu_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Clipboard test (no GL)
|
|
|
|
|
$(S)/clipboard/clipboard_test.o: $(S)/clipboard/clipboard_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/clipboard/clipboard_test.html: $(S)/clipboard/clipboard_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# FileDialog test (no GL)
|
|
|
|
|
$(S)/filedialog/filedialog_test.o: $(S)/filedialog/filedialog_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/filedialog/filedialog_test.html: $(S)/filedialog/filedialog_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Layout test (no GL)
|
|
|
|
|
$(S)/layout/layout_test.o: $(S)/layout/layout_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/layout/layout_test.html: $(S)/layout/layout_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# AUI test (no GL)
|
|
|
|
|
$(S)/aui/aui_test.o: $(S)/aui/aui_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/aui/aui_test.html: $(S)/aui/aui_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Toolbar test (no GL)
|
|
|
|
|
$(S)/toolbar/toolbar_test.o: $(S)/toolbar/toolbar_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/toolbar/toolbar_test.html: $(S)/toolbar/toolbar_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Grid test (no GL)
|
|
|
|
|
$(S)/grid/grid_test.o: $(S)/grid/grid_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/grid/grid_test.html: $(S)/grid/grid_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Dialog test (no GL)
|
|
|
|
|
$(S)/dialog/dialog_test.o: $(S)/dialog/dialog_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/dialog/dialog_test.html: $(S)/dialog/dialog_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
2025-11-28 14:24:53 +01:00
|
|
|
|
2025-11-29 16:19:13 +01:00
|
|
|
# Timer test (no GL)
|
|
|
|
|
$(S)/timer/timer_test.o: $(S)/timer/timer_test.cpp
|
2025-11-28 14:24:53 +01:00
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/timer/timer_test.html: $(S)/timer/timer_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Tree test (no GL)
|
|
|
|
|
$(S)/tree/tree_test.o: $(S)/tree/tree_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/tree/tree_test.html: $(S)/tree/tree_test.o $(WX_CORE_LIB)
|
2025-11-29 16:19:13 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-03 11:27:00 +01:00
|
|
|
# DataView test (no GL)
|
|
|
|
|
$(S)/dataview/dataview_test.o: $(S)/dataview/dataview_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/dataview/dataview_test.html: $(S)/dataview/dataview_test.o $(WX_CORE_LIB)
|
2025-12-03 11:27:00 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# HtmlWindow test (needs HTML library)
|
|
|
|
|
$(S)/htmlwin/htmlwin_test.o: $(S)/htmlwin/htmlwin_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/htmlwin/htmlwin_test.html: $(S)/htmlwin/htmlwin_test.o $(WX_CORE_LIB)
|
2025-12-03 11:27:00 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_HTML) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# StyledTextCtrl test (needs STC library)
|
|
|
|
|
$(S)/stc/stc_test.o: $(S)/stc/stc_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/stc/stc_test.html: $(S)/stc/stc_test.o $(WX_CORE_LIB)
|
2025-12-03 11:27:00 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_STC) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-03 15:51:44 +01:00
|
|
|
# Print test (no GL)
|
|
|
|
|
$(S)/print/print_test.o: $(S)/print/print_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/print/print_test.html: $(S)/print/print_test.o $(WX_CORE_LIB)
|
2025-12-03 15:51:44 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-03 16:33:27 +01:00
|
|
|
# DragDrop test (no GL)
|
|
|
|
|
$(S)/dnd/dnd_test.o: $(S)/dnd/dnd_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/dnd/dnd_test.html: $(S)/dnd/dnd_test.o $(WX_CORE_LIB)
|
2025-12-03 16:33:27 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-03 16:57:02 +01:00
|
|
|
# PropertyGrid test (needs propgrid library)
|
|
|
|
|
$(S)/propgrid/propgrid_test.o: $(S)/propgrid/propgrid_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/propgrid/propgrid_test.html: $(S)/propgrid/propgrid_test.o $(WX_CORE_LIB)
|
2025-12-03 16:57:02 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_PROPGRID) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Pickers test (colour/font pickers, no GL)
|
|
|
|
|
$(S)/pickers/pickers_test.o: $(S)/pickers/pickers_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/pickers/pickers_test.html: $(S)/pickers/pickers_test.o $(WX_CORE_LIB)
|
2025-12-03 16:57:02 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Collapsible pane test (no GL)
|
|
|
|
|
$(S)/collapsible/collapsible_test.o: $(S)/collapsible/collapsible_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/collapsible/collapsible_test.html: $(S)/collapsible/collapsible_test.o $(WX_CORE_LIB)
|
2025-12-03 16:57:02 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# ListCtrl virtual mode test (no GL)
|
|
|
|
|
$(S)/listctrl/listctrl_test.o: $(S)/listctrl/listctrl_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/listctrl/listctrl_test.html: $(S)/listctrl/listctrl_test.o $(WX_CORE_LIB)
|
2025-12-03 16:57:02 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# InfoBar test (no GL)
|
|
|
|
|
$(S)/infobar/infobar_test.o: $(S)/infobar/infobar_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/infobar/infobar_test.html: $(S)/infobar/infobar_test.o $(WX_CORE_LIB)
|
2025-12-03 16:57:02 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-03 17:16:14 +01:00
|
|
|
# DataViewCtrl Virtual Mode test (no GL, uses base dataview)
|
|
|
|
|
$(S)/dataviewvirtual/dataviewvirtual_test.o: $(S)/dataviewvirtual/dataviewvirtual_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/dataviewvirtual/dataviewvirtual_test.html: $(S)/dataviewvirtual/dataviewvirtual_test.o $(WX_CORE_LIB)
|
2025-12-03 17:16:14 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# AuiNotebook test (needs aui)
|
|
|
|
|
$(S)/auinotebook/auinotebook_test.o: $(S)/auinotebook/auinotebook_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/auinotebook/auinotebook_test.html: $(S)/auinotebook/auinotebook_test.o $(WX_CORE_LIB)
|
2025-12-03 17:16:14 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_AUI) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Wizard test (needs adv)
|
|
|
|
|
$(S)/wizard/wizard_test.o: $(S)/wizard/wizard_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/wizard/wizard_test.html: $(S)/wizard/wizard_test.o $(WX_CORE_LIB)
|
2025-12-03 17:16:14 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_ADV) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Grid Edit test (cell editing, no GL)
|
|
|
|
|
$(S)/gridedit/gridedit_test.o: $(S)/gridedit/gridedit_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/gridedit/gridedit_test.html: $(S)/gridedit/gridedit_test.o $(WX_CORE_LIB)
|
2025-12-03 17:16:14 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Calendar test (needs adv)
|
|
|
|
|
$(S)/calendar/calendar_test.o: $(S)/calendar/calendar_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/calendar/calendar_test.html: $(S)/calendar/calendar_test.o $(WX_CORE_LIB)
|
2025-12-03 17:16:14 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_ADV) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-03 17:58:47 +01:00
|
|
|
# Grid Renderers test (no GL)
|
|
|
|
|
$(S)/gridrenderers/gridrenderers_test.o: $(S)/gridrenderers/gridrenderers_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/gridrenderers/gridrenderers_test.html: $(S)/gridrenderers/gridrenderers_test.o $(WX_CORE_LIB)
|
2025-12-03 17:58:47 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Print Preview test (no GL)
|
|
|
|
|
$(S)/printpreview/printpreview_test.o: $(S)/printpreview/printpreview_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/printpreview/printpreview_test.html: $(S)/printpreview/printpreview_test.o $(WX_CORE_LIB)
|
2025-12-03 17:58:47 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Bitmap Buttons test (no GL)
|
|
|
|
|
$(S)/bitmapbuttons/bitmapbuttons_test.o: $(S)/bitmapbuttons/bitmapbuttons_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/bitmapbuttons/bitmapbuttons_test.html: $(S)/bitmapbuttons/bitmapbuttons_test.o $(WX_CORE_LIB)
|
2025-12-03 17:58:47 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Specialized Controls test (needs adv for treebook)
|
|
|
|
|
$(S)/specialized/specialized_test.o: $(S)/specialized/specialized_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/specialized/specialized_test.html: $(S)/specialized/specialized_test.o $(WX_CORE_LIB)
|
2025-12-03 17:58:47 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_ADV) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
# Validators test (no GL)
|
|
|
|
|
$(S)/validators/validators_test.o: $(S)/validators/validators_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/validators/validators_test.html: $(S)/validators/validators_test.o $(WX_CORE_LIB)
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Owner-drawn ComboBox test (no GL)
|
|
|
|
|
$(S)/ownerdrawn/ownerdrawn_test.o: $(S)/ownerdrawn/ownerdrawn_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/ownerdrawn/ownerdrawn_test.html: $(S)/ownerdrawn/ownerdrawn_test.o $(WX_CORE_LIB)
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Popup Window test (no GL)
|
|
|
|
|
$(S)/popup/popup_test.o: $(S)/popup/popup_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/popup/popup_test.html: $(S)/popup/popup_test.o $(WX_CORE_LIB)
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# XML Document test (needs xml library)
|
|
|
|
|
$(S)/xml/xml_test.o: $(S)/xml/xml_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/xml/xml_test.html: $(S)/xml/xml_test.o $(WX_CORE_LIB)
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_XML) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# WASM Edge Cases test (no GL)
|
|
|
|
|
$(S)/wasmedge/wasmedge_test.o: $(S)/wasmedge/wasmedge_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/wasmedge/wasmedge_test.html: $(S)/wasmedge/wasmedge_test.o $(WX_CORE_LIB)
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-04 11:06:33 +01:00
|
|
|
# Font Enumeration test (no GL)
|
|
|
|
|
$(S)/fontenum/fontenum_test.o: $(S)/fontenum/fontenum_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/fontenum/fontenum_test.html: $(S)/fontenum/fontenum_test.o $(WX_CORE_LIB)
|
2025-12-04 11:06:33 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Text Decorations test (no GL)
|
|
|
|
|
$(S)/textdecor/textdecor_test.o: $(S)/textdecor/textdecor_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/textdecor/textdecor_test.html: $(S)/textdecor/textdecor_test.o $(WX_CORE_LIB)
|
2025-12-04 11:06:33 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Bitmask test (no GL)
|
|
|
|
|
$(S)/bitmask/bitmask_test.o: $(S)/bitmask/bitmask_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/bitmask/bitmask_test.html: $(S)/bitmask/bitmask_test.o $(WX_CORE_LIB)
|
2025-12-04 11:06:33 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
# Regions test (no GL)
|
|
|
|
|
$(S)/regions/regions_test.o: $(S)/regions/regions_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/regions/regions_test.html: $(S)/regions/regions_test.o $(WX_CORE_LIB)
|
2025-12-04 11:06:33 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-14 13:28:43 +01:00
|
|
|
# Maximize test (no GL) - reproduces KiCad startup maximize issue
|
|
|
|
|
$(S)/maximize/maximize_test.o: $(S)/maximize/maximize_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/maximize/maximize_test.html: $(S)/maximize/maximize_test.o $(WX_CORE_LIB)
|
2025-12-14 13:28:43 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-14 16:10:08 +01:00
|
|
|
# Early size test (no GL) - tests GetClientSize() before Show()
|
|
|
|
|
$(S)/earlysize/earlysize_test.o: $(S)/earlysize/earlysize_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/earlysize/earlysize_test.html: $(S)/earlysize/earlysize_test.o $(WX_CORE_LIB)
|
2025-12-14 16:10:08 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-15 11:47:50 +01:00
|
|
|
# Thread Pool test (pthread) - reproduces KiCad deadlock when hardware_concurrency() > PTHREAD_POOL_SIZE
|
|
|
|
|
$(S)/threadpool/threadpool_test.o: $(S)/threadpool/threadpool_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/threadpool/threadpool_test.html: $(S)/threadpool/threadpool_test.o $(WX_CORE_LIB)
|
2025-12-15 11:47:50 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_PTHREAD) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
2025-12-15 14:34:43 +01:00
|
|
|
# Log Error test (no GL) - reproduces KiCad's kiface error dialog
|
|
|
|
|
$(S)/logerror/logerror_test.o: $(S)/logerror/logerror_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
2025-12-30 14:17:51 +01:00
|
|
|
$(S)/logerror/logerror_test.html: $(S)/logerror/logerror_test.o $(WX_CORE_LIB)
|
2025-12-15 14:34:43 +01:00
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
wip: nested-asyncify fix, wxAuiToolBar registration, tests, research docs
Main-repo side of a multi-part WIP covering the KiCad WASM tool-selection
and nested-Asyncify work. Submodule commits are in kicad@f6e9239aaa
(libcontext hygiene) and wxwidgets@bb80f91e8b (auibar registration +
dialog diagnostics).
## scripts/common/inject-dyncall-shims.sh
Wrap Asyncify.handleSleep / allocateData to save-and-restore Asyncify.currData
around each EM_ASYNC_JS sleep. This fixes the nested Asyncify collision where
a fiber swap that fired during a modal's event loop clobbered currData, and
the modal's later doRewind used the fiber's buffer and hit "RuntimeError:
index out of bounds". Root cause documented as Emscripten Issue #9153
(wontfix upstream).
Diagnostic-rewind logging (forcedBottomOfCallStack, callStack traces) is
retained to help future debugging of Asyncify state corruption.
## tests/
- tests/playwright-kicad.config.ts: add `channel: 'chrome'` for the
chromium project so --project=chromium --headed uses system Chrome
(real GPU) instead of SwiftShader on ARM Mac. Also switch trace to
retain-on-failure + screenshot on-failure for easier E2E debugging.
- tests/kicad/pcbnew.spec.ts: replace `tool.checked` assertions with a
label-suffix check (`[checked]`) since our auibar registration encodes
checked state in the label (no schema change to the registry).
- tests/apps/Makefile.wasm: add `coroutine-nested` build target + include
it in the all: list.
- tests/apps/standalone/coroutine/: kicad_coroutine_harness.h + test app
reproducing KiCad COROUTINE semantics against real libcontext.
- tests/apps/standalone/coroutine-nested/: nested_test.cpp reproduces the
EM_ASYNC_JS-modal + fiber-swap nesting bug in isolation. 8 scenarios
from baseline_modal_alone through nested_fibers_inside_modal.
- tests/e2e/coroutine.spec.ts + coroutine-nested.spec.ts: Playwright specs
that load the standalone apps and assert all case cases pass via
[COROUTINE_TEST] SUMMARY log parsing.
## research/ and features/browser-tools/
Three background docs capturing the investigation trajectory:
- features/browser-tools/0001-kicad-wasm-tool-activation-investigation.md
Early investigation: why tools don't activate; initial dynCall-empty-
callback hypothesis.
- features/browser-tools/0002-wasm-coroutine-deep-dive.md
Deep dive on Asyncify internals, fiber API, QEMU's coroutine-wasm
reference implementation.
- features/browser-tools/0003-wxauitoolbar-registration-fix.md
The narrow fix: why wxAuiToolBar needs a registration block, where to
add it, what the fallback plan is.
- research/threading_1.md: corrected root-cause analysis after reading
runtime logs — nested-Asyncify currData collision, Emscripten #9153.
- research/threading_2.md: extended research on alternative approaches
(JSPI/WasmFX/state-machines) and why they don't help here.
## Submodule pointer updates
kicad: f6e9239aaa (wip: libcontext WASM hygiene cleanup)
wxwidgets: bb80f91e8b (wip: wxAuiToolBar element-registry registration +
dialog diagnostics)
## Open threads not yet in scope
- Firefox/Chrome divergent behavior: "indirect call signature mismatch"
traps in Firefox vs renderer crash in system Chrome (tracked in
plans/peaceful-hugging-pnueli.md and the research docs).
- E2E pixel-diff for Draw Lines fails because the test's diff region does
not cover where the line is actually drawn; tool activation works, the
line is visible in test-results/pcbnew-draw-lines-02-after-drawing.png.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:58:16 +02:00
|
|
|
# Coroutine stress harness - mirrors KiCad coroutine semantics against real libcontext
|
|
|
|
|
$(S)/coroutine/coroutine_test.o: $(S)/coroutine/coroutine_test.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -I$(KICAD_ROOT)/thirdparty/libcontext $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine/libcontext.o: $(KICAD_ROOT)/thirdparty/libcontext/libcontext.cpp $(KICAD_ROOT)/thirdparty/libcontext/libcontext.h
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -I$(KICAD_ROOT)/thirdparty/libcontext $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine/coroutine_test.html: $(S)/coroutine/coroutine_test.o $(S)/coroutine/libcontext.o $(WX_CORE_LIB)
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
# Nested coroutine+modal interaction harness - reproduces Asyncify rewind corruption
|
|
|
|
|
# when fiber swaps happen inside a wxDialog::ShowModal event loop (Issue #9153).
|
|
|
|
|
$(S)/coroutine-nested/nested_test.o: $(S)/coroutine-nested/nested_test.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -I$(KICAD_ROOT)/thirdparty/libcontext -I$(S)/coroutine $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-nested/nested_test.html: $(S)/coroutine-nested/nested_test.o $(S)/coroutine/libcontext.o $(WX_CORE_LIB)
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
2025-11-29 16:19:13 +01:00
|
|
|
# Convenience targets
|
|
|
|
|
menu: $(S)/menu/menu_test.html
|
|
|
|
|
clipboard: $(S)/clipboard/clipboard_test.html
|
|
|
|
|
filedialog: $(S)/filedialog/filedialog_test.html
|
|
|
|
|
layout: $(S)/layout/layout_test.html
|
|
|
|
|
aui: $(S)/aui/aui_test.html
|
|
|
|
|
toolbar: $(S)/toolbar/toolbar_test.html
|
|
|
|
|
grid: $(S)/grid/grid_test.html
|
|
|
|
|
dialog: $(S)/dialog/dialog_test.html
|
|
|
|
|
timer: $(S)/timer/timer_test.html
|
|
|
|
|
tree: $(S)/tree/tree_test.html
|
2025-12-03 11:27:00 +01:00
|
|
|
dataview: $(S)/dataview/dataview_test.html
|
|
|
|
|
htmlwin: $(S)/htmlwin/htmlwin_test.html
|
|
|
|
|
stc: $(S)/stc/stc_test.html
|
2025-12-03 15:51:44 +01:00
|
|
|
print: $(S)/print/print_test.html
|
2025-12-03 16:33:27 +01:00
|
|
|
dnd: $(S)/dnd/dnd_test.html
|
2025-12-03 16:57:02 +01:00
|
|
|
propgrid: $(S)/propgrid/propgrid_test.html
|
|
|
|
|
pickers: $(S)/pickers/pickers_test.html
|
|
|
|
|
collapsible: $(S)/collapsible/collapsible_test.html
|
|
|
|
|
listctrl: $(S)/listctrl/listctrl_test.html
|
|
|
|
|
infobar: $(S)/infobar/infobar_test.html
|
2025-12-03 17:16:14 +01:00
|
|
|
dataviewvirtual: $(S)/dataviewvirtual/dataviewvirtual_test.html
|
|
|
|
|
auinotebook: $(S)/auinotebook/auinotebook_test.html
|
|
|
|
|
wizard: $(S)/wizard/wizard_test.html
|
|
|
|
|
gridedit: $(S)/gridedit/gridedit_test.html
|
|
|
|
|
calendar: $(S)/calendar/calendar_test.html
|
2025-12-03 17:58:47 +01:00
|
|
|
gridrenderers: $(S)/gridrenderers/gridrenderers_test.html
|
|
|
|
|
printpreview: $(S)/printpreview/printpreview_test.html
|
|
|
|
|
bitmapbuttons: $(S)/bitmapbuttons/bitmapbuttons_test.html
|
|
|
|
|
specialized: $(S)/specialized/specialized_test.html
|
Add Phase 3 test coverage: validators, ownerdrawn, popup, graphicsctx, xml, wasmedge
New test apps:
- validators: wxTextValidator, wxIntegerValidator, wxFloatingPointValidator, custom validators
- ownerdrawn: wxOwnerDrawnComboBox for custom dropdown rendering (layer/font/icon combos)
- popup: wxPopupTransientWindow for transient popups (status, palette, color picker)
- graphicsctx: wxGraphicsContext for vector graphics (partial WASM support)
- xml: wxXmlDocument for XML parsing (used 665 times in KiCad)
- wasmedge: WASM edge cases (file system, threading, fonts, clipboard, memory)
Updates:
- 35 test apps, 246 tests passing (~99% coverage)
- Document WASM limitations and future TODOs in WHATWORKS.md
- Add baseline screenshots for all new tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:54:40 +01:00
|
|
|
validators: $(S)/validators/validators_test.html
|
|
|
|
|
ownerdrawn: $(S)/ownerdrawn/ownerdrawn_test.html
|
|
|
|
|
popup: $(S)/popup/popup_test.html
|
|
|
|
|
xml: $(S)/xml/xml_test.html
|
|
|
|
|
wasmedge: $(S)/wasmedge/wasmedge_test.html
|
2025-12-04 11:06:33 +01:00
|
|
|
fontenum: $(S)/fontenum/fontenum_test.html
|
|
|
|
|
textdecor: $(S)/textdecor/textdecor_test.html
|
|
|
|
|
bitmask: $(S)/bitmask/bitmask_test.html
|
|
|
|
|
regions: $(S)/regions/regions_test.html
|
2025-12-14 13:28:43 +01:00
|
|
|
maximize: $(S)/maximize/maximize_test.html
|
2025-12-14 16:10:08 +01:00
|
|
|
earlysize: $(S)/earlysize/earlysize_test.html
|
2025-12-15 11:47:50 +01:00
|
|
|
threadpool: $(S)/threadpool/threadpool_test.html
|
2025-12-15 14:34:43 +01:00
|
|
|
logerror: $(S)/logerror/logerror_test.html
|
2025-11-28 14:24:53 +01:00
|
|
|
|
2026-03-22 12:48:05 +01:00
|
|
|
# Retina/HiDPI scaling test
|
|
|
|
|
$(S)/retinascale/retinascale_test.o: $(S)/retinascale/retinascale_test.cpp
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/retinascale/retinascale_test.html: $(S)/retinascale/retinascale_test.o $(WX_CORE_LIB)
|
|
|
|
|
$(CXX) $< $(LDFLAGS_NOGL) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
|
|
|
|
|
retinascale: $(S)/retinascale/retinascale_test.html
|
wip: nested-asyncify fix, wxAuiToolBar registration, tests, research docs
Main-repo side of a multi-part WIP covering the KiCad WASM tool-selection
and nested-Asyncify work. Submodule commits are in kicad@f6e9239aaa
(libcontext hygiene) and wxwidgets@bb80f91e8b (auibar registration +
dialog diagnostics).
## scripts/common/inject-dyncall-shims.sh
Wrap Asyncify.handleSleep / allocateData to save-and-restore Asyncify.currData
around each EM_ASYNC_JS sleep. This fixes the nested Asyncify collision where
a fiber swap that fired during a modal's event loop clobbered currData, and
the modal's later doRewind used the fiber's buffer and hit "RuntimeError:
index out of bounds". Root cause documented as Emscripten Issue #9153
(wontfix upstream).
Diagnostic-rewind logging (forcedBottomOfCallStack, callStack traces) is
retained to help future debugging of Asyncify state corruption.
## tests/
- tests/playwright-kicad.config.ts: add `channel: 'chrome'` for the
chromium project so --project=chromium --headed uses system Chrome
(real GPU) instead of SwiftShader on ARM Mac. Also switch trace to
retain-on-failure + screenshot on-failure for easier E2E debugging.
- tests/kicad/pcbnew.spec.ts: replace `tool.checked` assertions with a
label-suffix check (`[checked]`) since our auibar registration encodes
checked state in the label (no schema change to the registry).
- tests/apps/Makefile.wasm: add `coroutine-nested` build target + include
it in the all: list.
- tests/apps/standalone/coroutine/: kicad_coroutine_harness.h + test app
reproducing KiCad COROUTINE semantics against real libcontext.
- tests/apps/standalone/coroutine-nested/: nested_test.cpp reproduces the
EM_ASYNC_JS-modal + fiber-swap nesting bug in isolation. 8 scenarios
from baseline_modal_alone through nested_fibers_inside_modal.
- tests/e2e/coroutine.spec.ts + coroutine-nested.spec.ts: Playwright specs
that load the standalone apps and assert all case cases pass via
[COROUTINE_TEST] SUMMARY log parsing.
## research/ and features/browser-tools/
Three background docs capturing the investigation trajectory:
- features/browser-tools/0001-kicad-wasm-tool-activation-investigation.md
Early investigation: why tools don't activate; initial dynCall-empty-
callback hypothesis.
- features/browser-tools/0002-wasm-coroutine-deep-dive.md
Deep dive on Asyncify internals, fiber API, QEMU's coroutine-wasm
reference implementation.
- features/browser-tools/0003-wxauitoolbar-registration-fix.md
The narrow fix: why wxAuiToolBar needs a registration block, where to
add it, what the fallback plan is.
- research/threading_1.md: corrected root-cause analysis after reading
runtime logs — nested-Asyncify currData collision, Emscripten #9153.
- research/threading_2.md: extended research on alternative approaches
(JSPI/WasmFX/state-machines) and why they don't help here.
## Submodule pointer updates
kicad: f6e9239aaa (wip: libcontext WASM hygiene cleanup)
wxwidgets: bb80f91e8b (wip: wxAuiToolBar element-registry registration +
dialog diagnostics)
## Open threads not yet in scope
- Firefox/Chrome divergent behavior: "indirect call signature mismatch"
traps in Firefox vs renderer crash in system Chrome (tracked in
plans/peaceful-hugging-pnueli.md and the research docs).
- E2E pixel-diff for Draw Lines fails because the test's diff region does
not cover where the line is actually drawn; tool activation works, the
line is visible in test-results/pcbnew-draw-lines-02-after-drawing.png.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:58:16 +02:00
|
|
|
coroutine: $(S)/coroutine/coroutine_test.html
|
|
|
|
|
coroutine-nested: $(S)/coroutine-nested/nested_test.html
|
2026-03-22 12:48:05 +01:00
|
|
|
|
2025-11-28 14:24:53 +01:00
|
|
|
clean:
|
2025-11-29 16:19:13 +01:00
|
|
|
rm -f minimal_test.o minimal_test.html minimal_test.js minimal_test.wasm
|
|
|
|
|
rm -f $(S)/*/*.o $(S)/*/*.html $(S)/*/*.js $(S)/*/*.wasm
|
2025-11-28 14:24:53 +01:00
|
|
|
|
wip: nested-asyncify fix, wxAuiToolBar registration, tests, research docs
Main-repo side of a multi-part WIP covering the KiCad WASM tool-selection
and nested-Asyncify work. Submodule commits are in kicad@f6e9239aaa
(libcontext hygiene) and wxwidgets@bb80f91e8b (auibar registration +
dialog diagnostics).
## scripts/common/inject-dyncall-shims.sh
Wrap Asyncify.handleSleep / allocateData to save-and-restore Asyncify.currData
around each EM_ASYNC_JS sleep. This fixes the nested Asyncify collision where
a fiber swap that fired during a modal's event loop clobbered currData, and
the modal's later doRewind used the fiber's buffer and hit "RuntimeError:
index out of bounds". Root cause documented as Emscripten Issue #9153
(wontfix upstream).
Diagnostic-rewind logging (forcedBottomOfCallStack, callStack traces) is
retained to help future debugging of Asyncify state corruption.
## tests/
- tests/playwright-kicad.config.ts: add `channel: 'chrome'` for the
chromium project so --project=chromium --headed uses system Chrome
(real GPU) instead of SwiftShader on ARM Mac. Also switch trace to
retain-on-failure + screenshot on-failure for easier E2E debugging.
- tests/kicad/pcbnew.spec.ts: replace `tool.checked` assertions with a
label-suffix check (`[checked]`) since our auibar registration encodes
checked state in the label (no schema change to the registry).
- tests/apps/Makefile.wasm: add `coroutine-nested` build target + include
it in the all: list.
- tests/apps/standalone/coroutine/: kicad_coroutine_harness.h + test app
reproducing KiCad COROUTINE semantics against real libcontext.
- tests/apps/standalone/coroutine-nested/: nested_test.cpp reproduces the
EM_ASYNC_JS-modal + fiber-swap nesting bug in isolation. 8 scenarios
from baseline_modal_alone through nested_fibers_inside_modal.
- tests/e2e/coroutine.spec.ts + coroutine-nested.spec.ts: Playwright specs
that load the standalone apps and assert all case cases pass via
[COROUTINE_TEST] SUMMARY log parsing.
## research/ and features/browser-tools/
Three background docs capturing the investigation trajectory:
- features/browser-tools/0001-kicad-wasm-tool-activation-investigation.md
Early investigation: why tools don't activate; initial dynCall-empty-
callback hypothesis.
- features/browser-tools/0002-wasm-coroutine-deep-dive.md
Deep dive on Asyncify internals, fiber API, QEMU's coroutine-wasm
reference implementation.
- features/browser-tools/0003-wxauitoolbar-registration-fix.md
The narrow fix: why wxAuiToolBar needs a registration block, where to
add it, what the fallback plan is.
- research/threading_1.md: corrected root-cause analysis after reading
runtime logs — nested-Asyncify currData collision, Emscripten #9153.
- research/threading_2.md: extended research on alternative approaches
(JSPI/WasmFX/state-machines) and why they don't help here.
## Submodule pointer updates
kicad: f6e9239aaa (wip: libcontext WASM hygiene cleanup)
wxwidgets: bb80f91e8b (wip: wxAuiToolBar element-registry registration +
dialog diagnostics)
## Open threads not yet in scope
- Firefox/Chrome divergent behavior: "indirect call signature mismatch"
traps in Firefox vs renderer crash in system Chrome (tracked in
plans/peaceful-hugging-pnueli.md and the research docs).
- E2E pixel-diff for Draw Lines fails because the test's diff region does
not cover where the line is actually drawn; tool activation works, the
line is visible in test-results/pcbnew-draw-lines-02-after-drawing.png.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 13:58:16 +02:00
|
|
|
.PHONY: all clean menu clipboard filedialog layout aui toolbar grid dialog timer tree dataview htmlwin stc print dnd propgrid pickers collapsible listctrl infobar dataviewvirtual auinotebook wizard gridedit calendar gridrenderers printpreview bitmapbuttons specialized validators ownerdrawn popup xml wasmedge fontenum textdecor bitmask regions maximize earlysize threadpool logerror retinascale coroutine coroutine-nested
|
test(wasm): coroutine crash reproduction harness + per-engine runner
Investigation scaffolding for the Chrome-only KiCad coroutine renderer crash.
Adds isolated reproduction probes exercising the coroutine/Asyncify/fiber layer
under KiCad-like conditions, runnable in BOTH Firefox and system Chrome.
- tests/playwright-coroutine.config.ts + test:coroutine:firefox|chrome npm
scripts: run the coroutine specs in Firefox AND system Chrome (the old e2e
config only used bundled Chromium, which never reproduced the crash).
- tests/apps/standalone/coroutine-pthread/: no-wx + pthreads reproduction probes
(fiber-in-main, nested invoke_/dynCall boundaries, RunMainStack, embind,
main-loop/rAF activation) + worker_dom_stub.js for wx+pthreads builds.
- tests/apps/Makefile.wasm: coroutine-pthread{,-main,-nested,-nested-ex,-wx,
-embind,-mainloop} targets.
- scripts/common/shims/diagnostics.js: add EM_ASYNC_JS handleSleep enter/wake
tracking (DIAG_SLEEP) to detect nested-async at the crash.
Findings (details in research notes): every isolated factor so far — direct /
nested / RunMainStack fiber, wx event loop + all 13 scenarios incl EM_ASYNC_JS,
pthreads, and main-loop/rAF activation — runs CLEAN in system Chrome. The
coroutine/Asyncify layer is exonerated; GL/WebGL is the remaining untested factor
(next). The reliable FF-pass/Chrome-fail repro is still the KiCad pcbnew e2e.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 18:44:12 +02:00
|
|
|
|
|
|
|
|
# === Coroutine pthread variant — reproduces the KiCad Asyncify-fiber x pthreads crash ===
|
|
|
|
|
# Same modal-free harness as `coroutine`, but compiled/linked with pthreads to match
|
|
|
|
|
# KiCad's runtime (-pthread + PTHREAD_POOL_SIZE). The single-threaded `coroutine` build
|
|
|
|
|
# passes in system Chrome; KiCad (pthreads) crashes. This isolates that difference.
|
|
|
|
|
LDFLAGS_COROUTINE_PTHREAD = $(DEBUG_LDFLAGS) $(COROUTINE_BASE_LDFLAGS) -pthread \
|
|
|
|
|
-sPTHREAD_POOL_SIZE='navigator.hardwareConcurrency' -sPTHREAD_POOL_SIZE_STRICT=0 \
|
|
|
|
|
$(WX_LDFLAGS_NOGL)
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/coroutine_test_pt.o: $(S)/coroutine/coroutine_test.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -I$(KICAD_ROOT)/thirdparty/libcontext -I$(S)/coroutine $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/libcontext_pt.o: $(KICAD_ROOT)/thirdparty/libcontext/libcontext.cpp $(KICAD_ROOT)/thirdparty/libcontext/libcontext.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -I$(KICAD_ROOT)/thirdparty/libcontext $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/coroutine_test.html: $(S)/coroutine-pthread/coroutine_test_pt.o $(S)/coroutine-pthread/libcontext_pt.o $(WX_CORE_LIB)
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE_PTHREAD) --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
coroutine-pthread: $(S)/coroutine-pthread/coroutine_test.html
|
|
|
|
|
.PHONY: coroutine-pthread
|
|
|
|
|
|
|
|
|
|
# === No-wx pthread main() reproduction: fiber pattern in main + pthreads, no wxWidgets ===
|
|
|
|
|
LDFLAGS_COROUTINE_PTHREAD_NOWX = $(DEBUG_LDFLAGS) -sALLOW_MEMORY_GROWTH -sERROR_ON_UNDEFINED_SYMBOLS=0 \
|
|
|
|
|
-sASYNCIFY=1 -sASYNCIFY_STACK_SIZE=65536 -sASYNCIFY_IMPORTS=['emscripten_fiber_swap'] \
|
|
|
|
|
-sDYNCALLS=1 -pthread -sPTHREAD_POOL_SIZE='navigator.hardwareConcurrency' \
|
|
|
|
|
-sPTHREAD_POOL_SIZE_STRICT=0 -sEXPORTED_RUNTIME_METHODS=['ccall']
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/main_repro.o: $(S)/coroutine-pthread/main_repro.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -I$(KICAD_ROOT)/thirdparty/libcontext -I$(S)/coroutine $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/main_repro.html: $(S)/coroutine-pthread/main_repro.o $(S)/coroutine-pthread/libcontext_pt.o
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE_PTHREAD_NOWX) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
coroutine-pthread-main: $(S)/coroutine-pthread/main_repro.html
|
|
|
|
|
.PHONY: coroutine-pthread-main
|
|
|
|
|
|
|
|
|
|
# Nested JS<->wasm dynCall-boundary reproduction (no wx + pthreads)
|
|
|
|
|
$(S)/coroutine-pthread/nested_repro.o: $(S)/coroutine-pthread/nested_repro.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -I$(KICAD_ROOT)/thirdparty/libcontext -I$(S)/coroutine $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/nested_repro.html: $(S)/coroutine-pthread/nested_repro.o $(S)/coroutine-pthread/libcontext_pt.o
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE_PTHREAD_NOWX) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
coroutine-pthread-nested: $(S)/coroutine-pthread/nested_repro.html
|
|
|
|
|
.PHONY: coroutine-pthread-nested
|
|
|
|
|
|
|
|
|
|
# Nested invoke_/dynCall reproduction WITH exceptions (invoke_* boundaries, asyncify-unwindable)
|
|
|
|
|
LDFLAGS_COROUTINE_INVOKE = $(DEBUG_LDFLAGS) -sALLOW_MEMORY_GROWTH -sERROR_ON_UNDEFINED_SYMBOLS=0 \
|
|
|
|
|
-sASYNCIFY=1 -sASYNCIFY_STACK_SIZE=65536 \
|
|
|
|
|
-sASYNCIFY_IMPORTS=['invoke_vi','invoke_v','invoke_ii','invoke_iii','emscripten_fiber_swap'] \
|
|
|
|
|
-sDYNCALLS=1 -fexceptions -pthread -sPTHREAD_POOL_SIZE='navigator.hardwareConcurrency' \
|
|
|
|
|
-sPTHREAD_POOL_SIZE_STRICT=0 -sEXPORTED_RUNTIME_METHODS=['ccall']
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/nested_repro_ex.o: $(S)/coroutine-pthread/nested_repro.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -fexceptions -I$(KICAD_ROOT)/thirdparty/libcontext -I$(S)/coroutine $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/libcontext_ex.o: $(KICAD_ROOT)/thirdparty/libcontext/libcontext.cpp $(KICAD_ROOT)/thirdparty/libcontext/libcontext.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -fexceptions -I$(KICAD_ROOT)/thirdparty/libcontext $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/nested_repro_ex.html: $(S)/coroutine-pthread/nested_repro_ex.o $(S)/coroutine-pthread/libcontext_ex.o
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE_INVOKE) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
coroutine-pthread-nested-ex: $(S)/coroutine-pthread/nested_repro_ex.html
|
|
|
|
|
.PHONY: coroutine-pthread-nested-ex
|
|
|
|
|
|
|
|
|
|
# wx event loop + pthreads (KiCad's 13-scenario harness) with a worker DOM stub so the
|
|
|
|
|
# pthread workers don't crash on wx's module-eval document access.
|
|
|
|
|
$(S)/coroutine-pthread/coroutine_test_wxpt.html: $(S)/coroutine-pthread/coroutine_test_pt.o $(S)/coroutine-pthread/libcontext_pt.o $(WX_CORE_LIB)
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE_PTHREAD) --pre-js $(S)/coroutine-pthread/worker_dom_stub.js --pre-js $(JS) --shell-file $(HTML) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
coroutine-pthread-wx: $(S)/coroutine-pthread/coroutine_test_wxpt.html
|
|
|
|
|
.PHONY: coroutine-pthread-wx
|
|
|
|
|
|
|
|
|
|
# embind reproduction: coroutine activated via an embind (--bind) call
|
|
|
|
|
LDFLAGS_COROUTINE_EMBIND = $(LDFLAGS_COROUTINE_INVOKE) --bind
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/embind_repro.o: $(S)/coroutine-pthread/embind_repro.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -fexceptions -I$(KICAD_ROOT)/thirdparty/libcontext -I$(S)/coroutine $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/embind_repro.html: $(S)/coroutine-pthread/embind_repro.o $(S)/coroutine-pthread/libcontext_ex.o
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE_EMBIND) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
coroutine-pthread-embind: $(S)/coroutine-pthread/embind_repro.html
|
|
|
|
|
.PHONY: coroutine-pthread-embind
|
|
|
|
|
|
|
|
|
|
# Main-loop (rAF) activation reproduction: coroutine activated inside emscripten_set_main_loop
|
|
|
|
|
$(S)/coroutine-pthread/mainloop_repro.o: $(S)/coroutine-pthread/mainloop_repro.cpp $(S)/coroutine/kicad_coroutine_harness.h
|
|
|
|
|
@mkdir -p $(S)/coroutine-pthread
|
|
|
|
|
$(CXX) -c $(CXXFLAGS) -pthread -I$(KICAD_ROOT)/thirdparty/libcontext -I$(S)/coroutine $< -o $@
|
|
|
|
|
|
|
|
|
|
$(S)/coroutine-pthread/mainloop_repro.html: $(S)/coroutine-pthread/mainloop_repro.o $(S)/coroutine-pthread/libcontext_pt.o
|
|
|
|
|
$(CXX) $^ $(LDFLAGS_COROUTINE_PTHREAD_NOWX) -o $@
|
|
|
|
|
../../scripts/common/inject-dyncall-shims.sh $(basename $@).js
|
|
|
|
|
|
|
|
|
|
coroutine-pthread-mainloop: $(S)/coroutine-pthread/mainloop_repro.html
|
|
|
|
|
.PHONY: coroutine-pthread-mainloop
|