shader: extract main(argv) and add manifest/pipelines schema and LLVM path guards in pso_readiness with CLI suite #2575
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2583"
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:55:29Z.
Summary
Extracts a testable
main(argv=None) -> intentrypoint intools/pso_readiness.py, hardens manifest/pipelines JSON schema validation inreport(), and adds CLI path validation formanifest,pipelines, and--llvm, backed by a standalone pure-Python CLI test suite registered in CTest.Changes
tools/pso_readiness.py:main(argv=None) -> intreturning0and invokeraise SystemExit(main())under__main__.report(): requireisinstance(manifest, dict),isinstance(manifest.get("shaders"), list),isinstance(record, dict)for shader entries,isinstance(pipelines, dict), andisinstance(pipelines.get("pipelines"), list), raisingValueErroron malformed inputs._validate_cli_paths()inmain()to reject existing directory paths formanifestandpipelinesand require--llvm(when passed on CLI) to exist as a regular file, while preserving directreport(..., llvm="test-llvm")string acceptance and the exactPSO report: <exc>\nstderr prefix with exit status1(zero raw tracebacks).tests/pso_readiness_cli_check.py:sys.argv/__main__forwarding, error-handling, and mutation-killing tests.CMakeLists.txt:shader_pso_readiness_cli_checkin CTest right afterpso_readiness_check.Verification
All commands executed after rebasing onto
upstream/main(fc97ade7):out/pe-env/Scripts/python.exe -B tests/pso_readiness_cli_check.py -vRan 7 tests in 1.232s/OK(exit 0)out/pe-env/Scripts/python.exe -B tests/pso_readiness_check.pyPSO mesh probe passed (1 lowered, 2 lowering rejections, 2 disassembly failures),PSO compute probe passed (1 recognized, 1 unsupported opcode, 2 disassembly failures, 1 scan failure),PSO input validation passed (15 rejected inputs, 2 CLI exits, 1 valid control),PSO census, evidence states, and native hash control passed(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)--llvmpath guards,argvforwarding, return code,__main__SystemExit, and all 4 caught exception classes): 15/15 killed.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T21:56:35Z.
Review: COMMENTED
Review of head
e94e82fc(0 commits behind main). Verdict: sound, no blocking findings.Checked:
main(argv=None) -> intand_validate_cli_paths()keep thePSO report: <exc>stderr prefix and exit 1;report()schema guards raise ValueError instead of raw tracebacks.shader_pso_readiness_cli_checkis registered in CTest next topso_readiness_check.isinstance(record, dict)guard: 1 failure + 1 error.--llvmpath check: 1 error.Commands run (Linux):
python3 -B tests/pso_readiness_cli_check.py-> Ran 7 tests, OKpython3 -B tests/pso_readiness_check.py-> passedpython3 tests/docs_links_check.py-> 19 files, 495 links okpython3 tests/bidi_controls_check.py-> no bidi controlsgit diff --check origin/main...HEAD-> cleanNot verified here: Windows run and required CI were still pending at review time.
AI-assisted; commands listed were executed locally.