Fix Wave32 water tile allocation and surface lighting #742

Closed
github-bot wants to merge 3 commits from github-bot/gh-742 into main AGit
Owner

@⁠xss3009 on GitHub · 2026-11-28 04:44 UTC · original
xss3009:fix/wave32-water-transmission → main · +2936 −84 · 14 files · 3 commits · closed without merging

What changes

  • Use the per-lane transmission tile allocator from #45 and #221. Each eligible lane reserves one slot in the existing front or back list, preserving the list layout and the indirect-dispatch contract.
  • Port paired Wave64 lowering from TaynanGT/Vice-Tay#208 for the two identified surface lighting consumers, 5dc3b25986622949 and 6f225b641c5b0708. On Wave32, the two consumers use the paired path when VICTORY_WATER_LIGHT=1. The generator 1aa247ed3653b616 keeps the per-lane allocator. The consumer passes are still opt-in on Wave32.
  • Include the water switches in the shader cache key. VICTORY_WATER_TILE_SLOTS=0 and VICTORY_WATER_WAVE_PAIRS=0 allow separate controls.

Related #45 and #221. Allocator thanks to xss3009, fxceless and mutlusinan. Paired lowering is from Geckomacabre and TaynanGT's work in Vice-Tay #208.

RTX 5070 Ti in-game comparison

Windows 11 build 22631, driver 621.24, Series X, 1920×1080 scene rendered to 2560×1440, DLSS and frame generation off, BVH builder off. Both runs used a copy of the same first-boat checkpoint and experimental water lighting enabled.

Build tested Tile generation Surface lighting Bridge-approach result
#221 a37e532 Per-lane allocator Existing Wave32 lowering Residual rectangular patches along the shore/water boundary and small intermittent patches on the water
Local build on #221 Same per-lane allocator Only the two surface consumers paired The player reported the view cleaned up. Three 24-frame presented-frame bursts supported the bridge-approach result

The bridge direction and rear-camera framing were approximately matched. The comparison did not match the exact mission tick or a passing yacht's position. The two consumers were tested together in game. Original RTX 5070 Ti result and paired-consumer follow-up.

Validation of the submitted branch

  • Built the Windows diagnostics target on upstream 63b902f. Both allocator tests and the Wave32 water routing test passed.
  • Microsoft's DXIL validator passed all five checked shaders and the RTX 5070 Ti created all five D3D12 pipelines. The emitted DXIL hashes for the three affected compute shaders matched the in-game candidate. The in-game comparison above was on that candidate, before rebasing.
  • Repository asset policy passed. The branch contains source, tests and a short README update.
  • Workspace Clippy with warnings denied reports existing lints in untouched code in the base tree.

AI-assisted testing and porting.

**@⁠xss3009** on GitHub · 2026-11-28 04:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/742) `xss3009:fix/wave32-water-transmission` → `main` · +2936 −84 · 14 files · 3 commits · closed without merging ## What changes - Use the per-lane transmission tile allocator from #45 and #221. Each eligible lane reserves one slot in the existing front or back list, preserving the list layout and the indirect-dispatch contract. - Port paired Wave64 lowering from TaynanGT/Vice-Tay#208 for the two identified surface lighting consumers, `5dc3b25986622949` and `6f225b641c5b0708`. On Wave32, the two consumers use the paired path when `VICTORY_WATER_LIGHT=1`. The generator `1aa247ed3653b616` keeps the per-lane allocator. The consumer passes are still opt-in on Wave32. - Include the water switches in the shader cache key. `VICTORY_WATER_TILE_SLOTS=0` and `VICTORY_WATER_WAVE_PAIRS=0` allow separate controls. Related #45 and #221. Allocator thanks to xss3009, fxceless and mutlusinan. Paired lowering is from Geckomacabre and TaynanGT's work in Vice-Tay #208. ## RTX 5070 Ti in-game comparison Windows 11 build 22631, driver 621.24, Series X, 1920×1080 scene rendered to 2560×1440, DLSS and frame generation off, BVH builder off. Both runs used a copy of the same first-boat checkpoint and experimental water lighting enabled. | Build tested | Tile generation | Surface lighting | Bridge-approach result | | --- | --- | --- | --- | | #221 `a37e532` | Per-lane allocator | Existing Wave32 lowering | Residual rectangular patches along the shore/water boundary and small intermittent patches on the water | | Local build on #221 | Same per-lane allocator | Only the two surface consumers paired | The player reported the view cleaned up. Three 24-frame presented-frame bursts supported the bridge-approach result | The bridge direction and rear-camera framing were approximately matched. The comparison did not match the exact mission tick or a passing yacht's position. The two consumers were tested together in game. [Original RTX 5070 Ti result](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/221) and [paired-consumer follow-up](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/221). ## Validation of the submitted branch - Built the Windows diagnostics target on upstream `63b902f`. Both allocator tests and the Wave32 water routing test passed. - Microsoft's DXIL validator passed all five checked shaders and the RTX 5070 Ti created all five D3D12 pipelines. The emitted DXIL hashes for the three affected compute shaders matched the in-game candidate. The in-game comparison above was on that candidate, before rebasing. - Repository asset policy passed. The branch contains source, tests and a short README update. - Workspace Clippy with warnings denied reports existing lints in untouched code in the base tree. AI-assisted testing and porting.
`water_shading:CS_TransmissionVolumetrics_GenerateTiles` takes the list
slots for a whole 64-lane wave at once: the first lane adds the wave's
count and every lane's slot is its rank on top of that. Run as two host
waves, the rank of a lane in the second half needs the first half's mask;
without it the second wave's tiles overwrote the first wave's slots in
part, and those tiles got no light (dark blocks in the sea around boats,
piers and lamp posts).

Every lane now takes its own slot: one atomic add of 1 each, and its slot
is what the counter held. Slots are still each given once and the counters
end the same; only the order within a list differs, which nothing reads.
The rewrite is byte-exact against the title's build (container digest,
length and FNV-1a of the code); anything else is left alone.
`VICTORY_WATER_TILE_SLOTS=0` restores the old form.

From fxceless/victory-fork cd93552, after xss3009's "Fix transmission
tile allocation on wave32 hosts", written again for this tree.

(cherry picked from commit a37e53267e)
Pair the two known surface-lighting compute shaders on Wave32 when
experimental water lighting is requested. Use the per-lane tile
allocator for generation, with the original list and dispatch contract.
Keep the water options in the translated shader cache key.

Port paired Wave64 lowering from Geckomacabre and TaynanGT in
TaynanGT/Vice-Tay#208. Build on the allocator in #45 and #221.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 04:44:44 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-28 05:14 UTC · original · approved these changes

LGTM — verified on Windows (RTX 5090):

  • cargo test -p victory-shader --lib wave64_tests:: passed (19/19, including all 7 non-ignored after_loop:: tests)
  • cargo test -p victory-shader --lib emit::tests:: passed (22/22)
  • cargo clippy -p victory-shader --lib -- -D warnings passed with 0 warnings
  • cargo xtask policy passed (299 files ok)

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-28 05:14 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/742#pullrequestreview-6095963748) · **approved these changes** LGTM — verified on Windows (RTX 5090): - `cargo test -p victory-shader --lib wave64_tests::` passed (19/19, including all 7 non-ignored `after_loop::` tests) - `cargo test -p victory-shader --lib emit::tests::` passed (22/22) - `cargo clippy -p victory-shader --lib -- -D warnings` passed with 0 warnings - `cargo xtask policy` passed (`299 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠Yoshi-233 on GitHub · 2026-11-28 05:41 UTC · original

I tested the Windows play entry point at 4bb3bd956. There is a reproducible difference between the menu's Water light = On and --set VICTORY_WATER_LIGHT=1 for the new paired consumers.

How the setting is applied 1aa247ed… tile allocator 5dc3b259… / 6f225b64… consumers
Fresh launch or menu On New per-lane allocator Original 8×8×1 programs
VICTORY_WATER_LIGHT=1 in settings, or --set VICTORY_WATER_LIGHT=1 New per-lane allocator Paired 32×1×1 programs
Explicit VICTORY_WATER_LIGHT=1 and VICTORY_WATER_WAVE_PAIRS=0 New per-lane allocator Original consumer DXIL hashes again

The menu stores an empty value for On, and play removes the inherited variable. The existing water toggle treats this as enabled, while the paired path tests for the literal 1. I checked the resolved settings with six Windows launches, translated the real programs under seven configurations, and validated the generated DXIL. Each distinct configuration also produced the expected cache hits after a cold translation.

It would help to make the paired-path predicate use the same effective setting as the menu, or document the explicit --set requirement if opt-in is intentional. Otherwise two people comparing water screenshots can select the same menu value and run different shaders.

**@⁠Yoshi-233** on GitHub · 2026-11-28 05:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/742#issuecomment-7234826034) I tested the Windows `play` entry point at `4bb3bd956`. There is a reproducible difference between the menu's **Water light = On** and `--set VICTORY_WATER_LIGHT=1` for the new paired consumers. | How the setting is applied | `1aa247ed…` tile allocator | `5dc3b259…` / `6f225b64…` consumers | | --- | --- | --- | | Fresh launch or menu On | New per-lane allocator | Original 8×8×1 programs | | `VICTORY_WATER_LIGHT=1` in settings, or `--set VICTORY_WATER_LIGHT=1` | New per-lane allocator | Paired 32×1×1 programs | | Explicit `VICTORY_WATER_LIGHT=1` and `VICTORY_WATER_WAVE_PAIRS=0` | New per-lane allocator | Original consumer DXIL hashes again | The menu stores an empty value for On, and `play` removes the inherited variable. The existing water toggle treats this as enabled, while the paired path tests for the literal `1`. I checked the resolved settings with six Windows launches, translated the real programs under seven configurations, and validated the generated DXIL. Each distinct configuration also produced the expected cache hits after a cold translation. It would help to make the paired-path predicate use the same effective setting as the menu, or document the explicit `--set` requirement if opt-in is intentional. Otherwise two people comparing water screenshots can select the same menu value and run different shaders.
The menu writes an empty value for On, which the play launcher unsets.
Use one switch predicate for the GPU pipeline gate and the paired
translator so an unset value and explicit 1 both enable the same path.
Keep explicit 0 as Off and cover the menu and CLI values in a unit test.

Reported by Yoshi-233 in #742.
Author
Owner

@⁠xss3009 on GitHub · 2026-11-28 16:10 UTC · original

@⁠Yoshi-233 Thanks for tracing the F1 setting through Windows victory play. The follow-up in 5ad654e uses one water-light predicate for the two pipeline exclusions and paired Wave64 lowering. F1 On saves an empty value, which play unsets. The paired path now follows that default-on state and explicit 1. Explicit 0 still skips both surface-light passes on Wave32.

I tested on an RTX 5070 Ti (driver 621.24, 32-lane waves), with the same first-boat checkpoint and rear-camera view before the bridge. Series X rendered at 1920×1080 to 2560×1440, with DLSS and frame generation off.

Start path Runtime result
F1 Water Light Off Both surface-light pipelines were excluded with the saved 0.
Saved F1 Water Light On, fresh start without a CLI override Both 5dc3b25986622949 and 6f225b641c5b0708 logged WAVE64-PAIRED and created their D3D12 compute PSOs.
Saved Off, plus --set VICTORY_WATER_LIGHT=1 The CLI override enabled the same paired branches and both D3D12 compute PSOs.

I captured 24 consecutive presented frames at the bridge approach on each enabled run, including a fresh F1 On repeat. I did not observe the rectangular waterline flicker in these samples. The camera and checkpoint were matched, with different passing-boat positions. Offline DXIL validation also passed, and F1 On and the CLI override produced identical bytecode for the two passes.

The first F1 On diagnostic run hit a D3D12 device removal (0x887A0006) when starting a later capture, after the 24-frame bridge sample. It did not recur in the CLI test or the fresh F1 On repeat. I have not attributed the device removal to a specific command.

**@⁠xss3009** on GitHub · 2026-11-28 16:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/742#issuecomment-7242032382) @⁠Yoshi-233 Thanks for tracing the F1 setting through Windows `victory play`. The follow-up in `5ad654e` uses one water-light predicate for the two pipeline exclusions and paired Wave64 lowering. F1 On saves an empty value, which `play` unsets. The paired path now follows that default-on state and explicit `1`. Explicit `0` still skips both surface-light passes on Wave32. I tested on an RTX 5070 Ti (driver 621.24, 32-lane waves), with the same first-boat checkpoint and rear-camera view before the bridge. Series X rendered at 1920×1080 to 2560×1440, with DLSS and frame generation off. | Start path | Runtime result | | --- | --- | | F1 Water Light Off | Both surface-light pipelines were excluded with the saved `0`. | | Saved F1 Water Light On, fresh start without a CLI override | Both `5dc3b25986622949` and `6f225b641c5b0708` logged `WAVE64-PAIRED` and created their D3D12 compute PSOs. | | Saved Off, plus `--set VICTORY_WATER_LIGHT=1` | The CLI override enabled the same paired branches and both D3D12 compute PSOs. | I captured 24 consecutive presented frames at the bridge approach on each enabled run, including a fresh F1 On repeat. I did not observe the rectangular waterline flicker in these samples. The camera and checkpoint were matched, with different passing-boat positions. Offline DXIL validation also passed, and F1 On and the CLI override produced identical bytecode for the two passes. The first F1 On diagnostic run hit a D3D12 device removal (`0x887A0006`) when starting a later capture, after the 24-frame bridge sample. It did not recur in the CLI test or the fresh F1 On repeat. I have not attributed the device removal to a specific command.
github-bot closed this pull request 2026-11-28 19:24:52 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-28 19:22 UTC · original

Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

**@⁠trustno1-coder** on GitHub · 2026-11-28 19:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/742#issuecomment-7244495575) Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!742
No description provided.