Repository navigation
wave64_pipeline_audit: reject non-standard JSON constants, RecursionError, and invalid assess() entries - #5079
tomgamer22 wants to merge 2 commits into
Conversation
…rror, and invalid assess() entries
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 0a72628c2 on Windows 11: pytest tests/test_wave64_pipeline_audit.py -q -> 18 passed, 43 subtests passed; git diff --check clean.
wave64_pipeline_audit now rejects non-standard JSON constants (NaN/Infinity), a RecursionError from a deeply nested document, and invalid assess() entries with one ERROR: line instead of a traceback or a silently accepted report; the added cases cover each shape and the valid audit. No blocking issue.
|
Tested 0a72628 on Windows 11 26200, CPython 3.12.10 (CPU only, synthetic inputs, no game files): pass, with two notes on the tests.
Code read: the change is correct and safe. Neither note blocks it; they only affect what the new tests prove. AI-assisted: yes |
|
Tested
|
…udit-json # Conflicts: # tools/wave64_pipeline_audit.py
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 0650d63 merged with main 00f5ce6 on Linux (WSL2), CPython 3.12.16 with -I: pass. The merge was clean; tests/test_wave64_pipeline_audit.py ran 18 tests, OK. Negative control: with tools/wave64_pipeline_audit.py reverted to main's version, the test fails (7 failures, 5 errors); restored afterwards. |
|
Coordination question about duplicate shader names in the input index. On Windows I reproduced the same behavior on main (dde82f2) and this PR (0650d63), using a synthetic index and a device with a fixed subgroup size of 32. Two top-level members named Are you already planning to handle repeated shader names in this PR? We can contribute a focused follow-up with both orderings as regression tests. We are holding off on a claim since the JSON loader and test file overlap. |
|
Tested 0650d63 merged onto main 1924c8f on AMD RX 9070 XT (RDNA4, gfx1201, wave32 and wave64), RADV Mesa 26.3.1, Arch Linux (kernel 7.3.5), Python 3.14: pass.
No game files. AI-assisted (Claude Code). |
|
Hardware: AMD Radeon Graphics gfx1036 (Raphael iGPU, Windows driver 32.0.11024 / 24.10.24, wave64, maxPushConstantsSize 128, run with Baseline on main AI-assisted (Claude Code). |
|
Tested
From the agent's CLI run, which I did not repeat: at a nesting depth that raises, Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting. |
Summary
Claimed in #5032 (comment) (new BUILD item).
What failed
tools/wave64_pipeline_audit.py:152-157(load_json) calledjson.load(source)without aparse_constanthook, accepting non-standard JSON constants (NaN,Infinity,-Infinity), and only caught(OSError, ValueError), leaving deeply nested JSON (e.g."[" * 2000) able to raiseRecursionErroruncaught inload_jsonandmain()(including via--manifest/load_pipeline_manifest) instead of reporting a one-linewave64_pipeline_audit:error and exiting2.tools/wave64_pipeline_audit.py:66,85(assess) accessedentry["stage"]andSTAGE_BITS[stage]directly without validatingentryis adictwith"stage"inSTAGE_BITS, raising uncaughtTypeError/KeyErrorinstead ofValueError.Fix
_reject_constant(parse_constant=_reject_constant) tojson.loadinload_json()and caught(OSError, ValueError, RecursionError)in bothload_json()andmain().isinstance(entry, dict)andentry.get("stage") in STAGE_BITSat the start ofassess(), raisingValueError.tests/test_wave64_pipeline_audit.py(DecisionTestandCommandLineTest) covering deeply nested JSON inindex,--device-info, and--manifest, non-standard JSON constants (NaN,Infinity,-Infinity), and invalid/missingstageor non-dictentry.Testing
python -I tests/test_wave64_pipeline_audit.py—Ran 18 tests in 3.655s — OKgit diff --check— cleanNo GPU or game files were used; only synthetic Python CPU unit tests were run.
AI-assisted (Antigravity).
Generated by Antigravity (Gemini).