[pr-fix][rendering] Reflections: the left-out miss program's image cleared (DARNER_RAYMISS_CLEAR=1, off by default) #15

Open
Jesper-A wants to merge 3 commits from Jesper-A/Darner:pr6-raymiss-clear into main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit.

Base: the branch (3 commits) is on 4db98e011, the main commit it was cut from. main is now 4a92569fb. Not rebased (WIP; we rebase before WIP comes off, or sooner if you ask). A text-only trial merge (git merge-tree --write-tree --name-only trustno1/main pr6-raymiss-clear) merges cleanly: no conflicts.

This is a draft. It has not been run in the game on this base, and it has no before and after.

What was wrong (suspected, not confirmed). The reflections' "missed everything" program (the miss program) writes the texels of the rays the screen-space passes resolve nothing for; the resolve after it writes only where it finds something. main leaves the opaque layer's dispatches of that program out (sky_miss_left_out in draw.rs); since an earlier CodeFloe PR (#309 there, not migrated; in main) it runs when rays are found, so it is left out only with ray tracing off. Those texels then keep what the memory held: earlier frames' bytes, or another render target's where targets share memory (DARNER_ALIAS_TARGETS). The half-size reflection image is resolved from the frame before, so those bytes are fed back frame after frame. The fork reports we ported from saw coloured blocks, glitter and white frost on glass, while the transparent layer's program was left out too (it runs again since that change). On opaque glossy surfaces (car paint, chrome, floors) the same leftovers would show as noise. That could be what an earlier report showed on chrome and paint with ray tracing off (CodeFloe #74, closed, not migrated); that link is a guess, not confirmed: its reporter used a different card and had frame generation on, and no log was attached.

New switch: DARNER_RAYMISS_CLEAR=1. Default: not set (off), nothing changes. With 1, in place of each left-out dispatch the image it would have written (ambient::MISS_LIGHT, else the first 2D R11G11B10 image among the program's table views) is cleared to zero with the existing UAV clear (list::clear_uav_on_host), in both the direct and the indirect dispatch path. No reflected light there, instead of old bytes.

  • Ray tracing off only. The program is left out only with ray tracing off, so this does something only there. With ray tracing on it is not left out and nothing is cleared (unless DARNER_RAYMISS_KEEP=0 leaves it out always). This change does not repeat the earlier one.
  • Read once (asked_for!). It does not change which dispatches are left out; DARNER_RAYMISS_KEEP keeps its meaning (with KEEP=1 nothing is left out, so nothing is cleared).
  • If the image is not found, or is not a texture in the unordered state, one line is logged and nothing is cleared.
  • list::clear_uav_on_host and ClearValues become pub(crate); nothing else outside draw.rs changes. No shader change, so the shader cache key is unchanged.
  • Also: a README row (Lighting and ray tracing) and a docs/findings.md entry.

Diff against 4db98e011: 4 files (README.md, crates/darner-gpu/src/draw.rs, crates/darner-gpu/src/list.rs, docs/findings.md), 3 commits. It stands alone.

Credit: a port of the reflection part of Leonard Wernke's commit accfd9fe0 in a fork of the project's earlier GitHub repository (that pull request's repository is gone, so there is no link; there it was RAYMISS_ZERO, on by default). diego's commit ab37f19a7 (also a pull request there; RAYMISS_CLEAR, on by default) is the same fix with a compute pass of its own; we took the smaller change and credit both. The commit message carries a Co-authored-by line for both. The rest of Leonard Wernke's commit (draw-skip classification, panel advice, an out-of-memory retry) is not ported.

No upstream issue is confirmed to be this, so there is no Fixes or Refs line.

Spec dependence

  • Likely general: the clear is host D3D12 (an existing UAV clear), no title shader and no wave-size dependence.
  • May depend on our setup (RTX 2070 SUPER 8 GB Turing, ReBAR off, Ryzen 7 5800X, 32 GB, Series S + DLSS Performance): whether the artefact shows at all (not checked on another card).
  • Untested elsewhere: other cards and drivers, AMD, Series X profile, frame generation. Ray tracing on: no effect expected (the program is not left out).

How it was tested

  • Tested revision: the gates below ran on b4bc7ce5f. The head is now 9dd1bd25e (branch pr6-raymiss-clear, based on 4db98e011); the one commit after it only changes docs/findings.md (cites the earlier PR #309 there), so the gates were not run again.
  • Commands and results:
    • cargo clippy --workspace --all-targets --locked -- -D warnings with -A clippy::unnecessary_lazy_evaluations added: passed. This deviates from the required gate: the flag is not part of it, and the exact required command was not run on this branch. (On our pr6-specular-fill branch the same two clippy gates passed without the flag, so it was probably not needed, but that is another branch.)
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings, the same flag added: passed, same deviation.
    • Tests: darner-gpu, full library: one test failed, watch::tests::ask_once_by_res_splits_reservations_without_refusals (once also watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs). It is in a test file this change does not touch and it passes when run alone. The failures are unconfirmed and not baseline-checked: we did not run main for comparison, so we do not know whether they are flaky or old. cargo test --workspace --locked as one command was not run. This change adds no unit test of its own.
    • cargo xtask policy: passed.
    • There is no CI upstream; nothing here was checked by CI.
  • Gameplay, when relevant: RTX 2070 SUPER 8 GB, Series S (recorded as "Series S 720 quality"; the ray tracing mode was not recorded), clocks unlocked. On 2026-12-02 the user played with DARNER_RAYMISS_CLEAR=1 (and DARNER_AMBIENT_AIR_ROOM=1, not part of this PR) on our play build, which was older than current main and did not have the earlier change that runs the program when rays are found. The user's words: "Our reflection and glass ports seem to work well". That is an impression: no scene, no screenshot pair, no A/B. A glow on glass and windows seen in the same days was fixed by an upstream update, not by this switch. Nothing was run on the tested revision above.
  • Before and after, when relevant: none. Not measured: the cost (one clear of a half-size image per dispatch left out).
  • Shader wave sizes tested, when relevant: not relevant (no shader change).
  • Coverage gaps: no same-scene comparison with the switch on and off; no frame time; AMD and wave64 cards; the result on current main; whether the image it clears is the right one in every pipeline variant (the fallback search for a R11G11B10 image is untested in the game).

Checklist

  • This PR contains one change based on main. (git diff --stat 4db98e011 9dd1bd25e: the 4 files above. The branch is on 4db98e011, not on current main; a trial merge is clean, see Base.)
  • The diff follows docs/asset-policy.md. (Text only; cargo xtask policy passed on b4bc7ce5f; the later commit is docs only.)
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found for the same change. On 2026-12-03 this host had 3 issues (#1, #2, #4) and 8 pull requests (#3 by another contributor; #5 to #11 ours, WIP) in total; I searched their titles and bodies for raymiss, miss program, reflection and specular: nothing. The other contributor's pull request (#3, ray tracing mode in F1) changes host/menu.rs, host/panel.rs and hwrt.rs: none of this change's files. The earlier CodeFloe PR that runs the program when rays are found and the hardware ray tracing reflection fix (not migrated) are in main; this PR acts only where the program is still left out, which is ray tracing off. Our sibling branches pr6-raymiss-estimated (DARNER_RAYMISS_ESTIMATED) and pr6-specular-fill edit the same function sky_miss_left_out in draw.rs, so a textual conflict is possible; pr6-raymiss-estimated, pr6-air-room and pr6-specular-fill add a row to the same README table. Earlier reports on CodeFloe (not migrated) of reflection ghosting traced to skipped wave64 shaders and of reflections picking up texture colours are related, not claimed fixed.
  • Our own re-filed PRs that touch the same files: #6 (README.md, docs/findings.md); #7 (docs/findings.md); #8 (README.md, docs/findings.md); #9 (README.md, docs/findings.md); #10 (README.md, docs/findings.md); #11 (README.md). #5 share no file. Different changes; whichever lands first, the others take its rows when they are rebased.

Update 2026-12-03: marked ready as it stands; the 'draft' and 'not rebased' wording above is out of date, nothing was re-run in the game, and the maintainer will handle the rebase.

This change was made with AI assistance (Claude Code).

## Contributor role (optional) - Fluxer ID: ## What it changes Re-filed from an earlier CodeFloe PR (that repo is gone; nothing was migrated). Same branch and commit. **Base:** the branch (3 commits) is on `4db98e011`, the `main` commit it was cut from. `main` is now `4a92569fb`. Not rebased (WIP; we rebase before WIP comes off, or sooner if you ask). A text-only trial merge (`git merge-tree --write-tree --name-only trustno1/main pr6-raymiss-clear`) merges **cleanly**: no conflicts. This is a draft. It has not been run in the game on this base, and it has no before and after. **What was wrong (suspected, not confirmed).** The reflections' "missed everything" program (the miss program) writes the texels of the rays the screen-space passes resolve nothing for; the resolve after it writes only where it finds something. `main` leaves the opaque layer's dispatches of that program out (`sky_miss_left_out` in `draw.rs`); since an earlier CodeFloe PR (#309 there, not migrated; in `main`) it runs when rays are found, so it is left out only with ray tracing off. Those texels then keep what the memory held: earlier frames' bytes, or another render target's where targets share memory (`DARNER_ALIAS_TARGETS`). The half-size reflection image is resolved from the frame before, so those bytes are fed back frame after frame. The fork reports we ported from saw coloured blocks, glitter and white frost on glass, while the transparent layer's program was left out too (it runs again since that change). On opaque glossy surfaces (car paint, chrome, floors) the same leftovers would show as noise. That could be what an earlier report showed on chrome and paint with ray tracing off (CodeFloe #74, closed, not migrated); that link is a guess, not confirmed: its reporter used a different card and had frame generation on, and no log was attached. **New switch: `DARNER_RAYMISS_CLEAR=1`.** Default: not set (off), nothing changes. With `1`, in place of each left-out dispatch the image it would have written (`ambient::MISS_LIGHT`, else the first 2D R11G11B10 image among the program's table views) is cleared to zero with the existing UAV clear (`list::clear_uav_on_host`), in both the direct and the indirect dispatch path. No reflected light there, instead of old bytes. - **Ray tracing off only.** The program is left out only with ray tracing off, so this does something only there. With ray tracing on it is not left out and nothing is cleared (unless `DARNER_RAYMISS_KEEP=0` leaves it out always). This change does not repeat the earlier one. - Read once (`asked_for!`). It does not change which dispatches are left out; `DARNER_RAYMISS_KEEP` keeps its meaning (with `KEEP=1` nothing is left out, so nothing is cleared). - If the image is not found, or is not a texture in the unordered state, one line is logged and nothing is cleared. - `list::clear_uav_on_host` and `ClearValues` become `pub(crate)`; nothing else outside `draw.rs` changes. No shader change, so the shader cache key is unchanged. - Also: a README row (Lighting and ray tracing) and a `docs/findings.md` entry. Diff against `4db98e011`: 4 files (`README.md`, `crates/darner-gpu/src/draw.rs`, `crates/darner-gpu/src/list.rs`, `docs/findings.md`), 3 commits. It stands alone. **Credit:** a port of the reflection part of Leonard Wernke's commit `accfd9fe0` in a fork of the project's earlier GitHub repository (that pull request's repository is gone, so there is no link; there it was `RAYMISS_ZERO`, on by default). **diego**'s commit `ab37f19a7` (also a pull request there; `RAYMISS_CLEAR`, on by default) is the same fix with a compute pass of its own; we took the smaller change and credit both. The commit message carries a `Co-authored-by` line for both. The rest of Leonard Wernke's commit (draw-skip classification, panel advice, an out-of-memory retry) is not ported. No upstream issue is confirmed to be this, so there is no `Fixes` or `Refs` line. ### Spec dependence - **Likely general:** the clear is host D3D12 (an existing UAV clear), no title shader and no wave-size dependence. - **May depend on our setup** (RTX 2070 SUPER 8 GB Turing, ReBAR off, Ryzen 7 5800X, 32 GB, Series S + DLSS Performance): whether the artefact shows at all (not checked on another card). - **Untested elsewhere:** other cards and drivers, AMD, Series X profile, frame generation. Ray tracing on: no effect expected (the program is not left out). ## How it was tested - Tested revision: the gates below ran on `b4bc7ce5f`. The head is now `9dd1bd25e` (branch `pr6-raymiss-clear`, based on `4db98e011`); the one commit after it only changes `docs/findings.md` (cites the earlier PR #309 there), so the gates were not run again. - Commands and results: - `cargo clippy --workspace --all-targets --locked -- -D warnings` with `-A clippy::unnecessary_lazy_evaluations` added: passed. **This deviates from the required gate**: the flag is not part of it, and the exact required command was not run on this branch. (On our `pr6-specular-fill` branch the same two clippy gates passed without the flag, so it was probably not needed, but that is another branch.) - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`, the same flag added: passed, same deviation. - Tests: `darner-gpu`, full library: one test failed, `watch::tests::ask_once_by_res_splits_reservations_without_refusals` (once also `watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs`). It is in a test file this change does not touch and it passes when run alone. The failures are unconfirmed and not baseline-checked: we did not run `main` for comparison, so we do not know whether they are flaky or old. `cargo test --workspace --locked` as one command was not run. This change adds no unit test of its own. - `cargo xtask policy`: passed. - There is no CI upstream; nothing here was checked by CI. - Gameplay, when relevant: RTX 2070 SUPER 8 GB, Series S (recorded as "Series S 720 quality"; the ray tracing mode was not recorded), clocks unlocked. On 2026-12-02 the user played with `DARNER_RAYMISS_CLEAR=1` (and `DARNER_AMBIENT_AIR_ROOM=1`, not part of this PR) on our play build, which was older than current `main` and did not have the earlier change that runs the program when rays are found. The user's words: "Our reflection and glass ports seem to work well". That is an impression: no scene, no screenshot pair, no A/B. A glow on glass and windows seen in the same days was fixed by an upstream update, not by this switch. Nothing was run on the tested revision above. - Before and after, when relevant: none. Not measured: the cost (one clear of a half-size image per dispatch left out). - Shader wave sizes tested, when relevant: not relevant (no shader change). - Coverage gaps: no same-scene comparison with the switch on and off; no frame time; AMD and wave64 cards; the result on current `main`; whether the image it clears is the right one in every pipeline variant (the fallback search for a R11G11B10 image is untested in the game). ## Checklist - [x] This PR contains one change based on `main`. (`git diff --stat 4db98e011 9dd1bd25e`: the 4 files above. The branch is on `4db98e011`, not on current `main`; a trial merge is clean, see Base.) - [x] The diff follows `docs/asset-policy.md`. (Text only; `cargo xtask policy` passed on `b4bc7ce5f`; the later commit is docs only.) - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found for the same change. On 2026-12-03 this host had 3 issues (#1, #2, #4) and 8 pull requests (#3 by another contributor; #5 to #11 ours, WIP) in total; I searched their titles and bodies for raymiss, miss program, reflection and specular: nothing. The other contributor's pull request (#3, ray tracing mode in F1) changes `host/menu.rs`, `host/panel.rs` and `hwrt.rs`: none of this change's files. The earlier CodeFloe PR that runs the program when rays are found and the hardware ray tracing reflection fix (not migrated) are in `main`; this PR acts only where the program is still left out, which is ray tracing off. Our sibling branches `pr6-raymiss-estimated` (`DARNER_RAYMISS_ESTIMATED`) and `pr6-specular-fill` edit the same function `sky_miss_left_out` in `draw.rs`, so a textual conflict is possible; `pr6-raymiss-estimated`, `pr6-air-room` and `pr6-specular-fill` add a row to the same README table. Earlier reports on CodeFloe (not migrated) of reflection ghosting traced to skipped wave64 shaders and of reflections picking up texture colours are related, not claimed fixed. - Our own re-filed PRs that touch the same files: #6 (`README.md`, `docs/findings.md`); #7 (`docs/findings.md`); #8 (`README.md`, `docs/findings.md`); #9 (`README.md`, `docs/findings.md`); #10 (`README.md`, `docs/findings.md`); #11 (`README.md`). #5 share no file. Different changes; whichever lands first, the others take its rows when they are rebased. Update 2026-12-03: marked ready as it stands; the 'draft' and 'not rebased' wording above is out of date, nothing was re-run in the game, and the maintainer will handle the rebase. This change was made with AI assistance (Claude Code).
Without the ray-tracing structures the reflections' miss program writes the
texels of the rays the screen-space passes resolve nothing for. The opaque
layer's dispatches are left out (DARNER_RAYMISS_KEEP unset), so those texels
keep earlier frames' or other targets' bytes, fed back through the half-size
image. With the switch, the image a left-out dispatch would have written is
cleared to zero with the existing UAV clear, in the direct and the indirect
dispatch path. May be what #74 shows on chrome and paint (unconfirmed).

Port of the reflection part of Leonard Wernke's fork commit accfd9fe0 (old
PR #3631, RAYMISS_ZERO, on by default there); diego's ab37f19a7 (old PR #3411,
RAYMISS_CLEAR) is the same fix with its own pass. No shader change.

Co-authored-by: Leonard Wernke <[email protected]>
Co-authored-by: diego <[email protected]>

This change was made with AI assistance (Claude Code).
The row and the findings entry for the commit before (port of fork commits by Leonard Wernke, accfd9fe0, and diego, ab37f19a7).

This change was made with AI assistance (Claude Code).
This change was made with AI assistance (Claude Code).
Jesper-A changed title from WIP: [pr-fix][rendering] Reflections: the left-out miss program's image cleared (DARNER_RAYMISS_CLEAR=1, off by default) to [pr-fix][rendering] Reflections: the left-out miss program's image cleared (DARNER_RAYMISS_CLEAR=1, off by default) 2026-12-03 18:29:43 +00:00
This pull request has changes conflicting with the target branch.
  • docs/findings.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'pr6-raymiss-clear:Jesper-A-pr6-raymiss-clear'
git switch 'Jesper-A-pr6-raymiss-clear'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'Jesper-A-pr6-raymiss-clear'
git switch 'Jesper-A-pr6-raymiss-clear'
git rebase 'main'
git switch 'main'
git merge --ff-only 'Jesper-A-pr6-raymiss-clear'
git switch 'Jesper-A-pr6-raymiss-clear'
git rebase 'main'
git switch 'main'
git merge --no-ff 'Jesper-A-pr6-raymiss-clear'
git switch 'main'
git merge --squash 'Jesper-A-pr6-raymiss-clear'
git switch 'main'
git merge --ff-only 'Jesper-A-pr6-raymiss-clear'
git switch 'main'
git merge 'Jesper-A-pr6-raymiss-clear'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!15
No description provided.