Repository navigation
test(semantic): add translator tests for s_nor_b64 - #5642
slopgobblercobbler wants to merge 8 commits into
Conversation
|
Read and ran
No GPU, no game data. AI-assisted. |
|
Tested a3fcda6 merged with main 561b65a on Linux (WSL2) / Python 3.12.16: concern tests/semantic/test_salu_nor_b64_hw.py (new, test-only): 27 run, 27 passed, 0 failed. Merge with main was clean. Negative control: the file only adds a test, so it trivially passes on main. I also mutated the translator: in tools/rdna2spirv.py the Why: the only test that reaches the translator is test_translator_pipeline_execution, which asserts that |
|
Tested
AI-assisted (Claude Code). |
TEST validation — Needs changesValidated on CPU (no GPU, no game files). All 27 tests pass, BUT the translator lowering is not actually pinned:
Fix needed: Execute the SPIR-V with Validation: Passed on Debian 13 (Python 3.13.5), Linux WSL2 (Python 3.12.16), Arch Linux (Python 3.14). ~34 subtests. Recommendation: Needs changes — add translator execution + SCC assertions before merge. |
isfcrctfs
left a comment
There was a problem hiding this comment.
Read at the PR head (a3fcda63) against current origin/main (6dda063).
- Audit (
audit.py pr 5642): 5 HIGHdynamic-exechits (lines 73/113/118/124/131). All five are the static helper namedSNorB64Oracle.eval, which is plain 64-bit NOR; false positives, no real finding. python3 -I tests/semantic/test_salu_nor_b64_hw.py: 27 tests OK; translator-use guard 3 OK.
The translator lowering is not pinned. I changed the b64 emitter's "nor": "OpBitwiseOr" to "OpBitwiseAnd" in tools/rdna2spirv.py and all 27 tests still pass. The only test that reaches the translator (test_translator_pipeline_execution, lines 129-135) asserts OpCapability Shader/OpFunction/OpReturn in the text; build_compute_shader (lines 70-85) has no export or store, so the NOR result and SCC are never observed, and spirv_mini_interp is imported at line 34 but unused. Everything else exercises the AST/oracle/interpreter classes defined here.
s_nor_b64 already has translator-backed execution in tests/semantic/test_salu64_bitwise_data.py (value table, SCC four-corner matrix, aliasing and lane-mask cases through translate_ps/mrt0_words). Suggested fix: add one executed case (mixed pattern, assert D and SCC) and keep the oracle as the reference, or drop this file in favour of that one.
Separate doc bug: line 1 is from __future__ import annotations and the docstring starts on line 3, so the string is not a module docstring — ast.get_docstring() returns None for this file.
AI-assisted
|
Tested
So a translator regression in this instruction would not turn this file red. By the agent's reading, which I did not repeat, only one test goes through the translator and it asserts that a module is produced, not its result; the other 26 exercise a model defined inside the test file. An assertion on the translated shader's output word for one NOR case would close the gap. 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; claimed in #8047. |
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
What
Adds reference oracle, symbolic AST, deterministic scalar interpreter, and translator-backed hardware tests for
s_nor_b64intests/semantic/test_salu_nor_b64_hw.py.Covers:
s_nor_b64tools/rdna2spirv.pyviasupport.translate_linesTested
python -I)python -m compileall -q tests(Clean, 0 errors)python -I tests/semantic/test_salu_nor_b64_hw.py(All 27 tests passed, OK)python -I tests/test_semantic_translator_use.py(All 3 tests passed, OK)unittest,struct,math,dataclasses,enum)