ReviewOS

zig-utils/zig-js

Mid-GC: diagnose late asyncJoin waiter timeouts in the full parent inventory

#1109
Closed chris opened this 8 days ago ·
8 days ago

Related: #1106 and #1108.

An exact-parent 4c1f31af Debug engine built with the corrected #1108 fixture completes the unchanged full mid-GC inventory with 8 failures in 900 programs. All failures are finite-wait assertions in runMidScriptLateAsyncJoinCleanupGc or runMidScriptLateAsyncJoinRejectCleanupGc:

  • success fixture: seeds 4, 6, 7, 9;
  • rejection fixture: seeds 4, 6, 8, 9;
  • diagnostic: midgc late asyncJoin [reject] waiter result timed-out.

The full candidate engine inventory passes 900/900. This comparison does not establish a performance improvement or a causal engine fix: the host was contended and storage fluctuated. The parent control wall time was 2,307,527 ms; candidate was 1,301,732 ms, retained only as diagnostic context.

Executed follow-up: seed 4 of each failed profile, once on parent and once on candidate, passes all four runs with unchanged timers and watchdogs. The focused selectors are midgclateasyncjoincleanup 1 4 and midgclateasyncjoinrejectcleanup 1 4. The full profiles used THREADFUZZ_SEED_TIMEOUT_MS=300000 ... midgc 20 1, matching CI. No excludes, retries of the full failed run, or larger budgets were used. #1108's sync-timeout root-release fixture did not fail in the parent inventory.

Investigate whether finite parked-wait timeouts are a valid requirement for these allocation/late-promise workloads or whether an explicit phase is needed; also rule out engine scheduling/root defects. Do not label this a false positive solely from source inspection or passing focused replay.

Acceptance: execute a diagnostic that separates legitimate deadline expiry from engine failure; retain exact late join result/rejection, live-root, collection attempt/completion and eventual cleanup count/sum oracles; qualify any correction under Debug/ReleaseSafe/unsuppressed TSan and the full mid-GC inventory without exclusions or relaxed budgets.

8 days ago

Executed follow-up during #1107 verification: its full900 mid-GC run fails only the rejection fixture at seeds2 and3 (waiter result timed-out). Earlier parentfull900 had8 failures across both late-join fixtures; logs are retained.

A controlled diagnostic copies both original fixture functions, preserving workers, finite timers, allocation/spin work, collection counters, late result/rejection and finalization oracles. On exact parent4c1f31af with the real collector, a2700ms main pause produces:

  • success: timedOut=2, beforeRelease=2, state=0, elapsed=3188ms;
  • rejection: timedOut=3, beforeRelease=3, state=0, elapsed=3301ms.

Every waiter deadline legitimately expires before main publishes release. The assertion that only ok/not-equal can occur therefore depends on completing the main workload before a finite deadline.

The local correction retains that finite wait and validates its result, then keeps the waiter root graph alive in a predicate-driven untimed release wait. Release results and root marker/nested label are rechecked. All original late-join, GC attempt/completion, waiter sums and exact finalization count/sum assertions remain. The corrected controlled parent diagnostic passes both full fixtures after the same pause while requiring the timeouts to be observed.

No timer increase, exclusions, or polling sleeps are added to the tracked fixtures. Mode and full900 qualification are now running; no fix commit or completion claim yet.

8 days ago

Landed and pushed on main in98aaed26.

The finite wait remains with its original timeout. After any valid finite-wait completion, waiter roots stay live until main publishes release through a predicate-driven untimed wait; release results and marker/nested-label integrity are validated. Original workers, allocation/spin workload, late fulfillment/rejection, collection attempts/completions, waiter sums and exact finalization count/sum assertions remain.

Executed diagnosis: exact-parent controlled2700ms pause observes2 success and3 rejection timeouts while state remains0 (elapsed3188/3301ms). The corrected diagnostic passes both complete fixtures after the same pause while requiring expiry to be observed. Initial parent8 failures and candidate2 failures remain retained.

Qualification: each profile20/20 in Debug and ReleaseSafe,2/2 in unsuppressed TSan; full mid-GC900/900; TSan fuzz60/60. No larger finite timers, excluded cases, or relaxed CI watchdogs. Combined #1107 engine checks276/276 in three modes and full no-GIL253/253 in Debug/ReleaseSafe also pass. Flips0 test262 cases for this harness-only correction.

Sign in to comment on this issue.