ReviewOS

zig-utils/zig-js

Finish exact async-module, import-defer, and dynamic-import ordering semantics

#9
Closed chris opened this 11 days ago ·
11 days ago

Context

The runner now executes most module+async/top-level-await cases with the $DONE module harness. The remaining 35 module-related files are excluded before enumeration because they require exact async-module graph ordering, import-defer async-module semantics, or dynamic-import catch-target behavior not implemented by the current synchronous module driver.

Current excluded reasons

  • async-module-ordering
  • import-defer-async-module
  • dynamic-import-catch-target

See docs/.data/test262-excluded.tsv for the exact file inventory.

Done when

  • Async module evaluation follows the required TLA dependency graph and fulfillment/rejection ordering.
  • Deferred imports correctly handle async-module dependencies.
  • Dynamic import catch-target semantics match test262 expectations.
  • The 35 module-related exclusions are removed from conformance/test262.zig and docs/.data/test262-excluded.tsv.
  • zig build test262 stays green with the promoted cases included in the scored denominator.
11 days ago

Updated in 1fa9e65.\n\nThis issue is narrowed but intentionally still open. Dynamic-import catch-target coverage and most import-defer async-module coverage are now scored and passing. The remaining exclusions are exact async-module/TLA graph-ordering cases only:\n- test/language/expressions/dynamic-import/eval-self-once-module.js\n- test/language/import/import-defer/evaluation-top-level-await/flattening-order/main.js\n- test/language/module-code/top-level-await/top-level-ticks-2.js\n- test/language/module-code/top-level-await/top-level-ticks.js\n- test/language/module-code/top-level-await/rejection-order.js\n- test/language/module-code/top-level-await/unobservable-global-async-evaluation-count-reset.js\n- test/language/module-code/top-level-await/async-module-does-not-block-sibling-modules.js\n- test/language/module-code/top-level-await/fulfillment-order.js\n- test/language/module-code/top-level-await/module-async-import-async-resolution-ticks.js\n- test/language/module-code/top-level-await/module-self-import-async-resolution-ticks.js\n- test/language/module-code/verify-dfs.js\n\nFocused checks that now pass include dynamic-import catch (176), dynamic-import import-defer (126), import-defer static import (100), and module-code (590). Full regenerated docs data is green at VALID 48,486/48,486 with these 11 ordering cases still outside the denominator.

11 days ago

Completed in this branch/chunk.

What changed:

  • Removed the remaining 11 async-module/TLA/dynamic-import/import-defer exclusions from conformance/test262.zig.
  • Implemented async module continuation state for top-level await, dependency waiting, cycle-root parent registration, breadth-first async parent resumption, and dynamic-import waiters for pending module namespaces.
  • Deferred import defer async dependency work until the surrounding dependency walk has discovered later imports, preserving flattening order.
  • Moved dynamic import() module work onto the PromiseJobs queue without draining unrelated microtasks from inside the import job.
  • Fixed module default function declaration instantiation so imported default bindings are hoisted and remain mutable where test262 expects updates.
  • Refreshed docs/exclusion data: exclusions are now 11 staging-only files; skipped remains 0.

Flipped cases/counts:

  • 11 explicit async-module-related excluded entries were promoted into the scored denominator.
  • Valid denominator increased from 48,486 to 48,497.
  • Excluded inventory dropped from 22 to 11.

Verification:

  • zig build test --summary failures -> pass, 534/534.
  • ./zig-out/bin/test262 --diag test/language/module-code top-level-await -> 0 fail, 251 pass.
  • ./zig-out/bin/test262 --diag test/language/module-code verify-dfs -> 0 fail, 1 pass.
  • ./zig-out/bin/test262 --diag test/language/import flattening-order -> 0 fail, 1 pass.
  • ./zig-out/bin/test262 --diag test/language/expressions/dynamic-import eval-self-once-module -> 0 fail, 1 pass.
  • ./zig-out/bin/test262 --diag test/language/expressions/dynamic-import -> 0 fail, 941 pass.
  • zig build test262 -Doptimize=ReleaseFast -> VALID 48,497/48,497, NEGATIVE 4,669/4,669, skipped 0.
  • bun run docs:data -- --from docs/.data/test262-run-2026-07-05.txt regenerated docs/.data/test262.json.
  • bun run docs:build -> built 21 pages.
11 days ago

Closing: the #9 async-module/import-defer/dynamic-import ordering exclusions are now implemented, scored, documented, and covered by a full green test262 transcript.

11 days ago

Verification update after main@5663b24:

  • Issue #9 remains complete in the current configured runner.
  • ./zig-out/bin/test262 --list-excluded reports # total 0.
  • ./zig-out/bin/test262 --list-skips reports # total 0.
  • The previous async-module/import-defer/dynamic-import exclusions are not present in the current scored inventory.

This follow-up chunk also removed the separate README/docs claim that JSObjectMakeDeferredPromise was a NotImplemented C-API stub; that is not a #9 test262 flip. test262 case flips in this chunk: 0.

11 days ago

Follow-up verification after main@83e2805:\n\n- The stale intermediate "excluded inventory dropped from 22 to 11" note is no longer current.\n- Local current runner output is zero exclusions: ./zig-out/bin/test262 --list-excluded -> # total 0.\n- Local current runner output is zero skips: ./zig-out/bin/test262 --list-skips -> # total 0.\n- Tracked inventories match: docs/.data/test262-excluded.tsv and docs/.data/test262-skips.tsv both contain only the header plus # total 0.\n\nThis chunk did not flip test262 cases. It promoted one WebKit PR-249 threads witness instead: cve/mc-spec-timer-capability.js, moving PR-249 promoted coverage from 227/259 to 228/259 executable files.

11 days ago

Update for commit c4a8468:\n\n- test262 exclusions remain zero: ./zig-out/bin/test262 --list-excluded => # total 0.\n- test262 skips remain zero: ./zig-out/bin/test262 --list-skips => # total 0.\n- No test262 cases were skipped or excluded for this PR-249 threads promotion chunk.\n\nRelated coverage movement lives under issue #1: PR-249 promoted executable coverage 228 -> 229 and default threads-test allowlist 226 -> 227.

11 days ago

Fresh follow-up proof in 3b01795e after removing the last hidden/excluded Test262 coverage path.

Verification:

  • zig build test262 --summary all: 48,506/48,506 valid, 4,669/4,669 negative, skipped 0.
  • All late built-ins that previously risked being hidden by parent-side spawn pressure now report real counts, including TypedArray at 1,446/1,446, TypedArrayConstructors at 738/738, Uint8Array at 70/70, and WeakMap/WeakRef/WeakSet at 141/29/85.

The harness now fails closed if a subtree driver exits without machine-readable stats, so 0/0 cannot masquerade as complete coverage.

Sign in to comment on this issue.