Reflections: the miss program's sky is left out only while the structure builder is off (black metal and glass with RAY TRACING on) #3058

Closed
nick0451 wants to merge 1 commit from upstream-pr/3058 into main
nick0451 commented 2026-11-29 19:51:23 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T19:51:23Z.


What happens

With RAY TRACING on (VICTORY_BVH_BUILDER=1), reflections whose rays really find nothing come out black instead of taking the sky. On the house balcony the aluminium ladder, white with ray tracing off, turns black, and the glass door's panes go black too.

Why

#428 left out CS_RayMiss for opaque and transparent surfaces (DrawCtx::sky_miss_left_out). Without the ray-tracing structures nearly every ray reaches it and took the sky's light (white grain on floors), so leaving it out was right with the builder off. The check never asks whether the builder runs, though. Every other ray-tracing skip does: pipeline::make's left_out, the builder dispatches in draw.rs, and ambient. With the builder on, rays that reach the miss program have really found nothing and should take the sky. They got nothing.

The change

sky_miss_left_out also requires !crate::pipeline::builder_runs(). With the builder off nothing changes. With it on, the miss program runs as the title intends. (While the builder rests for its two frames, builder_runs() is false and the program stays out, as before.)

This is complementary to #2764 / #2872, which clear the left-out program's output: with the builder on, it isn't left out any more.

Tested

RTX 3090 24 GB, Windows 11, main 829188e9 (+ the 2-line start fix of #2392 to get past the commit-gate regression on this PC), Series S, DLSS performance, a frozen balcony save, RAY TRACING on. Shaders were compiled by earlier runs (the first run with the builder crawls at ~0.1 fps while the RT shader set compiles and static structures are rehydrated).

aluminium ladder glass door panes
ray tracing off white blinds, dark glass
ray tracing on, main black black
ray tracing on, this change white again (stickers visible) reflect the sky
  • No device removal or crash in any RT run on this card (balcony and a city street).
  • Speed: on the city street, RT on gave 15.7 fps on main and 12.1 with this change (one round each). The miss program runs again, so some cost is expected. One round is noisy, so treat that as rough.
  • With the builder off, the behaviour is unchanged by construction (the old condition plus one more &&).

Not this change: in some captures with RT on, the near railing's top turns black for a while, on main too. I'm looking into that separately.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5554472654 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3058). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T19:51:23Z. --- ## What happens With **RAY TRACING on** (`VICTORY_BVH_BUILDER=1`), reflections whose rays really find nothing come out **black** instead of taking the sky. On the house balcony the aluminium ladder, white with ray tracing off, turns black, and the glass door's panes go black too. ## Why #428 left out `CS_RayMiss` for opaque and transparent surfaces (`DrawCtx::sky_miss_left_out`). Without the ray-tracing structures nearly every ray reaches it and took the sky's light (white grain on floors), so leaving it out was right **with the builder off**. The check never asks whether the builder runs, though. Every other ray-tracing skip does: `pipeline::make`'s `left_out`, the builder dispatches in `draw.rs`, and `ambient`. With the builder on, rays that reach the miss program have really found nothing and should take the sky. They got nothing. ## The change `sky_miss_left_out` also requires `!crate::pipeline::builder_runs()`. With the builder off nothing changes. With it on, the miss program runs as the title intends. (While the builder rests for its two frames, `builder_runs()` is false and the program stays out, as before.) This is complementary to #2764 / #2872, which clear the left-out program's output: with the builder on, it isn't left out any more. ## Tested RTX 3090 24 GB, Windows 11, main `829188e9` (+ the 2-line start fix of #2392 to get past the commit-gate regression on this PC), Series S, DLSS performance, a frozen balcony save, RAY TRACING on. Shaders were compiled by earlier runs (the first run with the builder crawls at ~0.1 fps while the RT shader set compiles and static structures are rehydrated). | | aluminium ladder | glass door panes | |---|---|---| | ray tracing off | white | blinds, dark glass | | ray tracing on, main | **black** | black | | ray tracing on, this change | **white again** (stickers visible) | reflect the sky | - No device removal or crash in any RT run on this card (balcony and a city street). - Speed: on the city street, RT on gave 15.7 fps on main and 12.1 with this change (one round each). The miss program runs again, so some cost is expected. One round is noisy, so treat that as rough. - With the builder off, the behaviour is unchanged by construction (the old condition plus one more `&&`). Not this change: in some captures with RT on, the near railing's top turns black for a while, on main too. I'm looking into that separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nick0451 commented 2026-11-29 20:07:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T20:07:58Z.


Note on the failing check job: it stops at victory-loader (function unwind_copy is never used), a crate this PR doesn't touch. Main fails the same way (cargo clippy -p victory-loader --all-targets -- -D warnings), so it isn't from this change. Same as #2746.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7261833035 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3058#issuecomment-7261833035). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T20:07:58Z. --- Note on the failing **check** job: it stops at `victory-loader` (`function unwind_copy is never used`), a crate this PR doesn't touch. Main fails the same way (`cargo clippy -p victory-loader --all-targets -- -D warnings`), so it isn't from this change. Same as #2746. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dyshay commented 2026-11-29 20:47:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T20:47:02Z.


Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262354549 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3058#issuecomment-7262354549). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T20:47:02Z. --- Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.
nick0451 commented 2026-11-29 20:54:08 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T20:54:08Z.


Correction to the evidence above: the ladder before/after was run-to-run variation, not this change. I ran it properly: 4 fresh RT starts each, alternating, same save, same settings (RTX 3090, RAY TRACING on, shaders already compiled).

aluminium ladder black other black areas in the frame fps (runs)
main 0 of 4 1 of 4 (near railing top) 16.4 (17.7, 11.8, 16.4; 1 run left out)
this change 1 of 4 2 of 4 (a whole character dark; a black patch on the wall and door) 13.9 (13.2, 17.4, 14.5, 9.7)

So the black ladder/railing/patches are an intermittent ray-tracing problem in both builds, varying from start to start (plausibly the overlapping dynamic structures of #1412; cf. #2109's "about 1 run in 3 clean"). This PR doesn't fix them, and my single-run comparison overstated it. Sorry for the noise, and to anyone who picked it up on that basis.

What remains true: with the builder on, sky_miss_left_out still drops CS_RayMiss, unlike every other ray-tracing skip, so rays that really miss get no sky. That's a consistency fix, but I can't show a visible benefit on this save, and the miss program costs frame time again (the fps above lean that way, though they're noisy). Reasonable to hold it until the intermittent corruption is understood. I'm happy to convert this to a draft or close it, whichever you prefer.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262447134 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3058#issuecomment-7262447134). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T20:54:08Z. --- **Correction to the evidence above:** the ladder before/after was run-to-run variation, not this change. I ran it properly: 4 fresh RT starts each, alternating, same save, same settings (RTX 3090, RAY TRACING on, shaders already compiled). | | aluminium ladder black | other black areas in the frame | fps (runs) | |---|---|---|---| | main | **0 of 4** | 1 of 4 (near railing top) | 16.4 (17.7, 11.8, 16.4; 1 run left out) | | this change | **1 of 4** | 2 of 4 (a whole character dark; a black patch on the wall and door) | 13.9 (13.2, 17.4, 14.5, 9.7) | So **the black ladder/railing/patches are an intermittent ray-tracing problem in both builds**, varying from start to start (plausibly the overlapping dynamic structures of #1412; cf. #2109's "about 1 run in 3 clean"). This PR doesn't fix them, and my single-run comparison overstated it. Sorry for the noise, and to anyone who picked it up on that basis. What remains true: with the builder on, `sky_miss_left_out` still drops `CS_RayMiss`, unlike every other ray-tracing skip, so rays that really miss get no sky. That's a consistency fix, but I can't show a visible benefit on this save, and the miss program costs frame time again (the fps above lean that way, though they're noisy). Reasonable to hold it until the intermittent corruption is understood. I'm happy to convert this to a draft or close it, whichever you prefer. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nick0451 commented 2026-11-29 21:00:44 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-29T21:00:44Z.


Closing for now, per the correction above: the visible difference I reported was run-to-run variation, and the change's benefit isn't demonstrated. I'll come back with N-run evidence once the intermittent ray-tracing corruption (#1412-type) is understood, if it still matters then.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7262531620 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3058#issuecomment-7262531620). Originally posted by [nick0451](https://github.com/nick0451) on 2026-11-29T21:00:44Z. --- Closing for now, per the correction above: the visible difference I reported was run-to-run variation, and the change's benefit isn't demonstrated. I'll come back with N-run evidence once the intermittent ray-tracing corruption (#1412-type) is understood, if it still matters then. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

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!3058
No description provided.