SEMANTIC-PROCESS-TIMEOUT: bound hung test subprocesses #468
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!468
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/468/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@csmith105 on GitHub · 2026-11-24 05:53 UTC · original
csmith105:codex/semantic-process-timeout→main· +87 −6 · 2 files · 2 commits · merged 2026-11-24 06:32 UTCClaimed in the coordination issue as: SEMANTIC-PROCESS-TIMEOUT
What and why
A hanging test subprocess can block the semantic regression runner indefinitely. Add an optional positive finite
--timeout SECONDS(at most 86,400 seconds / 24 hours): it limits each module in parallel mode, or the entire existing unittest-discovery subprocess with-j 1. Timeouts return failure, retain partial output, and allow other parallel modules to finish. Omitting the option preserves existing behavior.The limit terminates the direct subprocess; it does not promise descendant-process cleanup. This change does not alter shader translation or test discovery.
Tested
Windows 11, Python 3.12.14:
python -I tests/test_run_semantic_tests.py: 15 tests passed, including hanging synthetic modules, preserved output, healthy parallel modules, serial behavior, invalid/out-of-range timeout values, and a passing fixture at the maximum supported timeout.python -m compileall -q make_game.py tools tests: passed.python -I make_game.py --help: passed.python -I scripts/run_semantic_tests.py tests/semantic -j 4 --timeout 300: 465 files / 6,104 tests in 484 seconds; two modules failed becausespirv-asandspirv-valwere absent (test_sopc_validation,test_unary_f16_validation). No timeout failures occurred.python -m unittest discover -s tests/semantic -p <filename>: 11 and 5 tests passed respectively. The full suite was not rerun after that environment change; the initial failures are retained in the validation record.python -I scripts/check_no_game_data.py scripts/run_semantic_tests.py tests/test_run_semantic_tests.py: passed.git diff --check: passed. Independent source review found no blockers.GPUs tested: n/a (test-runner change; no GPU execution).
AI-assisted: yes, OpenAI Codex, supervised through csmith105's session.
Checklist
mainand merges cleanly.@Dezmonius on GitHub · 2026-11-24 06:02 UTC · original
Independent Windows check on
973593fwith CPython 3.14.7. All 13 runner tests passed. A one-test synthetic fixture also passed with--timeout 300and with the option omitted, using both-j 1and-j 2.One validation edge case:
--timeout 1e100is accepted in both modes, but the same passing fixture immediately exits with status 1. With-j 1the runner reportsTIMED OUT after 1e+100 s. With-j 2it prints an uncaughtOverflowError: timestamp out of range for C PyTime_tfrom the subprocess output reader's thread join. To reproduce, runpython -I scripts/run_semantic_tests.py <directory-with-a-passing-test> -j 2 --timeout 1e100, then repeat with-j 1.Could the parser reject values above a documented, supported maximum before launching the subprocess? A finite out-of-range value in the argument validation test would cover both modes.
Synthetic tests only. AI-assisted (Codex).
@csmith105 on GitHub · 2026-11-24 06:20 UTC · original
Fixed in
90eb7284fe. I reproduced both reported failures before the change. The optional timeout now accepts positive finite values up to a documented 86,400 seconds (24 hours), keeping the wait within portable platform limits. Larger values are rejected by argparse before discovery or subprocess launch. Added regressions for 86,400.1 and 1e100 in both modes, plus a passing fixture at the exact maximum. All 15 focused runner tests pass on Windows/Python 3.12.14; independent source review found no blockers. The default remains unlimited.@Dezmonius on GitHub · 2026-11-24 06:22 UTC · original
Confirmed the fix at
90eb728on Windows with CPython 3.14.7. All 15 runner tests passed. On the original synthetic fixture, both-j 1and-j 2pass with the option omitted and at86400, and reject86400.1and1e100with argparse exit 2 and the documented maximum. Thanks for the fix.AI-assisted (Codex).
@QemmHD on GitHub · 2026-11-24 06:32 UTC · original
Merging. Why merged: scripts/run_semantic_tests.py gains a per-file timeout and rejects a zero timeout, so one hung semantic test file can't stall the whole run.
Why it's good: security-reviewed (argv-list subprocess on sys.executable only). Tested on Windows 11 merged onto main
8f481cf: tests/test_run_semantic_tests.py 10 passed on main -> 15 passed with this PR (new tests fail without the fix); a real run with --timeout 300 over test_sdwa* ran 40 tests with 0 failures and --timeout 0 is refused. Merges cleanly together with #474.AI-assisted (Claude Code, Claude Opus 5.5).