The prelude worker follows the helpers' priority, like the other threads the submitting thread waits for #322

Open
iridiumlotus wants to merge 2 commits from iridiumlotus/Darner:prelude-raised into Main
Contributor

What it changes

  • The problem on main: a frame timeline (DARNER_TIMELINE, diagnostics build of main f3840d7 plus #216) on an 8-core CPU, standing still in the open world: the submitting thread waits 7.7 ms a frame for darner-prelude in ten waits (WaitOnAddress at host::Host::submit < host::Host::send_late, ended by darner-prelude), while that thread runs only 4.4 ms a frame. On the chain each frame's present came out of, darner-prelude stands "woken, not running yet" for about 3.9 ms a frame (15.6 ms in the four frames sampled), more than half of the chain's 6.8 ms a frame of "woken, not running yet".

DARNER_ASYNC_PRELUDES (on by default) records a submission's preludes on a worker thread, and the submitting thread joins it before it sends. The submitting thread runs above normal priority (or as DARNER_SUBMIT_PRIORITY says, or highest on a core of its own), and the other threads it waits for are raised as well by the helpers' priority policy (DARNER_HELPERS_RAISED, on by default: above normal, or the number in DARNER_HELPER_PRIORITY; darner-wide, the land pools, darner-heap-sync, darner-aside, ...). The prelude worker was started at normal priority, so on a CPU where the title's threads and the list translators keep every core busy it waits for a processor while the submitting thread waits for it. That is the case DARNER_HELPERS_RAISED was made for (its comment in cores.rs describes it on a 6-core CPU); this thread was not on its list.

This gives the prelude worker a cores::Priority, kept before each batch of preludes like the other helpers, so it follows the same policy they do: with DARNER_HELPERS_RAISED on (the default) above normal, or the number in DARNER_HELPER_PRIORITY if one is given; with it off, normal. The submitting thread's own priority (DARNER_SUBMIT_PRIORITY, highest on a dedicated core) is not copied. Five lines in host.rs plus the comment there; the helpers_raised comment lists the thread and the measurement.

Not in this PR: keeping the worker on the fast cores of a hybrid CPU (keep_on_fast_cores), which the other helpers also ask for. I have no hybrid CPU to measure it on.

How it was tested

Update, 2026-12-05 (UTC): rebased onto main c8258f9 (head da1db11); git range-diff shows both commits unchanged. On the rebased tree cargo clippy -p darner-gpu --all-targets --locked -- -D warnings passed and cargo test -p darner-gpu --locked passed (1,805 passed, 0 failed, 81 ignored). The workspace-wide gates and the game runs below are from before the rebase and were not repeated on it.

  • Tested revision: d0bd297 (this branch, on main f3840d7) for the clippy gates and the policy check; the tests ran on its parent 6ffc294 (the head only rewords a code comment, after the review comment below). In the game: a release build of 270e8bf, the same code (the later commits differ only in comments and in the commit message), with scripts\play-nvidia.ps1 -NoMenu -Dlss ultraperformance: loaded the save and stood in the world for the 2 minutes of the run, 0 errors; read from outside the process 150 s after the start, darner-prelude is at thread priority 1, as darner-submit, darner-aside, darner-wide-0, darner-late-wait, darner-relay and darner-list-0 are.

  • Commands and results: the A/B below; gates further down.

  • Changes a default: yes, for everyone with DARNER_ASYNC_PRELUDES and DARNER_HELPERS_RAISED at their defaults (both on). It changes one thread's priority. Expected to matter where the CPU is fully busy (8 cores or fewer) and to do nothing where a core is free for the worker anyway.

  • A/B result: in-run A/B with DARNER_AB (same run, same scene, the switch flipped every 7 or 10 seconds). DARNER_AB can only flip DARNER_HELPERS_RAISED for all helpers at once, so these numbers are from an experiment build: main f3840d7 plus #216 plus this change behind a temporary switch of its own (not in this PR), built with --release --features ab. In it the worker's priority read from outside flips between 0 and 1 with the phases while the other threads stay at 1. Ryzen 7 5800X3D (8 cores, 16 threads), RTX 5080, 32 GB, Windows 11; scripts\play-nvidia.ps1 -NoMenu -Dlss ultraperformance (Series X profile, 2560x1440 output, scene 853x480, no ray tracing, no frame generation; the launcher sets DARNER_HELPER_PRIORITY=1, and the submitting thread is at 1 as well: no dedicated core, no DARNER_SUBMIT_PRIORITY), standing still in the open world on a daytime save, copied fresh from a backup for each run; 13.4 of the 16 logical processors busy. The scene's draw count moves between 6,700 and 14,600 a frame in a 60-second cycle, so each phase's mean frame time is fitted as a + b * draws + effect (A = the fit's value with the worker at normal priority; B - A = the effect):

    A (worker at normal priority) B - A (worker raised)
    Run 1: 7 s phases, 79 phases 42.1 ms at 9,772 draws (23.8 fps) -1.9 ms +-0.2 (-4.5 %)
    Run 1, the 47 phases under 9,100 draws 38.5 ms at 7,976 draws -2.5 ms +-0.2 (-6.6 %)
    Run 2: 7 s phases, 77 phases 42.6 ms at 9,935 draws -1.4 ms +-0.3 (-3.2 %)
    Run 3: 10 s phases, 54 phases 42.9 ms at 9,665 draws -1.8 ms +-0.2 (-4.1 %)
    Run 4: 10 s phases, two switches, 29 phases (7 with only this one on) 44.8 ms at 10,267 draws -2.7 ms +-0.5 (-6.1 %)
    Run 5: 10 s phases, DARNER_ASYNC_PRELUDES as the second switch, 29 phases 46.5 ms at 11,099 draws -1.7 ms +-0.8 (-3.7 %)

    Run 1 is the one to go by: it has every other thread as the launcher sets it. In runs 2 to 5 the experiment build also held darner-late-wait and darner-relay at priority 0 (the launcher's DARNER_HELPER_PRIORITY=1 has them at 1; a sixth run that flipped those two showed nothing: +0.8 ms +-0.8 and -0.5 ms +-0.8). With 10 s phases the A/B cycle is in step with the scene's 60-second cycle, so the busy stretch fell on the same side every time and the fit over draws has to carry that; runs 1 and 2 have 7 s phases for that reason. In run 5, DARNER_ASYNC_PRELUDES=0 is -0.5 ms +-0.7 against the worker at normal priority.

    Also tried and left out because it adds nothing on top of the raise: the submitting thread recording the preludes itself when the worker has not begun them (-1.5 ms +-0.5 alone).

  • Gates run (the three in AGENTS.md; there is no CI): cargo clippy --workspace --all-targets --locked -- -D warnings passed; the same with --all-features passed; cargo xtask policy passed (555 files ok); those three on d0bd297. cargo test --workspace --locked --no-fail-fast on 6ffc294 did not pass as a whole on this PC: every package passes except three tests outside this change (it touches host.rs and a comment in cores.rs, both in darner-gpu):

    • darner-gpu: 1,772 passed, 1 failed: watch::tests::ask_once_by_res_splits_reservations_without_refusals. It or watch::watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs fails in most full runs of the package here, on main f3840d7 without this change as well (3 full runs of 3 on main; 3 of 4 on this branch, the fourth all passed), and the first passes when run alone (3 of 3).
    • darner-shader: 556 passed, 1 failed: emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders (the fixture #227 fixes; it fails on main here too, see #216).
    • darner-shader oracle64::legacy_mul_forms_are_exact did not finish: it goes through every float in a debug build; I stopped it after 25 minutes and ran the rest of the package without it.
  • Gameplay, when relevant: RTX 5080, Series X profile, 2560x1440, DLSS ultra performance, no frame generation, no ray tracing.

  • Shader wave sizes tested, when relevant: not relevant.

  • Hardware dependence: may depend on the CPU. Measured on 8 cores / 16 threads. Untested on CPUs with more cores, on hybrid CPUs, and with the submitting thread on a dedicated core (dual-CCD V-Cache CPUs), where it runs at highest priority and the worker stays at the helpers' priority.

  • Coverage gaps: one scene (standing still, daytime), one PC. Not measured while driving or in cutscenes. Not measured with DARNER_SUBMIT_PRIORITY or DARNER_HELPER_PRIORITY set to anything but the launcher's values. The frame times are from the experiment build described above, not from this exact commit; this commit's exe is not comparable run against run yet (it is a new build here, and its first runs still made pipelines).

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • 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 for prelude, ASYNC_PRELUDES, HELPERS_RAISED or thread priority (open and closed, 2026-12-04). #274 also changes host.rs, in another place (the retirement queues).
  • Replaces or overlaps: none found
## What it changes - The problem on main: a frame timeline (`DARNER_TIMELINE`, diagnostics build of main `f3840d7` plus #216) on an 8-core CPU, standing still in the open world: the submitting thread waits **7.7 ms a frame** for `darner-prelude` in ten waits (`WaitOnAddress at host::Host::submit < host::Host::send_late`, ended by `darner-prelude`), while that thread runs only 4.4 ms a frame. On the chain each frame's present came out of, `darner-prelude` stands "woken, not running yet" for about 3.9 ms a frame (15.6 ms in the four frames sampled), more than half of the chain's 6.8 ms a frame of "woken, not running yet". `DARNER_ASYNC_PRELUDES` (on by default) records a submission's preludes on a worker thread, and the submitting thread joins it before it sends. The submitting thread runs above normal priority (or as `DARNER_SUBMIT_PRIORITY` says, or highest on a core of its own), and the other threads it waits for are raised as well by the helpers' priority policy (`DARNER_HELPERS_RAISED`, on by default: above normal, or the number in `DARNER_HELPER_PRIORITY`; `darner-wide`, the `land` pools, `darner-heap-sync`, `darner-aside`, ...). The prelude worker was started at normal priority, so on a CPU where the title's threads and the list translators keep every core busy it waits for a processor while the submitting thread waits for it. That is the case `DARNER_HELPERS_RAISED` was made for (its comment in `cores.rs` describes it on a 6-core CPU); this thread was not on its list. This gives the prelude worker a `cores::Priority`, kept before each batch of preludes like the other helpers, so it follows the same policy they do: with `DARNER_HELPERS_RAISED` on (the default) above normal, or the number in `DARNER_HELPER_PRIORITY` if one is given; with it off, normal. The submitting thread's own priority (`DARNER_SUBMIT_PRIORITY`, highest on a dedicated core) is not copied. Five lines in `host.rs` plus the comment there; the `helpers_raised` comment lists the thread and the measurement. Not in this PR: keeping the worker on the fast cores of a hybrid CPU (`keep_on_fast_cores`), which the other helpers also ask for. I have no hybrid CPU to measure it on. ## How it was tested Update, 2026-12-05 (UTC): rebased onto main `c8258f9` (head `da1db11`); `git range-diff` shows both commits unchanged. On the rebased tree `cargo clippy -p darner-gpu --all-targets --locked -- -D warnings` passed and `cargo test -p darner-gpu --locked` passed (1,805 passed, 0 failed, 81 ignored). The workspace-wide gates and the game runs below are from before the rebase and were not repeated on it. - Tested revision: `d0bd297` (this branch, on main `f3840d7`) for the clippy gates and the policy check; the tests ran on its parent `6ffc294` (the head only rewords a code comment, after the review comment below). In the game: a release build of `270e8bf`, the same code (the later commits differ only in comments and in the commit message), with `scripts\play-nvidia.ps1 -NoMenu -Dlss ultraperformance`: loaded the save and stood in the world for the 2 minutes of the run, 0 errors; read from outside the process 150 s after the start, `darner-prelude` is at thread priority 1, as `darner-submit`, `darner-aside`, `darner-wide-0`, `darner-late-wait`, `darner-relay` and `darner-list-0` are. - Commands and results: the A/B below; gates further down. - Changes a default: yes, for everyone with `DARNER_ASYNC_PRELUDES` and `DARNER_HELPERS_RAISED` at their defaults (both on). It changes one thread's priority. Expected to matter where the CPU is fully busy (8 cores or fewer) and to do nothing where a core is free for the worker anyway. - A/B result: in-run A/B with `DARNER_AB` (same run, same scene, the switch flipped every 7 or 10 seconds). `DARNER_AB` can only flip `DARNER_HELPERS_RAISED` for all helpers at once, so these numbers are from an experiment build: main `f3840d7` plus #216 plus this change behind a temporary switch of its own (not in this PR), built with `--release --features ab`. In it the worker's priority read from outside flips between 0 and 1 with the phases while the other threads stay at 1. Ryzen 7 5800X3D (8 cores, 16 threads), RTX 5080, 32 GB, Windows 11; `scripts\play-nvidia.ps1 -NoMenu -Dlss ultraperformance` (Series X profile, 2560x1440 output, scene 853x480, no ray tracing, no frame generation; the launcher sets `DARNER_HELPER_PRIORITY=1`, and the submitting thread is at 1 as well: no dedicated core, no `DARNER_SUBMIT_PRIORITY`), standing still in the open world on a daytime save, copied fresh from a backup for each run; 13.4 of the 16 logical processors busy. The scene's draw count moves between 6,700 and 14,600 a frame in a 60-second cycle, so each phase's mean frame time is fitted as `a + b * draws + effect` (A = the fit's value with the worker at normal priority; B - A = the effect): | | A (worker at normal priority) | B - A (worker raised) | |---|---|---| | Run 1: 7 s phases, 79 phases | 42.1 ms at 9,772 draws (23.8 fps) | **-1.9 ms +-0.2 (-4.5 %)** | | Run 1, the 47 phases under 9,100 draws | 38.5 ms at 7,976 draws | -2.5 ms +-0.2 (-6.6 %) | | Run 2: 7 s phases, 77 phases | 42.6 ms at 9,935 draws | -1.4 ms +-0.3 (-3.2 %) | | Run 3: 10 s phases, 54 phases | 42.9 ms at 9,665 draws | -1.8 ms +-0.2 (-4.1 %) | | Run 4: 10 s phases, two switches, 29 phases (7 with only this one on) | 44.8 ms at 10,267 draws | -2.7 ms +-0.5 (-6.1 %) | | Run 5: 10 s phases, `DARNER_ASYNC_PRELUDES` as the second switch, 29 phases | 46.5 ms at 11,099 draws | -1.7 ms +-0.8 (-3.7 %) | Run 1 is the one to go by: it has every other thread as the launcher sets it. In runs 2 to 5 the experiment build also held `darner-late-wait` and `darner-relay` at priority 0 (the launcher's `DARNER_HELPER_PRIORITY=1` has them at 1; a sixth run that flipped those two showed nothing: +0.8 ms +-0.8 and -0.5 ms +-0.8). With 10 s phases the A/B cycle is in step with the scene's 60-second cycle, so the busy stretch fell on the same side every time and the fit over draws has to carry that; runs 1 and 2 have 7 s phases for that reason. In run 5, `DARNER_ASYNC_PRELUDES=0` is -0.5 ms +-0.7 against the worker at normal priority. Also tried and left out because it adds nothing on top of the raise: the submitting thread recording the preludes itself when the worker has not begun them (-1.5 ms +-0.5 alone). - Gates run (the three in AGENTS.md; there is no CI): `cargo clippy --workspace --all-targets --locked -- -D warnings` passed; the same with `--all-features` passed; `cargo xtask policy` passed (555 files ok); those three on `d0bd297`. `cargo test --workspace --locked --no-fail-fast` on `6ffc294` did not pass as a whole on this PC: every package passes except three tests outside this change (it touches `host.rs` and a comment in `cores.rs`, both in darner-gpu): - darner-gpu: 1,772 passed, 1 failed: `watch::tests::ask_once_by_res_splits_reservations_without_refusals`. It or `watch::watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochs` fails in most full runs of the package here, on main `f3840d7` without this change as well (3 full runs of 3 on main; 3 of 4 on this branch, the fourth all passed), and the first passes when run alone (3 of 3). - darner-shader: 556 passed, 1 failed: `emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders` (the fixture #227 fixes; it fails on main here too, see #216). - darner-shader `oracle64::legacy_mul_forms_are_exact` did not finish: it goes through every float in a debug build; I stopped it after 25 minutes and ran the rest of the package without it. - Gameplay, when relevant: RTX 5080, Series X profile, 2560x1440, DLSS ultra performance, no frame generation, no ray tracing. - Shader wave sizes tested, when relevant: not relevant. - Hardware dependence: may depend on the CPU. Measured on 8 cores / 16 threads. Untested on CPUs with more cores, on hybrid CPUs, and with the submitting thread on a dedicated core (dual-CCD V-Cache CPUs), where it runs at highest priority and the worker stays at the helpers' priority. - Coverage gaps: one scene (standing still, daytime), one PC. Not measured while driving or in cutscenes. Not measured with `DARNER_SUBMIT_PRIORITY` or `DARNER_HELPER_PRIORITY` set to anything but the launcher's values. The frame times are from the experiment build described above, not from this exact commit; this commit's exe is not comparable run against run yet (it is a new build here, and its first runs still made pipelines). ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [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 for `prelude`, `ASYNC_PRELUDES`, `HELPERS_RAISED` or thread priority (open and closed, 2026-12-04). #274 also changes `host.rs`, in another place (the retirement queues). - Replaces or overlaps: none found
The submitting thread joins darner-prelude before it sends each submission,
and runs above normal priority, as the other threads it waits for do. The
prelude worker was started at normal priority: with every core busy it stood
ready without a processor while the submitting thread waited for it (7.7 ms
a frame in ten waits on an 8-core processor, the worker itself running 4.4).

It now keeps a cores::Priority like the other helpers. In-run A/B on that
processor, standing still in the open world: -1.9 ms a frame +-0.2 of 42.1
(-4.5 %).
Contributor

The implementation makes darner-prelude follow the existing helper priority policy. The submitting thread still reads DARNER_SUBMIT_PRIORITY and can use highest priority when it has a dedicated core. Could the title and the worker comment say that the prelude now follows the other helpers? That would describe the behavior under those overrides as well as the default used for the A/B.

The implementation makes `darner-prelude` follow the existing helper priority policy. The submitting thread still reads `DARNER_SUBMIT_PRIORITY` and can use highest priority when it has a dedicated core. Could the title and the worker comment say that the prelude now follows the other helpers? That would describe the behavior under those overrides as well as the default used for the A/B.
It follows the helpers' priority (cores::Priority: DARNER_HELPERS_RAISED, and
the number in DARNER_HELPER_PRIORITY if one is given), as the other threads the
submitting thread waits for do. The submitting thread's own priority
(DARNER_SUBMIT_PRIORITY, highest on a core of its own) is not copied. Comment
only.
iridiumlotus changed title from WIP: [pr-performance] The prelude worker runs at the submitting thread's priority, like the other threads it waits for to [pr-performance] The prelude worker follows the helpers' priority, like the other threads the submitting thread waits for 2026-12-04 15:17:32 +00:00
Author
Contributor

Thanks, you are right. The worker follows the helpers' priority policy (cores::Priority: DARNER_HELPERS_RAISED, and the number in DARNER_HELPER_PRIORITY if one is given); the submitting thread's own priority (DARNER_SUBMIT_PRIORITY, highest on a dedicated core) is not copied.

Changed: the worker's comment in host.rs says so now (d0bd297, comment only), and so do the title and the description. The A/B ran on the launcher's defaults, where the submitting thread and the helpers are both at 1; the description's coverage gaps now say that those overrides and a dedicated submit core were not measured.

Thanks, you are right. The worker follows the helpers' priority policy (`cores::Priority`: `DARNER_HELPERS_RAISED`, and the number in `DARNER_HELPER_PRIORITY` if one is given); the submitting thread's own priority (`DARNER_SUBMIT_PRIORITY`, highest on a dedicated core) is not copied. Changed: the worker's comment in `host.rs` says so now (d0bd297, comment only), and so do the title and the description. The A/B ran on the launcher's defaults, where the submitting thread and the helpers are both at 1; the description's coverage gaps now say that those overrides and a dedicated submit core were not measured.
Contributor

Test report on an Intel hybrid CPU: no measurable change here.

PC: i7-13700K (8P + 8E, 24 threads), RTX 4080 16 GB (driver 621.40), 64 GB, Windows 11 26300. Series X profile, 1440p with DLSS Quality, frame generation off, hardware ray tracing on, Reflex boost, DARNER_D3D12_BACKGROUND=0.
Builds: A = main 47d21cd + #334, #337, #457, #274, #397, #312, #304. B = A + this PR (d0bd297).
Method: the opening scene of one save, entered the same way every run (no input after the start screen); medians of per-second values from the host log in three 45-second windows from the moment the world appears; warm pipelines; one run of B, A twice.

A (run 1) A (run 2) B: + #322
frame time, ms 31.6 / 31.5 / 31.6 31.3 / 31.6 / 31.6 31.6 / 31.7 / 31.7
submitting thread, ms a frame 21.7 / 20.2 / 20.4 21.4 / 20.7 / 20.7 21.6 / 21.1 / 20.9
card time in the title's lists, ms 24.9 / 24.8 / 24.9 25.2 / 25.1 / 25.2 24.8 / 24.6 / 24.6
card idle behind submit work (DARNER_QUEUE_GAPS=1), ms a frame – 3.5 / 4.0 / 3.9 4.2 / 4.6 / 4.6

Within the run-to-run spread (about 0.3 ms). No errors in the log, and the picture 60 s in matches A. A diagnostics timeline of a similar build (f3840d7 with the same PRs) had the submitting thread waiting on darner-prelude in Host::submit for about 16 ms per 470 ms of trace, so the wait is there on this CPU too; with 24 logical processors the prelude worker seems to get a core either way.

Not tested: more than one run of B, other scenes, a CPU with fewer cores (where the PR's numbers come from).

Test report on an Intel hybrid CPU: no measurable change here. **PC:** i7-13700K (8P + 8E, 24 threads), RTX 4080 16 GB (driver 621.40), 64 GB, Windows 11 26300. Series X profile, 1440p with DLSS Quality, frame generation off, hardware ray tracing on, Reflex boost, `DARNER_D3D12_BACKGROUND=0`. **Builds:** A = main 47d21cd + #334, #337, #457, #274, #397, #312, #304. B = A + this PR (d0bd297). **Method:** the opening scene of one save, entered the same way every run (no input after the start screen); medians of per-second values from the host log in three 45-second windows from the moment the world appears; warm pipelines; one run of B, A twice. | | A (run 1) | A (run 2) | B: + #322 | |---|---|---|---| | frame time, ms | 31.6 / 31.5 / 31.6 | 31.3 / 31.6 / 31.6 | 31.6 / 31.7 / 31.7 | | submitting thread, ms a frame | 21.7 / 20.2 / 20.4 | 21.4 / 20.7 / 20.7 | 21.6 / 21.1 / 20.9 | | card time in the title's lists, ms | 24.9 / 24.8 / 24.9 | 25.2 / 25.1 / 25.2 | 24.8 / 24.6 / 24.6 | | card idle behind submit work (`DARNER_QUEUE_GAPS=1`), ms a frame | – | 3.5 / 4.0 / 3.9 | 4.2 / 4.6 / 4.6 | Within the run-to-run spread (about 0.3 ms). No errors in the log, and the picture 60 s in matches A. A diagnostics timeline of a similar build (f3840d7 with the same PRs) had the submitting thread waiting on `darner-prelude` in `Host::submit` for about 16 ms per 470 ms of trace, so the wait is there on this CPU too; with 24 logical processors the prelude worker seems to get a core either way. Not tested: more than one run of B, other scenes, a CPU with fewer cores (where the PR's numbers come from).
First-time contributor

Thanks for testing submitter takeover alongside the priority change. Did you also compare p95 frame time? In a separate experiment on a 5800X3D and RTX 5080, average FPS barely changed, but the slow frames improved in both short runs.

Final join Real FPS, pooled p95 per run (ms) Frames over 50 ms
Wait for worker 23.43 68.16 / 67.26 213/959 (22.2%)
Claim unstarted work 23.37 58.46 / 56.70 125/956 (13.1%)

Both local builds were based on f3840d73 and already queued independent prelude work early. At the final join, the submitter could take the pending batch under the queue lock only if no worker was active. It recorded outside the lock and appended results after the completed prefix in submission order. One instrumented pass averaged about 9.6 takeovers per frame.

Two warmed 20.5 s walking replays per build, Series X, hardware RT, DLSS Quality (3413×960 to 5120×1440), frame generation off. No counted dropped draws or dispatches in these windows. Traffic can vary. One pass per build had extra timing enabled.

These runs did not test #322 or establish a gain on top of raised priority. If you still have the takeover variant, comparing p95 and the share over 50 ms at fixed raised priority might be worthwhile.

Thanks for testing submitter takeover alongside the priority change. Did you also compare p95 frame time? In a separate experiment on a 5800X3D and RTX 5080, average FPS barely changed, but the slow frames improved in both short runs. | Final join | Real FPS, pooled | p95 per run (ms) | Frames over 50 ms | | --- | ---: | ---: | ---: | | Wait for worker | 23.43 | 68.16 / 67.26 | 213/959 (22.2%) | | Claim unstarted work | 23.37 | 58.46 / 56.70 | 125/956 (13.1%) | Both local builds were based on `f3840d73` and already queued independent prelude work early. At the final join, the submitter could take the pending batch under the queue lock only if no worker was active. It recorded outside the lock and appended results after the completed prefix in submission order. One instrumented pass averaged about 9.6 takeovers per frame. Two warmed 20.5 s walking replays per build, Series X, hardware RT, DLSS Quality (3413×960 to 5120×1440), frame generation off. No counted dropped draws or dispatches in these windows. Traffic can vary. One pass per build had extra timing enabled. These runs did not test #322 or establish a gain on top of raised priority. If you still have the takeover variant, comparing p95 and the share over 50 ms at fixed raised priority might be worthwhile.
First-time contributor

Test report for d0bd297 merged on top of release v2026.12.04.01, on an 8-core CPU (the report above is from a 24-thread one).

Measured: release build of v2026.12.04.01 (6 runs) against the same release + this PR (2 runs), each build after an uncounted warm-up run. Same save every run (the prison start, the cut to the plane, the first part on the boat) with recorded controller input, about 6.5 minutes a run. Launcher defaults for priorities (no DARNER_SUBMIT_PRIORITY / DARNER_HELPER_PRIORITY set).

v2026.12.04.01 (6 runs) + #322 (2 runs)
fps (mean of runs) 38.58 (38.25-39.01) 38.66 (38.65 / 38.67)
CPU frame preparation, ms (from the fps line) 8.67 (8.38-8.88) 7.60 (7.61 / 7.58)
submitting thread, ms a frame 10.30 (10.03-10.51) 9.20 (9.20 / 9.20)
frame time median / p95 / p99, ms 26.12 / 28.48 / 34.65 26.00 / 27.83 / 33.80
frames over 100 ms, per run 9.0 (6-13) 10.5 (10 / 11)
crashes 0 0

Both PR runs have CPU preparation about 1 ms (12%) lower than every base run; the other builds measured on this release the same day (three other PRs and one switch, 8 runs) stayed between 8.37 and 9.10 ms, so this looks tied to the PR. p95 and p99 are also below every base run, by a little (about 0.6 and 0.8 ms on the means). Frame rate: no measurable difference: on this route the frame time is not set by the CPU side, so the lower preparation time does not show up as fps. Frames over 100 ms: no change. No crashes, in one PR run a single "placed texture lies inside the memory of a texture the host writes" warning (resource.rs), which also showed up once in a release-only run of v2026.12.03.02. Only 2 PR runs, so the spread on the PR side is not known yet.

PC: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D (8 cores / 16 threads), 32 GB, Windows 11; scripts\build-darner.ps1 -Build release, Series X profile, 1440p native, DLSS Quality, no frame generation, fullscreen, no fps cap.

Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.

Test report for `d0bd297` merged on top of release v2026.12.04.01, on an 8-core CPU (the report above is from a 24-thread one). **Measured:** release build of v2026.12.04.01 (6 runs) against the same release + this PR (2 runs), each build after an uncounted warm-up run. Same save every run (the prison start, the cut to the plane, the first part on the boat) with recorded controller input, about 6.5 minutes a run. Launcher defaults for priorities (no `DARNER_SUBMIT_PRIORITY` / `DARNER_HELPER_PRIORITY` set). | | v2026.12.04.01 (6 runs) | + #322 (2 runs) | |---|---|---| | fps (mean of runs) | 38.58 (38.25-39.01) | 38.66 (38.65 / 38.67) | | CPU frame preparation, ms (from the fps line) | 8.67 (8.38-8.88) | 7.60 (7.61 / 7.58) | | submitting thread, ms a frame | 10.30 (10.03-10.51) | 9.20 (9.20 / 9.20) | | frame time median / p95 / p99, ms | 26.12 / 28.48 / 34.65 | 26.00 / 27.83 / 33.80 | | frames over 100 ms, per run | 9.0 (6-13) | 10.5 (10 / 11) | | crashes | 0 | 0 | Both PR runs have CPU preparation about 1 ms (12%) lower than every base run; the other builds measured on this release the same day (three other PRs and one switch, 8 runs) stayed between 8.37 and 9.10 ms, so this looks tied to the PR. p95 and p99 are also below every base run, by a little (about 0.6 and 0.8 ms on the means). Frame rate: no measurable difference: on this route the frame time is not set by the CPU side, so the lower preparation time does not show up as fps. Frames over 100 ms: no change. No crashes, in one PR run a single "placed texture lies inside the memory of a texture the host writes" warning (`resource.rs`), which also showed up once in a release-only run of v2026.12.03.02. Only 2 PR runs, so the spread on the PR side is not known yet. PC: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D (8 cores / 16 threads), 32 GB, Windows 11; `scripts\build-darner.ps1 -Build release`, Series X profile, 1440p native, DLSS Quality, no frame generation, fullscreen, no fps cap. Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.
Author
Contributor

I had only compared means at the time, so I measured it now.

Builds: one exe for both arms: main c8258f9 + this PR + the variant behind a temporary switch (release build). A = this PR as it is (the submitting thread waits for the worker at the join). B = at the join the submitting thread takes the batch and records it itself when the worker has not begun it.

Method: a recorded 320-second walk through the city at night (same save, same controller input), per-frame times from DARNER_BENCH_CSV, order A B B A A B. Ryzen 7 5800X3D + RTX 5080, Series S, DLSS Performance to 2560x1440, frame generation and ray tracing off, DARNER_ASYNC_PRELUDES=1, six list-translation threads.

A: wait for the worker B: take work not begun
fps 31.47 / 30.84 / 31.62 32.05 / 32.02 / 32.25
p95, ms 43.7 / 44.4 / 43.7 42.7 / 43.0 / 42.0
p99, ms 51.7 / 51.6 / 51.9 50.9 / 51.2 / 49.9
frames over 50 ms 1.4 / 1.3 / 1.4 % 1.2 / 1.2 / 1.0 %
frame time fitted at 5,500 draws, ms 31.7 / 32.7 / 32.0 31.4 / 32.1 / 31.5
draws a frame 5,597 / 5,487 / 5,435 5,491 / 5,245 / 5,403

In B the submitting thread took 4.6 to 5.3 of the 15 to 17 submissions' batches a frame.

Reading: p95 is about 1.4 ms (3 %) lower in every B run than in every A run, and the share over 50 ms a little lower. The mean at equal draws is 0.5 ms lower, which is inside the run-to-run spread here (about 0.4 ms), and two B runs had slightly lighter traffic. So a small gain in the slow frames on this scene, far from your 68 to 57 ms; this walk has few frames over 50 ms to begin with (1.4 %), yours had 22 %.

Not tested: Series X, ray tracing on, your resolution, more than three runs per arm. It stays out of this PR (one change per PR). If you open yours, I can run it on this bench.

I had only compared means at the time, so I measured it now. **Builds:** one exe for both arms: main `c8258f9` + this PR + the variant behind a temporary switch (release build). A = this PR as it is (the submitting thread waits for the worker at the join). B = at the join the submitting thread takes the batch and records it itself when the worker has not begun it. **Method:** a recorded 320-second walk through the city at night (same save, same controller input), per-frame times from `DARNER_BENCH_CSV`, order A B B A A B. Ryzen 7 5800X3D + RTX 5080, Series S, DLSS Performance to 2560x1440, frame generation and ray tracing off, `DARNER_ASYNC_PRELUDES=1`, six list-translation threads. | | A: wait for the worker | B: take work not begun | |---|---|---| | fps | 31.47 / 30.84 / 31.62 | 32.05 / 32.02 / 32.25 | | p95, ms | 43.7 / 44.4 / 43.7 | 42.7 / 43.0 / 42.0 | | p99, ms | 51.7 / 51.6 / 51.9 | 50.9 / 51.2 / 49.9 | | frames over 50 ms | 1.4 / 1.3 / 1.4 % | 1.2 / 1.2 / 1.0 % | | frame time fitted at 5,500 draws, ms | 31.7 / 32.7 / 32.0 | 31.4 / 32.1 / 31.5 | | draws a frame | 5,597 / 5,487 / 5,435 | 5,491 / 5,245 / 5,403 | In B the submitting thread took 4.6 to 5.3 of the 15 to 17 submissions' batches a frame. Reading: p95 is about 1.4 ms (3 %) lower in every B run than in every A run, and the share over 50 ms a little lower. The mean at equal draws is 0.5 ms lower, which is inside the run-to-run spread here (about 0.4 ms), and two B runs had slightly lighter traffic. So a small gain in the slow frames on this scene, far from your 68 to 57 ms; this walk has few frames over 50 ms to begin with (1.4 %), yours had 22 %. Not tested: Series X, ray tracing on, your resolution, more than three runs per arm. It stays out of this PR (one change per PR). If you open yours, I can run it on this bench.
TrustNo1 changed title from [pr-performance] The prelude worker follows the helpers' priority, like the other threads the submitting thread waits for to The prelude worker follows the helpers' priority, like the other threads the submitting thread waits for 2026-12-06 03:30:17 +00:00
Owner

Test needed — commit da1db11e; what to check:

  • The problem on main: a frame timeline (DARNER_TIMELINE, diagnostics build of main f3840d7 plus #216) on an 8-core CPU, standing still in the open world: the submitting thread waits 7.7 ms a frame for darner-prelude in ten waits (WaitOnAddress at host::Host::submit < host::Host::send_late, ended by darner-prelude), while that thread runs only 4.4 ms a frame. On the chain each frame's present came out of, darner-prelude stands "woken, not running yet" for about 3.9 ms a frame (15.6 ms in the four frames sampled), more than half of the chain's 6.8 ms a frame of "woken, not running yet".

DARNER_ASYNC_PRELUDES (on by default) records a submission's preludes on a worker thread, and the submitting thread joins it before it sends. The submitting thread runs above normal priority (or as DARNER_SUBMIT_PRIORITY says, or highest on a core of its own), and the other threads it waits for are raised as well by the helpers' priority policy (DARNER_HELPERS_RAISED, on by default: above normal, or the number in DARNER_HELPER_PRIORITY; darner-wide, the land pools, darner-heap-sync, darner-aside, ...). The prelude worker was started at normal priority, so on a CPU whe

Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.

Reply testing to take this run; it's free again after 24 h with no results.

**Test needed** — commit `da1db11e`; what to check: - The problem on main: a frame timeline (`DARNER_TIMELINE`, diagnostics build of main `f3840d7` plus #216) on an 8-core CPU, standing still in the open world: the submitting thread waits **7.7 ms a frame** for `darner-prelude` in ten waits (`WaitOnAddress at host::Host::submit < host::Host::send_late`, ended by `darner-prelude`), while that thread runs only 4.4 ms a frame. On the chain each frame's present came out of, `darner-prelude` stands "woken, not running yet" for about 3.9 ms a frame (15.6 ms in the four frames sampled), more than half of the chain's 6.8 ms a frame of "woken, not running yet". `DARNER_ASYNC_PRELUDES` (on by default) records a submission's preludes on a worker thread, and the submitting thread joins it before it sends. The submitting thread runs above normal priority (or as `DARNER_SUBMIT_PRIORITY` says, or highest on a core of its own), and the other threads it waits for are raised as well by the helpers' priority policy (`DARNER_HELPERS_RAISED`, on by default: above normal, or the number in `DARNER_HELPER_PRIORITY`; `darner-wide`, the `land` pools, `darner-heap-sync`, `darner-aside`, ...). The prelude worker was started at normal priority, so on a CPU whe Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture. Reply `testing` to take this run; it's free again after 24 h with no results.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'prelude-raised:iridiumlotus-prelude-raised'
git switch 'iridiumlotus-prelude-raised'

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 'iridiumlotus-prelude-raised'
git switch 'iridiumlotus-prelude-raised'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'iridiumlotus-prelude-raised'
git switch 'iridiumlotus-prelude-raised'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'iridiumlotus-prelude-raised'
git switch 'Main'
git merge --squash 'iridiumlotus-prelude-raised'
git switch 'Main'
git merge --ff-only 'iridiumlotus-prelude-raised'
git switch 'Main'
git merge 'iridiumlotus-prelude-raised'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
6 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!322
No description provided.