shader: harden input file and struct/zlib error guards in section_probe with CLI suite #2589
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2597"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-25T22:27:53Z.
Summary
tools/section_probe.py:inspect()viapath.is_file()before callingstat()/open(), raising clearValueErrorfor directories or non-regular files andFileNotFoundErrorfor missing files.main(argv=None) -> intand wrap[inspect(p, args.first, args.last) for p in args.archives]inexcept (OSError, ValueError, struct.error, zlib.error)exiting cleanly viaparser.exit(1, f"section_probe: {exc}\n")with zero raw tracebacks while preserving exact JSON output schema and--first/--lastexit code 2 validation.tests/section_probe_cli_check.pyand registershader_section_probe_cli_checkinCMakeLists.txt.Verification
python -B tests/section_probe_cli_check.py -v->Ran 6 tests in 0.812s(OK, exit 0)python -B tests/resource_ranges_check.py->Ran 21 tests in 0.451s(OK, exit 0)is_file/is_dir/exists/non-regular guards,OSError/ValueError/struct.error/zlib.errorhandlers, exit code, stderr prefix, window overlap dedup, preset-dict skip,argvforwarding,main()return type, and__main__exit propagation) ->15/15 KILLEDpython -B tests/form_coverage_check.py->form coverage checks passed(exit 0)python -B tests/docs_links_check.py->Self-test passed. Checked 19 Markdown files and 498 links.(exit 0)python -B tests/bidi_controls_check.py->Self-test passed. Checked 1824 tracked source, script and build/CI files: no bidirectional controls.(exit 0)AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T22:31:24Z.
Review: COMMENTED
Review of head
5a937dcb(comment only).What I checked:
tools/section_probe.py:inspect()now rejects missing paths, directories and non-regular files with a clear message.main()turns OSError/ValueError/struct.error/zlib.error into a one-line stderr message and exit code 1 instead of a traceback. Small and correct.CMakeLists.txt: newshader_section_probe_cli_checksits next to the sibling Python checks, same-Bpattern.--first/--lasttag validation, not these guards.Commands run (Linux, exact head):
python3 -B tests/section_probe_cli_check.py-> 6 tests OKpython3 tests/docs_links_check.py-> OKpython3 tests/bidi_controls_check.py-> OKgit diff --check origin/main...HEAD-> cleanstruct.error, zlib.errorfrom the except tuple -> suite FAILS (2 errors)is_file()guard -> suite FAILS (1 error)No blocking findings. Win2025 receipt to follow before any merge.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T22:36:45Z.
Win2025 WARP receipt for head
a16feab8after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
a16feab8b75030a9547ea140143fddb7023742d9:--preset dev):cmake --build --preset dev -- -j 2):31.26s(configure1.77s)ctest --preset dev -R 'section_probe' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (1.01s:shader_section_probe_cli_check0.91s)/O2(--preset release):cmake --build --preset release -- -j 2):55.03s(configure1.79s)ctest --preset release -R 'section_probe' --parallel 6 --no-tests=error --output-on-failure): 1/1 passed (0.90s:shader_section_probe_cli_check0.80s)tests/resource_ranges_check.pyok (0.6s)AI-assisted; commands listed were executed locally.