fix(ambient): add opt-in chromatic probe-garbage scrub (VICTORY_AMBIENT_CHROMA_SCRUB=1) #280

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

@⁠Vladimir-Human on GitHub · 2026-11-27 13:32 UTC · original
Vladimir-Human:fix/ambient-chroma-spike-guard → main · +443 −3 · 2 files · 1 commits · open

Summary

Split out from #255 per review feedback so chromatic probe-garbage filtering can be evaluated independently and stays strictly opt-in (OFF by default).

When VICTORY_AMBIENT_CHROMA_SCRUB=1 is set alongside VICTORY_AMBIENT, ambient.rs's raise pass drops three additional chromatic probe-garbage signatures left by unbuilt/stale screen probes (related to #168):

  • Bluer violet probe leftovers (was.b > 2.5 * was.g && was.b > was.r && was.b > 0.02, ported from VIctory-NVIDIA 826ba15) which otherwise bypass the luminance cap (LUMA.b = 0.0722).
  • Acid-green spikes (was.g > 2.5 * max(was.r, was.b) && was.g > 0.02).
  • Electric-cyan spikes (was.r < 0.35 * min(was.g, was.b) && max(was.g, was.b) > 0.02).

When VICTORY_AMBIENT_CHROMA_SCRUB is unset or not 1 (the default), bit 1 of the existing probe root constant (words[11]) is 0, preserving exact upstream ambient.rs behavior with zero root-signature or PSO changes (existing lightprobe stats check (probe & 1u) != 0).

Changed Files

  • crates/victory-gpu/src/ambient.rs: opt-in VICTORY_AMBIENT_CHROMA_SCRUB=1 switch, guarded chroma-spike checks in RAISE, unit test (chroma_scrub_is_opt_in), and a 12-tone D3D12 hardware + WARP test (raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp).
  • 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 layer errors):

  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings (default & --features diagnostics): 0 warnings.
  • cargo test -p victory-gpu --locked ambient::tests -- --test-threads=1 (default & --features diagnostics): 9/9 passed on both hardware and WARP, confirming in both scrub_on=false (default) and scrub_on=true (VICTORY_AMBIENT_CHROMA_SCRUB=1):
    • Default mode preserves exact upstream behavior (only existing magenta filter runs).
    • Opt-in mode scrubs violet, acid-green, and electric-cyan spikes to the spatial estimate.
    • Neutral daylight, blue sky, coastal water, deep water, warm sunset, warm lamp lighting, natural foliage bounce, and deep foliage bounce are preserved in both modes.
  • cargo run -p xtask --locked -- policy & cargo test -p xtask --locked: 11/11 passed.
**@⁠Vladimir-Human** on GitHub · 2026-11-27 13:32 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/280) `Vladimir-Human:fix/ambient-chroma-spike-guard` → `main` · +443 −3 · 2 files · 1 commits · open ## Summary Split out from #255 per review feedback so chromatic probe-garbage filtering can be evaluated independently and stays strictly opt-in (**OFF by default**). When `VICTORY_AMBIENT_CHROMA_SCRUB=1` is set alongside `VICTORY_AMBIENT`, `ambient.rs`'s `raise` pass drops three additional chromatic probe-garbage signatures left by unbuilt/stale screen probes (related to #168): - Bluer violet probe leftovers (`was.b > 2.5 * was.g && was.b > was.r && was.b > 0.02`, ported from `VIctory-NVIDIA` `826ba15`) which otherwise bypass the luminance cap (`LUMA.b = 0.0722`). - Acid-green spikes (`was.g > 2.5 * max(was.r, was.b) && was.g > 0.02`). - Electric-cyan spikes (`was.r < 0.35 * min(was.g, was.b) && max(was.g, was.b) > 0.02`). When `VICTORY_AMBIENT_CHROMA_SCRUB` is unset or not `1` (the default), bit 1 of the existing `probe` root constant (`words[11]`) is `0`, preserving exact upstream `ambient.rs` behavior with zero root-signature or PSO changes (existing lightprobe stats check `(probe & 1u) != 0`). ## Changed Files - `crates/victory-gpu/src/ambient.rs`: opt-in `VICTORY_AMBIENT_CHROMA_SCRUB=1` switch, guarded chroma-spike checks in `RAISE`, unit test (`chroma_scrub_is_opt_in`), and a 12-tone D3D12 hardware + WARP test (`raise_opt_in_chroma_scrub_filters_spikes_and_preserves_scene_tones_on_hardware_and_warp`). - `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 layer errors): - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` (default & `--features diagnostics`): **0 warnings**. - `cargo test -p victory-gpu --locked ambient::tests -- --test-threads=1` (default & `--features diagnostics`): **9/9 passed** on both hardware and WARP, confirming in both `scrub_on=false` (default) and `scrub_on=true` (`VICTORY_AMBIENT_CHROMA_SCRUB=1`): - Default mode preserves exact upstream behavior (only existing magenta filter runs). - Opt-in mode scrubs violet, acid-green, and electric-cyan spikes to the spatial estimate. - Neutral daylight, blue sky, coastal water, deep water, warm sunset, warm lamp lighting, natural foliage bounce, and deep foliage bounce are preserved in both modes. - `cargo run -p xtask --locked -- policy` & `cargo test -p xtask --locked`: **11/11 passed**.
Split out from #255 per review so descriptor behavior and ambient chroma
filtering can be evaluated independently on matched moving shots.

Adds opt-in VICTORY_AMBIENT_CHROMA_SCRUB=1 (off by default, passed via bit 1
of `probe` in ambient.rs with zero root-signature or PSO change):
- Ports the violet/blue probe-garbage filter from VIctory-NVIDIA (826ba15)
  that bypasses the luminance-only cap (LUMA.b = 0.0722).
- Adds acid-green (g > 2.5 * max(r, b)) and electric-cyan (r < 0.35 * min(g, b))
  chroma-spike guards for stale/unbuilt screen probes on thin foliage edges (#168).
- Verified with D3D12 HW and WARP compiled RAISE tests in both default-off and
  opt-in-on modes proving violet/acid-green/electric-cyan spikes are scrubbed
  when enabled (and untouched when off) while neutral daylight, blue sky,
  coastal and deep water tones, warm sunset/lamp lighting, and natural/deep
  foliage bounce are preserved.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 13:34:48 +00:00
github-bot force-pushed github-bot/gh-280 from 227d26b58b to b06b3ca07d 2026-11-27 13:48:04 +00:00 Compare
Author
Owner

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

@⁠Vladimir-Human This is the right scope for a separate image test. Use the same foliage move with the flag off and on, plus a shot containing deliberate violet or cyan light. The 12-tone test gives us a synthetic reference for what the filter is supposed to preserve.

**@⁠TaynanGT** on GitHub · 2026-11-27 13:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/280#issuecomment-7219733542) @⁠Vladimir-Human This is the right scope for a separate image test. Use the same foliage move with the flag off and on, plus a shot containing deliberate violet or cyan light. The 12-tone test gives us a synthetic reference for what the filter is supposed to preserve.
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/280/head:github-bot/gh-280'
git switch 'github-bot/gh-280'

Merge

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