Live-app fix (Place Footprints / routing dead in Chrome): submodule bumps carry the coroutine ownership fix (kicad 012d95ecb4) and the handler-exception survival fix (wxwidgets 1b5f0e31f4). Emscripten-6 fallout: - occ/ngspice worker wrappers: mainScriptUrlOrBlob was removed upstream; pthread children re-run the wrapper blob, so an em-pthread realm now importScripts the glue and gets out of the way (before: recursive service boots, pool never fills, silent 180s boot hangs — every occ spec and ngspice bg_run). - Makefile.wasm: -sASYNCIFY frankenlinks on the no-wx coroutine repro targets ported to -sJSPI (the JSPI-only libcontext crashed at first yield under them); mainloop/gl repro pages drive their tick through a promising export (emscripten_set_main_loop callbacks cannot suspend); retired inject-dyncall-shims lines removed (targets were unbuildable since Phase 8); $stringToNewUTF8 force-included (the EM_ASM value bridge aborted the runtime on the first decoded exception). - fiber-park levers: neither embind shape can drive suspending levers (plain throws on strict-JSPI Firefox; emscripten::async() re-executes its invoker on settle) — kept sync for manual Chromium probing, spec coverage moved to the jspi-coroutine harness (18 cases). Suite work: - Playwright 1.61.1 -> 1.62.1 (Firefox 153: JSPI on by default). - fiber-resume-park.spec retired -> coroutine-lifecycle.spec: census gate over boot / board load / chooser open / cancel (deterministically red on the pre-fix build). - Blind asyncify-era pins re-keyed: quasimodal-strand + wait-beacons beacon regexes, footprint-chooser-close liveness -> wx parking-timer heartbeat (scheduler counters idle flat on Firefox). - occ/ngspice test providers: 60s boot timeout + worker error surfacing (a worker death used to be a silent 180s timeout). - Harness pages: stale 9.99 config dir -> 10.0 (library_manager wxCHECK noise, chooser had no libraries). - gal-webgl harness: missing artifacts rebuilt (boost/glm extracted to the host sysroot), PgmOrNull stub added for the rebased GAL. - jspi-scheduler: clean-shutdown console line restored (app-quit contract), quarantine never yanks SP from a live window. Gates: test:e2e 699 passed / 0 failed (wx-chromium, kicad-firefox, kicad-chromium, jspi-firefox, coroutine-firefox); web ff/cr/mobile 71 passed; lint:ci-coverage 166, lint:determinism 163, screenshots manifest 492 current, corpus 7/7, tools:contract green. Offline screenshot baselines show expected mass drift from the engine bump — re-baseline (screenshots:noise -> promote) is a follow-up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016X9eh1s5sTx1o9Em9KBuwR
51 lines
2.8 KiB
TypeScript
51 lines
2.8 KiB
TypeScript
import { test, expect } from './utils/fixtures';
|
|
|
|
// A raytracer-style worker-join run inside a wx modal pump. A pass is dispatched from a wxTimer that
|
|
// fires while a ShowModal() dialog is open; the modal pump runs ProcessEvents via ccall(async:true),
|
|
// so the work runs in a fresh managed Asyncify context at state == Normal. Both join styles complete
|
|
// multi-core there:
|
|
// m=0 busywait : sleep_for join; the pre-warmed pool completes it.
|
|
// m=1 yield : emscripten_sleep join; legal at state == Normal, so it suspends and resumes.
|
|
//
|
|
// Named coroutine-* so playwright-coroutine.config.ts runs it in real Chrome + Firefox. WebKit
|
|
// skipped for pthread apps (COEP).
|
|
|
|
const APP = '/standalone/raytrace-modal/raytrace_modal_test.html';
|
|
|
|
function workersRan( logs: string[] ): number {
|
|
const l = logs.find( x => x.includes( '[RTPOOL] SUCCESS' ) );
|
|
const m = l?.match( /workersRan=(\d+)/ );
|
|
return m ? +m[1] : -1;
|
|
}
|
|
|
|
function abortErrors( testLogger: { errors: string[] } ) {
|
|
return testLogger.errors.filter( e => /invalid state:\s*1|Aborted/i.test( e ) );
|
|
}
|
|
|
|
async function waitForLog( testLogger: { consoleLogs: string[] }, needle: string, timeout = 60000 ) {
|
|
await expect.poll( () => testLogger.consoleLogs.some( l => l.includes( needle ) ), { timeout } ).toBe( true );
|
|
}
|
|
|
|
test.describe( 'Raytracer worker-join inside a wx modal pump', () => {
|
|
|
|
test( 'm=0 busywait: pre-warmed pool busy-wait completes inside the modal → multi-core', async ( { page, testLogger } ) => {
|
|
await page.goto( `${APP}#m=0` );
|
|
await waitForLog( testLogger, '[RTPOOL] SUCCESS mode=0' );
|
|
expect( workersRan( testLogger.consoleLogs ), 'multi-core inside the modal' ).toBeGreaterThan( 1 );
|
|
expect( abortErrors( testLogger ), 'no Asyncify abort' ).toHaveLength( 0 );
|
|
} );
|
|
|
|
// The in-modal work runs in a fresh ProcessEvents entry, so an emscripten_sleep join is a
|
|
// legal scheduler park and the pass completes multi-core. (The asyncify-era `Asyncify.state=0`
|
|
// probe log retired with that backend — under JSPI the equivalent invariant is that the
|
|
// sleep park suspends cleanly, i.e. SUCCESS is reached with no scheduler anomaly.)
|
|
test( 'm=1 yield: emscripten_sleep join inside the modal → multi-core', async ( { page, testLogger } ) => {
|
|
await page.goto( `${APP}#m=1` );
|
|
await waitForLog( testLogger, '[RTPOOL] SUCCESS mode=1' );
|
|
expect( testLogger.consoleLogs.filter( l =>
|
|
/\[wx-scheduler\] (force-clearing stuck window|job tick error)|\[libctx-jspi\] ghost\/refused/.test( l ) ),
|
|
'no scheduler anomaly during the in-modal join' ).toHaveLength( 0 );
|
|
expect( workersRan( testLogger.consoleLogs ), 'the yield-join completes → multi-core' ).toBeGreaterThan( 1 );
|
|
expect( abortErrors( testLogger ), 'no Asyncify abort' ).toHaveLength( 0 );
|
|
} );
|
|
} );
|