tools: provide one-command synthetic source-only smoke suite (DX-07) #705
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!705
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/dx07-smoke-suite"
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?
Pull request successfully merged and closed
Summary
Implements DX-07: One-command synthetic source-only smoke suite.
Provides developers and CI with a quick, deterministic, zero-asset validation mechanism across Windows, Linux, and macOS without requiring retail game packages, carved shaders, or specific GPU hardware.
Key Capabilities
Verification
Independent Windows 10 check of
0c3ea1awith CPython 3.14.7 and a process-local PATH pointing to an empty directory, withVULKAN_SDKunset. All seven smoke tests passed. Bothscripts/smoke.py --quick --jsonandscripts/dev.py smoke --quick --jsonexit 0, report all five checks as PASS, and produce a parseable JSON document.The JSON failure path is broken. I appended an invalid Python statement to
make_game.pyin a disposable copy and ranpython -I scripts/smoke.py --quick --json. Exit 1 and the trailing JSON verdictFAILare correct, butcompileall(..., quiet=1)writes*** Error compiling ...to stdout before JSON, sojson.loads(stdout)fails at line 1. This leaves CI without machine-readable output for the failure it needs to inspect.I locally redirected
run_checks()stdout to stderr in JSON mode. The same syntax-error fixture then produced one parseableFAILdocument on stdout and the compiler diagnostic on stderr for both entry points. A failure-mode test could assert that the entire stdout parses, regardless of exit code.Source-only synthetic check. AI-assisted (Codex).
Tested
0c3ea1ad8on Apple M5 Pro, macOS 26.7.3 (25G342), arm64, Python 3.15.2 (CI uses 3.12):tests/test_smoke_suite.py: 7 tests OK.python3 -I scripts/smoke.py(full, not--quick) runs and passes on macOS:python_compileall,clean_room_no_game_data,cli_help_make_game.py,cli_help_tools/rdna2spirv.py,cli_help_scripts/dev.py,test_test_dev_discovery,test_test_shader_ir_parse— all PASS,Verdict: PASS, about 1.3 s end to end.No GPU leg (the suite is source-only by design). No game data. AI-assisted.
Thank you for catching that @Dezmonius! Fixed in da7881260:
un_checks() now redirects compileall stdout into a buffer (printing compilation diagnostics to stderr on failure) and --json mode guards
un_checks() with contextlib.redirect_stdout(sys.stderr). Added est_compile_failure_keeps_json_stdout_clean covering both scripts/smoke.py --quick --json and scripts/dev.py smoke --quick --json; all 8 tests pass (python -I tests/test_smoke_suite.py).
Two repository-wide guard tests are red at head
da7881260, and neither is a pre-existing red: I applied this PR's diff to a clean worktree at6293c1c4f(origin/main) and ran the same files on clean main, where both are green.Linux x86-64, 4 vCPU, CPython 3.14.7 (system), no game files, no GPU.
tests/test_tool_stdout_encoding.py:scripts/smoke.pyends with a bareraise SystemExit(main()); every program undertools/,scripts/andviewer/is expected to start its__main__block with the guard.scripts/dev.pyalready has that block, so the shape is one file away.tests/test_docs_cli_flags.py:docs/testing.md:75runspython -I scripts/dev.py smoke --quick. It works at runtime, becausedev.pyforwardssmoketo the producer before argparse, but the guard maps adev.pysubcommand to its producer throughDEV_PRODUCERSintests/test_docs_cli_flags.py:163, which only knowsboot-traceandguest-scene. The newsmokesubcommand has to be added there; otherwise the guard reads--quickas a flag ofdev.pyitself.Both fixes verified in the same worktree:
try/exceptguard at the end ofscripts/smoke.py, as inscripts/dev.py, and"smoke": "scripts/smoke.py"inDEV_PRODUCERS:tests/test_docs_cli_flags.py4 tests OK,tests/test_tool_stdout_encoding.py4 tests OK,tests/test_smoke_suite.py8 tests OK,tests/test_text_write_line_endings.py3 tests OK.Lists differ: ['scripts/smoke.py'] != []andLists differ: [('docs/testing.md:75', 'scripts/dev.py', '--quick')] != []come back.One caveat on my own method, in case you reproduce it: I first saw
docs/testing.md:63 --prereqs-onlyreported too. That one is an artifact of testing agit applyworktree, where the newscripts/smoke.pyis untracked andtracked_files()cannot see it; aftergit add -Ait disappears. Only the two failures above are real.AI-assisted review; no game files were used.
Thank you for the detailed review and reproduction steps @Poussistar! Both items have been resolved in commit
b3ed59406:sys.stdout.reconfigure(errors="replace")inscripts/smoke.py's__main__block (test_tool_stdout_encoding.pynow passes forscripts/smoke.py)."smoke": "scripts/smoke.py"toDEV_PRODUCERSintests/test_docs_cli_flags.pyso subcommand--quickis properly mapped (test_docs_cli_flags.pynow passes cleanly, 4/4 tests OK).AI-assisted (Claude Code)
Merged into
main(merge commit 17eb74947), approved by DadaCap (maintainer). Thanks!Checked before merging: Tested in our local release candidate (main + 41 PRs): translator suite 512 files / 6,442 tests clean, Python suite with no new failure versus main, and 360 s game runs on an RTX 5080 with no regression. The merge was pinned to the head commit that was tested (a9692a8c9).
AI-assisted (Claude Code), posted for DadaCap.