WARP: gathers_at_a_level_match_the_hardware is one texel off in every channel (hardware matches the model) #3261

Open
opened 2026-11-26 14:56:01 +00:00 by github-bot · 0 comments
Owner

@⁠zzm1234560621-prog on GitHub · 2026-11-26 14:52 UTC · original

emit::synthetic_tests::gathers_at_a_level_match_the_hardware fails whenever WARP is the device, and every channel is off by exactly one texel:

VICTORY_WARP=1 cargo test -p victory-shader --lib -- gathers_at_a_level_match_the_hardware -- --nocapture

thread 'emit::synthetic_tests::gathers_at_a_level_match_the_hardware' panicked at
crates/victory-shader/src/emit/synthetic_tests.rs:276:17:
assertion `left == right` failed: hardware: lane 4 against its gather
left:  [66.0, 67.0, 35.0, 34.0]
right: [65.0, 66.0, 34.0, 33.0]

left is the device, right the test's model. It is not rounding and not one lane's arithmetic: all four gathered channels are the neighbouring texels, on the same lane, in one direction.

Why this looks like a WARP-side difference and not the lowering

  • The same test passes on the Intel Arc (Xe-LPG) here — it is not among the seven failures in #3196 — so the model and at least one hardware adapter agree, and the lowering produces something a real gather executes correctly.
  • It fails in the WARP-only configuration the reviewers use (VICTORY_WARP=1, or VICTORY_WARP=1 + VICTORY_D3D12_WARP=1, --test-threads=1), which is also where oni-swr's four failures come from.
  • With #3242 the other three of those four become skips (they were asserting a hardware property of a device with warp == false); this is the one that remains, so it is the only thing between that configuration and green.

Directions I would try

  1. Coordinate rounding. A gather takes the 2×2 footprint from floor(u), floor(v); a host that rounds half-texel differently, or that applies the level's +0.5 offset, lands exactly one texel over in both axes — which is what the numbers show. Compare the coordinate the lowering passes with what the model assumes, and see whether WARP floors before or after the level offset.
  2. Level selection. image_gather4_l takes an explicit LOD. One level wrong would change which mip is sampled; if the test's texture is small enough that a neighbouring mip is shifted by one texel, it looks like this. Worth checking whether right and left correspond to adjacent mips before assuming a coordinate bias.
  3. If it is genuinely WARP's implementation, the test wants a skip with a named reason, the way the wave-size ones now have (supports_wave_lanes), rather than a failure — but that should follow the diagnosis, not replace it.

What I did not do

I did not change anything here: I was chasing the WARP-only configuration for #3242 and this is what was left. The model side (synthetic_tests' gather reference) would need whoever owns it to say which of the two readings above is the intended geometry.

No game files. AI-assisted (Claude).

**@⁠zzm1234560621-prog** on GitHub · 2026-11-26 14:52 UTC · [original](https://github.com/Marvisak/VIctory/issues/3261) `emit::synthetic_tests::gathers_at_a_level_match_the_hardware` fails whenever WARP is the device, and every channel is off by exactly one texel: ``` VICTORY_WARP=1 cargo test -p victory-shader --lib -- gathers_at_a_level_match_the_hardware -- --nocapture thread 'emit::synthetic_tests::gathers_at_a_level_match_the_hardware' panicked at crates/victory-shader/src/emit/synthetic_tests.rs:276:17: assertion `left == right` failed: hardware: lane 4 against its gather left: [66.0, 67.0, 35.0, 34.0] right: [65.0, 66.0, 34.0, 33.0] ``` `left` is the device, `right` the test's model. It is not rounding and not one lane's arithmetic: all four gathered channels are the neighbouring texels, on the same lane, in one direction. ## Why this looks like a WARP-side difference and not the lowering - The same test **passes on the Intel Arc (Xe-LPG)** here — it is not among the seven failures in #3196 — so the model and at least one hardware adapter agree, and the lowering produces something a real gather executes correctly. - It fails in the WARP-only configuration the reviewers use (`VICTORY_WARP=1`, or `VICTORY_WARP=1` + `VICTORY_D3D12_WARP=1`, `--test-threads=1`), which is also where oni-swr's four failures come from. - With #3242 the other three of those four become skips (they were asserting a hardware property of a device with `warp == false`); this is the one that remains, so it is the only thing between that configuration and green. ## Directions I would try 1. **Coordinate rounding.** A gather takes the 2×2 footprint from `floor(u), floor(v)`; a host that rounds half-texel differently, or that applies the level's `+0.5` offset, lands exactly one texel over in both axes — which is what the numbers show. Compare the coordinate the lowering passes with what the model assumes, and see whether WARP floors before or after the level offset. 2. **Level selection.** `image_gather4_l` takes an explicit LOD. One level wrong would change which mip is sampled; if the test's texture is small enough that a neighbouring mip is shifted by one texel, it looks like this. Worth checking whether `right` and `left` correspond to adjacent mips before assuming a coordinate bias. 3. If it is genuinely WARP's implementation, the test wants a skip with a named reason, the way the wave-size ones now have (`supports_wave_lanes`), rather than a failure — but that should follow the diagnosis, not replace it. ## What I did not do I did not change anything here: I was chasing the WARP-only configuration for #3242 and this is what was left. The model side (`synthetic_tests`' gather reference) would need whoever owns it to say which of the two readings above is the intended geometry. _No game files. AI-assisted (Claude)._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:56:01 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#3261
No description provided.