victory-gpu: add VICTORY_AMBIENT_FLOOR and NaN/Inf guard in ambient pass #69

Manually merged
github merged 1 commit from gh-pr/69/head into gh-pr/69/base 2026-12-01 20:06:27 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-28 20:18 UTC · original
Androtim:feat/iter83-ambient-floor → main · +43 −4 · 1 files · 1 commits · merged 2026-11-29 04:46 UTC

Summary

  • Ported ambient pass safety and floor clamping from Hasusmogus/cool_fox@ba096f8 in crates/victory-gpu/src/ambient.rs:
    • Added parse_floor and floor() (VICTORY_AMBIENT_FLOOR, defaults to 0.0 so default look is unchanged unless explicitly opted in).
    • Expanded Set root constants from 15 to 16 dwords (fill in slot 15 on Role::Resolve).
    • Added an IEEE float bit-mask NaN/Inf guard on shader-read ambient hit values (any((asuint(found) & 0x7f800000u) == 0x7f800000u) ? 0.0 : max(found, 0.0)) plus max(found, float3(1.0, 0.98, 0.94) * fill * open) clamping.
    • Added floor_settings unit test covering default (0), custom values, and clamping.
  • Automated verification:
    • xtask policy: 299 files ok
    • xtask tests: 6 passed; 0 failed
    • clippy (default and --features diagnostics): 0 warnings
    • victory-gpu ambient::tests: 8 passed; 0 failed (includes floor_settings and the_passes_build)
    • Plain --release -p victory --bin victory + objdump -p: clean build, Windows system DLLs only
  • Commit: 6c288db

Rig Specs Tested On

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

Run Settings & Profile

  • Binary: --features diagnostics --release (D:\victory-data\verify-runs\pr69-ambient-floor-r2)
  • Profile: verify-world.ps1 75s live open-world GPU soak with default VICTORY_AMBIENT_FLOOR=0 and VICTORY_CACHE_DIR=D:\victory-data\cache-minivi

Measurements & Verification

  • Live 75s GPU verification (pr69-ambient-floor-r2, first_world_frame=8546): 11/11 gates PASS
    • Performance: 11.3 fps median (9.96 fps mean, 0.7 fps min), 88.55 ms median frame time (preparing 43.65 ms, GPU 1.35 ms, copyback 7.25 ms, max_draws=11479 across 16 windows; +2.40 fps vs 8.9 fps baseline)
    • Memory: 5785 MB max VRAM (5757 MB median) / 6839 MB min budget (0 MB over budget; -79 MB vs 5864 MB baseline)
    • Streaming & pipelines: 43759 textures uploaded, 1884 final waiting textures (-5237 vs 7121 baseline), 260.5 median pipeline drops (261.0 baseline), mapped() rate 29.48 ms/s (longest 31.5 ms)
    • Visual & stability: 20/24 lit PNGs (luma=105.09, edge_energy=7.0, near_black=1.44%, magenta=0.0%), 0 crashes (no_host_texture_errors=0, untranslated_shaders=2); inspected frame-8578.png and frame-9226.png — sharp deck/under-deck lighting, glass reflections, water, and UI with zero artifacts.
    • Note: run 1 (pr69-ambient-floor) passed 10/11 gates (10.8 fps, 5847 MB VRAM) with transient 274 pipeline drops vs 261.0 baseline (stderr.log confirmed RT-off skips and 214 clean CS_RayMiss ambient dispatches); clean rerun pr69-ambient-floor-r2 passed all 11/11 gates.
**@⁠Androtim** on GitHub · 2026-11-28 20:18 UTC · [original](https://github.com/Androtim/MiniVI/pull/69) `Androtim:feat/iter83-ambient-floor` → `main` · +43 −4 · 1 files · 1 commits · merged 2026-11-29 04:46 UTC ## Summary - Ported ambient pass safety and floor clamping from `Hasusmogus/cool_fox@ba096f8` in `crates/victory-gpu/src/ambient.rs`: - Added `parse_floor` and `floor()` (`VICTORY_AMBIENT_FLOOR`, defaults to `0.0` so default look is unchanged unless explicitly opted in). - Expanded `Set` root constants from `15` to `16` dwords (`fill` in slot 15 on `Role::Resolve`). - Added an IEEE float bit-mask NaN/Inf guard on shader-read ambient hit values (`any((asuint(found) & 0x7f800000u) == 0x7f800000u) ? 0.0 : max(found, 0.0)`) plus `max(found, float3(1.0, 0.98, 0.94) * fill * open)` clamping. - Added `floor_settings` unit test covering default (`0`), custom values, and clamping. - Automated verification: - `xtask policy`: `299 files ok` - `xtask` tests: `6 passed; 0 failed` - `clippy` (default and `--features diagnostics`): 0 warnings - `victory-gpu` `ambient::tests`: `8 passed; 0 failed` (includes `floor_settings` and `the_passes_build`) - Plain `--release -p victory --bin victory` + `objdump -p`: clean build, Windows system DLLs only - Commit: `6c288db` ## Rig Specs Tested On - CPU: `Intel Core i7-13700F` - GPU: `NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)` - RAM: `32 GiB` - OS / Driver: `Windows 11 Build 26300`, NVIDIA driver `32.0.16.2124` ## Run Settings & Profile - Binary: `--features diagnostics --release` (`D:\victory-data\verify-runs\pr69-ambient-floor-r2`) - Profile: `verify-world.ps1` 75s live open-world GPU soak with default `VICTORY_AMBIENT_FLOOR=0` and `VICTORY_CACHE_DIR=D:\victory-data\cache-minivi` ## Measurements & Verification - Live 75s GPU verification (`pr69-ambient-floor-r2`, `first_world_frame=8546`): **11/11 gates PASS** - Performance: `11.3 fps` median (`9.96 fps` mean, `0.7 fps` min), `88.55 ms` median frame time (`preparing 43.65 ms`, `GPU 1.35 ms`, `copyback 7.25 ms`, `max_draws=11479` across `16` windows; `+2.40 fps` vs `8.9 fps` baseline) - Memory: `5785 MB` max VRAM (`5757 MB` median) / `6839 MB` min budget (`0 MB` over budget; `-79 MB` vs `5864 MB` baseline) - Streaming & pipelines: `43759` textures uploaded, `1884` final waiting textures (`-5237` vs `7121` baseline), `260.5` median pipeline drops (`261.0` baseline), `mapped()` rate `29.48 ms/s` (longest `31.5 ms`) - Visual & stability: `20/24` lit PNGs (`luma=105.09`, `edge_energy=7.0`, `near_black=1.44%`, `magenta=0.0%`), `0` crashes (`no_host_texture_errors=0`, `untranslated_shaders=2`); inspected `frame-8578.png` and `frame-9226.png` — sharp deck/under-deck lighting, glass reflections, water, and UI with zero artifacts. - Note: run 1 (`pr69-ambient-floor`) passed 10/11 gates (`10.8 fps`, `5847 MB` VRAM) with transient `274` pipeline drops vs `261.0` baseline (`stderr.log` confirmed RT-off skips and 214 clean `CS_RayMiss` ambient dispatches); clean rerun `pr69-ambient-floor-r2` passed all 11/11 gates.
Ported from Hasusmogus/cool_fox@ba096f8: expands ambient resolve root constants to 16 dwords, sanitizes NaN/Inf from shader-read hit buffer, and clamps ambient floor via VICTORY_AMBIENT_FLOOR (0 by default).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:06:24 +00:00
github manually merged commit 6c288dbbcd into gh-pr/69/base 2026-12-01 20:06:27 +00:00
Author
Owner

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

Automated triage for the maintainers (not an approval).

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

Review Summary

Clean, minimal port of VICTORY_AMBIENT_FLOOR and the IEEE-754 bit-mask NaN/Inf guard in crates/victory-gpu/src/ambient.rs.

  • Root constants & shader wiring (SOURCE, after): RS, cbuffer Set, words, and SetComputeRoot32BitConstants are all consistently expanded from 15 to 16 dwords (total root signature size 22 dwords, well within D3D12's 64-dword limit). words[15] (fill) is populated from floor().to_bits() for Role::Resolve and remains 0.0 for other roles.
  • Shader logic (raise):
    • any((asuint(found) & 0x7f800000u) == 0x7f800000u) ? 0.0 : max(found, 0.0) reliably filters NaN/Inf and negatives without relying on fast-math isnan/isinf.
    • max(found, float3(1.0, 0.98, 0.94) * fill * open) matches the constant stand-in tint and is a no-op when VICTORY_AMBIENT_FLOOR is unset/0.
  • Parsing & tests (parse_floor, floor, floor_settings): Rejects empty, non-positive, NaN, and Inf inputs; unit tests cover these cases.
  • Minor nit: parse_floor and floor were inserted between air()'s doc comment (/// The most the air scatters...) and fn air() -> f32, attaching air()'s doc comment to parse_floor instead of air. Moving parse_floor/floor above air()'s doc comment (or below air()) will keep the docs aligned.

Since this modifies the ambient.rs HLSL compute shader and D3D12 root signature (and the PR's soak run only exercised the default VICTORY_AMBIENT_FLOOR=0 path), flagging for a quick local GPU smoke test including a non-zero VICTORY_AMBIENT_FLOOR check before merge.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-28 21:03 UTC · [original](https://github.com/Androtim/MiniVI/pull/69#issuecomment-7245734741) <!-- minivi-triage v1 head=6c288dbbcd0ecd453292a312af8221ea7d4467cd verdict=needs-gpu-test ci=passing at=2026-11-28T21:03:27Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary Clean, minimal port of `VICTORY_AMBIENT_FLOOR` and the IEEE-754 bit-mask NaN/Inf guard in `crates/victory-gpu/src/ambient.rs`. - **Root constants & shader wiring (`SOURCE`, `after`)**: `RS`, `cbuffer Set`, `words`, and `SetComputeRoot32BitConstants` are all consistently expanded from `15` to `16` dwords (total root signature size 22 dwords, well within D3D12's 64-dword limit). `words[15]` (`fill`) is populated from `floor().to_bits()` for `Role::Resolve` and remains `0.0` for other roles. - **Shader logic (`raise`)**: - `any((asuint(found) & 0x7f800000u) == 0x7f800000u) ? 0.0 : max(found, 0.0)` reliably filters NaN/Inf and negatives without relying on fast-math `isnan`/`isinf`. - `max(found, float3(1.0, 0.98, 0.94) * fill * open)` matches the constant stand-in tint and is a no-op when `VICTORY_AMBIENT_FLOOR` is unset/`0`. - **Parsing & tests (`parse_floor`, `floor`, `floor_settings`)**: Rejects empty, non-positive, NaN, and Inf inputs; unit tests cover these cases. - **Minor nit**: `parse_floor` and `floor` were inserted between `air()`'s doc comment (`/// The most the air scatters...`) and `fn air() -> f32`, attaching `air()`'s doc comment to `parse_floor` instead of `air`. Moving `parse_floor`/`floor` above `air()`'s doc comment (or below `air()`) will keep the docs aligned. Since this modifies the `ambient.rs` HLSL compute shader and D3D12 root signature (and the PR's soak run only exercised the default `VICTORY_AMBIENT_FLOOR=0` path), flagging for a quick local GPU smoke test including a non-zero `VICTORY_AMBIENT_FLOOR` check before merge. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 04:46 UTC · original

Automated RTX 4060 Ti 8 GB A/B hardware verification passed (playtest/wave2 vs origin/main 1ab5d84):

  • Hardware cargo test (RTX 4060 Ti): victory-shader lds_sub (1/1), emit::wave64_tests (14/14), victory-gpu (505/505) — 520 passed, 0 failed.
  • Automated 45s in-world A/B (scripts/verify-world.ps1, DLSS Quality + golden autosave):
    • FPS: 13.45 fps (77.25 ms) vs 3.20 fps (308.8 ms) baseline (+10.25 fps / 4.2x faster)
    • Draws: max_draws=3122 vs 2994
    • Stability: 0 crashes / 0 DRED
    • VRAM: 6174 / 6903 MB (-25 MB vs baseline, 0 MB over budget)
    • Texture backlog: final_waiting=7638 vs 12258 (-4620)
    • Visual check: Clean rendered frames (frame-7969.png, frame-8409.png), no regressions vs origin/main.
**@⁠Androtim** on GitHub · 2026-11-29 04:46 UTC · [original](https://github.com/Androtim/MiniVI/pull/69#issuecomment-7250855872) Automated RTX 4060 Ti 8 GB A/B hardware verification passed (`playtest/wave2` vs `origin/main` `1ab5d84`): - **Hardware `cargo test` (RTX 4060 Ti):** `victory-shader` `lds_sub` (1/1), `emit::wave64_tests` (14/14), `victory-gpu` (505/505) — **520 passed, 0 failed**. - **Automated 45s in-world A/B (`scripts/verify-world.ps1`, DLSS Quality + golden autosave):** - **FPS:** **13.45 fps** (`77.25 ms`) vs **3.20 fps** (`308.8 ms`) baseline (**+10.25 fps / 4.2x faster**) - **Draws:** `max_draws=3122` vs `2994` - **Stability:** `0` crashes / `0` DRED - **VRAM:** `6174 / 6903 MB` (`-25 MB` vs baseline, `0 MB` over budget) - **Texture backlog:** `final_waiting=7638` vs `12258` (`-4620`) - **Visual check:** Clean rendered frames (`frame-7969.png`, `frame-8409.png`), no regressions vs `origin/main`.
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!69
No description provided.