Ambient: hold the ray-marched fog to the room's light and settle the estimate by the clock (interior veil on cards without the builder) #58

Closed
github-bot wants to merge 4 commits from gh-pr/58/head into gh-pr/58/base
Owner

@⁠Dathinel on GitHub · 2026-11-27 02:08 UTC · original
Dathinel:ambient-march-fog-cap → main · +305 −9 · 3 files · 4 commits · closed without merging

The fog veil over interiors with the ambient estimate on (a number, not constant:), for cards without the ray-tracing builder. Four commits, every switch off unless set.

What was measured (RTX 3050 Laptop 4 GB, 32-lane, Series S, title 1.0.2.1)

Target dumps of a veiled and a clean run of the same interior cutscene, on a tree of f4b48ad lineage:

  • The veil does not travel through the froxel volume VICTORY_AMBIENT_AIR caps (it held about 0.05, and the cap was applied). It travels the title's ray-marched in-scatter: scattering_transmittance_system:CS_Gather_Classified_* (180x102 RGBA16F) → CS_ReconstructRaymarchClassified* → diffusion → CS_ApplyCombinedDeferred. Scene colour on the interior wall equalled that image texel for texel; nothing bounds that path.
  • The stand-in's slow mean of the room follows 4 % a frame. At 4 to 6 fps, after a cut from a bright shot it sat about 100 times above the room's present light for seconds (0.61 against 0.0063 in one dumped frame), so a cap built on it cut nothing. Identical runs came out veiled (about 7 in 10) or clean.

What is here

Commit Switch From
afcded6 NaN/inf froxels zeroed in the air clamp; VICTORY_AMBIENT_MOST=<multiple> (default 4.0, as now) hand-ported from trustno1-coder/VIctory-NVIDIA 77e13a97
1a96059 VICTORY_AMBIENT_SETTLE=<ms>[,<jump>]: the slow mean settles by the clock and takes a change of more than <jump> at once hand-ported from avatarmanz/VIctory-7900XTX b4ba4bb, 9576c45
de0c40f, 37b5a14 VICTORY_AMBIENT_MARCH=<multiple>: a new role holds the two ray-marched in-scatter images to that multiple of the slow mean before each CS_ReconstructRaymarchClassifiedFull/NoAlpha new

With every switch unset nothing changes: the march pipeline and its view heap are made only when the switch is on, and a failure there leaves the stand-in standing.

Results

On our tree (f4b48ad lineage), VICTORY_AMBIENT_SETTLE=250,3 VICTORY_AMBIENT_MARCH=3: no veil in three runs of three; before, about 7 runs in 10 veiled. VICTORY_AMBIENT_MARCH=1.0 flattened daylight haze (82 % of texels on the cap), so 3 is what I use.

On this branch (your main at 6d813b4 plus these commits), one run each, same settings (VICTORY_AMBIENT=0.8 VICTORY_AMBIENT_AIR=1.5), captures every 4 s:

interiors frame
main 6d813b4 veiled 5.1 to 6.0 fps
this branch with SETTLE=250,3 MARCH=3 no veil, dark 5.6 to 6.1 fps

It builds (cargo build --locked --profile diag -p victory --features diagnostics) and the log shows the role running on the 180x102 images.

Limits, so nobody is surprised

  • It does nothing with VICTORY_AMBIENT=constant:..., which Play-VIctory.cmd sets: the cap is a multiple of the estimate's slow mean, and there is none in constant mode. It works with a number (as Play-VIctory-4GB.cmd sets) or with the variable unset.
  • The role finds the in-scatter at table slots (1, 96) and (1, 112) of the two reconstruct programs. I checked those on the Series S profile only; elsewhere the format check makes it skip, with one warning.
  • The view ring is 4,096 long and not retired by fence; said where it is declared.
  • Interiors come out clean but dark: this bounds the fog, it does not add indirect light.
  • Not run: cargo test, clippy, cargo fmt (a few added lines are over 100 columns), any card other than the one above, the Series X profile.
  • #56 also edits clear_air; the two are complementary (that one caps the froxels in constant mode) and may need a trivial merge.

A separate observation, not part of this change: on this 4 GB card both main and this branch show banded colours, characters without hair and green water in that cutscene, which the f4b48ad-lineage tree does not with the same settings. I will file it as an issue with what I can measure.

The dump comparison, the numbers and the tree these come from: https://github.com/Dathinel/victory-4gb/pull/15 and https://github.com/Dathinel/victory-4gb/issues/2. No game files or captures attached.

🤖 Generated with Claude Code

**@⁠Dathinel** on GitHub · 2026-11-27 02:08 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/58) `Dathinel:ambient-march-fog-cap` → `main` · +305 −9 · 3 files · 4 commits · closed without merging The fog veil over interiors with the ambient estimate on (a number, not `constant:`), for cards without the ray-tracing builder. Four commits, every switch off unless set. ## What was measured (RTX 3050 Laptop 4 GB, 32-lane, Series S, title 1.0.2.1) Target dumps of a veiled and a clean run of the same interior cutscene, on a tree of `f4b48ad` lineage: - The veil does not travel through the froxel volume `VICTORY_AMBIENT_AIR` caps (it held about 0.05, and the cap was applied). It travels the title's ray-marched in-scatter: `scattering_transmittance_system:CS_Gather_Classified_*` (180x102 RGBA16F) → `CS_ReconstructRaymarchClassified*` → diffusion → `CS_ApplyCombinedDeferred`. Scene colour on the interior wall equalled that image texel for texel; nothing bounds that path. - The stand-in's slow mean of the room follows 4 % a frame. At 4 to 6 fps, after a cut from a bright shot it sat about 100 times above the room's present light for seconds (0.61 against 0.0063 in one dumped frame), so a cap built on it cut nothing. Identical runs came out veiled (about 7 in 10) or clean. ## What is here | Commit | Switch | From | |---|---|---| | `afcded6` | NaN/inf froxels zeroed in the air clamp; `VICTORY_AMBIENT_MOST=<multiple>` (default 4.0, as now) | hand-ported from trustno1-coder/VIctory-NVIDIA `77e13a97` | | `1a96059` | `VICTORY_AMBIENT_SETTLE=<ms>[,<jump>]`: the slow mean settles by the clock and takes a change of more than `<jump>` at once | hand-ported from avatarmanz/VIctory-7900XTX `b4ba4bb`, `9576c45` | | `de0c40f`, `37b5a14` | `VICTORY_AMBIENT_MARCH=<multiple>`: a new role holds the two ray-marched in-scatter images to that multiple of the slow mean before each `CS_ReconstructRaymarchClassifiedFull/NoAlpha` | new | With every switch unset nothing changes: the march pipeline and its view heap are made only when the switch is on, and a failure there leaves the stand-in standing. ## Results On our tree (`f4b48ad` lineage), `VICTORY_AMBIENT_SETTLE=250,3 VICTORY_AMBIENT_MARCH=3`: no veil in three runs of three; before, about 7 runs in 10 veiled. `VICTORY_AMBIENT_MARCH=1.0` flattened daylight haze (82 % of texels on the cap), so 3 is what I use. On this branch (your `main` at `6d813b4` plus these commits), one run each, same settings (`VICTORY_AMBIENT=0.8 VICTORY_AMBIENT_AIR=1.5`), captures every 4 s: | | interiors | frame | |---|---|---| | `main` `6d813b4` | veiled | 5.1 to 6.0 fps | | this branch with `SETTLE=250,3 MARCH=3` | no veil, dark | 5.6 to 6.1 fps | It builds (`cargo build --locked --profile diag -p victory --features diagnostics`) and the log shows the role running on the 180x102 images. ## Limits, so nobody is surprised - **It does nothing with `VICTORY_AMBIENT=constant:...`**, which `Play-VIctory.cmd` sets: the cap is a multiple of the estimate's slow mean, and there is none in constant mode. It works with a number (as `Play-VIctory-4GB.cmd` sets) or with the variable unset. - The role finds the in-scatter at table slots (1, 96) and (1, 112) of the two reconstruct programs. I checked those on the Series S profile only; elsewhere the format check makes it skip, with one warning. - The view ring is 4,096 long and not retired by fence; said where it is declared. - Interiors come out clean but dark: this bounds the fog, it does not add indirect light. - Not run: `cargo test`, clippy, `cargo fmt` (a few added lines are over 100 columns), any card other than the one above, the Series X profile. - #56 also edits `clear_air`; the two are complementary (that one caps the froxels in constant mode) and may need a trivial merge. A separate observation, not part of this change: on this 4 GB card both `main` and this branch show banded colours, characters without hair and green water in that cutscene, which the `f4b48ad`-lineage tree does not with the same settings. I will file it as an issue with what I can measure. The dump comparison, the numbers and the tree these come from: https://github.com/Dathinel/victory-4gb/pull/15 and https://github.com/Dathinel/victory-4gb/issues/2. No game files or captures attached. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The air clamp (VICTORY_AMBIENT_AIR) left a NaN or infinite froxel as it
was (no comparison with it holds), and it is summed along every view ray
through it: black or white patches floating in the room. It is now written
as 0, with the exponent-bit test `keep` already uses (Wine's compiler has
no isnan/isinf) in place of the source's isnan/isinf.

The most the title's own resolve may keep, as a multiple of the estimate,
is VICTORY_AMBIENT_MOST=<multiple> (4 when unset, as before).

From Dathinel/victory-4gb b36adb7, ported there from
trustno1-coder/VIctory-NVIDIA 77e13a97 by trustno1-coder.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The slow mean of the light around went 0.04 of the way a frame: 25 frames,
which at 4-6 frames a second is several seconds of a room too bright or too
dark after a cut or a door. VICTORY_AMBIENT_SETTLE=<ms>[,<jump>] (e.g.
250,3, the source's default) has it go by a time constant instead, the same
share of the way a second whatever the frame rate, and take a change by
more than the jump factor (3 when not given; 0: none) at once. Unset or 0:
0.04 a frame, as before.

One more root constant (the jump factor), in the hand-made root signature
as in the shader's. Not taken from the source: the light probe
(lightprobe.rs, its statistics buffer and constants), the optional third
part (<fresh seconds>, which bounds the title's leftover after a jump),
the default of 250,3 when unset, and its return to isnan/isinf and to the
root signature inside the shader.

Hand-ported from avatarmanz/VIctory-7900XTX b4ba4bb, 9576c45 (by
avatarmanz), by way of Dathinel/victory-4gb 62f16b9.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Measured in one interior without rays: the 180x102 R16G16B16A16_FLOAT image
the CS_Gather_Classified_* programs write has a mean of 0.24 in a clean run
and 0.67 in a veiled one, and the froxel volume the air clamp bounds holds
about 0.05. Before either CS_ReconstructRaymarchClassified* dispatch the
images it reads at table 1, places 96 and 112, are scaled down to the
multiple of the room's slow mean luminance (hue and alpha kept, NaN to 0).
Off unless set; its pipeline and its heap of views are made only then, and
apart from the stand-in's own passes. It needs the estimate
(VICTORY_AMBIENT a number), not constant:<level>, which has no slow mean.

Not built or run on this tree: written against it by reading.

From Dathinel/victory-4gb 743f9b0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A review found that a slot was reused after 64 clamps whether or not the
lists that recorded the earlier ones had run. Still a ring, now about 500
frames round; said so where it is declared.

From Dathinel/victory-4gb 31780d9.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 06:08:09 +00:00
github-bot closed this pull request 2026-11-27 06:08:09 +00:00
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-27 03:11 UTC · original

I checked the descriptor-ring limitation at 37b5a14b using two generated 4 × 4 RGBA16F textures and two command lists. On both an RTX 5080 and Windows’ built-in WARP, I kept the first list closed and available for submission while recording 4,095 more march bindings on the other list. Request 4,097 selected the first list’s exact CPU and GPU descriptor addresses. The control stopped before overwriting that descriptor.

I put a fix directly on top of this PR. Each host texture lazily owns one immutable mip-zero march UAV. The recording holds that exact texture until reset, so two lists can be recorded or replayed in either order. The heap is allocated only for textures the march pass actually binds. One-commit patch

The fixed test reads back four 4 × 4 RGBA16F images, including replay of an earlier list after the other list was reset. RTX 5080 and built-in WARP each matched 256/256 components. The test prints the adapter name and readback count.

git fetch https://github.com/steven-seagull27/cool_fox.git refs/heads/codex/pr58-march-view-lifetime
git cherry-pick 717edbf90a2169b872b0899f0cb928c839aca8df
$env:VICTORY_D3D12_WARP = '0'
cargo test -p victory-gpu --lib --features diagnostics resource::march_view_tests::march_views_are_immutable_across_interleaved_lists_and_reset -- --exact --nocapture

Set VICTORY_D3D12_WARP=1 for the WARP run. AI-assisted implementation and testing.

**@⁠steven-seagull27** on GitHub · 2026-11-27 03:11 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/58#issuecomment-7208779978) I checked the descriptor-ring limitation at `37b5a14b` using two generated 4 × 4 RGBA16F textures and two command lists. On both an RTX 5080 and Windows’ built-in WARP, I kept the first list closed and available for submission while recording 4,095 more march bindings on the other list. Request 4,097 selected the first list’s exact CPU and GPU descriptor addresses. The control stopped before overwriting that descriptor. I put a fix directly on top of this PR. Each host texture lazily owns one immutable mip-zero march UAV. The recording holds that exact texture until reset, so two lists can be recorded or replayed in either order. The heap is allocated only for textures the march pass actually binds. [One-commit patch](https://github.com/steven-seagull27/cool_fox/commit/717edbf90a2169b872b0899f0cb928c839aca8df) The fixed test reads back four 4 × 4 RGBA16F images, including replay of an earlier list after the other list was reset. **RTX 5080 and built-in WARP each matched 256/256 components.** The test prints the adapter name and readback count. ```powershell git fetch https://github.com/steven-seagull27/cool_fox.git refs/heads/codex/pr58-march-view-lifetime git cherry-pick 717edbf90a2169b872b0899f0cb928c839aca8df $env:VICTORY_D3D12_WARP = '0' cargo test -p victory-gpu --lib --features diagnostics resource::march_view_tests::march_views_are_immutable_across_interleaved_lists_and_reset -- --exact --nocapture ``` Set `VICTORY_D3D12_WARP=1` for the WARP run. AI-assisted implementation and testing.
Author
Owner

@⁠DoubleGhosty on GitHub · 2026-11-27 05:20 UTC · original

Applied all 4 commits to main — NaN/inf froxel guard, VICTORY_AMBIENT_MOST, VICTORY_AMBIENT_SETTLE and the ray-march clamp with its 4096 view ring. Thank you for the thorough measurements.

**@⁠DoubleGhosty** on GitHub · 2026-11-27 05:20 UTC · [original](https://github.com/DoubleGhosty/cool_fox/pull/58#issuecomment-7210559669) Applied all 4 commits to main — NaN/inf froxel guard, VICTORY_AMBIENT_MOST, VICTORY_AMBIENT_SETTLE and the ray-march clamp with its 4096 view ring. Thank you for the thorough measurements.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.