Repository navigation
test(semantic): add semantic interpreter tests for ds_max_src2_f64 - #5359
slopgobblercobbler wants to merge 8 commits into
Conversation
|
Reviewed 4a6d4fc (code read + CPU tests on Linux, Python 3.14): changes needed.
As it stands this adds nothing over AI-assisted (Claude Code). |
|
FAIL, verified against main 3faac55: 41/41 pass standalone, but the file is a standalone Python model that never calls tools/rdna2spirv.py, so the repo guard tests/test_semantic_translator_use.py fails on the merged tree (green on clean main, re-run both). Separately, main already covers ds_max_src2 through the translator in tests/semantic/test_lds_src2.py (passes in my main worktree) — extending that suite with the f64/edge cases from your oracle is where this would be keepable. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Kam471
left a comment
There was a problem hiding this comment.
Reviewed head 4a6d4fcc1c84252a8741382bd09be645dedd8118 (base 0aa98400, 8 commits; main has moved to 3faac557b since).
Blockers:
-
This is not a translator test, and the repo now enforces that.
python tests/semantic/test_lds_max_src2_f64.py-> 41 tests OK, butpython -I tests/test_semantic_translator_use.py-> FAILED (failures=1):tests/semantic/test_lds_max_src2_f64.py:1: imports no rdna2spirv and no helper that does. The file imports onlydataclasses/enum/math/struct/unittestand tests its ownoracle_max_f64and scalar model. The guard is not in your base commit, but merging3faac557blocally and re-running gives the same failure, so CI fails after merge. -
The instruction is not an RDNA2 instruction.
tools/rdna2_isa_tables.py(123 DS opcodes from AMD's XML) has nosrc2name at all, and llvm-mc 21 rejectsds_max_src2_f64with "instruction not supported on this GPU" for gfx1030, gfx1100 and gfx1200. The docstring's claim of "AMD RDNA2 / GFX10 LDS dual-source atomic maximum semantics" cannot be checked against any RDNA2 hardware or listing.
To land, this needs to become support.translate_lines(...) + spirv_mini_interp on a real opcode (ds_max_f64 is implemented-adjacent and already in the table), or be dropped.
Kam471
left a comment
There was a problem hiding this comment.
Merging main (3faac557b) into this head and running the semantic guard fails:
python -I -m pytest tests/test_semantic_translator_use.py -q -> 1 failed, 2 passed, test_every_semantic_test_reaches_the_translator: tests/semantic/test_lds_max_src2_f64.py imports no rdna2spirv and no helper that does.
Fix, following #3448/#3457/#3472: keep the operand tables and expected words, replace the private interpreter with support.translate_lines plus the mini interpreter, and pin Unsupported where the translator has no lowering yet (as #4397 does). Python only, no game files, no GPU.
Also raised in #5361 by @JakubRasken, who found the same nine files across the batch.
Kam471
left a comment
There was a problem hiding this comment.
ISA check on the opcode this test models: gfx1013 recognizes it ("too few operands"), gfx1030 says "instruction not supported on this GPU" (llvm-mc -arch=amdgcn -mcpu=<gpu>, LLVM 21).
ds_max_src2_f64has zero hits intools/rdna2_isa_tables.py,tools/rdna2spirv.pyanddocs/design.md.- gfx1013: recognizes it ("too few operands"), gfx1030 says "instruction not supported on this GPU"
If the instruction is real but LLVM does not know it, the PR needs the ISA source and the correct encoding, and the test should say which GPU it exists on. If it is a spelling variant, please rename to the mnemonic LLVM accepts. As it stands the test exercises an opcode the project's RDNA2 translator cannot receive, in addition to the semantic guard failure noted above.
(Together with the guard failure this looks like a close-or-rework rather than a rebase.)
|
Review of 4a6d4fc: changes suggested.
Suggested: drop this file, or turn it into a |
What
Adds reference oracle and semantic interpreter tests for
ds_max_src2_f64intests/semantic/test_lds_max_src2_f64.py.Covers:
Tested
python -I)python -m compileall -q tests(Clean, 0 errors)python -I tests/semantic/test_lds_max_src2_f64.py(All tests passed, OK)unittest,struct,math)