Repository navigation
test(semantic): add semantic interpreter tests for s_or_b32 - #5752
slopgobblercobbler wants to merge 10 commits into
Conversation
…odel for s_or_b32
…ions for s_or_b32
…king for s_or_b32
…eneration for s_or_b32
…andling for s_or_b32
… detection for s_or_b32
|
Tested
|
|
Verified on your head at main 561b65a: merges clean, 33/33 pass, guard green — but the guard is green only because the file imports the translator: a few smoke tests (~:159/:316/:485/:542) use translate_lines/mrt0_words, while the bulk of the 33 assert the file's own ScalarRegisterState/execute_s_or_b32 model against its own oracle, with no spirv_mini_interp execution anywhere — so most cases pass whatever rdna2spirv.py emits. That is the pattern the conversion PRs #3519/#3537 exist to replace, and the _hw suffix is misleading since nothing here touches hardware. Note main already covers s_or_b32 through the translator in tests/semantic/test_alu_bitop_folding.py among others. Re-aiming the grid at translated listings through support.translate_lines + spirv_mini_interp would make the negative controls bite for real. Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested 93692ae merged with main 561b65a on Linux (WSL2) / Python 3.12.16: pass tests/semantic/test_salu_or_b32_hw.py (new, test-only PR): 33 run, 33 passed, 0 failed. The tests also pass on plain main (the translator already supports s_or_b32). Negative control by mutation: making s_or_b32 a bitwise AND in the constant-fold branch and in the S2 table of tools/rdna2spirv.py gives 33 run, 12 failures (translator smoke, equivalence, aliasing, SCC branching, float-pattern and AST-emission tests); mutation reverted afterwards. Note for scope: only 8 of the 33 tests call translate_lines; the rest (truth table, algebraic laws, De Morgan, AST classes, ScalarRegisterState interpreter) check Python reference code defined in the test file itself, so they cannot catch a translator bug. The PR does not touch tools/rdna2spirv.py, so I did not run the full semantic suite. |
|
Updated test_salu_or_b32_hw.py to re-aim the test suite at translator-backed execution across all test classes, addressing feedback from @memorypressure and @kapitche:
|
Summary
s_or_b32.tests/semantic/test_salu_or_b32_hw.pydirectly exercisingsupport.translate_linesandsupport.mrt0_words.Verification
python -m compileall -q testspython -I tests/semantic/test_salu_or_b32_hw.pypython -I tests/test_semantic_translator_use.py