fix(descriptor): honor VICTORY_DYNAMIC_SLOTS on PORTABLE_VIEWS hosts and port VICTORY_RAW_VIEW_CLAMP #255

Open
github-bot wants to merge 1 commit from github-bot/gh-255 into main AGit
Owner

@⁠Vladimir-Human on GitHub · 2026-11-27 12:31 UTC · original
Vladimir-Human:fix/nvidia-dynamic-slots-and-foliage-chroma → main · +828 −27 · 3 files · 1 commits · open

Summary

Scoped strictly to descriptor-heap dynamic slot sizing and OOB raw buffer view clamping (the ambient chromatic scrub was split out into a separate opt-in PR per review feedback; related to #168):

  1. Fix dynamic_slots() off-by-one on PORTABLE_VIEWS-capped hosts (descriptor/host.rs):
    • On NVIDIA (probe_view_limit -> PORTABLE_VIEWS = 1_000_000), null == 999_999 < PORTABLE_VIEWS, so the previous if null < PORTABLE_VIEWS { return DYNAMIC; } branch unconditionally ignored VICTORY_DYNAMIC_SLOTS and hard-capped dynamic slots at 262,144 (causing DynamicDescriptorTable draw drops under heavy frame demand in #168).
    • dynamic_slots_for now honors explicit VICTORY_DYNAMIC_SLOTS up to PORTABLE_DYNAMIC_CAP (524,288, preserving at least 475,711 title slots and preventing null - extra underflow) and uses spare headroom without shrinking count when unset.
    • Added pure unit tests and a live HostHeap::new subprocess regression test (VICTORY_DYNAMIC_SLOTS=393216).
  2. Port VICTORY_RAW_VIEW_CLAMP (VIctory-NVIDIA aec85ef) + diagnostics meter (host.rs):
    • Bounds raw SRV/UAV buffer views (raw_view_range, raw_at, raw_uav_at) against the backing resource size and 16-byte alignment, substituting safe null raw descriptors for past-end/unaligned/empty views and shortening tail-straddling views (with VICTORY_RAW_VIEW_CLAMP=0 kill-switch).
    • Added D3D12 hardware + WARP compute dispatch tests verifying exact SRV loads, UAV writes, per-reason clamp counters, and zero D3D12 debug layer errors.

Changed Files

  • crates/victory-gpu/src/descriptor/host.rs: dynamic_slots_for fix, VICTORY_RAW_VIEW_CLAMP, unit + HostHeap::new + HW/WARP OOB clamp tests.
  • crates/victory-gpu/src/host.rs: raw_view_clamps diagnostics frame-line counter.
  • crates/victory-gpu/src/indirect.rs: #[cfg(test)] pub(crate) visibility on WarpHarness::on for test reuse.

Verification

Verified on local D3D12 hardware (NVIDIA GeForce RTX 4070 SUPER) and WARP (VICTORY_D3D12_DEBUG=1, --test-threads=1, 0 D3D12 debug errors):

  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings (default & --features diagnostics): 0 warnings.
  • cargo test -p victory-gpu --locked descriptor::host::tests -- --test-threads=1: 57/57 passed (default & diagnostics, hardware + WARP).
  • cargo run -p xtask --locked -- policy & cargo test -p xtask --locked: 11/11 passed.
**@⁠Vladimir-Human** on GitHub · 2026-11-27 12:31 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/255) `Vladimir-Human:fix/nvidia-dynamic-slots-and-foliage-chroma` → `main` · +828 −27 · 3 files · 1 commits · open ## Summary Scoped strictly to descriptor-heap dynamic slot sizing and OOB raw buffer view clamping (the ambient chromatic scrub was split out into a separate opt-in PR per review feedback; related to #168): 1. **Fix `dynamic_slots()` off-by-one on `PORTABLE_VIEWS`-capped hosts (`descriptor/host.rs`):** - On NVIDIA (`probe_view_limit` -> `PORTABLE_VIEWS = 1_000_000`), `null == 999_999 < PORTABLE_VIEWS`, so the previous `if null < PORTABLE_VIEWS { return DYNAMIC; }` branch unconditionally ignored `VICTORY_DYNAMIC_SLOTS` and hard-capped dynamic slots at `262,144` (causing `DynamicDescriptorTable` draw drops under heavy frame demand in #168). - `dynamic_slots_for` now honors explicit `VICTORY_DYNAMIC_SLOTS` up to `PORTABLE_DYNAMIC_CAP` (`524,288`, preserving at least `475,711` title slots and preventing `null - extra` underflow) and uses spare headroom without shrinking `count` when unset. - Added pure unit tests and a live `HostHeap::new` subprocess regression test (`VICTORY_DYNAMIC_SLOTS=393216`). 2. **Port `VICTORY_RAW_VIEW_CLAMP` (`VIctory-NVIDIA` `aec85ef`) + diagnostics meter (`host.rs`):** - Bounds raw SRV/UAV buffer views (`raw_view_range`, `raw_at`, `raw_uav_at`) against the backing resource size and 16-byte alignment, substituting safe null raw descriptors for past-end/unaligned/empty views and shortening tail-straddling views (with `VICTORY_RAW_VIEW_CLAMP=0` kill-switch). - Added D3D12 hardware + WARP compute dispatch tests verifying exact SRV loads, UAV writes, per-reason clamp counters, and zero D3D12 debug layer errors. ## Changed Files - `crates/victory-gpu/src/descriptor/host.rs`: `dynamic_slots_for` fix, `VICTORY_RAW_VIEW_CLAMP`, unit + `HostHeap::new` + HW/WARP OOB clamp tests. - `crates/victory-gpu/src/host.rs`: `raw_view_clamps` diagnostics frame-line counter. - `crates/victory-gpu/src/indirect.rs`: `#[cfg(test)]` `pub(crate)` visibility on `WarpHarness::on` for test reuse. ## Verification Verified on local D3D12 hardware (NVIDIA GeForce RTX 4070 SUPER) and WARP (`VICTORY_D3D12_DEBUG=1`, `--test-threads=1`, `0` D3D12 debug errors): - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` (default & `--features diagnostics`): **0 warnings**. - `cargo test -p victory-gpu --locked descriptor::host::tests -- --test-threads=1`: **57/57 passed** (default & `diagnostics`, hardware + WARP). - `cargo run -p xtask --locked -- policy` & `cargo test -p xtask --locked`: **11/11 passed**.
Addresses descriptor pressure, raw-view bounds safety, and chromatic screen
probe leftovers reported in #168:

1. Fix dynamic_slots() off-by-one in crates/victory-gpu/src/descriptor/host.rs:
   probe_view_limit() sets null = PORTABLE_VIEWS - 1 (999,999 < 1,000,000) on
   1M-descriptor hosts, causing `if null < PORTABLE_VIEWS { return DYNAMIC; }`
   to silently ignore VICTORY_DYNAMIC_SLOTS and cap dynamic slots at 262,144
   (leading to DynamicDescriptorTable draw drops in #168). Honor explicit
   VICTORY_DYNAMIC_SLOTS safely within PORTABLE_VIEWS (capped at 524,288 so
   title slots stay protected and null - extra never underflows, with a clear
   warning when title slots shrink), and grant unused headroom on smaller heaps.
2. Port VICTORY_RAW_VIEW_CLAMP (on by default; =0 restores legacy views) from
   fxceless/victory-fork PR #1266 (dd5e8c9e) / VIctory-NVIDIA (aec85ef) into
   descriptor/host.rs (raw_at/raw_uav_at) and host.rs meter line, plus D3D12
   HW and WARP OOB SRV/UAV boundary tests.
3. Port violet probe-garbage filter from VIctory-NVIDIA (826ba15) and add an
   acid-green / electric-cyan chroma-spike guard in crates/victory-gpu/src/ambient.rs
   (referencing #168), verified with D3D12 HW and WARP raise-pass tests proving
   chromatic spikes are scrubbed while daylight, blue sky, sunset, and natural
   foliage bounce are preserved.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 12:32:15 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 12:42 UTC · original

@⁠Vladimir-Human The portable-heap limit and the raw-view bounds have focused synthetic checks. I’d land those independently of the chroma change so we can measure the descriptor behaviour on its own. The chroma pass needs a matched moving shot of the foliage and still needs to preserve intended colour on sky, water and warm lighting.

**@⁠TaynanGT** on GitHub · 2026-11-27 12:42 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/255#issuecomment-7218568111) @⁠Vladimir-Human The portable-heap limit and the raw-view bounds have focused synthetic checks. I’d land those independently of the chroma change so we can measure the descriptor behaviour on its own. The chroma pass needs a matched moving shot of the foliage and still needs to preserve intended colour on sky, water and warm lighting.
github-bot changed title from fix(gpu): honor VICTORY_DYNAMIC_SLOTS on portable heaps, clamp raw views, scrub chroma spikes (#168) to fix(descriptor): honor VICTORY_DYNAMIC_SLOTS on PORTABLE_VIEWS hosts and port VICTORY_RAW_VIEW_CLAMP 2026-11-27 13:34:55 +00:00
github-bot force-pushed github-bot/gh-255 from 3986eb57e7 to cdaaebc32f 2026-11-27 13:34:56 +00:00 Compare
Author
Owner

@⁠Vladimir-Human on GitHub · 2026-11-27 13:32 UTC · original

Thank you @⁠TaynanGT for the review! Split cleanly in cdaaebc3:

  • Removed crates/victory-gpu/src/ambient.rs completely from #255 so this PR is strictly focused on the descriptor/host.rs dynamic_slots() PORTABLE_VIEWS fix and VICTORY_RAW_VIEW_CLAMP (+ host.rs meter and indirect.rs test visibility).
  • Moved the chromatic probe-garbage scrub to a separate opt-in PR (#280, OFF by default behind VICTORY_AMBIENT_CHROMA_SCRUB=1), verified on D3D12 HW + WARP to preserve daylight, blue sky, coastal/deep water tones, warm sunset/lamp lighting, and natural/deep foliage bounce.
  • Re-verified clippy (-D warnings, default + diagnostics), descriptor::host::tests (57/57 HW + WARP, 0 D3D12 debug errors), and xtask policy.
**@⁠Vladimir-Human** on GitHub · 2026-11-27 13:32 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/255#issuecomment-7219619547) Thank you @⁠TaynanGT for the review! Split cleanly in `cdaaebc3`: - Removed `crates/victory-gpu/src/ambient.rs` completely from #255 so this PR is strictly focused on the `descriptor/host.rs` `dynamic_slots()` `PORTABLE_VIEWS` fix and `VICTORY_RAW_VIEW_CLAMP` (+ `host.rs` meter and `indirect.rs` test visibility). - Moved the chromatic probe-garbage scrub to a separate opt-in PR (#280, OFF by default behind `VICTORY_AMBIENT_CHROMA_SCRUB=1`), verified on D3D12 HW + WARP to preserve daylight, blue sky, coastal/deep water tones, warm sunset/lamp lighting, and natural/deep foliage bounce. - Re-verified clippy (`-D warnings`, default + `diagnostics`), `descriptor::host::tests` (57/57 HW + WARP, 0 D3D12 debug errors), and `xtask policy`.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 13:37 UTC · original

@⁠Vladimir-Human The split gives us a descriptor-only comparison in this PR and a separate visual change in #280. I’ll use the 57 descriptor checks as the functional baseline and keep the foliage comparison on the chroma branch.

**@⁠TaynanGT** on GitHub · 2026-11-27 13:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/255#issuecomment-7219727968) @⁠Vladimir-Human The split gives us a descriptor-only comparison in this PR and a separate visual change in #280. I’ll use the 57 descriptor checks as the functional baseline and keep the foliage comparison on the chroma branch.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/255/head:github-bot/gh-255'
git switch 'github-bot/gh-255'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-255'
git switch 'github-bot/gh-255'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-255'
git switch 'github-bot/gh-255'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-255'
git switch 'main'
git merge --squash 'github-bot/gh-255'
git switch 'main'
git merge --ff-only 'github-bot/gh-255'
git switch 'main'
git merge 'github-bot/gh-255'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.