victory-gpu: settle ambient light mean by wall clock with jump snap #15

Merged
Androtim merged 1 commit from upstream-pr/15 into main 2026-11-28 18:44:17 +00:00
Androtim commented 2026-11-28 05:24:27 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T05:24:27Z.


## Summary
Adapts time-based indirect ambient settling from VIctory-7900XTX (b4ba4bb / 9576c45) into crates/victory-gpu/src/ambient.rs (preserving VICTORY_AMBIENT_ONCE, VICTORY_AMBIENT_SPECULAR, and magenta/violet probe filtering):

  • Adds VICTORY_AMBIENT_SETTLE=<ms>[,<jump>[,<fresh_s>]] (default 250,3; 0 restores per-frame 0.04 step) so the slow mean in mean() converges at the same wall-clock rate regardless of frame rate instead of taking 2-4 seconds at 7-13 fps.
  • Snaps immediately on large brightness changes (> jump ratio) and optionally ramps most over fresh seconds in raise() to prevent outdoor sky history bleeding into indoor rooms.
  • Expands b0 root constants from 12 to 15 words (jump, fresh, dt), keeping u1/u2 UAV layout unchanged.
  • Adds unit tests ambient::tests::settle_settings and ambient::tests::follow_is_frame_rate_independent alongside live D3D12 HLSL compile check the_passes_build.

Rig Specs Tested On

  • CPU: 13th Gen Intel(R) Core(TM) i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (Driver 32.0.16.2124, 8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Microsoft Windows 11 Home (Build 26300)

Run Settings & Profile

  • Build & Commit SHA: diag @ 5fcb838 (victory --release --features diagnostics)
  • Console Profile & Internal Resolution / Scale: series-s (0.6666667 internal scale)
  • Ray Tracing: off
  • Upscaling: DLSS quality (VICTORY_DLSS=1 VICTORY_DLSS_MODE=quality)
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: play.rs SETTINGS defaults (VICTORY_AMBIENT=0.8, VICTORY_AMBIENT_AIR=1.5, VICTORY_AMBIENT_SPECULAR=1, default VICTORY_AMBIENT_SETTLE=250,3)
  • Scene / Area & Session Length: Mission-1 golden save (dock -> balcony open world, 11,264 max draws/frame, 75s in-world window across 15 windows)

Measurements & Verification

  • Base FPS (without Frame Gen): 8.9-9.7 fps on steady balcony (103.2-112.6 ms, 1.0 ms total GPU across all passes including ambient); 6.2 fps overall median across the 15-window boot-overlap capture while background pipelines finished compiling (874 -> 274 being made; vs baseline-main 8.9 fps where only 248 remained at world entry)
  • Frame-Gen FPS (if enabled): N/A (off)
  • VRAM / RAM Usage: 6,041 MB peak VRAM / 6,940 MB budget (over = 0 MB, per memory of textures)
  • Texture Queue: 42,588 uploaded (1,884 MB), final waiting 4,740 (vs baseline-main 7,121), mapped() stall rate 21.56 ms/s (vs 26.99 ms/s)
  • Visual Check (24 sampled PNGs, 11 lit): median luma = 105.3 (vs 103.2), near_black = 0.0%, edge_energy = 6.92, magenta = 0.0%; confirmed the stand-in's mean of the light around settles by the clock (VICTORY_AMBIENT_SETTLE) ms=250.0 jump=3.0 fresh=0.0
  • Crashes / DRED Resets: 0 crashes, 0 no host texture errors
  • Automated Checks:
    • cargo +1.98.1-x86_64-pc-windows-gnu xtask policy (294 files ok)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask (6 passed)
    • 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-gpu (450 passed; 0 failed; 36 ignored)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5537030289 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/15). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T05:24:27Z. --- ## Summary Adapts time-based indirect ambient settling from `VIctory-7900XTX` (`b4ba4bb` / `9576c45`) into `crates/victory-gpu/src/ambient.rs` (preserving `VICTORY_AMBIENT_ONCE`, `VICTORY_AMBIENT_SPECULAR`, and magenta/violet probe filtering): - Adds `VICTORY_AMBIENT_SETTLE=<ms>[,<jump>[,<fresh_s>]]` (default `250,3`; `0` restores per-frame `0.04` step) so the slow mean in `mean()` converges at the same wall-clock rate regardless of frame rate instead of taking 2-4 seconds at 7-13 fps. - Snaps immediately on large brightness changes (> `jump` ratio) and optionally ramps `most` over `fresh` seconds in `raise()` to prevent outdoor sky history bleeding into indoor rooms. - Expands `b0` root constants from 12 to 15 words (`jump`, `fresh`, `dt`), keeping `u1`/`u2` UAV layout unchanged. - Adds unit tests `ambient::tests::settle_settings` and `ambient::tests::follow_is_frame_rate_independent` alongside live D3D12 HLSL compile check `the_passes_build`. ## Rig Specs Tested On - **CPU:** 13th Gen Intel(R) Core(TM) i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (Driver 32.0.16.2124, 8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Microsoft Windows 11 Home (Build 26300) ## Run Settings & Profile - **Build & Commit SHA:** `diag` @ `5fcb838` (`victory --release --features diagnostics`) - **Console Profile & Internal Resolution / Scale:** `series-s` (`0.6666667` internal scale) - **Ray Tracing:** `off` - **Upscaling:** `DLSS quality` (`VICTORY_DLSS=1 VICTORY_DLSS_MODE=quality`) - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `play.rs` `SETTINGS` defaults (`VICTORY_AMBIENT=0.8`, `VICTORY_AMBIENT_AIR=1.5`, `VICTORY_AMBIENT_SPECULAR=1`, default `VICTORY_AMBIENT_SETTLE=250,3`) - **Scene / Area & Session Length:** Mission-1 golden save (dock -> balcony open world, 11,264 max draws/frame, 75s in-world window across 15 windows) ## Measurements & Verification - **Base FPS (without Frame Gen):** `8.9-9.7 fps` on steady balcony (`103.2-112.6 ms`, `1.0 ms` total GPU across all passes including ambient); `6.2 fps` overall median across the 15-window boot-overlap capture while background pipelines finished compiling (`874 -> 274` being made; vs `baseline-main` `8.9 fps` where only `248` remained at world entry) - **Frame-Gen FPS (if enabled):** N/A (off) - **VRAM / RAM Usage:** `6,041 MB` peak VRAM / `6,940 MB` budget (`over = 0 MB`, per `memory of textures`) - **Texture Queue:** `42,588` uploaded (`1,884 MB`), final waiting `4,740` (vs `baseline-main` `7,121`), `mapped()` stall rate `21.56 ms/s` (vs `26.99 ms/s`) - **Visual Check (24 sampled PNGs, 11 lit):** `median luma = 105.3` (vs `103.2`), `near_black = 0.0%`, `edge_energy = 6.92`, `magenta = 0.0%`; confirmed `the stand-in's mean of the light around settles by the clock (VICTORY_AMBIENT_SETTLE) ms=250.0 jump=3.0 fresh=0.0` - **Crashes / DRED Resets:** `0` crashes, `0` `no host texture` errors - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu xtask policy` (`294 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask` (`6 passed`) - [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-gpu` (`450 passed; 0 failed; 36 ignored`)
Androtim commented 2026-11-28 06:04:11 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T06:04:11Z.


Automated triage for the maintainers (not an approval).

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

Review Summary

Clean, tightly scoped port of wall-clock ambient mean settling and brightness-jump snapping into crates/victory-gpu/src/ambient.rs.

  • HLSL & D3D12 ABI: Root signature (RootConstants(num32BitConstants=15, b0)), cbuffer Set layout (jump, fresh, dt), and SetComputeRoot32BitConstants(0, 15, ...) in after() all match. Verified that clear_air (L328), reflect_light (L381), and raise (L462) only read cells[CELLS].rgb, so repurposing cells[CELLS].a as seconds-since-jump (age) does not break other passes.
  • Logic & Preserved Behavior: VICTORY_AMBIENT_ONCE, VICTORY_AMBIENT_SPECULAR, and the magenta/violet probe filters in raise() remain intact. Default VICTORY_AMBIENT_SETTLE=250,3 keeps fresh=0.0, while VICTORY_AMBIENT_SETTLE=0 restores the 0.04 per-frame step.
  • Tests & CI: CI is passing; settle_settings and follow_is_frame_rate_independent cover parsing and frame-rate independence alongside the_passes_build.

Non-blocking Nit

  • In after(), follow(role) calls frame_ms(role) for words[8] and then words[14] calls frame_ms(role) a second time. Although ASKED.swap(now, Relaxed) == now usually deduplicates the second call, a 1 ms clock tick between those two lines will overwrite LAST/DT with 1.0 ms for that frame. Computing let dt_ms = frame_ms(role); once in after() (using follow_for(dt_ms, settle) and dt_ms / 1000.0) avoids the double call and millisecond-boundary race.

Verdict

needs-gpu-test — This changes HLSL compute shaders (mean, raise), the compute root signature, and default ambient settling behavior (250,3 when unset), so a local real-GPU smoke test is warranted before merging.


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7235059847 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/15#issuecomment-7235059847). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T06:04:11Z. --- <!-- minivi-triage v1 head=5fcb838e8aa87246eb60a78b325bc9e0db4eafec verdict=needs-gpu-test ci=passing at=2026-11-28T06:04:38Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary Clean, tightly scoped port of wall-clock ambient mean settling and brightness-jump snapping into `crates/victory-gpu/src/ambient.rs`. - **HLSL & D3D12 ABI:** Root signature (`RootConstants(num32BitConstants=15, b0)`), `cbuffer Set` layout (`jump`, `fresh`, `dt`), and `SetComputeRoot32BitConstants(0, 15, ...)` in `after()` all match. Verified that `clear_air` (`L328`), `reflect_light` (`L381`), and `raise` (`L462`) only read `cells[CELLS].rgb`, so repurposing `cells[CELLS].a` as seconds-since-jump (`age`) does not break other passes. - **Logic & Preserved Behavior:** `VICTORY_AMBIENT_ONCE`, `VICTORY_AMBIENT_SPECULAR`, and the magenta/violet probe filters in `raise()` remain intact. Default `VICTORY_AMBIENT_SETTLE=250,3` keeps `fresh=0.0`, while `VICTORY_AMBIENT_SETTLE=0` restores the `0.04` per-frame step. - **Tests & CI:** CI is passing; `settle_settings` and `follow_is_frame_rate_independent` cover parsing and frame-rate independence alongside `the_passes_build`. ### Non-blocking Nit - In `after()`, `follow(role)` calls `frame_ms(role)` for `words[8]` and then `words[14]` calls `frame_ms(role)` a second time. Although `ASKED.swap(now, Relaxed) == now` usually deduplicates the second call, a 1 ms clock tick between those two lines will overwrite `LAST`/`DT` with `1.0` ms for that frame. Computing `let dt_ms = frame_ms(role);` once in `after()` (using `follow_for(dt_ms, settle)` and `dt_ms / 1000.0`) avoids the double call and millisecond-boundary race. ### Verdict **`needs-gpu-test`** — This changes HLSL compute shaders (`mean`, `raise`), the compute root signature, and default ambient settling behavior (`250,3` when unset), so a local real-GPU smoke test is warranted before merging. --- _Generated with Antigravity CLI (`agy`)._
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
Androtim/MiniVI!15
No description provided.