Repository navigation
test(semantic): add cubemap projection suite bundle - #5893
slopgobblercobbler wants to merge 25 commits into
Conversation
…es for v_cubeid_f32
… cases for v_cubesc_f32
… cases for v_cubetc_f32
…ization for v_cubema_f32
|
Verified against main 561b65a: merges cleanly, 26/26 pass (re-run), guard green; 7 translate sites, rest oracle, and main's test_valu_cube.py already covers all four v_cube* mnemonics through the translator — oracle/mutation depth rather than new coverage, same note as #5901/#5898. Mnemonics all real. Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Mutation check of the current head with a generic run ( AI-assisted (Claude Code). No game files. |
|
Reviewed 1e79815, code read (CPU), AI-assisted: the translator-backed cases overlap |
|
Second check, CPU, Linux (no game files). Run by an agent (Hermes) on mralanbourne's machine; AI-assisted.
On this head, from a worktree: |
|
Tested 1e79815 (applied cleanly on main dfe4e4a) on Windows 11, Python 3.14, spirv-tools + llvm-mc from the project toolchain, CPU only (no GPU run): the new tests pass, with the doubts below. tests/semantic/test_valu_cubemap_bundle.py: Ran 27, OK, 0.8 s (0 failures, 0 errors, 0 skips). The same file also passes on unmodified main. Mutation check in a throwaway copy of main: I flipped the cubesc +X source in the v_cubesc_f32 lowering of tools/rdna2spirv.py (the z-negation select); the file then fails (9 of 27 fail), so it is sensitive to translator bugs in what it covers. Overlap: tests/semantic/test_valu_cube.py already covers v_cubeid_f32, v_cubesc_f32, v_cubetc_f32 and v_cubema_f32 (all six faces, axis ties, signed-zero and NaN cubema, VOP3 e64 and source modifiers, output modifiers, SGPR/inline operands, dst aliasing, EXEC-mask preservation, a swapped-axes negative control). The +0.0 rule for v_cubema is already pinned there too. What this file adds that is not already tested is small. Repo rule (tests run the repository's code, not a model of it): about half of the file does not exercise the translator. CubeInstructionAST/Operand (lines 152-185) only checks that a dataclass stores the numbers it was given. WavefrontSimdState with exec_mask (lines 224-252, 346-363, 450-466, 547-562) is a Python lane model that is compared with itself; only the one run_cube_op line at the end of each of those tests touches the translator, and it runs a single lane, so no EXEC divergence is tested despite the names. Several assertEqual(oracle_*(...), literal) lines test select_cube_face against constants, i.e. the test's own model. Real checks that do look sound: run_cube_op (line 110) goes through translate_lines/mrt0_words, and the expected constants are right per the RDNA2 table (+X sc=-z, -Z sc=-x, -Y tc=-z, ties (1,1,1)->face 4, (-1,-1,-1)->face 5, cubema(-3,1,1)=-6, (2,2,0.5)->+Y, (0.5,2,2)->+Z). Doubt: test_cubetc_zero_y_axis (line 469) says -0.0 -> 0.0 but assertEqual(-0.0, 0.0) cannot see the sign bit; compare the raw word if the sign matters. The pipeline test (line 614) takes its expected values from the in-file select_cube_face model rather than constants. Suggestion: drop the AST and SimdState classes and the oracle-vs-literal asserts, keep run_cube_op and the pipeline test, and only add cases that test_valu_cube.py lacks. AI-assisted (Claude Code): ran the new test file and the mutation check on private copies and read the diff against the translator cube ops. No GPU used, nothing was committed or posted from the test machine. |
|
Tested
So a wrong lowering of the instruction this file names turns it red. Mutation checks are spot checks, not full coverage. 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. |
|
checked: #58931e79815 | with: Environment: Linux; no GPU (llvmpipe only), no game copy. The Windows build environment is available and was not needed for a one-file Python test change: clang-cl 23.1.5 + lld-link, xwin SDK 10.0.26100, CMake 4.5.1, RelWithDebInfo + BUILD_TESTING=ON, Wine 11.22-staging. What I ran, on a fresh checkout of GitHub
Controls (a test-only PR, so the control is a translator mutation):
One correction to an earlier comment: "the AST / scalar-interpreter / SIMD-divergence classes ... never exercise the translator" does not hold mechanically. Instrumenting Import state: not in the maintainers' forge Not run: Windows binaries, any GPU path, retail data. AI-assisted. |
What
Adds comprehensive translator-backed regression tests and reference mathematical models for Subsystem Feature Bundle 16: VALU Cubemap Coordinates & Projection Suite in
tests/semantic/test_valu_cubemap_bundle.py.Covers all 4 RDNA2 cubemap coordinate projection operations (24 granular commits):
v_cubeid_f32- Face index selection (0.0 to 5.0) under |Z| >= |Y| >= |X| priority rulesv_cubesc_f32- S coordinate projection across all 6 cubemap facesv_cubetc_f32- T coordinate projection across all 6 cubemap facesv_cubema_f32- Major axis magnitude calculation (2 * major_axis) with hardware +0.0 normalization for ±0.0Each opcode includes:
tools/rdna2spirv.pyviasupport.translate_linesand MRT0 output verificationTested
python -I)python -I tests/test_semantic_translator_use.py(Passes translator reachability check)python -I tests/semantic/test_valu_cubemap_bundle.py(All 24 test suites OK)unittest,struct,math)upstream/main