G-buffer shards: a wave64 mesh program's v_readfirstlane reads each host wave's first lane #521

Closed
opened 2026-11-27 23:48:30 +00:00 by github-bot · 4 comments
Owner

@⁠alexballvideos-netizen on GitHub · 2026-11-27 23:47 UTC · original

Split out of #258 (claimed by @⁠Tarraga there) so the fix below can be booked on its own.

What: with the world drawing (preview b3c1a1b0, VICTORY_GUESS_GRAPHICS=1), the G-buffer has long fans and sheets on every kind of mesh geometry: characters, cars, buildings. Some triangles are right, others spread from a point. They're already there before lighting.

Cause: the common G-buffer mesh programs (6eedbc0771df10ab, 35d5616385a0a8f8, 08ebaafa2f409986 and others) are wave64 groups whose threads are console lanes, so each 32-lane host wave is half a console wave. Their v_readfirstlane_b32 (7 to 10 per program, some of values that differ per lane: per-meshlet counts) lowered to waveReadLaneFirst, each host wave's own first lane. Lanes 32 to 63 then read lane 32's value, not lane 0's, and build vertices and primitives from the wrong meshlet.

Evidence (M3 Max 36 GB, Series X): with the first-lane read made the console wave's, G-buffer dumps from 140 to 290 s show no fans, where every earlier run had them. Things ruled out on the way are in #258.

PR to follow.

**@⁠alexballvideos-netizen** on GitHub · 2026-11-27 23:47 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/517) Split out of #258 (claimed by @⁠Tarraga there) so the fix below can be booked on its own. **What:** with the world drawing (preview `b3c1a1b0`, `VICTORY_GUESS_GRAPHICS=1`), the G-buffer has long fans and sheets on every kind of mesh geometry: characters, cars, buildings. Some triangles are right, others spread from a point. They're already there before lighting. **Cause:** the common G-buffer mesh programs (`6eedbc0771df10ab`, `35d5616385a0a8f8`, `08ebaafa2f409986` and others) are wave64 groups whose threads are console lanes, so each 32-lane host wave is half a console wave. Their `v_readfirstlane_b32` (7 to 10 per program, some of values that differ per lane: per-meshlet counts) lowered to `waveReadLaneFirst`, each host wave's own first lane. Lanes 32 to 63 then read lane 32's value, not lane 0's, and build vertices and primitives from the wrong meshlet. **Evidence (M3 Max 36 GB, Series X):** with the first-lane read made the console wave's, G-buffer dumps from 140 to 290 s show no fans, where every earlier run had them. Things ruled out on the way are in https://git.gtahub.st/github/LakshanSivakumar--Native-Victory-macOS/issues/258. PR to follow.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 23:48:30 +00:00
Author
Owner

@⁠alexballvideos-netizen on GitHub · 2026-11-27 23:47 UTC · original

/claim

**@⁠alexballvideos-netizen** on GitHub · 2026-11-27 23:47 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/517#issuecomment-7230408435) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 23:47 UTC · original

Claimed by @⁠alexballvideos-netizen. Open a draft pull request with Refs #517 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 23:47 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/517#issuecomment-7230410528) Claimed by @⁠alexballvideos-netizen. Open a draft pull request with `Refs #517` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-28 00:36 UTC · original

Thank you for this. It is fixed on main by #522. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.

**@⁠LakshanSivakumar** on GitHub · 2026-11-28 00:36 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/517#issuecomment-7231042799) Thank you for this. It is fixed on main by #522. I have not checked every case from this report in the game myself, so please retest on main a6a58361 and reopen this if you still see it. Closing as fixed.
Author
Owner

@⁠alexballvideos-netizen on GitHub · 2026-11-28 00:53 UTC · original

Retested on main 226645f9, which includes a6a58361 and #522. M3 Max 36 GB, Series X, headless, VICTORY_DEPTH_TWINS=0, with the base-colour target dumped every 25 s from 140 to 294 s. All 6 dumps are clean: characters in the street, a car interior and a house interior, with no fans or sheets. There were no GPU time-outs and the run went the full 320 s. It stays closed.

**@⁠alexballvideos-netizen** on GitHub · 2026-11-28 00:53 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/517#issuecomment-7231271589) Retested on `main` `226645f9`, which includes `a6a58361` and #522. M3 Max 36 GB, Series X, headless, `VICTORY_DEPTH_TWINS=0`, with the base-colour target dumped every 25 s from 140 to 294 s. All 6 dumps are clean: characters in the street, a car interior and a house interior, with no fans or sheets. There were no GPU time-outs and the run went the full 320 s. It stays closed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.