Scrub NaN on typed buffer stores too (VICTORY_NAN_SCRUB) #15

Closed
Tissma95 wants to merge 1 commit from upstream-pr/15 into main
Tissma95 commented 2026-11-27 03:22:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Tissma95 on 2026-11-27T03:22:35Z.


With VICTORY_NAN_SCRUB=1 (the launcher's default), the colours a pixel shader exports and float image stores already get NaN and infinities set to 0. Typed buffer stores of floats did not. A NaN that a compute pass writes through a typed buffer view could still reach the blur, the exposure and the history of the temporal upscaler.

Change (crates/victory-shader/src/emit/lower.rs, +26/−1):

  • With the switch on, the floats of a typed store are now scrubbed the same way (scrub_nan).
  • This only happens where the view-kind bits (integer_view) say the view is not of an integer format.
  • Left as they are, so integer bits are never touched:
    • halves moved as integers (the face network);
    • views of an integer format;
    • views whose kind is not read.
  • d16 data is scrubbed as it is widened.
  • VICTORY_NAN_SCRUB is already part of the shader cache key. The translator change itself renews the cache.

Why: this follows the NaN guard in codec-d/cool_fox (after Neptune-VE). That guard covers typed buffer stores as well as colour exports and image stores, and with it the blotched, painted-looking walls and skin were reported gone there. The README of this fork lists a posterized "oil paint" look that appears in some runs. On an RTX 3060 Ti (Series S, 720p), I saw a pastel look and some inverted colours.

Tested:

  • cargo test -p victory-shader --lib passes (203 passed, 2 ignored).
  • In game, on an RTX 3060 Ti 8 GB with a Ryzen 9 5900X and 32 GB of RAM (Series S, DLSS, the launcher's defaults):
    • the lighting artefacts (pastel look, some inverted colours) were much reduced compared with the run before the change;
    • vegetation still shows some of them, mostly up close;
    • no errors and no device losses;
    • the frame rate is the same (11.6 fps median against 10.9; preparing 47 ms against 54 ms, at fewer draws a frame).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EPTFUmv7kwA2Jtjutdp8Sh

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5520619660 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/15). Originally posted by [Tissma95](https://github.com/Tissma95) on 2026-11-27T03:22:35Z. --- With `VICTORY_NAN_SCRUB=1` (the launcher's default), the colours a pixel shader exports and float image stores already get NaN and infinities set to 0. Typed buffer stores of floats did not. A NaN that a compute pass writes through a typed buffer view could still reach the blur, the exposure and the history of the temporal upscaler. **Change** (`crates/victory-shader/src/emit/lower.rs`, +26/−1): - With the switch on, the floats of a typed store are now scrubbed the same way (`scrub_nan`). - This only happens where the view-kind bits (`integer_view`) say the view is not of an integer format. - Left as they are, so integer bits are never touched: - halves moved as integers (the face network); - views of an integer format; - views whose kind is not read. - d16 data is scrubbed as it is widened. - `VICTORY_NAN_SCRUB` is already part of the shader cache key. The translator change itself renews the cache. **Why:** this follows the NaN guard in codec-d/cool_fox (after Neptune-VE). That guard covers typed buffer stores as well as colour exports and image stores, and with it the blotched, painted-looking walls and skin were reported gone there. The README of this fork lists a posterized "oil paint" look that appears in some runs. On an RTX 3060 Ti (Series S, 720p), I saw a pastel look and some inverted colours. **Tested:** - `cargo test -p victory-shader --lib` passes (203 passed, 2 ignored). - In game, on an RTX 3060 Ti 8 GB with a Ryzen 9 5900X and 32 GB of RAM (Series S, DLSS, the launcher's defaults): - the lighting artefacts (pastel look, some inverted colours) were much reduced compared with the run before the change; - vegetation still shows some of them, mostly up close; - no errors and no device losses; - the frame rate is the same (11.6 fps median against 10.9; preparing 47 ms against 54 ms, at fewer draws a frame). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EPTFUmv7kwA2Jtjutdp8Sh
Tissma95 commented 2026-11-27 03:56:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Tissma95 on 2026-11-27T03:56:02Z.


Follow-up: on a later run the pastel look and the wrong vegetation colours came back with the same build and VICTORY_NAN_SCRUB=1, so the improvement I saw may have been a good run rather than this change. It is still correct as a scrub of typed stores, but I can't claim it fixes the oil-paint look.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7209385957 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/15#issuecomment-7209385957). Originally posted by [Tissma95](https://github.com/Tissma95) on 2026-11-27T03:56:02Z. --- Follow-up: on a later run the pastel look and the wrong vegetation colours came back with the same build and VICTORY_NAN_SCRUB=1, so the improvement I saw may have been a good run rather than this change. It is still correct as a scrub of typed stores, but I can't claim it fixes the oil-paint look.

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