Shaders: pair surface water lighting on Wave32 for F1 and CLI #1935

Open
xss3009 wants to merge 9 commits from upstream-pr/1935 into main
xss3009 commented 2026-11-29 03:24:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by xss3009 on 2026-11-29T03:24:47Z.


Supersedes #742 on current main, based on 568c5e5. The Wave32 tile allocator from #45 is already in the base and is unchanged.

Changes

  • Use paired Wave64 lowering for the exact surface-light programs 5dc3b25986622949 and 6f225b641c5b0708 on Wave32. Keep the existing wave-wide fallback, underwater path, and separate volume-portal switch.
  • Use one water-light predicate for pipeline creation and paired lowering. Saving F1 Water Light On writes an empty value, which victory play unsets. An unset value and explicit 1 both enable the paired route. Saved 0 still skips both water passes on Wave32.
  • Include the water switches in the shader cache key. VICTORY_WATER_WAVE_PAIRS=0 keeps the passes enabled and selects the existing lowering for comparison.

RTX 5070 Ti verification

Windows 11, driver 621.24, Wave32, Series X, 1080p internal resolution and 1440p output. DLSS, frame generation, and the BVH builder were off. I loaded copies of the same first-boat checkpoint and used the aft camera at the bridge approach, then the same two-second forward input. The capture times within the mission differ.

Start path Runtime switches and pipeline result Bridge and moving water samples
F1 Water Light On, saved and restarted without a CLI override Both consumers used paired lowering and created D3D12 compute PSOs 48 presented frames, no rectangular waterline flicker observed
Saved Off plus --set VICTORY_WATER_LIGHT=1 Both consumers used paired lowering and created D3D12 compute PSOs 48 presented frames, no rectangular waterline flicker observed

The setup run with F1 Off logged both surface-light pipelines as excluded. The two On routes produced identical bytecode for both consumers in offline DXIL validation. The generator and both consumers passed that validation. Two synthetic paired-lowering tests also passed on the 5070 Ti against CPU reference results. Frame captures and added logging were local diagnostics.

Baseline checks

The Windows diagnostics build passed. The emitter suite had 263 passes and one failure on this Windows installation. The same D3D12 WARP test fails on unmodified 568c5e5 because its software adapter exposes SM 6.2. The asset-policy size check also fails on the base for emit/lower.rs (711,512 bytes against 655,360), and still fails after the port (722,507 bytes). The patch contains source and README changes only.

Paired lowering comes from Geckomacabre and TaynanGT (Vice-Tay #208). Yoshi-233 identified the F1/CLI mismatch in #742. Codex (GPT-6.2-sol) assisted with the port and verification.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5547163294 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1935). Originally posted by [xss3009](https://github.com/xss3009) on 2026-11-29T03:24:47Z. --- Supersedes #742 on current `main`, based on `568c5e5`. The Wave32 tile allocator from #45 is already in the base and is unchanged. ## Changes - Use paired Wave64 lowering for the exact surface-light programs `5dc3b25986622949` and `6f225b641c5b0708` on Wave32. Keep the existing wave-wide fallback, underwater path, and separate volume-portal switch. - Use one water-light predicate for pipeline creation and paired lowering. Saving F1 Water Light On writes an empty value, which `victory play` unsets. An unset value and explicit `1` both enable the paired route. Saved `0` still skips both water passes on Wave32. - Include the water switches in the shader cache key. `VICTORY_WATER_WAVE_PAIRS=0` keeps the passes enabled and selects the existing lowering for comparison. ## RTX 5070 Ti verification Windows 11, driver 621.24, Wave32, Series X, 1080p internal resolution and 1440p output. DLSS, frame generation, and the BVH builder were off. I loaded copies of the same first-boat checkpoint and used the aft camera at the bridge approach, then the same two-second forward input. The capture times within the mission differ. | Start path | Runtime switches and pipeline result | Bridge and moving water samples | | --- | --- | --- | | F1 Water Light On, saved and restarted without a CLI override | Both consumers used paired lowering and created D3D12 compute PSOs | 48 presented frames, no rectangular waterline flicker observed | | Saved Off plus `--set VICTORY_WATER_LIGHT=1` | Both consumers used paired lowering and created D3D12 compute PSOs | 48 presented frames, no rectangular waterline flicker observed | The setup run with F1 Off logged both surface-light pipelines as excluded. The two On routes produced identical bytecode for both consumers in offline DXIL validation. The generator and both consumers passed that validation. Two synthetic paired-lowering tests also passed on the 5070 Ti against CPU reference results. Frame captures and added logging were local diagnostics. ## Baseline checks The Windows diagnostics build passed. The emitter suite had 263 passes and one failure on this Windows installation. The same D3D12 WARP test fails on unmodified `568c5e5` because its software adapter exposes SM 6.2. The asset-policy size check also fails on the base for `emit/lower.rs` (711,512 bytes against 655,360), and still fails after the port (722,507 bytes). The patch contains source and README changes only. Paired lowering comes from Geckomacabre and TaynanGT (Vice-Tay #208). Yoshi-233 identified the F1/CLI mismatch in #742. **Codex (GPT-6.2-sol)** assisted with the port and verification.
nick0451 commented 2026-11-29 13:26:03 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T13:26:03Z.


Checked against current main, alongside #1926 (which turns these programs off instead). RTX 3090 (32-lane), Windows 11, this PR merged onto main 829188e9 (+ a local 2-line start fix, #1625).

  • victory translate --list, VICTORY_HOST_WAVE=32, every output hash against main: of 25,789 shaders, exactly 2 differ: water_shading:CS_TransmissionVolumetrics_Tiled (5dc3b25986622949) and _Tiled_LocalLights (6f225b641c5b0708), the two #1926 leaves out. Nothing else changes and nothing new is refused.
  • In game, VICTORY_WATER_LIGHT unset so both programs run (both logged as made), a save looking over open water at 100-300 m, 2 rounds each: 25.2 fps against main's 25.0, the same lit turquoise water, and no blocks in view in either. The blocks of #739 are reported close to boats and under water. I couldn't get the camera there, so that part is untested here.

So if the close-up blocks are gone with this, it keeps the lit water that #1926 would trade away. (On this card the programs cost nothing measurable at this distance: #1926 comment.)

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7256534493 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1935#issuecomment-7256534493). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T13:26:03Z. --- Checked against current main, alongside #1926 (which turns these programs off instead). RTX 3090 (32-lane), Windows 11, this PR merged onto main `829188e9` (+ a local 2-line start fix, #1625). - **`victory translate --list`, `VICTORY_HOST_WAVE=32`, every output hash against main:** of 25,789 shaders, **exactly 2 differ**: `water_shading:CS_TransmissionVolumetrics_Tiled` (`5dc3b25986622949`) and `_Tiled_LocalLights` (`6f225b641c5b0708`), the two #1926 leaves out. Nothing else changes and nothing new is refused. - **In game**, `VICTORY_WATER_LIGHT` unset so both programs run (both logged as made), a save looking over open water at 100-300 m, 2 rounds each: 25.2 fps against main's 25.0, the same lit turquoise water, and no blocks in view in either. The blocks of #739 are reported close to boats and under water. I couldn't get the camera there, so that part is untested here. So if the close-up blocks are gone with this, it keeps the lit water that #1926 would trade away. (On this card the programs cost nothing measurable at this distance: #1926 comment.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sergiogbrox commented 2026-11-30 20:09:51 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by sergiogbrox on 2026-11-30T20:09:51Z.


A data point from a game run, for comparison with this PR's route.

I built v2026.11.30.03 with the water changes from the foxhound fork's 85b56b9 (readmet3xt-lab/foxhound, GPL-3.0, co-authored with xss3009) instead of this PR: every lane of the slab loop stores the column in 5dc3b25986622949 and 6f225b641c5b0708 (s_and_saveexec -> s_mov exec, VICTORY_WATER_ALL_WRITE), and GenerateTiles puts the local-light tiles in the plain list (VICTORY_WATER_LOCAL_PLAIN). That commit was checked only in a capture replay ("Not yet seen in a run of the game"), so this is its first run in the game that I know of.

RTX 5060 Ti 16 GB (32-lane), driver 621.40, Ryzen 7 5700X, Windows 11, 2560x1440, DLSS Balanced, frame generation 2x, VICTORY_WATER_LIGHT=1.

  • Both programs ran; the run logged pipeline failures: 0 host pipelines failed, 0 shaders do not translate.
  • Shoreline, open sea and the water close beside a boat: the water is lit and no dark blocks were seen. Not checked underwater.
  • Against .30.02 with the water light left out (the 32-lane default), from the same save, played freely (not a fixed route): median 18.1 fps in both, 10th percentile 14.6 against 14.1. This machine is CPU-bound (about 38 ms a frame preparing), so a GPU cost under that would not show here.

The cost of this route: the local-light tiles lose the local lights' glow in the water volume, because _Tiled_LocalLights still does not finish on 32 lanes there. If this PR's paired lowering makes _Tiled_LocalLights finish, it keeps that glow, so this is mostly useful as a second way to check the same blocks, close to a boat, where the check in the comment above could not get the camera. The build also carries foxhound 4ec928a (GpuParticleEmit _AttachMesh widened to 64), which does not touch water.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7290503175 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1935#issuecomment-7290503175). Originally posted by [sergiogbrox](https://github.com/sergiogbrox) on 2026-11-30T20:09:51Z. --- A data point from a game run, for comparison with this PR's route. I built `v2026.11.30.03` with the water changes from the foxhound fork's 85b56b9 (readmet3xt-lab/foxhound, GPL-3.0, co-authored with xss3009) instead of this PR: every lane of the slab loop stores the column in `5dc3b25986622949` and `6f225b641c5b0708` (`s_and_saveexec` -> `s_mov exec`, `VICTORY_WATER_ALL_WRITE`), and GenerateTiles puts the local-light tiles in the plain list (`VICTORY_WATER_LOCAL_PLAIN`). That commit was checked only in a capture replay ("Not yet seen in a run of the game"), so this is its first run in the game that I know of. RTX 5060 Ti 16 GB (32-lane), driver 621.40, Ryzen 7 5700X, Windows 11, 2560x1440, DLSS Balanced, frame generation 2x, `VICTORY_WATER_LIGHT=1`. - Both programs ran; the run logged `pipeline failures: 0 host pipelines failed, 0 shaders do not translate`. - Shoreline, open sea and the water close beside a boat: the water is lit and no dark blocks were seen. Not checked underwater. - Against `.30.02` with the water light left out (the 32-lane default), from the same save, played freely (not a fixed route): median 18.1 fps in both, 10th percentile 14.6 against 14.1. This machine is CPU-bound (about 38 ms a frame preparing), so a GPU cost under that would not show here. The cost of this route: the local-light tiles lose the local lights' glow in the water volume, because `_Tiled_LocalLights` still does not finish on 32 lanes there. If this PR's paired lowering makes `_Tiled_LocalLights` finish, it keeps that glow, so this is mostly useful as a second way to check the same blocks, close to a boat, where the check in the comment above could not get the camera. The build also carries foxhound 4ec928a (GpuParticleEmit `_AttachMesh` widened to 64), which does not touch water. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1935:upstream-pr/1935'
git switch 'upstream-pr/1935'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1935'
git switch 'upstream-pr/1935'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1935'
git switch 'upstream-pr/1935'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1935'
git switch 'main'
git merge --squash 'upstream-pr/1935'
git switch 'main'
git merge --ff-only 'upstream-pr/1935'
git switch 'main'
git merge 'upstream-pr/1935'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!1935
No description provided.