You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recompiler: wave64 VS / PS on 32-lane waves – votes are taken per half (not only lane reads) #336
docs/wave64-on-wave32.md treats a 32-lane wave of a console wave64 VS / PS as a console wave whose lanes 32..63 are not populated, so per-lane code and masks count as exact and only reads of lanes ≥ 32 are hazards (upper_lanes.rs, #133). That misses a second way the result can depend on how the driver cuts the wave: wave-wide votes are taken per half.
s_cbranch_vccnz / vccz, execz / execnz, scc* after a compare of a lane mask: on the console the 64 lanes go one way if any lane votes yes. Cut in two, the half with no yes lane takes the other side, which the console wave never ran for those lanes. If that side does more than skip lane-masked work, the half's output differs.
A scalar defined behind such a vote is then defined in one half and not the other.
Lane counts, ranks, first-lane indices and the lane id (s_bcnt1 of a mask, v_mbcnt, s_ff1) take different values in a half than in the wave.
wave_hazards says nothing about these, so 0 hazards does not mean a wave64 PS is exact on 32-lane waves (NVIDIA, and AMD drivers that pick 32 for a PS). How many programs of the retail pack this reaches is not measured yet; step 3 below measures it.
Plan – classify first, fix later, each PR on its own:
Preparation, no behaviour change: share upper_lanes::successors and add post-dominators / control dependence over a program's instructions, with unit tests.
A classifier, not called by translation: per wave64 VS / PS a tier (exact as is / exact through a known idiom / may differ) and the reasons, from a forward taint pass (partition-dependent values reaching exports, stores, branch conditions, EXEC) plus rules for votes that only skip lane-masked work. Unit tests on hand-written programs.
An ignored census test over XCL_SAMPLE_RPF, like retail_wave64_graphics_lane_census, and the measured counts in docs/wave64-on-wave32.md.
Then the may-differ cases one at a time, each with a GPU test.
AI-assisted: Claude Code (Claude Opus 5.5) wrote this issue.
A probe over the pack shows where the rest is. Among the programs that are not Exact, 2 409 had vote-branch as their only reason; most of those were the discard early-out that #953 handles. Waterfall loops (v_readfirstlane + v_cmp_eq of it) are rare: 1 of the 520 programs whose only reasons are cross-lane / tainted-exec / lane-id. So the next parts will be chosen by such probes rather than by idiom names. After that: the census as an ignored test with the counts in docs/wave64-on-wave32.md, then the may-differ cases one at a time with GPU tests.
AI use: Claude Code with Claude Opus 5.5 wrote this note.
Activity
Recompiler: basic blocks, post-dominators and control dependence (iva…
emirduran707 commentedon Nov 24, 2026
Progress, as a stack (each PR's own commit on top of the one below):
A probe over the pack shows where the rest is. Among the programs that are not Exact, 2 409 had
vote-branchas their only reason; most of those were the discard early-out that #953 handles. Waterfall loops (v_readfirstlane+v_cmp_eqof it) are rare: 1 of the 520 programs whose only reasons arecross-lane/tainted-exec/lane-id. So the next parts will be chosen by such probes rather than by idiom names. After that: the census as an ignored test with the counts indocs/wave64-on-wave32.md, then the may-differ cases one at a time with GPU tests.AI use: Claude Code with Claude Opus 5.5 wrote this note.
Recompiler: classify wave64 VS / PS by whether a 32-lane cut changes …
Recompiler: classify wave64 VS / PS by whether a 32-lane cut changes …
Recompiler: classify wave64 VS / PS by whether a 32-lane cut changes …
Recompiler: classify wave64 VS / PS by whether a 32-lane cut changes …
Recompiler: a vote's side may narrow EXEC through a whole-quad copy (x…
Merge pull request #517 from emirduran707/wave64-partition
Merge pull request #953 from emirduran707/wave64-idioms