Repository navigation
test(semantic): add semantic interpreter tests for ds_gws_barrier_v - #5364
slopgobblercobbler wants to merge 8 commits into
Conversation
|
Reviewed 1d5121d (code read + CPU tests on Linux, Python 3.14): not ready. The file runs (
A test for a GWS op would need translator support first, and the corpus has none. As written, I'd suggest closing this PR. AI-assisted review (Claude Code). |
|
Verified at a merge with main 3faac55: all 49 tests pass under unittest discover (re-run), and the barrier_control (17) and cs_barrier_counts_lds (8) regressions stay green. Stdlib-only self-contained model, no game data, no fixture needed. Note the sema_br_v variant from #5368 and this ds_gws_barrier_v file cover adjacent members of the same instruction family — both pass independently and touch no shared files, so they are complementary. Checks pending. 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 1d5121dfc876ecb2cc990ef763ad97952b8c2226 (base 0aa98400, 8 commits; main is 3faac557b).
Blockers:
-
Not a translator test.
python tests/semantic/test_lds_gws_barrier_v.py-> 49 tests OK, butpython -I tests/test_semantic_translator_use.py-> FAILED (failures=1):tests/semantic/test_lds_gws_barrier_v.py:1: imports no rdna2spirv and no helper that does. Reproduced after merging3faac557blocally, so CI fails after merge. The file importsmath/struct/unittest/dataclasses/enumand tests a local model. -
ds_gws_barrier_vis not an instruction. llvm-mc 21: "invalid instruction, did you mean: ds_gws_barrier?". The ISA table hasds_gws_barrier(0x1d) and no_vvariant of it (onlyds_gws_sema_vhas the V suffix). There is nothing to translate, so the derivations are for an opcode the hardware does not have. -
The "IEEE 754 float boundaries, subnormals, and signed zeros" coverage is boilerplate on a GWS barrier, which does no float arithmetic.
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_gws_barrier_v.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: "invalid instruction, did you mean: ds_gws_barrier?" on gfx1013 and gfx1030 (llvm-mc -arch=amdgcn -mcpu=<gpu>, LLVM 21).
ds_gws_barrier_vhas zero hits intools/rdna2_isa_tables.py,tools/rdna2spirv.pyanddocs/design.md.- gfx1013: and gfx1030
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 1d5121d: changes suggested. |
What
Adds reference oracle and semantic interpreter tests for
ds_gws_barrier_vintests/semantic/test_lds_gws_barrier_v.py.Tested
python -I)python -m compileall -q tests(Passed)python -I tests/semantic/test_lds_gws_barrier_v.py(Passed)