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>
This commit is contained in:
parent
a4ad69412e
commit
01dce40dc9
11 changed files with 616 additions and 1 deletions
|
|
@ -78,6 +78,26 @@
|
|||
}, 100);
|
||||
}
|
||||
|
||||
// 6. EM_ASYNC_JS sleeps (startModal, js_enumerateFonts, clipboard, etc.) — log
|
||||
// enter/wake so we can see whether an async sleep is NESTED with a fiber swap
|
||||
// at the crash (the #9153 collision). Logging only; delegates unchanged.
|
||||
if (typeof Asyncify !== "undefined" && typeof Asyncify.handleSleep === "function") {
|
||||
var __diagOrigHandleSleep = Asyncify.handleSleep.bind(Asyncify);
|
||||
var diagSleepId = 0;
|
||||
Asyncify.handleSleep = function(startAsync) {
|
||||
var id = ++diagSleepId;
|
||||
console.warn("[DIAG_SLEEP] ENTER id=" + id + " state=" + asyncState() +
|
||||
" currData=" + ((typeof Asyncify.currData !== "undefined" && Asyncify.currData) || "null"));
|
||||
return __diagOrigHandleSleep(function(wakeUp) {
|
||||
return startAsync(function(result) {
|
||||
console.warn("[DIAG_SLEEP] WAKE id=" + id + " state=" + asyncState() +
|
||||
" currData=" + ((typeof Asyncify.currData !== "undefined" && Asyncify.currData) || "null"));
|
||||
return wakeUp(result);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
console.warn("[DIAG] Asyncify/fiber/modal diagnostics installed (logging only)");
|
||||
})();
|
||||
// === End diagnostics ===
|
||||
|
|
|
|||
Loading…
Reference in a new issue