runtime: extract main(argv) and add path/key/timeout guards in mesh86_cache with CLI suite #2576
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2584"
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-25T21:56:01Z.
Summary
Extracts a testable
main(argv=None) -> intentrypoint intools/startup/mesh86_cache.py, validates 64-bit request keys and cache/shader/DXC paths upfront, boundsdxc -dumpbininvocations withtimeout=30, and expands CLI error handling to catch allsubprocess.SubprocessErrorfailures without raw tracebacks, backed by a standalone pure-Python CLI test suite registered in CTest.Changes
tools/startup/mesh86_cache.py:main(argv=None) -> intreturning0and invokeraise SystemExit(main())under__main__.0 <= args.key < (1 << 64), verifyargs.cacheis an existing directory, and add_require_file()checks for--mesh,--pixel, and--prove-root-srvso missing paths and directories fail cleanly beforepublish().timeout=30tosubprocess.run()inpublish()when proving the mesh root SRV profile, and expand themain()exception handler to(ValueError, OSError, struct.error, subprocess.SubprocessError)exiting cleanly with code1and zero raw tracebacks while preservingload_request(),publish(),prove_mesh_root_srv(), and atomic marker/stage publishing.tests/startup_mesh86_cache_cli_check.py:timeout=30/SubprocessError/struct.error, and atomic artifact-preservation tests.CMakeLists.txt:runtime_mesh86_cache_cli_checkin CTest right afterstartup_mesh86_srv_proof.Verification
All commands executed after rebasing onto
upstream/main(fc97ade7):out/pe-env/Scripts/python.exe -B tests/startup_mesh86_cache_cli_check.py -vRan 4 tests in 1.760s/OK(exit 0)out/pe-env/Scripts/python.exe -B tests/startup_mesh86_srv_proof_check.py <dxc.exe> out/build/devaccepted one DWORD load and rejected two loads from the same SRV handleandverified one DWORD at t0 space0 and refused PS access, shifted, dynamic, wide and wrong-space loads(exit 0)out/pe-env/Scripts/python.exe -B tests/startup_indirect_mesh_cache_check.py <dxc.exe> out/build/dev/startup_indirect_draw_indexed.exe warpmesh cache padding replay reused the PSO; sample-mask change generated a new key(exit 0)out/pe-env/Scripts/python.exe -B tests/startup_tools_lint_check.pyPASS: 11 files under tools/startup parse; control snippet rejected and valid snippet accepted(exit 0)out/pe-env/Scripts/python.exe -B tests/form_coverage_check.pyform coverage checks passed(exit 0)out/pe-env/Scripts/python.exe -B tests/docs_links_check.pySelf-test passed. Checked 19 Markdown files and 495 links.(exit 0)out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.pySelf-test passed. Checked 1815 tracked source, script and build/CI files: no bidirectional controls.(exit 0)timeout=30, 64-bit key lower/upper/off-by-one bounds,cache.is_dir(),_require_filefor--mesh/--pixel/--prove-root-srv,--mesh-required guard,SubprocessError/struct.errorcatches,argvforwarding, andmain()return code): 13/13 killed.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T22:01:37Z.
Review: COMMENTED
Review of head
8226d96c(comment only, no approval).Checked:
main(argv=None) -> intextraction, 64-bit key range check, cache dir check,_require_filefor--mesh/--pixel/--prove-root-srv: logic is correct; theis not Nonechange also fixes the case of an empty-looking Path.timeout=30on the dxc-dumpbincall, andsubprocess.SubprocessErrornow caught (TimeoutExpired is covered, CalledProcessError is a subclass).runtime_mesh86_cache_cli_checksits next to the siblingstartup_mesh86_srv_prooftest inside the sameINTAKE_PYTHONblock. No other open or merged PR touches mesh86_cache CLI.Commands run locally:
python3 -B tests/startup_mesh86_cache_cli_check.py: 4 tests OKpython3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py,git diff --check origin/main...HEAD: cleantimeout=30: test failsCalledProcessError: test errorsResult: sound. Win2025 run is next.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T22:10:00Z.
Win2025 WARP receipt for head
8226d96c.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
8226d96c37be5627937a3a490d40d87eabc27e1a:--preset dev):cmake --build --preset dev -- -j 2):156.44s(configure3.08s)ctest --preset dev -R 'mesh86' --parallel 2 --no-tests=error --output-on-failure): 2/2 passed (1.83s:startup_mesh86_srv_proof0.97s,runtime_mesh86_cache_cli_check1.62s)/O2(--preset release):cmake --build --preset release -- -j 2):282.59s(configure3.25s)ctest --preset release -R 'mesh86' --parallel 2 --no-tests=error --output-on-failure): 2/2 passed (2.14s:startup_mesh86_srv_proof1.15s,runtime_mesh86_cache_cli_check1.87s)sccache: 40/1265 hits; wall454.7sAI-assisted; commands listed were executed locally.