Shaders: the console's waterfall loop over a first-lane table offset

The console compiler loops over a per-lane descriptor by reading the
first active lane's table offset (v_readfirstlane_b32), narrowing EXEC
to the lanes with the same one (v_cmpx_eq_u32), loading that entry
(s_load_dwordx8) and dropping those lanes (s_andn2_wrexec). Such a load
now goes through the waterfall proof; when it holds, each lane loads its
own entry through a non-uniform handle. Unproven, the offset stays the
first lane's, as before.

Translation census over the title's 26,096 programs: none lost, 108 get
past these loops to a later refusal. The 249 programs behind #736 also
need per-lane size queries in loops without an access.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MarvisandClaude Opus 5.5 committed 2026-11-24 10:53:38 +01:00
1 parent 2f899cb543
commit 45c6e80601
3 files changed
+112 -2

No files matched your search

+7 -2
View File
@@ -3313,7 +3313,12 @@ impl<'a> Lower<'a> {
return Ok(h);
}
let index = self.heap_index(*load, *first, sampler)?;
let h = self.s.heap_handle(self.cur, index, sampler, false, props);
// A waterfall loop's load at the first lane's offset reads
// each lane's own entry (see `resource::Waterfall`).
let per_lane = self.x.res.waterfall.loads.contains(load);
let h = self
.s
.heap_handle(self.cur, index, sampler, per_lane, props);
self.handles.insert(key, h);
Ok(h)
}
@@ -7071,12 +7076,12 @@ mod tests {
0xBE83_0380, // s_mov_b32 s3, 0
S_ENDPGM,
];
for words in [add, sub] {
lowers(&words, 0).unwrap();
}
}
fn perm_features(selector: u32) -> u64 {
// Synthetic compute shader:
// v0 is the thread ID and can supply a dynamic selector.