fix(descriptor,ambient): honor VICTORY_DYNAMIC_SLOTS on PORTABLE_VIEWS hosts and add opt-in chroma scrub #48

Manually merged
github merged 1 commit from github-bot/gh-48 into main 2026-11-28 19:03:03 +00:00 AGit
Owner

@⁠Vladimir-Human on GitHub · 2026-11-27 14:09 UTC · original
Vladimir-Human:fix/nvidia-dynamic-slots-and-foliage-chroma → main · +1037 −28 · 3 files · 1 commits · merged 2026-11-28 19:01 UTC

Summary

Two targeted fixes for NVIDIA / PORTABLE_VIEWS hosts (with all new behavior strictly opt-in and existing VICTORY_RAW_VIEW_CLAMP aec85ef and ambient.rs 826ba15 magenta/violet paths preserved verbatim):

  1. Fix dynamic_slots() off-by-one on PORTABLE_VIEWS-capped hosts (crates/victory-gpu/src/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 silently ignored VICTORY_DYNAMIC_SLOTS and hard-capped dynamic slots at 262,144 (causing DynamicDescriptorTable draw drops under heavy frame demand).
    • dynamic_slots_for now honors explicit VICTORY_DYNAMIC_SLOTS up to PORTABLE_DYNAMIC_CAP (524,288, keeping at least 475,711 title descriptor slots and preventing null - extra underflow) while never shrinking count when unset.
    • Adds pure unit tests, a live HostHeap::new subprocess regression test (VICTORY_DYNAMIC_SLOTS=393216), and a D3D12 HW/WARP OOB raw-view clamp execution test (raw_view_clamp_bounds_srv_and_uav_on_hardware_and_warp) exercising raw_view_range, raw_at, and raw_uav_at (aec85ef production code left untouched).
  2. Add opt-in VICTORY_AMBIENT_CHROMA_SCRUB=1 for acid-green and electric-cyan probe spikes (crates/victory-gpu/src/ambient.rs):
    • OFF by default: keeps existing 826ba15 magenta/violet filtering verbatim unless VICTORY_AMBIENT_CHROMA_SCRUB=1 is set (passed cleanly via root constant uint chroma_scrub).
    • When enabled, additionally drops acid-green (g > 2.5 * max(r, b) && g > 0.02) and electric-cyan (r < 0.35 * min(g, b) && max(g, b) > 0.02) spikes left by unbuilt/stale screen probes on thin foliage edges.
    • Verified via a 12-tone D3D12 HW + WARP test in both default-off and opt-in-on modes to preserve neutral daylight, blue sky, coastal/deep water tones, warm sunset/lamp lighting, and natural/deep foliage bounce.
  3. Test harness visibility (crates/victory-gpu/src/indirect.rs):
    • Exposes #[cfg(test)] pub(crate) fn on on WarpHarness for test reuse.

Verification

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

  • cargo clippy -p xtask --all-targets --locked -- -D warnings: 0 warnings; cargo clippy -p victory-gpu --all-targets --locked (default & --all-features): 0 warnings in ambient.rs and 0 new warnings in descriptor/host.rs/indirect.rs.
  • cargo test -p victory-gpu --locked descriptor::host::tests -- --test-threads=1: 51/51 (HW default, HW --all-features, WARP).
  • cargo test -p victory-gpu --locked ambient::tests -- --test-threads=1: 7/7 (HW default, HW --all-features, WARP).
  • cargo run -p xtask --locked -- policy & cargo test -p xtask --locked: 6/6 passed.
**@⁠Vladimir-Human** on GitHub · 2026-11-27 14:09 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/48) `Vladimir-Human:fix/nvidia-dynamic-slots-and-foliage-chroma` → `main` · +1037 −28 · 3 files · 1 commits · merged 2026-11-28 19:01 UTC ## Summary Two targeted fixes for NVIDIA / `PORTABLE_VIEWS` hosts (with all new behavior strictly opt-in and existing `VICTORY_RAW_VIEW_CLAMP` `aec85ef` and `ambient.rs` `826ba15` magenta/violet paths preserved verbatim): 1. **Fix `dynamic_slots()` off-by-one on `PORTABLE_VIEWS`-capped hosts (`crates/victory-gpu/src/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 silently ignored `VICTORY_DYNAMIC_SLOTS` and hard-capped dynamic slots at `262,144` (causing `DynamicDescriptorTable` draw drops under heavy frame demand). - `dynamic_slots_for` now honors explicit `VICTORY_DYNAMIC_SLOTS` up to `PORTABLE_DYNAMIC_CAP` (`524,288`, keeping at least `475,711` title descriptor slots and preventing `null - extra` underflow) while never shrinking `count` when unset. - Adds pure unit tests, a live `HostHeap::new` subprocess regression test (`VICTORY_DYNAMIC_SLOTS=393216`), and a D3D12 HW/WARP OOB raw-view clamp execution test (`raw_view_clamp_bounds_srv_and_uav_on_hardware_and_warp`) exercising `raw_view_range`, `raw_at`, and `raw_uav_at` (`aec85ef` production code left untouched). 2. **Add opt-in `VICTORY_AMBIENT_CHROMA_SCRUB=1` for acid-green and electric-cyan probe spikes (`crates/victory-gpu/src/ambient.rs`):** - **OFF by default:** keeps existing `826ba15` magenta/violet filtering verbatim unless `VICTORY_AMBIENT_CHROMA_SCRUB=1` is set (passed cleanly via root constant `uint chroma_scrub`). - When enabled, additionally drops acid-green (`g > 2.5 * max(r, b) && g > 0.02`) and electric-cyan (`r < 0.35 * min(g, b) && max(g, b) > 0.02`) spikes left by unbuilt/stale screen probes on thin foliage edges. - Verified via a 12-tone D3D12 HW + WARP test in both default-off and opt-in-on modes to preserve neutral daylight, blue sky, coastal/deep water tones, warm sunset/lamp lighting, and natural/deep foliage bounce. 3. **Test harness visibility (`crates/victory-gpu/src/indirect.rs`):** - Exposes `#[cfg(test)] pub(crate) fn on` on `WarpHarness` for test reuse. ## Verification Verified on D3D12 hardware (NVIDIA GeForce RTX 4070 SUPER) and WARP (`VICTORY_D3D12_DEBUG=1`, `--test-threads=1`, `0` D3D12 debug layer errors): - `cargo clippy -p xtask --all-targets --locked -- -D warnings`: **0 warnings**; `cargo clippy -p victory-gpu --all-targets --locked` (default & `--all-features`): **0 warnings in `ambient.rs` and 0 new warnings in `descriptor/host.rs`/`indirect.rs`**. - `cargo test -p victory-gpu --locked descriptor::host::tests -- --test-threads=1`: **51/51** (HW default, HW `--all-features`, WARP). - `cargo test -p victory-gpu --locked ambient::tests -- --test-threads=1`: **7/7** (HW default, HW `--all-features`, WARP). - `cargo run -p xtask --locked -- policy` & `cargo test -p xtask --locked`: **6/6 passed**.
Two targeted fixes verified on D3D12 hardware and WARP (all new behavior
strictly opt-in; existing VICTORY_RAW_VIEW_CLAMP and ambient magenta/violet
paths preserved untouched):

- descriptor/host.rs: fix off-by-one `if null < PORTABLE_VIEWS` check in
  `dynamic_slots()` (`null == 999_999 < 1_000_000` on NVIDIA silently
  ignored `VICTORY_DYNAMIC_SLOTS`, capping dynamic slots at 262,144).
  Honors explicit `VICTORY_DYNAMIC_SLOTS` up to `PORTABLE_DYNAMIC_CAP`
  (524,288) while preserving title slots and never shrinking `count` when
  unset. Adds unit tests, live `HostHeap::new` subprocess regression test,
  and a D3D12 HW/WARP OOB raw-view clamp test exercising `raw_view_range`,
  `raw_at`, and `raw_uav_at`.
- ambient.rs: add opt-in `VICTORY_AMBIENT_CHROMA_SCRUB=1` (OFF by default;
  passed via root constant `chroma_scrub`) to scrub acid-green and
  electric-cyan probe spikes on thin foliage edges while keeping existing
  magenta/violet filtering untouched when off and preserving daylight, blue
  sky, coastal/deep water tones, warm sunset/lamp lighting, and natural/deep
  foliage bounce in both modes (verified on D3D12 HW and WARP).
- indirect.rs: expose `#[cfg(test)] pub(crate)` `WarpHarness::on` for
  reusing the D3D12 hardware/WARP harness across tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 14:14:13 +00:00
github-bot referenced this pull request from a commit 2026-11-28 19:02:00 +00:00
github manually merged commit 768160e6d4 into main 2026-11-28 19:03:03 +00:00
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/trustno1-coder--VIctory-NVIDIA!48
No description provided.