shader(water): give each lane its own tile list slot on 32-lane waves #49

Closed
github-bot wants to merge 1 commit from gh-pr/49/head into gh-pr/49/base
Owner

@⁠Androtim on GitHub · 2026-11-28 14:17 UTC · original
Androtim:feat/iter63-water-tile-slots → main · +187 −2 · 4 files · 1 commits · closed without merging

Summary

Ports fxceless/victory-fork@cd93552 ("Open water without dark patches: the water light's tile lists take a slot a lane", after xss3009's fix in VIctory-NVIDIA 69e7e00) and keys the shader cache on VICTORY_WATER_TILE_SLOTS:

  • water_tile_slots.rs: Matches water_shading:CS_TransmissionVolumetrics_GenerateTiles by container digest (f5d10cde74333782f30f9bb556c073d4), program size (2112 bytes), and FNV-1a code hash, rewriting both the unlit-tile and lit-tile append blocks on 32-lane hosts so every lane atomic-adds 1 to obtain its own slot instead of exchanging half-wave masks via group memory (which overwrote first-wave tiles and left dark 16x16 water blocks around piers and boats). Opt-out via VICTORY_WATER_TILE_SLOTS=0. Includes 2 unit tests.
  • emit/mod.rs & translate.rs: Add pub fn host_form(c: &Container, native: &mut NativeProgram) -> bool and run it before translation and offline DXIL listing.
  • shader_cache.rs: Include VICTORY_WATER_TILE_SLOTS in the shader cache translation key so toggled runs never collide on disk.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 (Build 26300) / NVIDIA Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: release & diagnostics release builds @ 49ddc6f (CARGO_TARGET_DIR=D:\victory-build\minivi, RUSTFLAGS="-C link-self-contained=yes")
  • Console Profile & Internal Resolution / Scale: series-s — 720p
  • Ray Tracing: off (ambient_specular_active=true)
  • Upscaling: DLSS quality
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: D:\victory-build\verify-tools\verify-world.ps1 (matching apps/victory/src/play.rs SETTINGS + VICTORY_D3D12_DRED=light, VICTORY_CARD_ACCOUNTING=1, VICTORY_CAPTURE_WORLD=1)
  • Scene / Area & Session Length: Opening canal pier / open-world balcony (max_draws=11246, world_windows=16), 75 seconds in-world capture (D:\victory-data\verify-runs\pr49-water-tile-slots)

Measurements & Verification

  • Base FPS (without Frame Gen): 11.15 fps median (9.9 fps mean, 1.4 fps min, 90.0 ms median frame time; +2.25 fps vs baseline-main 8.9 fps)
  • Frame-Gen FPS (if enabled): off
  • VRAM / RAM Usage: 5751.5 MB median / 5779 MB peak VRAM against 6889 MB min DXGI budget (0 MB over budget, room_false=8.3%, -85 MB peak vs baseline-main 5864 MB); texture queue 44363 uploaded, 1819 final waiting (-5302 vs baseline-main 7121)
  • Visuals (24 captured PNGs): 19/24 lit, median luma 104.7 (+1.50 vs baseline-main 103.2), edge energy 7.04, 0.0% magenta / cyan; inspected frame-6888.png & frame-7842.png showing smooth water lighting along the pier and open sea with no dark tile patches
  • Residency & Crashes / DRED Resets: 0 crashes, 0 no_host_texture errors, mapped() rate 36.93 ms/world_sec (39000 calls, 3596.3 ms, max 30.3 ms), all 11/11 verify-world gates PASS
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (298 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib water_tile_slots (2 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib wave64_tests (12 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib shader_cache (2 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory --bin victory (23 passed; 0 failed)
    • cargo +1.98.1-x86_64-pc-windows-gnu build -p victory --release + objdump -p (0 non-system MinGW DLLs) & --features diagnostics --release
**@⁠Androtim** on GitHub · 2026-11-28 14:17 UTC · [original](https://github.com/Androtim/MiniVI/pull/49) `Androtim:feat/iter63-water-tile-slots` → `main` · +187 −2 · 4 files · 1 commits · closed without merging ## Summary Ports `fxceless/victory-fork@cd93552` (*"Open water without dark patches: the water light's tile lists take a slot a lane"*, after xss3009's fix in `VIctory-NVIDIA` `69e7e00`) and keys the shader cache on `VICTORY_WATER_TILE_SLOTS`: - **[`water_tile_slots.rs`](file:///crates/victory-shader/src/emit/water_tile_slots.rs)**: Matches `water_shading:CS_TransmissionVolumetrics_GenerateTiles` by container digest (`f5d10cde74333782f30f9bb556c073d4`), program size (`2112` bytes), and FNV-1a code hash, rewriting both the unlit-tile and lit-tile append blocks on 32-lane hosts so every lane atomic-adds `1` to obtain its own slot instead of exchanging half-wave masks via group memory (which overwrote first-wave tiles and left dark 16x16 water blocks around piers and boats). Opt-out via `VICTORY_WATER_TILE_SLOTS=0`. Includes 2 unit tests. - **[`emit/mod.rs`](file:///crates/victory-shader/src/emit/mod.rs)** & **[`translate.rs`](file:///apps/victory/src/translate.rs)**: Add `pub fn host_form(c: &Container, native: &mut NativeProgram) -> bool` and run it before translation and offline DXIL listing. - **[`shader_cache.rs`](file:///crates/victory-gpu/src/shader_cache.rs)**: Include `VICTORY_WATER_TILE_SLOTS` in the shader cache translation key so toggled runs never collide on disk. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 (Build 26300) / NVIDIA Driver `32.0.16.2124` ## Run Settings & Profile - **Build & Commit SHA:** `release` & `diagnostics` release builds @ `49ddc6f` (`CARGO_TARGET_DIR=D:\victory-build\minivi`, `RUSTFLAGS="-C link-self-contained=yes"`) - **Console Profile & Internal Resolution / Scale:** `series-s` — `720p` - **Ray Tracing:** `off` (`ambient_specular_active=true`) - **Upscaling:** `DLSS quality` - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `D:\victory-build\verify-tools\verify-world.ps1` (matching `apps/victory/src/play.rs` `SETTINGS` + `VICTORY_D3D12_DRED=light`, `VICTORY_CARD_ACCOUNTING=1`, `VICTORY_CAPTURE_WORLD=1`) - **Scene / Area & Session Length:** Opening canal pier / open-world balcony (`max_draws=11246`, `world_windows=16`), 75 seconds in-world capture (`D:\victory-data\verify-runs\pr49-water-tile-slots`) ## Measurements & Verification - **Base FPS (without Frame Gen):** `11.15 fps` median (`9.9 fps` mean, `1.4 fps` min, `90.0 ms` median frame time; `+2.25 fps` vs `baseline-main` `8.9 fps`) - **Frame-Gen FPS (if enabled):** off - **VRAM / RAM Usage:** `5751.5 MB` median / `5779 MB` peak VRAM against `6889 MB` min DXGI budget (`0 MB` over budget, `room_false=8.3%`, `-85 MB` peak vs `baseline-main` `5864 MB`); texture queue `44363` uploaded, `1819` final waiting (`-5302` vs `baseline-main` `7121`) - **Visuals (24 captured PNGs):** `19/24` lit, median luma `104.7` (`+1.50` vs `baseline-main` `103.2`), edge energy `7.04`, `0.0%` magenta / cyan; inspected `frame-6888.png` & `frame-7842.png` showing smooth water lighting along the pier and open sea with no dark tile patches - **Residency & Crashes / DRED Resets:** `0` crashes, `0` `no_host_texture` errors, `mapped()` rate `36.93 ms/world_sec` (`39000` calls, `3596.3 ms`, max `30.3 ms`), all `11/11` `verify-world` gates **PASS** - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`298 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask` (`6 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib water_tile_slots` (`2 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-shader --lib wave64_tests` (`12 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib shader_cache` (`2 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory --bin victory` (`23 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu build -p victory --release` + `objdump -p` (`0` non-system MinGW DLLs) & `--features diagnostics --release`
Ports fxceless/victory-fork@cd93552 (after xss3009's fix in VIctory-NVIDIA 69e7e00):
- water_tile_slots.rs: match water_shading:CS_TransmissionVolumetrics_GenerateTiles (container f5d10cde74333782f30f9bb556c073d4, FNV-1a verified) and rewrite its front/back list appends to atomic-add 1 per lane rather than rank-exchanging across two 32-lane waves.
- emit/mod.rs & apps/victory/src/translate.rs: add host_form() before translation and offline DXIL listing (VICTORY_WATER_TILE_SLOTS=0 opt-out).
- shader_cache.rs: hash VICTORY_WATER_TILE_SLOTS into the shader cache translation key.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:04:41 +00:00
github-bot closed this pull request 2026-12-01 20:04:41 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 18:48 UTC · original

Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Summary

Clean, tightly scoped PR that rewrites the two tile-list append blocks of water_shading:CS_TransmissionVolumetrics_GenerateTiles on 32-lane wave hosts (lower::host_max_wave() == 32) so each lane performs its own buffer_atomic_add of 1 instead of exchanging half-wave masks through group memory.

Review Notes

  • Safety & scoping (crates/victory-shader/src/emit/water_tile_slots.rs): The rewrite is gated by container digest (CONTAINER), HwStage::Cs, native.wave64, exact byte length (2112), and 64-bit FNV-1a hash (0x377a_8d97_4fb8_631f), so unrelated shaders cannot be modified. Both FRONT (0x6a8..0x704) and BACK (0x70c..0x774) preserve total length and pad trailing dwords with s_nop (0xbf80_0000), keeping surrounding branch targets intact.
  • Wiring & cache keying:
    • victory_shader::emit::host_form is applied consistently in both crates/victory-shader/src/emit/mod.rs (translate_plain) and apps/victory/src/translate.rs (translate).
    • crates/victory-gpu/src/shader_cache.rs (build) adds VICTORY_WATER_TILE_SLOTS to the translation key alongside host_settings(), preventing cache collisions when toggling VICTORY_WATER_TILE_SLOTS=0.
  • Minor non-blocking note: In water_tile_slots::tests::an_append_becomes_one_add_a_lane_and_keeps_its_length, the rewrite loop is duplicated inline rather than calling a shared inner helper (e.g., apply_rewrite(&mut code)), so the test verifies the constants/layout but not the production loop body directly.

Verdict

Logic, cache keying, and CI look solid. Because this changes default shader translation behavior on 32-lane wave GPUs, it is marked needs-gpu-test for an independent local real-GPU visual/stability verification before merging.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-28 18:48 UTC · [original](https://github.com/Androtim/MiniVI/pull/49#issuecomment-7244066083) <!-- minivi-triage v1 head=49ddc6f25d206ad64e30306936fc287001bdcdc7 verdict=needs-gpu-test ci=passing at=2026-11-28T18:48:40Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Summary Clean, tightly scoped PR that rewrites the two tile-list append blocks of `water_shading:CS_TransmissionVolumetrics_GenerateTiles` on 32-lane wave hosts (`lower::host_max_wave() == 32`) so each lane performs its own `buffer_atomic_add` of `1` instead of exchanging half-wave masks through group memory. ### Review Notes - **Safety & scoping (`crates/victory-shader/src/emit/water_tile_slots.rs`)**: The rewrite is gated by container digest (`CONTAINER`), `HwStage::Cs`, `native.wave64`, exact byte length (`2112`), and 64-bit FNV-1a hash (`0x377a_8d97_4fb8_631f`), so unrelated shaders cannot be modified. Both `FRONT` (`0x6a8..0x704`) and `BACK` (`0x70c..0x774`) preserve total length and pad trailing dwords with `s_nop` (`0xbf80_0000`), keeping surrounding branch targets intact. - **Wiring & cache keying**: - `victory_shader::emit::host_form` is applied consistently in both `crates/victory-shader/src/emit/mod.rs` (`translate_plain`) and `apps/victory/src/translate.rs` (`translate`). - `crates/victory-gpu/src/shader_cache.rs` (`build`) adds `VICTORY_WATER_TILE_SLOTS` to the translation key alongside `host_settings()`, preventing cache collisions when toggling `VICTORY_WATER_TILE_SLOTS=0`. - **Minor non-blocking note**: In `water_tile_slots::tests::an_append_becomes_one_add_a_lane_and_keeps_its_length`, the rewrite loop is duplicated inline rather than calling a shared inner helper (e.g., `apply_rewrite(&mut code)`), so the test verifies the constants/layout but not the production loop body directly. ### Verdict Logic, cache keying, and CI look solid. Because this changes default shader translation behavior on 32-lane wave GPUs, it is marked **`needs-gpu-test`** for an independent local real-GPU visual/stability verification before merging. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 21:18 UTC · original

Closing as superseded duplicate of merged PR #2.

**@⁠Androtim** on GitHub · 2026-11-28 21:18 UTC · [original](https://github.com/Androtim/MiniVI/pull/49#issuecomment-7245921407) Closing as superseded duplicate of merged PR #2.

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/Androtim--MiniVI!49
No description provided.