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

Merged
Vladimir-Human merged 1 commit from upstream-pr/48 into main 2026-11-28 19:01:28 +00:00
Vladimir-Human commented 2026-11-27 14:09:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Vladimir-Human on 2026-11-27T14:09:26Z.


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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5528017106 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/48). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-27T14:09:26Z. --- ## 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**.
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
trustno1-coder/VIctory-NVIDIA!48
No description provided.