Window glass: dark stripes that blink every other frame (wave32 lane numbers on wave64 pixel waves) #189

Closed
opened 2026-12-02 13:59:39 +00:00 by github-bot · 0 comments
Owner

@⁠kyle41313 on GitHub · 2026-12-02 13:57 UTC · original

Symptom. Sunlit house windows show dark horizontal bands, about 4 of every 8 rows, on every other frame. Two windows in view flash in opposite phase. The bands show over shaded backgrounds and hide over sunlit ones.

Setup. RX 9070 XT, RADV, Proton Experimental 11.0, ray tracing off (VICTORY_BVH_BUILDER=0).

Cause. The house glass pixel program b37565055f2f7d3b (the same program as #28) picks a neighboring light-grid cell per pixel from its lane number plus the frame counter: v_mbcnt_lo_u32_b32 v57, -1, 0 at console offset 0x5730, then v_add_nc_u32 v57, s63, v57 at 0x574c. The program is wave32 on the console. xmem sets no wave size for pixel programs, so RADV should run them in waves of 64 (not measured). The v_mbcnt_lo lowering returns 32 for every host lane from 32 up. Half of each wave then reads the same cell, and the choice flips with the frame.

Fix: VICTORY_GLASS_DITHER_OFF=1 (#193). For this program only, the result at 0x574c becomes 0. Off by default; in the shader cache key. Applies to d044248 and compiles there without warnings. In game: no bands and no blinking, the glass otherwise drawn as before. This is a workaround: every pixel reads the same cell, so the console's per-pixel dither is lost.

Suggested general fix (untested). Give pixel programs' v_mbcnt the console's 0-31 lane numbering when a wave32 program runs in host waves of 64, for example waveGetLaneIndex() & 31, and split ballot masks by wave half. That would keep the dither and cover any other program that uses the lane number this way.

Evidence: live pins, measurements, what did not help

Live pins of single instruction results in one running game (a diagnostics build of ours, on 6dbc3e7):

  • The sum at 0x574c pinned to 0: bands and blinking gone.
  • The lane number at 0x5730 pinned to 0: bands gone. Row-difference measure on a fence strip seen through the glass: 0.32 and 0.34 pinned, 1.46-1.82 unpinned.
  • The light's shadow gather inside the light loop (0x5b80) pinned "lit" keeps the bands (1.82 against 2.04 unpinned); pinned "shadowed", which turns the light off, removes them (0.03). So the bands are in which light data a pixel gets, not in the shadow.
  • Bits 0 and 1 of the sum choose the x and y neighbor (0x5768, 0x576c, 0x5778, 0x5814). Over an 8x8 tile, a half-wave split gives 4 banded rows of every 8.
  • Measure: mean absolute difference between adjacent pixel rows inside a window, per frame, from 60 fps screen recordings. On the desk window, 431 of 433 frame steps reversed direction; 2 windows in view correlated at -0.99.

The wave-size chain comes from reading the code: s.wave_size is set on the compute path only (lower.rs around line 2566), and console_lane masks with "all ones from 32 on".

What did not help:

  • VICTORY_QUAD_GUARD=1 (#28), VICTORY_RDNA_FLOAT=0, VICTORY_PLACED_COPIED=1: no change.
  • RADV_PERFTEST=pswave32: the host refused the glass pipelines (3 launches), so the test could not tell.
  • Bits 0-1 of the lane number taken from the pixel's place in its 2x2 quad: no change, since host lane bits 0-1 already are the quad place on AMD.
  • The fix's 0 is computed from the result (x & 0): with a plain constant there, the host refused the glass pipeline.

No game files, captures or screenshots included.

Fix: pull request #193.

**@⁠kyle41313** on GitHub · 2026-12-02 13:57 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/189) **Symptom.** Sunlit house windows show dark horizontal bands, about 4 of every 8 rows, on every other frame. Two windows in view flash in opposite phase. The bands show over shaded backgrounds and hide over sunlit ones. **Setup.** RX 9070 XT, RADV, Proton Experimental 11.0, ray tracing off (`VICTORY_BVH_BUILDER=0`). **Cause.** The house glass pixel program `b37565055f2f7d3b` (the same program as #28) picks a neighboring light-grid cell per pixel from its lane number plus the frame counter: `v_mbcnt_lo_u32_b32 v57, -1, 0` at console offset 0x5730, then `v_add_nc_u32 v57, s63, v57` at 0x574c. The program is wave32 on the console. xmem sets no wave size for pixel programs, so RADV should run them in waves of 64 (not measured). The `v_mbcnt_lo` lowering returns 32 for every host lane from 32 up. Half of each wave then reads the same cell, and the choice flips with the frame. **Fix: `VICTORY_GLASS_DITHER_OFF=1`** (#193). For this program only, the result at 0x574c becomes 0. Off by default; in the shader cache key. Applies to d044248 and compiles there without warnings. In game: no bands and no blinking, the glass otherwise drawn as before. This is a workaround: every pixel reads the same cell, so the console's per-pixel dither is lost. **Suggested general fix (untested).** Give pixel programs' `v_mbcnt` the console's 0-31 lane numbering when a wave32 program runs in host waves of 64, for example `waveGetLaneIndex() & 31`, and split ballot masks by wave half. That would keep the dither and cover any other program that uses the lane number this way. <details> <summary>Evidence: live pins, measurements, what did not help</summary> Live pins of single instruction results in one running game (a diagnostics build of ours, on 6dbc3e7): - The sum at 0x574c pinned to 0: bands and blinking gone. - The lane number at 0x5730 pinned to 0: bands gone. Row-difference measure on a fence strip seen through the glass: 0.32 and 0.34 pinned, 1.46-1.82 unpinned. - The light's shadow gather inside the light loop (0x5b80) pinned "lit" keeps the bands (1.82 against 2.04 unpinned); pinned "shadowed", which turns the light off, removes them (0.03). So the bands are in which light data a pixel gets, not in the shadow. - Bits 0 and 1 of the sum choose the x and y neighbor (0x5768, 0x576c, 0x5778, 0x5814). Over an 8x8 tile, a half-wave split gives 4 banded rows of every 8. - Measure: mean absolute difference between adjacent pixel rows inside a window, per frame, from 60 fps screen recordings. On the desk window, 431 of 433 frame steps reversed direction; 2 windows in view correlated at -0.99. The wave-size chain comes from reading the code: `s.wave_size` is set on the compute path only (lower.rs around line 2566), and `console_lane` masks with "all ones from 32 on". What did not help: - `VICTORY_QUAD_GUARD=1` (#28), `VICTORY_RDNA_FLOAT=0`, `VICTORY_PLACED_COPIED=1`: no change. - `RADV_PERFTEST=pswave32`: the host refused the glass pipelines (3 launches), so the test could not tell. - Bits 0-1 of the lane number taken from the pixel's place in its 2x2 quad: no change, since host lane bits 0-1 already are the quad place on AMD. - The fix's 0 is computed from the result (`x & 0`): with a plain constant there, the host refused the glass pipeline. </details> No game files, captures or screenshots included. Fix: pull request #193.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 13:59:39 +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/lobomfz--VIctory-xmem#189
No description provided.