[pr-performance][shaders] Six translator levers on by default (+9 % fps, -5.0 ms of GPU time a frame, on an RTX 2080 Ti) #76

Manually merged
TrustNo1 merged 0 commits from cafe/shader-levers into main 2026-12-04 02:13:29 +00:00 AGit
Contributor

Contributor role (optional)

  • Fluxer ID: Cafe#9189

What it changes

+9 % fps, -5.0 ms of GPU time a frame on an RTX 2080 Ti (same build, the six off against on).

Re-filed from CodeFloe PR 295 (that repo is gone; nothing was migrated). CodeFloe numbers are written without "#" here, since numbers restarted on this host. Brought up to main 1a5286a78 by merging main in, without conflicts.

Six translator changes, each measured on its own, on by default. Four are new, two change existing defaults. Each has a switch to turn it off by itself.

Setting (default now) What it does Measured on an RTX 2080 Ti
DARNER_LEGACY_FINITE=31 (new; before, only values proven bounded) A legacy multiply (0 x anything = 0) becomes a plain multiply when its factors come from constant buffers, textures, buffers, or sums and products of these, i.e. it takes those values as finite. AMD cards only (or with DARNER_HOST_RDNA=1): it is read only in the AMD form of the legacy multiply, so on NVIDIA and Intel with the defaults it changes no shader math (corrected after review). On the RTX 2080 Ti with DARNER_HOST_RDNA=1 DARNER_RDNA_FLOAT=3: -1.5 ms of the 3.9 ms the zero guards cost a frame
DARNER_MOVREL_WATERFALL (new, on unless 0) Waterfall loops over an M0 register index (v_movrels/v_movreld) run once per lane instead of once per distinct index, each pass a select over the whole register range. -0.3 ms
DARNER_LICM_CBUF=1 (new; 0 off, 2 also descriptor handles) Constant-buffer rows at constant indices leave loops even from blocks that run conditionally. The lighting gathers' ray march re-read 125 rows each step. -2.8 ms in game
DARNER_SHADER_OPT=511 (was 447) Adds the WIDE pass: up to 4 dwords of a console load in one call. -0.25 ms (replay)
DARNER_SHADER_LOOP_LIMIT_OF (new), default 7b2c3c1db2298f44:1024 Loop limits for single programs, named by the hash the log shows, keyed apart in the shader cache. CS_ShadowTileBalanceRTCost walks an index range whose loop ran toward the 4,096-round compute cap; 1,024 is 4 times what the scene needed. Empty removes it. -0.9 ms (replay)
Unfolded by default: CS_ShadowRenderTiled, CS_GenerateShadowMasks_HairOnly These run in the exact (unfolded) wave64 form on a 32-lane host, as lightAtlas already does. -1.3 ms (replay), -0.3 ms in game; hair masks -0.5 ms

LEGACY_FINITE, MOVREL_WATERFALL and LICM_CBUF are added to the shader cache key. The translated shaders change, so every player's pipelines are rebuilt once after this update.

How it was tested

  • Tested revision: 7e96ad684 (main 4a92569fb with the six merged in); main 1a5286a78 merged in since as 581ee600f, without conflicts and with no translator change between the two.
  • Gameplay: RTX 2080 Ti, Windows 10, Series S profile, 2560x1440 output, DLSS Performance, hardware ray tracing, no frame generation, the rest at Darner's defaults. Jason's house save, the same 30 s stretch after the world shows, pipelines warm, no other program using the card (checked per run).
  • Before and after, same build, two runs each: GPU time a frame 58.9 and 58.8 ms with the six at the old defaults, 53.5 and 54.1 ms with them on: -5.0 ms (-8.6 %). On this card that is 16.5 to 18.1 fps. In the opening top-down pan, a heavier view: 74.9/74.6 to 68.9/70.8 ms (-4.9 ms). Old defaults: DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas, and the loop limit pointed at no program. LEGACY_FINITE did nothing in these runs (NVIDIA card, Darner's defaults): the gain is the other five levers'.
  • Found and measured one by one on an earlier code base (boat save): +1.0 fps for the first two, +0.6 for the loop limit, WIDE and hair masks together, +1.4 for LICM_CBUF. The replayed frames' pictures were unchanged.
  • Picture in game: on in all our runs for three days, watched by eye; no picture fault traced to them. There was no separate eyes check for each one.
  • Shader wave sizes tested: 32 lanes (NVIDIA) only.
  • cargo test --release --locked -p darner-shader --lib: 490 passed, 68 failed; main alone: 488 passed and the same 68 failed (the 2 more are this change's tests). The 68 need a Shader Model 6.6 device, which this Windows 10 PC can't give a test program. -p darner-gpu --lib stops after 143 tests with exit code 3 here, the same on main alone.
  • Coverage gaps: AMD, Intel and other NVIDIA cards (the unfolded list is for 32-lane hosts; LEGACY_FINITE acts only on AMD cards or with DARNER_HOST_RDNA=1; the others apply everywhere). Risk to watch: LEGACY_FINITE takes texture and buffer values as finite. If a game texture holds an infinity or NaN, 0 times it now gives NaN where it gave 0: look for black or bright specks. DARNER_LEGACY_FINITE=0 brings back the old behaviour.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • 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 here for these switches, loop limits or the unfolded list. On CodeFloe, near but different: PR 251 (three programs in the wide-fallback skip list), PRs 183 and 187 (other wave64 forms).
## Contributor role (optional) - Fluxer ID: `Cafe#9189` ## What it changes **+9 % fps, -5.0 ms of GPU time a frame** on an RTX 2080 Ti (same build, the six off against on). Re-filed from CodeFloe PR 295 (that repo is gone; nothing was migrated). CodeFloe numbers are written without "#" here, since numbers restarted on this host. Brought up to `main` 1a5286a78 by merging `main` in, without conflicts. Six translator changes, each measured on its own, on by default. Four are new, two change existing defaults. Each has a switch to turn it off by itself. | Setting (default now) | What it does | Measured on an RTX 2080 Ti | |---|---|---| | `DARNER_LEGACY_FINITE=31` (new; before, only values proven bounded) | A legacy multiply (0 x anything = 0) becomes a plain multiply when its factors come from constant buffers, textures, buffers, or sums and products of these, i.e. it takes those values as finite. | **AMD cards only** (or with `DARNER_HOST_RDNA=1`): it is read only in the AMD form of the legacy multiply, so on NVIDIA and Intel with the defaults it changes no shader math (corrected after review). On the RTX 2080 Ti with `DARNER_HOST_RDNA=1 DARNER_RDNA_FLOAT=3`: -1.5 ms of the 3.9 ms the zero guards cost a frame | | `DARNER_MOVREL_WATERFALL` (new, on unless `0`) | Waterfall loops over an M0 register index (`v_movrels`/`v_movreld`) run once per lane instead of once per distinct index, each pass a select over the whole register range. | -0.3 ms | | `DARNER_LICM_CBUF=1` (new; `0` off, `2` also descriptor handles) | Constant-buffer rows at constant indices leave loops even from blocks that run conditionally. The lighting gathers' ray march re-read 125 rows each step. | -2.8 ms in game | | `DARNER_SHADER_OPT=511` (was 447) | Adds the `WIDE` pass: up to 4 dwords of a console load in one call. | -0.25 ms (replay) | | `DARNER_SHADER_LOOP_LIMIT_OF` (new), default `7b2c3c1db2298f44:1024` | Loop limits for single programs, named by the hash the log shows, keyed apart in the shader cache. `CS_ShadowTileBalanceRTCost` walks an index range whose loop ran toward the 4,096-round compute cap; 1,024 is 4 times what the scene needed. Empty removes it. | -0.9 ms (replay) | | Unfolded by default: `CS_ShadowRenderTiled`, `CS_GenerateShadowMasks_HairOnly` | These run in the exact (unfolded) wave64 form on a 32-lane host, as `lightAtlas` already does. | -1.3 ms (replay), -0.3 ms in game; hair masks -0.5 ms | `LEGACY_FINITE`, `MOVREL_WATERFALL` and `LICM_CBUF` are added to the shader cache key. The translated shaders change, so every player's pipelines are rebuilt once after this update. ## How it was tested - Tested revision: 7e96ad684 (`main` 4a92569fb with the six merged in); `main` 1a5286a78 merged in since as 581ee600f, without conflicts and with no translator change between the two. - Gameplay: RTX 2080 Ti, Windows 10, Series S profile, 2560x1440 output, DLSS Performance, hardware ray tracing, no frame generation, the rest at Darner's defaults. Jason's house save, the same 30 s stretch after the world shows, pipelines warm, no other program using the card (checked per run). - Before and after, same build, two runs each: GPU time a frame 58.9 and 58.8 ms with the six at the old defaults, 53.5 and 54.1 ms with them on: -5.0 ms (-8.6 %). On this card that is 16.5 to 18.1 fps. In the opening top-down pan, a heavier view: 74.9/74.6 to 68.9/70.8 ms (-4.9 ms). Old defaults: `DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas`, and the loop limit pointed at no program. `LEGACY_FINITE` did nothing in these runs (NVIDIA card, Darner's defaults): the gain is the other five levers'. - Found and measured one by one on an earlier code base (boat save): +1.0 fps for the first two, +0.6 for the loop limit, `WIDE` and hair masks together, +1.4 for `LICM_CBUF`. The replayed frames' pictures were unchanged. - Picture in game: on in all our runs for three days, watched by eye; no picture fault traced to them. There was no separate eyes check for each one. - Shader wave sizes tested: 32 lanes (NVIDIA) only. - `cargo test --release --locked -p darner-shader --lib`: 490 passed, 68 failed; `main` alone: 488 passed and the same 68 failed (the 2 more are this change's tests). The 68 need a Shader Model 6.6 device, which this Windows 10 PC can't give a test program. `-p darner-gpu --lib` stops after 143 tests with exit code 3 here, the same on `main` alone. - Coverage gaps: AMD, Intel and other NVIDIA cards (the unfolded list is for 32-lane hosts; `LEGACY_FINITE` acts only on AMD cards or with `DARNER_HOST_RDNA=1`; the others apply everywhere). Risk to watch: `LEGACY_FINITE` takes texture and buffer values as finite. If a game texture holds an infinity or NaN, 0 times it now gives NaN where it gave 0: look for black or bright specks. `DARNER_LEGACY_FINITE=0` brings back the old behaviour. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [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 here for these switches, loop limits or the unfolded list. On CodeFloe, near but different: PR 251 (three programs in the wide-fallback skip list), PRs 183 and 187 (other wave64 forms).
Measured on an RTX 2080 Ti (Series S, 1440p DLSS Performance, hardware RT,
house save): 18.57 -> 21.01 fps, GPU 51.2 -> 46.4 ms a frame.

- DARNER_LEGACY_FINITE=31 (new): a legacy multiply is plain when its factors
  come from constant buffers, textures, buffers, or sums and products of
  these (taken as finite). 0 proves each one as before.
- DARNER_MOVREL_WATERFALL (new, on unless 0): waterfall loops over an M0
  register index run once per lane.
- DARNER_LICM_CBUF=1 (new): constant-buffer rows at constant indices leave
  loops from conditional blocks too.
- DARNER_SHADER_OPT default 511: the WIDE pass runs too.
- DARNER_SHADER_LOOP_LIMIT_OF (new): loop limits of single programs, by the
  hash a run's log names them by, keyed apart in the shader cache; default
  7b2c3c1db2298f44:1024 (CS_ShadowTileBalanceRTCost), empty for none.
- CS_ShadowRenderTiled and CS_GenerateShadowMasks_HairOnly unfolded by
  default on 32-lane hosts, like lightAtlas.

LEGACY_FINITE, MOVREL_WATERFALL and LICM_CBUF are in the shader cache key.
# Conflicts:
#	crates/darner-gpu/src/shader_cache.rs
First-time contributor

Nice. @TrustNo1 merge it

Nice. @TrustNo1 merge it
Author
Contributor

Would love to get some feedback on this too btw for folks that are GPU bound (or otherwise, just give me gpu time if you can).

I do pretty extensive correctness test even on my own captures, but still only just with my hardware and my driver.
Most of those optis should at least not hurt anybody though, like worst thing that hoisting a constant can do is that the compiler still just decides to read it in the loop anyway. 🤷‍♂️

Would *love* to get some feedback on this too btw for folks that are GPU bound (or otherwise, just give me gpu time if you can). I do pretty extensive correctness test even on my own captures, but still only just with my hardware and my driver. Most of those optis should at least not hurt anybody though, like worst thing that hoisting a constant can do is that the compiler still just decides to read it in the loop anyway. 🤷‍♂️
First-time contributor

Sup Cafe! Just compiled your PR and tested it.

Specs : 3060 ti (8 gig) 11700k I7 and 48 gig of DDR4.

FPS before was around 17-19 (without FG of course) and after running your PR it just jumped up to 21-23. Frame gen time also dropped by 5-6ms.

Very impressive buddy! If you need any more info I'll keep my eyes out. I'm also testing some tweaks and modifications to the code but have come up with NOTHING like this!

Sup Cafe! Just compiled your PR and tested it. Specs : 3060 ti (8 gig) 11700k I7 and 48 gig of DDR4. FPS before was around 17-19 (without FG of course) and after running your PR it just jumped up to 21-23. Frame gen time also dropped by 5-6ms. Very impressive buddy! If you need any more info I'll keep my eyes out. I'm also testing some tweaks and modifications to the code but have come up with NOTHING like this!
First-time contributor

AMD numbers, as asked: RX 7900 XTX (24 GB, driver 32.0.32029.2010), Ryzen 7 7800X3D, Windows 11.

Card time in the title's lists: -2.5 ms a frame standing still (19.1 to 16.6 ms, -13 %), -2.3 ms on a walk. No fps change here: this PC is CPU-bound in this scene (the submitting thread 22-28 ms a frame), so the card's saving doesn't show as frame rate.

Setup: PR head 581ee600f built as is (diag profile), the same build both ways. Old defaults set as in your description (DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas, DARNER_SHADER_LOOP_LIMIT_OF pointed at no program; the "these programs' loops stop sooner" warning was in every on-run's log and in none of the off-runs). Series S profile (1920x1080, no upscaler), hardware ray tracing, no frame generation, frame rate uncapped, DARNER_RELAY=2 DARNER_PORT_CBV=1. A heavy downtown save, pipelines warmed for both arms beforehand, the last 120 s of each run measured, arms alternated. No device losses, no pipelines compiled during the measured part.

Standing still (same view every run, 5.5k draws a frame), two pairs (off, on, on, off):

Pair Card ms/frame (settled median), off -> on avg fps, off -> on draws/frame median, off -> on
1 18.9 -> 16.6 35.2 -> 34.4 5485 -> 5530
2 19.3 -> 16.6 33.1 -> 34.8 5610 -> 5518

Walking (a scripted 140 s walk; it wanders, so draws differ between runs by up to a third), three pairs (off, on, on, off, off, on):

Pair Card ms/frame (settled median), off -> on avg fps, off -> on draws/frame median, off -> on
1 20.3 -> 16.9 31.2 -> 32.5 7965 -> 7707
2 18.3 -> 17.5 33.7 -> 32.4 5587 -> 7598
3 19.6 -> 16.9 32.2 -> 33.6 7843 -> 6679

The card was faster with the six on in all five pairs. Pair 2 of the walk had the smallest gap; its off-run walked a lighter stretch (5.6k against 7.6k draws).

Not covered: I measured the levers together, not one by one. Nobody has checked the picture by eye on this card yet (the specks risk you mention for LEGACY_FINITE). I'll add a note here if we see any. I didn't check whether the unfolded list does anything on a wave64 AMD host; I'd expect it not to.

AMD numbers, as asked: **RX 7900 XTX** (24 GB, driver 32.0.32029.2010), Ryzen 7 7800X3D, Windows 11. **Card time in the title's lists: -2.5 ms a frame standing still (19.1 to 16.6 ms, -13 %), -2.3 ms on a walk.** No fps change here: this PC is CPU-bound in this scene (the submitting thread 22-28 ms a frame), so the card's saving doesn't show as frame rate. Setup: PR head 581ee600f built as is (diag profile), the same build both ways. Old defaults set as in your description (`DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas`, `DARNER_SHADER_LOOP_LIMIT_OF` pointed at no program; the "these programs' loops stop sooner" warning was in every on-run's log and in none of the off-runs). Series S profile (1920x1080, no upscaler), hardware ray tracing, no frame generation, frame rate uncapped, `DARNER_RELAY=2 DARNER_PORT_CBV=1`. A heavy downtown save, pipelines warmed for both arms beforehand, the last 120 s of each run measured, arms alternated. No device losses, no pipelines compiled during the measured part. **Standing still** (same view every run, 5.5k draws a frame), two pairs (off, on, on, off): | Pair | Card ms/frame (settled median), off -> on | avg fps, off -> on | draws/frame median, off -> on | |---|---|---|---| | 1 | 18.9 -> 16.6 | 35.2 -> 34.4 | 5485 -> 5530 | | 2 | 19.3 -> 16.6 | 33.1 -> 34.8 | 5610 -> 5518 | **Walking** (a scripted 140 s walk; it wanders, so draws differ between runs by up to a third), three pairs (off, on, on, off, off, on): | Pair | Card ms/frame (settled median), off -> on | avg fps, off -> on | draws/frame median, off -> on | |---|---|---|---| | 1 | 20.3 -> 16.9 | 31.2 -> 32.5 | 7965 -> 7707 | | 2 | 18.3 -> 17.5 | 33.7 -> 32.4 | 5587 -> 7598 | | 3 | 19.6 -> 16.9 | 32.2 -> 33.6 | 7843 -> 6679 | The card was faster with the six on in all five pairs. Pair 2 of the walk had the smallest gap; its off-run walked a lighter stretch (5.6k against 7.6k draws). Not covered: I measured the levers together, not one by one. Nobody has checked the picture by eye on this card yet (the specks risk you mention for `LEGACY_FINITE`). I'll add a note here if we see any. I didn't check whether the unfolded list does anything on a wave64 AMD host; I'd expect it not to.
First-time contributor
@TrustNo1

Tested #76 merged onto bd0de0c (the v2026.12.03.01 release commit) together with #23, #36, #37, #92 and #98. RTX 5090, driver 621.14, hardware RT, DLSS Quality, Series X profile, 1440p.

With all six changes at their new defaults, roads showed large dark blotches with blocky, speckled edges, spreading around cars, most visible at sunset (long shadows). With DARNER_LEGACY_FINITE=0 and the other five still on, they were gone during an 8½-minute drive.

This matches the risk the PR names: a value that isn't finite reaches a legacy multiply, and the temporal passes spread the resulting NaN. Maybe keep LEGACY_FINITE off by default until the source is found. The other five gave no picture problems we noticed.

Dark blotches on the road with DARNER_LEGACY_FINITE at its new default

Tested #76 merged onto `bd0de0c` (the v2026.12.03.01 release commit) together with #23, #36, #37, #92 and #98. RTX 5090, driver 621.14, hardware RT, DLSS Quality, Series X profile, 1440p. With all six changes at their new defaults, roads showed large dark blotches with blocky, speckled edges, spreading around cars, most visible at sunset (long shadows). With `DARNER_LEGACY_FINITE=0` and the other five still on, they were gone during an 8½-minute drive. This matches the risk the PR names: a value that isn't finite reaches a legacy multiply, and the temporal passes spread the resulting NaN. Maybe keep `LEGACY_FINITE` off by default until the source is found. The other five gave no picture problems we noticed. ![Dark blotches on the road with DARNER_LEGACY_FINITE at its new default](https://git.gtahub.st/attachments/35b19b7f-a456-4e26-8d5d-04844a51edbd)
Contributor

A/B of this PR on an RTX 2070 SUPER (Turing, 8 GB). The six levers on give about +27 % fps here (13.2 to 16.7). Two runs per arm.

Setup. PR head 581ee600f, built as our measuring build (diag profile, diagnostics feature, DLSS SDK), not the release/PGO exe. The same exe in both arms:

  • B = PR defaults, no switches.
  • A = old defaults as in the description: DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas, with DARNER_SHADER_LOOP_LIMIT_OF pointed at no program.

Xbox Series S profile, DLSS Performance (720p to 1440p), the darner play set of 68 switches from play.rs at 581ee600f, no frame generation. PC: Ryzen 7 5800X, 32 GB, driver 621.40, Windows 11 build 26320, Resizable BAR off, GPU clocks unlocked. The same save each run, 240 s in the world, scored on the last 180 per-second frame lines. One unscored warm run per arm first (each arm did its own full shader preload, since the switches change the cache key). Then A1, B1, B2, A2. The warm runs (the first run after each cache-key change, 77 s to the world) scored 14.99 fps (A) and 15.04 fps (B); we left them out under our settle rule because compiles and caches were still settling, and we can't say why they show no gap.

Run avg fps median frame p95 frame 1 % low draws (median) errors
A1 (old defaults) 13.55 79.3 ms 79.8 ms ~10.1 fps 6039 0
B1 (PR defaults) 16.59 57.9 ms 68.1 ms ~11.8 fps 5799 0
B2 (PR defaults) 16.82 54.3 ms 65.9 ms ~12.2 fps 5905 0
A2 (old defaults) 12.78 80.0 ms 83.3 ms ~9.7 fps 6023 0

A averages 13.17 fps, B 16.71 fps: +26.9 %, and the median frame is 23.6 ms shorter. Both B runs are above both A runs, and A2 is lower than A1, so the order did not favour B. The save loaded to a frame line in about 60 s with B and 69 to 80 s with A.

Not measured: GPU time per frame (we did not extract it, so this is frame time, not card time), any split between the six levers (all six were switched together), and more than two runs per arm.

Picture: we compared screenshots of A1 and B1 at the same point of the run, and played about four minutes on the PR defaults. To our eyes it looked the same. This is a visual check, not an image diff.

On this NVIDIA card DARNER_LEGACY_FINITE should do nothing: in 581ee600f it is read only in the RDNA branch of legacy_mul (crates/darner-shader/src/emit/lower.rs lines 4670 and 4676), which needs host_rdna(), and that is on only for an AMD card (or DARNER_HOST_RDNA=1). We read this in the code and did not test it with that switch off alone, so the gain here comes from the other five levers. It also means this run says nothing about the dark road blotches f41 reported.

Spec dependence: measured on one PC only (Turing, wave32, 8 GB near its memory budget), with all six levers switched together; untested on other cards.

Logs are not attached because this is a test report. We can attach the four logs, with user and PC names removed, if you want them.

Drafted with AI assistance (Claude Code).

A/B of this PR on an RTX 2070 SUPER (Turing, 8 GB). The six levers on give about +27 % fps here (13.2 to 16.7). Two runs per arm. **Setup.** PR head 581ee600f, built as our measuring build (diag profile, diagnostics feature, DLSS SDK), not the release/PGO exe. The same exe in both arms: - B = PR defaults, no switches. - A = old defaults as in the description: `DARNER_LEGACY_FINITE=0 DARNER_MOVREL_WATERFALL=0 DARNER_LICM_CBUF=0 DARNER_SHADER_OPT=447 DARNER_WAVE_FOLDED_SKIP=lightAtlas`, with `DARNER_SHADER_LOOP_LIMIT_OF` pointed at no program. Xbox Series S profile, DLSS Performance (720p to 1440p), the `darner play` set of 68 switches from play.rs at 581ee600f, no frame generation. PC: Ryzen 7 5800X, 32 GB, driver 621.40, Windows 11 build 26320, Resizable BAR off, GPU clocks unlocked. The same save each run, 240 s in the world, scored on the last 180 per-second frame lines. One unscored warm run per arm first (each arm did its own full shader preload, since the switches change the cache key). Then A1, B1, B2, A2. The warm runs (the first run after each cache-key change, 77 s to the world) scored 14.99 fps (A) and 15.04 fps (B); we left them out under our settle rule because compiles and caches were still settling, and we can't say why they show no gap. | Run | avg fps | median frame | p95 frame | 1 % low | draws (median) | errors | |---|---|---|---|---|---|---| | A1 (old defaults) | 13.55 | 79.3 ms | 79.8 ms | ~10.1 fps | 6039 | 0 | | B1 (PR defaults) | 16.59 | 57.9 ms | 68.1 ms | ~11.8 fps | 5799 | 0 | | B2 (PR defaults) | 16.82 | 54.3 ms | 65.9 ms | ~12.2 fps | 5905 | 0 | | A2 (old defaults) | 12.78 | 80.0 ms | 83.3 ms | ~9.7 fps | 6023 | 0 | A averages 13.17 fps, B 16.71 fps: +26.9 %, and the median frame is 23.6 ms shorter. Both B runs are above both A runs, and A2 is lower than A1, so the order did not favour B. The save loaded to a frame line in about 60 s with B and 69 to 80 s with A. **Not measured:** GPU time per frame (we did not extract it, so this is frame time, not card time), any split between the six levers (all six were switched together), and more than two runs per arm. Picture: we compared screenshots of A1 and B1 at the same point of the run, and played about four minutes on the PR defaults. To our eyes it looked the same. This is a visual check, not an image diff. On this NVIDIA card `DARNER_LEGACY_FINITE` should do nothing: in 581ee600f it is read only in the RDNA branch of `legacy_mul` (`crates/darner-shader/src/emit/lower.rs` lines 4670 and 4676), which needs `host_rdna()`, and that is on only for an AMD card (or `DARNER_HOST_RDNA=1`). We read this in the code and did not test it with that switch off alone, so the gain here comes from the other five levers. It also means this run says nothing about the dark road blotches f41 reported. Spec dependence: measured on one PC only (Turing, wave32, 8 GB near its memory budget), with all six levers switched together; untested on other cards. Logs are not attached because this is a test report. We can attach the four logs, with user and PC names removed, if you want them. Drafted with AI assistance (Claude Code).
Author
Contributor

@f41 Thanks, I couldn't reproduce this myself, but it could be related. I've had some funkiness with shadows and reflections myself, but they're unchanged by those changes. Can you try this PR alone (idk if #23 could be part of it too) at the same spot?

I can't quite pin down what the issue is here, there's still some roughness to HW RT and quite a few race conditions that are a pain to track down or provoke, so if you could run a couple more A/B just to be sure,
If you're confident that this setting is the cause, I'll narrow the switch down to constant buffers only (or some other subset where Infinite just doesn't make sense).

@f41 Thanks, I couldn't reproduce this myself, but it could be related. I've had some funkiness with shadows and reflections myself, but they're unchanged by those changes. Can you try this PR alone (idk if #23 could be part of it too) at the same spot? I can't quite pin down what the issue is here, there's still some roughness to HW RT and quite a few race conditions that are a pain to track down or provoke, so if you could run a couple more A/B just to be sure, If you're confident that this setting is the cause, I'll narrow the switch down to constant buffers only (or some other subset where Infinite just doesn't make sense).
Author
Contributor

Addendum, as Jesper pointed out above (and I checked in the code): DARNER_LEGACY_FINITE is only read in the AMD form of the legacy multiply (legacy_mul in lower.rs), which is on only for AMD cards or with DARNER_HOST_RDNA=1. On an NVIDIA card with the defaults it changes no shader math; changing it only changes the shader cache key, so every shader is rebuilt fresh. @f41, did you have DARNER_HOST_RDNA=1 set? If not, this switch can't have caused the blotches, and the clean drive after changing it was more likely the fresh rebuild or one of the races I mentioned.

On my side (RTX 2080 Ti, hardware RT), the glitches I see (a flashing mirror, grainy shadows) are unchanged with DARNER_LEGACY_FINITE=0, and unchanged with the AMD forms off entirely. I'll also correct the PR description: LEGACY_FINITE only counts on AMD cards (or with DARNER_HOST_RDNA=1), so the +9 % on my card comes from the other five levers.

Addendum, as Jesper pointed out above (and I checked in the code): `DARNER_LEGACY_FINITE` is only read in the AMD form of the legacy multiply (`legacy_mul` in `lower.rs`), which is on only for AMD cards or with `DARNER_HOST_RDNA=1`. On an NVIDIA card with the defaults it changes no shader math; changing it only changes the shader cache key, so every shader is rebuilt fresh. @f41, did you have `DARNER_HOST_RDNA=1` set? If not, this switch can't have caused the blotches, and the clean drive after changing it was more likely the fresh rebuild or one of the races I mentioned. On my side (RTX 2080 Ti, hardware RT), the glitches I see (a flashing mirror, grainy shadows) are unchanged with `DARNER_LEGACY_FINITE=0`, and unchanged with the AMD forms off entirely. I'll also correct the PR description: `LEGACY_FINITE` only counts on AMD cards (or with `DARNER_HOST_RDNA=1`), so the +9 % on my card comes from the other five levers.

You're both right; I checked it in lower.rs. DARNER_LEGACY_FINITE is read only in the RDNA form of legacy_mul, and DARNER_HOST_RDNA was not set on this RTX 5090. So setting it to 0 changed only the shader cache key here, and my attribution was wrong. Sorry for the noise.

A/B since then, same settings both ways (Series X profile, 1440p, DLSS Quality, frame generation off, hardware RT), same area: main 57dea7f with #23, and the combined build with #76. No blotches in either, but these were short runs (under a minute each in the world). I can't reproduce the blotches on demand, so I can't tie them to #76. Both earlier runs had freshly rebuilt shader caches, so a rebuild alone doesn't explain the clean drive either. More likely a different spot, time of day, or one of the HW RT races you mention. If I catch them again, I'll post the log and the spot.

You're both right; I checked it in `lower.rs`. `DARNER_LEGACY_FINITE` is read only in the RDNA form of `legacy_mul`, and `DARNER_HOST_RDNA` was not set on this RTX 5090. So setting it to 0 changed only the shader cache key here, and my attribution was wrong. Sorry for the noise. A/B since then, same settings both ways (Series X profile, 1440p, DLSS Quality, frame generation off, hardware RT), same area: `main` `57dea7f` with #23, and the combined build with #76. No blotches in either, but these were short runs (under a minute each in the world). I can't reproduce the blotches on demand, so I can't tie them to #76. Both earlier runs had freshly rebuilt shader caches, so a rebuild alone doesn't explain the clean drive either. More likely a different spot, time of day, or one of the HW RT races you mention. If I catch them again, I'll post the log and the spot.
First-time contributor

Test report on an RTX 5080.

Hardware: RTX 5080 (NVIDIA 621.40), Ryzen 7 9800X3D, 32 GB, Windows 11 build 26300.

Setup: both builds from source (cargo build --release --locked -p darner), same settings both ways (1440p, DLSS, frame generation 2x, Series X), the same save (Jason's house), one manual ~5 minute drive per build, pipelines warm, F1 closed while driving. I scored only gameplay frame lines from the logs (dropped loading/menu lines: frame time < 10 ms).

Run frame lines median fps median frame median card time
main 57dea7f 92 27.6 36.2 ms 26.2 ms
#76 581ee600f 67 28.7 34.8 ms 25.4 ms

That is +1.1 fps (+4 %) and -1.4 ms a frame (-0.8 ms of card time) here: the same direction as the other reports, a smaller gain than on the Turing cards. The card is still the limit in this scene on this PC.

Not measured: one run per arm, the six levers not split apart, the two drives were not the same route, no image diff. No picture faults noticed in either drive.

Drafted with AI assistance (OpenCode).

Test report on an RTX 5080. Hardware: RTX 5080 (NVIDIA 621.40), Ryzen 7 9800X3D, 32 GB, Windows 11 build 26300. Setup: both builds from source (`cargo build --release --locked -p darner`), same settings both ways (1440p, DLSS, frame generation 2x, Series X), the same save (Jason's house), one manual ~5 minute drive per build, pipelines warm, F1 closed while driving. I scored only gameplay frame lines from the logs (dropped loading/menu lines: frame time < 10 ms). | Run | frame lines | median fps | median frame | median card time | |---|---|---|---|---| | main `57dea7f` | 92 | 27.6 | 36.2 ms | 26.2 ms | | #76 `581ee600f` | 67 | 28.7 | 34.8 ms | 25.4 ms | That is +1.1 fps (+4 %) and -1.4 ms a frame (-0.8 ms of card time) here: the same direction as the other reports, a smaller gain than on the Turing cards. The card is still the limit in this scene on this PC. Not measured: one run per arm, the six levers not split apart, the two drives were not the same route, no image diff. No picture faults noticed in either drive. Drafted with AI assistance (OpenCode).
First-time contributor

On an RTX 4070 Ti SUPER, the warmed reverse-order pair showed 0.26 ms less GPU work per frame on average across its two intervals. The FPS differences were +0.26 and +0.01. The first pair showed a larger difference but also had substantially different draw counts, so I could not establish a repeatable FPS gain on this scene.

Launch Build Rendered FPS, interval 1 / 2 GPU work, ms/frame p99 frame time, ms Median draws/frame
1 Base 26.27 / 26.07 35.82 / 36.15 45.30 / 45.93 7097 / 7099
2 Patched 27.25 / 27.06 33.89 / 34.16 62.72 / 66.84 6296 / 6321
3 Patched 27.95 / 27.45 33.05 / 33.72 59.92 / 60.03 6224 / 6414
4 Base 27.69 / 27.44 33.43 / 33.86 59.10 / 58.76 6330 / 6344

These are archived runs from the original CodeFloe PR 295. Base 28ef3ddb, patched 8e4b9cd0. Git stable patch ID f97fc5a772fc822ae6c2a9b6ac117aabef728e70 matches the six-file diff at 581ee600. The Forgejo head has a different base and still needs a fresh run.

Windows 11, i5-13600KF, 32 GB RAM, RTX 4070 Ti SUPER 16 GB, driver 617.14. Series X, native 2560×1440, 30 FPS cap, hardware RT off, DLSS off, FG off. Same copied save, same keyed input by a parked car, separate cache per build. Each launch waited for clear shader/pipeline counters for 10 s, warmed up for 45 s, then recorded two 45 s intervals. FPS uses frame count divided by summed frame intervals. GPU work uses summed card_lists_ms per frame. The final two launches had zero shader misses, pipeline builds or waits in their scored intervals, and median sampled GPU load was 99%. Traffic varied.

On an RTX 4070 Ti SUPER, the warmed reverse-order pair showed 0.26 ms less GPU work per frame on average across its two intervals. The FPS differences were +0.26 and +0.01. The first pair showed a larger difference but also had substantially different draw counts, so I could not establish a repeatable FPS gain on this scene. | Launch | Build | Rendered FPS, interval 1 / 2 | GPU work, ms/frame | p99 frame time, ms | Median draws/frame | |---:|---|---|---|---|---| | 1 | Base | 26.27 / 26.07 | 35.82 / 36.15 | 45.30 / 45.93 | 7097 / 7099 | | 2 | Patched | 27.25 / 27.06 | 33.89 / 34.16 | 62.72 / 66.84 | 6296 / 6321 | | 3 | Patched | 27.95 / 27.45 | 33.05 / 33.72 | 59.92 / 60.03 | 6224 / 6414 | | 4 | Base | 27.69 / 27.44 | 33.43 / 33.86 | 59.10 / 58.76 | 6330 / 6344 | These are archived runs from the original CodeFloe PR 295. Base `28ef3ddb`, patched `8e4b9cd0`. Git stable patch ID `f97fc5a772fc822ae6c2a9b6ac117aabef728e70` matches the six-file diff at `581ee600`. The Forgejo head has a different base and still needs a fresh run. Windows 11, i5-13600KF, 32 GB RAM, RTX 4070 Ti SUPER 16 GB, driver 617.14. Series X, native 2560×1440, 30 FPS cap, hardware RT off, DLSS off, FG off. Same copied save, same keyed input by a parked car, separate cache per build. Each launch waited for clear shader/pipeline counters for 10 s, warmed up for 45 s, then recorded two 45 s intervals. FPS uses frame count divided by summed frame intervals. GPU work uses summed `card_lists_ms` per frame. The final two launches had zero shader misses, pipeline builds or waits in their scored intervals, and median sampled GPU load was 99%. Traffic varied.
TrustNo1 manually merged commit 89889c2a4e into main 2026-12-04 02:13:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
9 participants
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!76
No description provided.