Light stand-in: an opt-in hold of the traced reflections to the light around (VICTORY_AMBIENT_REFLECT) #99

Closed
github-bot wants to merge 2 commits from github-bot/gh-99 into main AGit
Owner

@⁠CowboyBingus on GitHub · 2026-11-27 00:46 UTC · original
CowboyBingus:fix/ambient-reflect-hold → main · +332 −10 · 2 files · 2 commits · closed without merging

What it fixes

In our runs with the ray-tracing structure builder off, eyes in many close-ups showed a flat blue-white glow or a pale lavender where the irises should be. With this hold on, the irises were dark in the close-ups we captured.

avatarmanz/VIctory-7900XTX#231 reports the same symptom on AMD cards: flat, bright, bluish-white patches over the eyes, with no iris or pupil. A comment there reports the eyes correct with VICTORY_BVH_BUILDER=1.

What it does

This only acts while the builder is off and the light stand-in is on.

Right after each program that resolves the traced reflections, one pass runs over the reflection image. The image is found the same way as in #314. Any texel brighter than a set multiple of the stand-in's light around it is scaled down to that limit, keeping its hue.

How to switch it on

It is off by default. Two switches are needed:

  • VICTORY_AMBIENT_REFLECT=<multiple>: a positive number. Unset, 0 or off leaves the title's own reflections. We used 1.
  • VICTORY_AMBIENT_REFLECT_IN=<text>[,<text>]: text in the names of the programs that resolve the reflections.
    • These texts are passed at run time, so the change adds no program names to the code.
    • They are matched after the names of the stand-in's other roles.

It also needs the stand-in on: VICTORY_AMBIENT (which play.ps1 sets), or VICTORY_AMBIENT_RT, which also switches the stand-in on. It does nothing while the builder runs, including with VICTORY_AMBIENT_RT.

Log lines:

  • At start-up, when both switches are valid and the stand-in is on: reflections held to a multiple of the light around (VICTORY_AMBIENT_REFLECT) held=… count=….
  • The first time a reflection image is held: the reflections are held after their resolve size=[…].

With either switch unset, behaviour is unchanged. (With only VICTORY_AMBIENT_REFLECT set, a warning says that no reflections are held.)

  • No program gets the new role.
  • The hold's pass is not compiled.
  • The new hook after indirect dispatches does not run; it runs only for that role.

If the hold's pass fails to compile, a warning is logged and the rest of the stand-in still runs.

Measured

Setup:

  • RTX 5070 Ti 16 GB, Windows 11, Series S console.
  • play.ps1 settings without -Safe or -RayTracing: its 4090 machine settings, picked automatically, except the last three runs below, which used -Machine 4070.
  • Every run without the builder has the "structure builder, which is off" lines in its log (30 to 32 per run). The builder-on comparison run has none.
  • Runs were 230 s with a screenshot every 2 s.
  • Frame-time figures are the median of the "ms/frame" log lines over frames with more than 1,000 draws.

Results:

  • Without the hold (plain 0b5b906): a flat blue-white glow over the eyes in one close-up (run V3, s0120). Pale lavender in a close-up of another run (run P1, s0129).
  • With the hold (0b5b906 plus this change, switches as above): dark irises in close-ups at s0118 and s0123 (run E2b). In another run (H1) they were dark brown at s0125 and s0130. Both log lines were present once in each of the three runs with the hold and absent from the five without it.
  • Frame time: four alternating runs (P1 without, H1 with, P2 without, H2 with) gave 73.95, 73.15, 73.0 and 74.1 ms.
  • For comparison, the builder on (VICTORY_BVH_BUILDER=1, no hold): the eyes looked normal, but the run had other picture defects and ran at about 2 fps (median 428 ms).
  • Scoring: a separate check scored every eye close-up from 95 to 140 s in 8 runs.
    • The 3 runs with the hold had 29 normal close-ups, 0 glowing and 0 tinted.
    • The 5 runs without it had 14 glowing (flat, no pupil), 13 tinted (a blue-violet iris or patch, with the pupil still visible) and 21 normal.
    • The same check saw blue-white highlights on glossy surfaces in the runs without the hold, and none in the same shots of the runs with it.
  • This branch (4e3e366 plus this change, -Machine 4070, one run): both log lines present, the eye close-ups dark, and a median of 48.4 ms. Two plain 4e3e366 runs on the same preset had medians of 49.5 and 47.05 ms.

All runs with the hold except the last one used the change on 0b5b906. The runs without it used plain 0b5b906, except the two plain 4e3e366 runs. This branch is the same change rebased onto 4e3e366.

  • The rebase conflicted in ambient.rs after(), where this change's most meets the newer bounds(). For the hold, most is its own multiple and least is 0; the hold's pass does not read least.
  • The hold now also skips while the builder runs. This is needed because VICTORY_AMBIENT_RT lets the stand-in run with the builder.

Credit

Ported from Serph91P's avatarmanz/VIctory-7900XTX#314 (commit 6c7e3a8, GPL-3.0-or-later): the hold's HLSL pass, the reflection role, the image lookup and the hook after indirect dispatches. The idea of holding the reflections to the ambient light, and the switch's name, are beloooo's (VIctory-Belobug-AMD 44dcd437).

Differences from #314:

  • Off by default.
  • Program names are given at run time and matched last.
  • The hook after indirect dispatches is limited to this role.
  • The pass is compiled only when the hold is on, and a failure there does not turn off the rest of the stand-in.
  • The replay's --reflect and the docs are left out.

Tests

  • ambient::tests::settings: parsing of both switches.
  • ambient::tests::roles_by_name: the role is given only by the texts passed in, and never without them.
  • ambient::tests::the_hold_compiles: the hold's pass compiles with the system's compiler.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: both pass (exit 0).
  • cargo test --workspace --locked --no-fail-fast on 4e3e366 + this change: 1105 passed, 0 failed, 53 ignored (29 test result lines; RTX 5070 Ti, Windows 11).

No game data in the commit.

🤖 Generated with Claude Code

**@⁠CowboyBingus** on GitHub · 2026-11-27 00:46 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99) `CowboyBingus:fix/ambient-reflect-hold` → `main` · +332 −10 · 2 files · 2 commits · closed without merging **What it fixes** In our runs with the ray-tracing structure builder off, eyes in many close-ups showed a flat blue-white glow or a pale lavender where the irises should be. With this hold on, the irises were dark in the close-ups we captured. avatarmanz/VIctory-7900XTX#231 reports the same symptom on AMD cards: flat, bright, bluish-white patches over the eyes, with no iris or pupil. A comment there reports the eyes correct with `VICTORY_BVH_BUILDER=1`. **What it does** This only acts while the builder is off and the light stand-in is on. Right after each program that resolves the traced reflections, one pass runs over the reflection image. The image is found the same way as in #314. Any texel brighter than a set multiple of the stand-in's light around it is scaled down to that limit, keeping its hue. **How to switch it on** It is off by default. Two switches are needed: - `VICTORY_AMBIENT_REFLECT=<multiple>`: a positive number. Unset, `0` or `off` leaves the title's own reflections. We used `1`. - `VICTORY_AMBIENT_REFLECT_IN=<text>[,<text>]`: text in the names of the programs that resolve the reflections. - These texts are passed at run time, so the change adds no program names to the code. - They are matched after the names of the stand-in's other roles. It also needs the stand-in on: `VICTORY_AMBIENT` (which `play.ps1` sets), or `VICTORY_AMBIENT_RT`, which also switches the stand-in on. It does nothing while the builder runs, including with `VICTORY_AMBIENT_RT`. Log lines: - At start-up, when both switches are valid and the stand-in is on: `reflections held to a multiple of the light around (VICTORY_AMBIENT_REFLECT) held=… count=…`. - The first time a reflection image is held: `the reflections are held after their resolve size=[…]`. With either switch unset, behaviour is unchanged. (With only `VICTORY_AMBIENT_REFLECT` set, a warning says that no reflections are held.) - No program gets the new role. - The hold's pass is not compiled. - The new hook after indirect dispatches does not run; it runs only for that role. If the hold's pass fails to compile, a warning is logged and the rest of the stand-in still runs. **Measured** Setup: - RTX 5070 Ti 16 GB, Windows 11, Series S console. - `play.ps1` settings without `-Safe` or `-RayTracing`: its 4090 machine settings, picked automatically, except the last three runs below, which used `-Machine 4070`. - Every run without the builder has the "structure builder, which is off" lines in its log (30 to 32 per run). The builder-on comparison run has none. - Runs were 230 s with a screenshot every 2 s. - Frame-time figures are the median of the "ms/frame" log lines over frames with more than 1,000 draws. Results: - **Without the hold** (plain 0b5b906): a flat blue-white glow over the eyes in one close-up (run V3, s0120). Pale lavender in a close-up of another run (run P1, s0129). - **With the hold** (0b5b906 plus this change, switches as above): dark irises in close-ups at s0118 and s0123 (run E2b). In another run (H1) they were dark brown at s0125 and s0130. Both log lines were present once in each of the three runs with the hold and absent from the five without it. - **Frame time:** four alternating runs (P1 without, H1 with, P2 without, H2 with) gave 73.95, 73.15, 73.0 and 74.1 ms. - **For comparison, the builder on** (`VICTORY_BVH_BUILDER=1`, no hold): the eyes looked normal, but the run had other picture defects and ran at about 2 fps (median 428 ms). - **Scoring:** a separate check scored every eye close-up from 95 to 140 s in 8 runs. - The 3 runs with the hold had 29 normal close-ups, 0 glowing and 0 tinted. - The 5 runs without it had 14 glowing (flat, no pupil), 13 tinted (a blue-violet iris or patch, with the pupil still visible) and 21 normal. - The same check saw blue-white highlights on glossy surfaces in the runs without the hold, and none in the same shots of the runs with it. - **This branch (4e3e366 plus this change, `-Machine 4070`, one run):** both log lines present, the eye close-ups dark, and a median of 48.4 ms. Two plain 4e3e366 runs on the same preset had medians of 49.5 and 47.05 ms. All runs with the hold except the last one used the change on 0b5b906. The runs without it used plain 0b5b906, except the two plain 4e3e366 runs. This branch is the same change rebased onto 4e3e366. - The rebase conflicted in `ambient.rs` `after()`, where this change's `most` meets the newer `bounds()`. For the hold, `most` is its own multiple and `least` is 0; the hold's pass does not read `least`. - The hold now also skips while the builder runs. This is needed because `VICTORY_AMBIENT_RT` lets the stand-in run with the builder. **Credit** Ported from Serph91P's avatarmanz/VIctory-7900XTX#314 (commit 6c7e3a8, GPL-3.0-or-later): the hold's HLSL pass, the reflection role, the image lookup and the hook after indirect dispatches. The idea of holding the reflections to the ambient light, and the switch's name, are beloooo's (VIctory-Belobug-AMD 44dcd437). Differences from #314: - Off by default. - Program names are given at run time and matched last. - The hook after indirect dispatches is limited to this role. - The pass is compiled only when the hold is on, and a failure there does not turn off the rest of the stand-in. - The replay's `--reflect` and the docs are left out. **Tests** - `ambient::tests::settings`: parsing of both switches. - `ambient::tests::roles_by_name`: the role is given only by the texts passed in, and never without them. - `ambient::tests::the_hold_compiles`: the hold's pass compiles with the system's compiler. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: both pass (exit 0). - `cargo test --workspace --locked --no-fail-fast` on 4e3e366 + this change: 1105 passed, 0 failed, 53 ignored (29 test result lines; RTX 5070 Ti, Windows 11). No game data in the commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With the ray-tracing structure builder off, the stand-in for the indirect
light (VICTORY_AMBIENT) can now also hold the image the reflections'
resolve programs write: right after such a program each texel is held to
no more than a multiple of the stand-in's light around it, hue kept.

Off by default. It acts only when all of these hold:
- VICTORY_AMBIENT_REFLECT=<multiple> (a positive number; unset, 0 or off:
  the title's own reflections);
- VICTORY_AMBIENT_REFLECT_IN=<text>[,<text>]: text in the names of the
  programs that resolve the reflections (given at run time, so the
  reflections' programs are not named in the code; these texts are looked
  for after the other roles' names);
- the stand-in on (VICTORY_AMBIENT set) and the builder not running. With
  VICTORY_AMBIENT_RT the stand-in also runs while the builder does; the
  hold does not.

The hold's pass is compiled only when both switches are set, and a
failure to make it leaves the rest of the stand-in running. The hook
after indirect dispatches runs only for the reflections' resolve, so the
other roles are unchanged.

Ported from Serph91P's avatarmanz/VIctory-7900XTX#314 (commit 6c7e3a87,
GPL-3.0-or-later): the HOLD pass, the Reflect role and the hook after indirect
dispatches. That the reflections can be held to the ambient light, and the
switch's name, are beloooo's (VIctory-Belobug-AMD 44dcd437). Left out of
the port: the replay's --reflect and the docs.

Tests: ambient::tests::settings (the two switches' parsing),
roles_by_name (Reflect only by the given texts; none without them),
the_hold_compiles (the HOLD pass compiles with the system's compiler).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:29:46 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 01:28 UTC · original · reviewed

Thanks for the alternating runs and the comparison with the builder enabled. I started CI on fc9ef8a7. Could you confirm whether the reflection resolves you measured use a count buffer? I left a question on the indirect path.

**@⁠TaynanGT** on GitHub · 2026-11-27 01:28 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99#pullrequestreview-6082280696) · **reviewed** Thanks for the alternating runs and the comparison with the builder enabled. I started CI on `fc9ef8a7`. Could you confirm whether the reflection resolves you measured use a count buffer? I left a question on the indirect path.
@ -4625,0 +4641,4 @@
if p.stages.first().and_then(|s| s.shader.ambient)
== Some(crate::ambient::Role::Reflect)
{
self.after_dispatch(list, p);
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 01:28 UTC · original

This hook records a write to the reflection UAV after ExecuteIndirect. With a count buffer of zero, the resolve records no dispatch at playback and this still rewrites the previous contents. Do the targeted resolves always run at least one dispatch? Please document or guard that requirement if the counted path can reach the hook.

**@⁠TaynanGT** on GitHub · 2026-11-27 01:28 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99#discussion_r4714797083) This hook records a write to the reflection UAV after `ExecuteIndirect`. With a count buffer of zero, the resolve records no dispatch at playback and this still rewrites the previous contents. Do the targeted resolves always run at least one dispatch? Please document or guard that requirement if the counted path can reach the hook.
After an ExecuteIndirect with a count buffer the record count is read on
the card and may be 0, and a Dispatch may ask for no groups. The resolve
then writes nothing, and a hold recorded after it would rewrite what the
image held before. In both cases the hold is no longer recorded. The first
time each happens while `ambient::after` would record a hold (the image's
view is not checked), an INFO line says so:
"reflections not held after a counted indirect dispatch" and
"reflections not held after a dispatch of no groups".

To show which ways the title dispatches the resolves, they are counted
by how they were dispatched: holds after a Dispatch and after an
ExecuteIndirect without a count buffer; counted and empty resolves left
alone (counted only while `ambient::after` would record a hold; the
image's view is not checked). The counts are logged at INFO at the first
noted resolve 100 or more frames after the first noted one, then at most
once every 1000 frames
("reflections' resolves: held after a direct dispatch, held after an
indirect one without a count, not held after a counted one or a direct
one of no groups", with frames, direct, indirect, counted and empty).

Nothing changes while the hold is off (VICTORY_AMBIENT_REFLECT or
VICTORY_AMBIENT_REFLECT_IN unset): no program has the reflections' role
(Role::Reflect), so neither
the new branches nor the counts are reached.

Not covered: an ExecuteIndirect without a count buffer whose records ask
for no groups; the hold still follows it.

Test: ambient::tests::counts_by_dispatch_are_due_after_the_first_note_then_every_so_often.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠CowboyBingus on GitHub · 2026-11-27 02:12 UTC · original

Thanks. Our earlier logs could not answer the count-buffer question, so I added counts by dispatch path and measured one run.

Earlier runs. These were four runs with the hold, all on an RTX 5070 Ti: three on 0b5b906 with a port of this PR's first commit, and one on 4e3e366 with its first commit, before these guards. Their logs have only these hold lines:

  • one start-up line;
  • one line the first time the hold runs;
  • one or two of the stand-in's first lines (role=Reflect).

None of these lines says whether the resolve came from Dispatch, from ExecuteIndirect without a count buffer, or from ExecuteIndirect with one.

In fa90adf:

  • After an ExecuteIndirect with a count buffer, the hold is no longer recorded.
  • After a Dispatch of no groups, the hold is no longer recorded either.
  • The first time each of these happens while ambient::after would record a hold, an INFO line says so:
    • reflections not held after a counted indirect dispatch
    • reflections not held after a dispatch of no groups
  • The comments at both hooks give the reason.
  • The resolves are counted by how they were dispatched: holds after Dispatch, holds after ExecuteIndirect without a count, and counted and empty resolves left alone (noted only while ambient::after would record a hold). The counts are logged at the first noted resolve 100 or more frames after the first noted one, then at most once every 1000 frames:
    reflections' resolves: held after a direct dispatch, held after an indirect one without a count, not held after a counted one or a direct one of no groups frames=… direct=… indirect=… counted=… empty=…
  • Test: ambient::tests::counts_by_dispatch_are_due_after_the_first_note_then_every_so_often checks the schedule of the count lines (counts_due).

Measured. One run (its log spans 230 s) with a diagnostics build (--profile diag --features diagnostics) of b8fda70, whose tree is the same as fa90adf's (exe md5 b6405e23…): RTX 5070 Ti, Series S, -Machine 4070, VICTORY_AMBIENT_REFLECT=1 and VICTORY_AMBIENT_REFLECT_IN set. The count lines, verbatim:

  • frames=100 direct=0 indirect=201 counted=0 empty=0
  • frames=1100 direct=0 indirect=2201 counted=0 empty=0
  • frames=2100 direct=0 indirect=4201 counted=0 empty=0
  • frames=3100 direct=0 indirect=6201 counted=0 empty=0 (the last one)

In this run, up to the last count line (frames=3100), every hold that was recorded followed an ExecuteIndirect without a count buffer (direct=0). The log goes on for 10.6 s after that line, and holds in those seconds are in no count.

Neither "reflections not held after …" line appears anywhere in the log. So while ambient::after would have recorded a hold (by its own checks; the image's view is not checked), no resolve with a count buffer and no empty Dispatch reached the hook.

These counts cover only the scenes this one run reached.

Not covered: an ExecuteIndirect without a count buffer whose records ask for no groups. The hook still follows it, and these counts do not show such records.

Checks. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: both exit 0. cargo test --workspace --locked --no-fail-fast: exit 0, 1106 passed, 0 failed, 53 ignored. Both ran on this tree (b8fda70) on Windows 11, on the same machine as the run above.

**@⁠CowboyBingus** on GitHub · 2026-11-27 02:12 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99#issuecomment-7207917018) Thanks. Our earlier logs could not answer the count-buffer question, so I added counts by dispatch path and measured one run. **Earlier runs.** These were four runs with the hold, all on an RTX 5070 Ti: three on 0b5b906 with a port of this PR's first commit, and one on 4e3e366 with its first commit, before these guards. Their logs have only these hold lines: - one start-up line; - one line the first time the hold runs; - one or two of the stand-in's first lines (`role=Reflect`). None of these lines says whether the resolve came from `Dispatch`, from `ExecuteIndirect` without a count buffer, or from `ExecuteIndirect` with one. **In fa90adf:** - After an `ExecuteIndirect` with a count buffer, the hold is no longer recorded. - After a `Dispatch` of no groups, the hold is no longer recorded either. - The first time each of these happens while `ambient::after` would record a hold, an INFO line says so: - `reflections not held after a counted indirect dispatch` - `reflections not held after a dispatch of no groups` - The comments at both hooks give the reason. - The resolves are counted by how they were dispatched: holds after `Dispatch`, holds after `ExecuteIndirect` without a count, and counted and empty resolves left alone (noted only while `ambient::after` would record a hold). The counts are logged at the first noted resolve 100 or more frames after the first noted one, then at most once every 1000 frames: `reflections' resolves: held after a direct dispatch, held after an indirect one without a count, not held after a counted one or a direct one of no groups frames=… direct=… indirect=… counted=… empty=…` - Test: `ambient::tests::counts_by_dispatch_are_due_after_the_first_note_then_every_so_often` checks the schedule of the count lines (`counts_due`). **Measured.** One run (its log spans 230 s) with a diagnostics build (`--profile diag --features diagnostics`) of b8fda70, whose tree is the same as fa90adf's (exe md5 b6405e23…): RTX 5070 Ti, Series S, `-Machine 4070`, `VICTORY_AMBIENT_REFLECT=1` and `VICTORY_AMBIENT_REFLECT_IN` set. The count lines, verbatim: - `frames=100 direct=0 indirect=201 counted=0 empty=0` - `frames=1100 direct=0 indirect=2201 counted=0 empty=0` - `frames=2100 direct=0 indirect=4201 counted=0 empty=0` - `frames=3100 direct=0 indirect=6201 counted=0 empty=0` (the last one) In this run, up to the last count line (frames=3100), every hold that was recorded followed an `ExecuteIndirect` without a count buffer (direct=0). The log goes on for 10.6 s after that line, and holds in those seconds are in no count. Neither "reflections not held after …" line appears anywhere in the log. So while `ambient::after` would have recorded a hold (by its own checks; the image's view is not checked), no resolve with a count buffer and no empty `Dispatch` reached the hook. These counts cover only the scenes this one run reached. **Not covered:** an `ExecuteIndirect` without a count buffer whose records ask for no groups. The hook still follows it, and these counts do not show such records. **Checks.** `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: both exit 0. `cargo test --workspace --locked --no-fail-fast`: exit 0, 1106 passed, 0 failed, 53 ignored. Both ran on this tree (b8fda70) on Windows 11, on the same machine as the run above.
Author
Owner

@⁠CowboyBingus on GitHub · 2026-11-27 02:12 UTC · original
On crates/victory-gpu/src/draw.rs line 4644 (outdated):

@@ -4622,6 +4636,13 @@ impl State {
         // back (`crate::indirect`).
         if kind == DISPATCH {
             DISPATCHED.fetch_add(1, Ordering::Relaxed);
+            // The reflections' resolve is dispatched so; the other roles
+            // keep to direct dispatches, as before.
+            if p.stages.first().and_then(|s| s.shader.ambient)
+                == Some(crate::ambient::Role::Reflect)
+            {
+                self.after_dispatch(list, p);

Guarded in fa90adf: after an ExecuteIndirect with a count buffer (and after a Dispatch of no groups) the hold is not recorded, with a one-time INFO line and counts by dispatch path. Measured counts and the case not covered are in the PR conversation.

**@⁠CowboyBingus** on GitHub · 2026-11-27 02:12 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99#discussion_r4714996926) On `crates/victory-gpu/src/draw.rs` line 4644 (outdated): ```diff @@ -4622,6 +4636,13 @@ impl State { // back (`crate::indirect`). if kind == DISPATCH { DISPATCHED.fetch_add(1, Ordering::Relaxed); + // The reflections' resolve is dispatched so; the other roles + // keep to direct dispatches, as before. + if p.stages.first().and_then(|s| s.shader.ambient) + == Some(crate::ambient::Role::Reflect) + { + self.after_dispatch(list, p); ``` Guarded in fa90adf: after an `ExecuteIndirect` with a count buffer (and after a `Dispatch` of no groups) the hold is not recorded, with a one-time INFO line and counts by dispatch path. Measured counts and the case not covered are in the PR conversation.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 02:19 UTC · original
On crates/victory-gpu/src/draw.rs line 4644 (outdated):

@@ -4622,6 +4636,13 @@ impl State {
         // back (`crate::indirect`).
         if kind == DISPATCH {
             DISPATCHED.fetch_add(1, Ordering::Relaxed);
+            // The reflections' resolve is dispatched so; the other roles
+            // keep to direct dispatches, as before.
+            if p.stages.first().and_then(|s| s.shader.ambient)
+                == Some(crate::ambient::Role::Reflect)
+            {
+                self.after_dispatch(list, p);

Thanks for adding the counted and direct zero-group guards and measuring the dispatch paths. I approved CI for fa90adf. Since all 6,201 holds in the reported window followed uncounted indirect resolves, the zero-group record you called out is the remaining case to cover. Could you check whether the targeted resolves can reach that path with a zero group dimension, or guard the hold so it only runs when the resolve actually wrote the image?

**@⁠TaynanGT** on GitHub · 2026-11-27 02:19 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99#discussion_r4715032019) On `crates/victory-gpu/src/draw.rs` line 4644 (outdated): ```diff @@ -4622,6 +4636,13 @@ impl State { // back (`crate::indirect`). if kind == DISPATCH { DISPATCHED.fetch_add(1, Ordering::Relaxed); + // The reflections' resolve is dispatched so; the other roles + // keep to direct dispatches, as before. + if p.stages.first().and_then(|s| s.shader.ambient) + == Some(crate::ambient::Role::Reflect) + { + self.after_dispatch(list, p); ``` Thanks for adding the counted and direct zero-group guards and measuring the dispatch paths. I approved CI for `fa90adf`. Since all 6,201 holds in the reported window followed uncounted indirect resolves, the zero-group record you called out is the remaining case to cover. Could you check whether the targeted resolves can reach that path with a zero group dimension, or guard the hold so it only runs when the resolve actually wrote the image?
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 03:14 UTC · original

@⁠CowboyBingus Thanks for calling out the uncounted zero-group case. I tested a guard that reads the actual group counts after the clamp. The WARP test preserved the reflection texel for a zero in each dimension and for an oversized dispatch that the clamp zeroed. A valid dispatch changed the texel. I kept your commits in draft #127.

Could you repeat your RTX 5070 Ti scene on #127 with the same settings? The new counters distinguish indirect_gated from multiple. The original 6,201 uncounted calls did not distinguish those paths. A short excerpt with those counts, the GPU time and how the eyes look would cover the remaining check.

**@⁠TaynanGT** on GitHub · 2026-11-27 03:14 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99#issuecomment-7208818554) @⁠CowboyBingus Thanks for calling out the uncounted zero-group case. I tested a guard that reads the actual group counts after the clamp. The WARP test preserved the reflection texel for a zero in each dimension and for an oversized dispatch that the clamp zeroed. A valid dispatch changed the texel. I kept your commits in draft #127. Could you repeat your RTX 5070 Ti scene on #127 with the same settings? The new counters distinguish `indirect_gated` from `multiple`. The original 6,201 uncounted calls did not distinguish those paths. A short excerpt with those counts, the GPU time and how the eyes look would cover the remaining check.
github-bot closed this pull request 2026-11-27 04:15:49 +00:00
Author
Owner

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

Thanks for the reflection work and the follow-up RTX 5070 Ti run, @⁠CowboyBingus. The opt-in hold is now on main through #127 with your commits preserved. The guard passed the empty-dispatch WARP regression, and I reran the ambient, indirect and texture readback checks together with #141. The gameplay numbers remain useful context for measuring the pass separately.

**@⁠TaynanGT** on GitHub · 2026-11-27 04:11 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/99#issuecomment-7209597506) Thanks for the reflection work and the follow-up RTX 5070 Ti run, @⁠CowboyBingus. The opt-in hold is now on `main` through #127 with your commits preserved. The guard passed the empty-dispatch WARP regression, and I reran the ambient, indirect and texture readback checks together with #141. The gameplay numbers remain useful context for measuring the pass separately.

Pull request closed

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