Repository navigation
Closed
Labels
performanceMeasured runtime, memory, scaling, or build performanceMeasured runtime, memory, scaling, or build performancetoolingBuild, test, documentation, and developer toolingBuild, test, documentation, and developer tooling
Description
Parents: #491, #493
Related: #617
Problem
The Test262 runner fell through to the full default corpus for every unrecognized first argument. A harmless-looking test262 --help therefore launched the complete parent driver and worker tree. Recognized modes with missing operands silently returned success. This could create long-lived hidden corpus work, contaminate evidence jobs, and turn CLI mistakes into expensive host load.
This was observed directly while validating #618/#619: an attempted --help probe spawned a class-expression subtree driver, remained alive after the calling tool returned, and invalidated an otherwise complete parent/candidate comparison.
Scope
- Preserve no-argument execution as the intentional full-corpus entry point used by
zig build test262. - Add explicit
--helpusage output that exits successfully without opening the corpus or spawning workers. - Reject unknown options/modes before
runParent. - Reject missing required operands and malformed numeric worker ranges with a nonzero result instead of silently returning or coercing to zero.
- Reject unexpected trailing operands for fixed-arity modes; retain the documented optional
--diagfilter and variadic--vm-witnesspaths. - Add deterministic argument-contract tests that do not execute Test262.
No-workaround rules
- No argument allowlist in a shell wrapper, delayed validation after corpus discovery, silent success, worker spawning for usage output, or weakening the intentional no-argument full run.
Acceptance
- No args retains the exact full-corpus dispatch to
runParent. -
--helpis side-effect-free and documents every mode. - Unknown, incomplete, malformed, and over-complete fixed-arity invocations fail before corpus work.
-
--diagoptional filtering and--vm-witnessvariadic paths remain exact in the command contract. - Focused CLI tests, valid-path Test262 smoke, and dependency/build gates pass; 0 Test262 semantic flips.
Metadata
Metadata
Assignees
Labels
performanceMeasured runtime, memory, scaling, or build performanceMeasured runtime, memory, scaling, or build performancetoolingBuild, test, documentation, and developer toolingBuild, test, documentation, and developer tooling
Activity
fix(test262): reject invalid runner modes (#620)
chrisbbreuer commentedon Aug 16, 2026
Fail-closed runner dispatch pushed in 34f5c8c6 (
fix(test262): reject invalid runner modes (#620)).Every named mode now passes through one pure exact-arity parser before corpus discovery. No arguments still dispatch directly to the existing
runParent;--helpwrites complete usage and returns; worker numeric operands are parsed strictly; fixed-arity modes reject trailing operands;--diagretains its optional filter and--vm-witnessretains one-or-more paths. Bothtest262andtest262-bindepend on the four standard-library CLI contract tests.Validation at the commit:
test262-binbuild passed;--help: exit 0, Test262 process count 0 → 0;--diagoperand, and malformed worker index: each exit 1, process count stays 0;A valid
--diagcorpus smoke and the final 0-flip statement remain pending because user-owned Home unit jobs are active; #620 stays open until that uncontended check completes.chrisbbreuer commentedon Aug 16, 2026
Completed by 34f5c8c6 (
fix(test262): reject invalid runner modes (#620)).Final uncontaminated valid-path evidence:
--diag test/language/statements/whilewith 0 failures / 38 passes;Together with the 4/4 pure CLI contract tests, production
test262-binbuild, side-effect-free help, nonzero invalid/missing/malformed invocations, and the 15-edge / 0-migration / 60-tool dependency audit, every acceptance item is complete. This changes dispatch validation only and flips 0 Test262 semantic cases.