Repository navigation
semantic: the ballot/barrier audit runs structured wave64 helper calls - #4727
bobcatchris wants to merge 1 commit into
Conversation
main is red: python -I tests/semantic/test_loop_ballot_barrier.py reports 3 failures and 2 errors on 98fa503. 4d9ef4e routes these reducible compute CFGs through structured inline wave64 emulation, which labels the path "emulated wave64 structured" and emits the mask setup as %x_pre_mask_fn / %x_pre_both_fn / %x_pre_vote_fn called from %main. The audit's interpreter parsed only %main, so it failed the label check and then raised NotImplementedError on OpFunctionCall. _parse_spv now records every OpFunction with its OpFunctionParameters, entry label and function-local OpVariables, and step_inv implements OpFunctionCall, OpReturnValue and OpReturn with a per-invocation frame (return block, ip, destination, previous block) and a local scope stack. Helper locals are allocated per call, so a future helper with locals cannot alias another call's. The emulation label check accepts either structured or round scheduling, and the same per-lane memory assertions run, so whichever path the translator picks is audited. Checked: 15/15 tests pass after the change; the unmodified test on 98fa503 still fails 3+2. Pure stdlib and synthetic RDNA2 listings; no hardware, game data or translator change. AI-assisted.
|
Tested head Command:
All pass. AI-assisted (Devin). |
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 7a9dd621c on Windows 11: tests/semantic/test_loop_ballot_barrier.py -> 15 tests, OK; git diff --check clean.
The ballot/barrier audit now also runs the structured wave64 helper calls (the same expected words), so the structured path is checked alongside the round-based one; test-only. No blocking issue.
|
Verified on Linux: this fixes a genuinely red-on-main test — at base the file fails 3 + errors 2 (all wave64-emulate modes, red since structured inline emulation landed); at the head all 15 tests pass under python -I (re-run here), and the translator-use guard is satisfied (the file imports rdna2spirv directly). One caution for maintainers: #4152 extends the same interpreter's function-call support and edits the same control_flow hunk with a stricter assert — the two will conflict; worth deciding which one lands. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Checked Command in each checkout:
The base reproduces the three structured-vs-round scheduler label failures and the two unsupported |
|
Tested
|
|
Whole-surface evidence that this is the one red module on On a clean worktree at
At this PR's head ( AI-assisted. |
|
Re-review request. This is the only red module on |
|
Tested On For whoever picks between them: #3995 ( AI-assisted (Claude Code). CPU only, no game files. |
kacper-serewis
left a comment
There was a problem hiding this comment.
A private merge of 7a9dd62 with #3018 at 6c6edcc (includes #2986) applied cleanly. Across 6,255 semantic tests the baseline had three failures and two errors, all cleared on the combined tree. Both runs had four skips and one expected failure. A four-lane helper returned independent values above the 4 GiB address boundary and the control mutations changed them as predicted. AI-assisted, synthetic CPU validation.
|
Tested
|
|
Closing as superseded. AI-assisted. |
What and why
main(98fa503f) is red in this audit:4d9ef4eb(structured inline/hybrid wave64 emulation) routes these reducible compute CFGs throughplan_structured_emulation. That path labelsgen.control_flowemulated wave64 structuredand emits the mask setup as helper functions (%x_pre_mask_fn,%x_pre_both_fn,%x_pre_vote_fn) called from%main. The audit's interpreter parsed only%main, so it failed the old label assertion and had no way to execute the new default path at all.What changed
tests/semantic/test_loop_ballot_barrier.pyonly:_parse_spvrecords everyOpFunctionwith itsOpFunctionParameters, entry label and function-localOpVariables (main's stay where they were).step_invimplementsOpFunctionCall,OpReturnValueandOpReturnwith a per-invocation frame (return block, ip, destination register, previous block) plus a scope stack for helper locals. Locals are keyed per call, so two calls cannot alias.emulated wave64 roundsoremulated wave64 structured; the same per-lane memory assertions then run, so whichever scheduler the translator picks is checked against the RDNA2 oracles.The helper bodies use only parameters, SSA and the already-supported
%x_bufatomics; no translator change is needed.Checks
python -I tests/semantic/test_loop_ballot_barrier.py→ 15 tests, OK (was 3 failures + 2 errors).98fa503fstill fails 3+2; only the interpreter and the label assertion changed.git diff --checkclean.Synthetic hand-written RDNA2 listings only; no hardware, game data or GPU run involved.
AI-assisted.