design-b D-1b: delete the legacy handlesleep runtime from the injector
Doc 20 D-1, second slice: the injector now injects asyncify-scheduler.js unconditionally — the WX_SCHEDULER=0 legacy opt-out, the SHIM_DISABLE_HANDLESLEEP ablation skip, and the SHIM_DISABLE_TRAMPOLINE_HEAL ablation skip are gone, and scripts/common/shims/handlesleep.js is deleted (the scheduler subsumed its capture/restore, fiber guard, and trampoline-heal duties in S2). Comment-only scrubs point the remaining references at the scheduler shim. .ci-cache-epoch bumped (shim/injector behavior changed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TEHGiiXMShNXbBr7gSJ7iz
This commit is contained in:
parent
e7b8c2725b
commit
4906b9fb56
10 changed files with 34 additions and 477 deletions
|
|
@ -2,9 +2,9 @@ import { test, expect, tryLoadApp } from '../e2e/utils/fixtures';
|
|||
|
||||
/**
|
||||
* S2 scheduler-core gates (docs/features/async/17 §3d N1/N4, §4 S2).
|
||||
* Runs against the races harness built with WX_SCHEDULER=1 (scheduler-only
|
||||
* glue — the legacy handlesleep shim is NOT injected on scheduler builds).
|
||||
* Both tests self-skip on legacy glue, so the file is safe in either variant.
|
||||
* Runs against the races harness; the scheduler shim is the only runtime
|
||||
* (the legacy handlesleep opt-out was deleted at doc 20 D-1). The self-skip
|
||||
* on shim-less glue is kept as a stale-build guard.
|
||||
*
|
||||
* N1 — single-writer tripwire: Asyncify.currData is an accessor; a pure-JS
|
||||
* write without scheduler authorization beacons (and throws in strict mode).
|
||||
|
|
@ -48,7 +48,7 @@ async function bootAndSettle(
|
|||
);
|
||||
}
|
||||
|
||||
test.describe('S2 scheduler core (WX_SCHEDULER=1 glue)', () => {
|
||||
test.describe('S2 scheduler core (scheduler glue)', () => {
|
||||
test('N4: battery leaves coherent books — wakes drained, no strays, battery green', async ({
|
||||
page,
|
||||
testLogger,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import { test, expect } from "./fixtures";
|
|||
* - mid-load applies are DROPPED (the probe segment must not move);
|
||||
* - after settle the entries work normally (guard released).
|
||||
*
|
||||
* VARIANT CONTRACT (docs/features/async/17 §3b): on WX_SCHEDULER=1 glue the
|
||||
* VARIANT CONTRACT (docs/features/async/17 §3b): on scheduler glue the
|
||||
* shim's embind lane queues busy-window mutators and delivers them after
|
||||
* settle, so the "applies are DROPPED" assertions flip to "applies are
|
||||
* DELIVERED in order" — assertSettledContract branches on the lane's
|
||||
|
|
@ -301,7 +301,7 @@ async function assertSettledContract(page: Page, stats: FuzzStats): Promise<void
|
|||
|
||||
// Variant contract (docs/features/async/17 §3b). Legacy glue: the gate
|
||||
// DROPPED the mid-load applies — the probe never moved. Scheduler glue
|
||||
// (WX_SCHEDULER=1 shim embind lane, doc 18): the same applies were QUEUED
|
||||
// (scheduler shim embind lane, doc 18): the same applies were QUEUED
|
||||
// and DELIVERED after settle, in order — the probe sits where the hammer's
|
||||
// deltas moved it. Same stimulus, the drop→deliver flip is the assertion.
|
||||
const schedulerLane = await page.evaluate(
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ function runLoadPcbTest(demo: DemoCfg): void {
|
|||
// the load — not before, not after the board renders. The formerly
|
||||
// tolerated post-load clipboard/unwind RuntimeErrors are fixed
|
||||
// (sync clipboard IsSupported in wx; "unwind" sentinel handling in
|
||||
// scripts/common/shims/handlesleep.js; see docs/features/asyncify-arbiter/).
|
||||
// the scheduler shim; see docs/features/asyncify-arbiter/).
|
||||
const asyncifySignatures = [
|
||||
'index out of bounds',
|
||||
'indirect call to null',
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { test, expect } from "./fixtures";
|
|||
*
|
||||
* The mailbox flips drop→deliver: a mutating entry issued during the open
|
||||
* becomes a queued message, applied IN ORDER after the open completes. GREEN
|
||||
* since S1's embind lane — the WX_SCHEDULER=1 shim wraps the audited mutators
|
||||
* since S1's embind lane — the scheduler shim wraps the audited mutators
|
||||
* (doc 18) at the Module boundary, queueing busy-window calls and delivering
|
||||
* after settle with promise-returned results. S4 moves queueing worker-side.
|
||||
* Self-skips on legacy glue (the lane is a build variant until S5).
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import { expectGuardsSilent } from "./utils/guard-beacons";
|
|||
* and the main loop spends most wall-clock time Asyncify-parked inside
|
||||
* wxWasmYieldToBrowser. A timer handler that itself parks therefore creates
|
||||
* TWO live Asyncify contexts over the single-slot `Asyncify.currData` — the
|
||||
* emscripten #9153 family that scripts/common/shims/handlesleep.js silently
|
||||
* repairs. The collab entries add the third ingredient: they run on
|
||||
* emscripten #9153 family that the scheduler shim
|
||||
* (scripts/common/shims/asyncify-scheduler.js) silently repairs. The collab entries add the third ingredient: they run on
|
||||
* TOOL_MANAGER coroutines (emscripten_fiber_swap), which bypass the shim's
|
||||
* allocateData accounting entirely — and `finishContextSwitch` is exactly
|
||||
* where the prod trap's second stack dies.
|
||||
|
|
@ -328,7 +328,7 @@ test.describe("timer Notify() Asyncify-park during main-loop yield (concurrent c
|
|||
);
|
||||
if (cLane) expectGuardsSilent(testLogger.consoleLogs, ["timerRetry"]);
|
||||
|
||||
// Window-engagement proof, independent of survival: the handlesleep shim
|
||||
// Window-engagement proof, independent of survival: the scheduler shim
|
||||
// must have SEEN the concurrent parks (its reporting is new — silence here
|
||||
// means the lever never created the overlap and the repro is vacuous).
|
||||
const shimLines = testLogger.consoleLogs.filter((l) => l.includes("[wx-asyncify]"));
|
||||
|
|
@ -336,7 +336,7 @@ test.describe("timer Notify() Asyncify-park during main-loop yield (concurrent c
|
|||
for (const l of shimLines.slice(0, 10)) console.log(`[TEST] ${l}`);
|
||||
expect(
|
||||
shimLines.length,
|
||||
"handlesleep shim observed the concurrent-park window",
|
||||
"scheduler shim observed the concurrent-park window",
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export interface GuardBeaconCounts {
|
|||
timerRetry: BeaconFamilyCount;
|
||||
// wx dispatch interlock bookkeeping anomalies (evtloop.cpp)
|
||||
dispatchAnomaly: BeaconFamilyCount;
|
||||
// handlesleep.js shim: nested-park / wake-aliasing / stale-fiber refusals
|
||||
// asyncify-scheduler.js shim: nested-park / wake-aliasing / stale-fiber refusals
|
||||
wxAsyncify: BeaconFamilyCount;
|
||||
// libcontext swap-layer refusals + hot-main beacons ([collab-fcontext])
|
||||
libcontext: BeaconFamilyCount;
|
||||
|
|
|
|||
Loading…
Reference in a new issue