Scripts: harden check_layout CLI argument handling and binary lookup #1196
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1196
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1196"
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?
@heditrigui on GitHub · 2026-11-24 13:05 UTC · original
heditrigui:scripts/check-layout-cli-hardening→main· +206 −29 · 2 files · 1 commits · openHarden
scripts/re/check_layout.pyCLI invocation and binary lookup:-hor--help(exit code 0), and exit with code 2 on missing arguments, avoiding an unhandledIndexError.xclexecutable viaXCL_EXEenvironment variable, falling back totarget/release/xcl.exeandtarget/debug/xcl.exe.xclbinary is missing instead of throwing unhandled tracebacks.scripts/test_check_layout.pycovering CLI help flags, exit codes on missing arguments/directories/binaries, synthetic RTS0 layout parsing, and mock disassembly matching.Tested
python -B -m unittest discover -s scripts -p "test_*.py" -v: 16 passed, 0 failed.scripts/re/check_layout.py --help(exits 0 with usage docstring).scripts/re/check_layout.pywith no args (exits 2 with usage docstring).scripts/re/check_layout.py non_existent_dir(exits 1 with clear diagnostic).scripts/pr_check.py --local.Not tested
scripts/and does not touch runtime code or dependencies.AI use
Antigravity (Gemini 3.8 Flash (High)) designed the CLI argument handling and fallback resolution, implemented unit tests in
scripts/test_check_layout.py, ran the test suite, and verified PR conventions.@DavidM1911 on GitHub · 2026-11-24 13:22 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Python 3.
python scripts/test_check_layout.py: 7 tests OK — covers the hardenedcheck_layoutCLI argument handling and binary lookup.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@futurepro62 on GitHub · 2026-11-24 14:15 UTC · original
Tested exact head
5d84245, script tests only, since this PR has no test report yet.Tested
python -m pytest scripts/test_check_layout.pyat the head: 7 passed, 2 subtests passed.930e8b4): does not get to run: collection fails withFileNotFoundError, since main'scheck_layout.pyruns its scan at import time (which is what this PR changes).xcl disasmexits non-zero); this PR does not check that exit code, and the two conflict (git merge-treereports a conflict).Not tested
AI use
@heditrigui on GitHub · 2026-11-24 14:55 UTC · original
Thanks for the independent test verification @futurepro62! Good catch on #1088. If maintainers prefer to land #1088 first, we can rebase this PR on top of it to incorporate both the disasm returncode check from #1088 and the CLI argument handling, binary lookup resolution, and unit tests from #1196.
@RavenCurseBurg on GitHub · 2026-11-26 01:38 UTC · original · edited 2026-11-26 01:52 UTC
Tested
5d84245635be718805ab6dd012de8cd17c8571bfand the integration on top of this PR. The candidate carries the disassembly error handling from #1088 (d17e8d946753) and retains this PR’s executable selection.With two synthetic RTS0 files and a command-line stand-in selected via
XCL_EXE, I ran four failure cases: diagnostics on both streams, stderr only, stdout only, or neither. The current head called the stand-in twice and exited 0 in all four. The candidate stopped on the first shader and returned its exit code 23 in all four. It printed the filename, preferred stderr, used stdout when needed, and printed no successful load summary.Four successful runs on each revision counted both loads. They covered an override path containing spaces, a release-only build, debug and release present together, and an override with both present. I checked which executable actually ran.
python -B -m unittest discover -s scripts -p "test_check_layout.py"on the candidate: 8 passed, 0 failed or skipped. Windows build 26100, i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) prepared the integration and fixtures and ran the tests. No real disassembler, game, GPU or full Rust suite was exercised.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.