Recompiler: wave64 VS / PS on 32-lane waves – votes are taken per half (not only lane reads) #333
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-23T23:48:41Z.
docs/wave64-on-wave32.mdtreats 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.s_bcnt1of a mask,v_mbcnt,s_ff1) take different values in a half than in the wave.wave_hazardssays 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:
upper_lanes::successorsand add post-dominators / control dependence over a program's instructions, with unit tests.XCL_SAMPLE_RPF, likeretail_wave64_graphics_lane_census, and the measured counts indocs/wave64-on-wave32.md.AI-assisted: Claude Code (Claude Opus 5.5) wrote this issue.
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-24T01:23:52Z.
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.