First draw waits for a registered buffer being materialized #409

Open
opened 2026-12-04 20:25:58 +00:00 by tyr0nsur · 0 comments
Contributor

What you see

On the RTX 4060, the first host frame interval containing title draws stalls at startup. The first swap-chain Present was already accepted. The affected row was Present 3, with two draws and zero recorded pipeline wait in all four stock runs.

To reproduce, launch a Series S test profile with the warmed Darner cache described below. Keep eight thin translators and set DARNER_FIND_INDEX to 1/0/0/1 on separate launches. Collect DARNER_BENCH_CSV and a six-interval DARNER_TIMELINE from startup. Stop after the startup window. Match the first CSV row with draws to the pending recording in the timeline.

Stock main run Index First interval with draws Title Present waits for prior send Longest shadow::lookup_buffer wait in the early trace
A1 on 217.753 ms 164.902 ms 111.941 ms
B1 off 173.462 ms 143.440 ms 89.635 ms
B2 off 164.480 ms 138.373 ms 89.308 ms
A2 on 209.854 ms 166.742 ms 112.075 ms

Both off runs shortened this startup interval. A following draw still waited in lookup_buffer. A separate local diagnostics build on the same base measured the following phases (one capture per mode, for attribution):

Index Reader acquiring registered-buffer lock Critical draw materializing a registered buffer under write lock Within that span, before buffer_sides Within buffer_sides
on 107.568 ms 107.915 ms 99.946 ms 7.874 ms
off 115.271 ms 115.374 ms 107.647 ms 7.632 ms

The reader's lock wait overlaps the critical draw's materialization span by about 107.5 and 115.2 ms respectively. The long span begins before the ordinary allocation helper. The exact pre-allocation operation remains open. This follows the first-draw symptom observed while testing worker counts in #37.

Before you post

  • I read the pinned known-issues thread at the top of the issue list (https://git.gtahub.st/TrustNo1/Darner/issues). If my problem is listed there, I reply in that thread instead of opening this.
  • This issue is about one problem.
  • I verified the game files and run no mods.

RAY TRACING in F1

Off.

GPU and driver

NVIDIA GeForce RTX 4060 8 GB, driver 621.40.

CPU, RAM and Windows version

Ryzen 7 5800X (16 logical threads), 32 GB RAM, Windows 11 Pro build 26300.

Darner release or commit

f3840d73 on main. I built the stock and local diagnostics images with Rust 1.98.1 using cargo build --locked --offline -j 2 --profile fast --features diagnostics -p darner, line-table symbols enabled and incremental compilation disabled.

Settings

Series S, 1920×1080 output, DLSS Quality, DLSS FG 2×, RT and HDR off, half textures. Isolated test profiles. Each launch began with byte-identical warmed Darner caches. DARNER_ADAPTER=RTX 4060, DARNER_THIN=1, DARNER_THIN_THREADS=8, DARNER_THIN_HEAP_ORDER=1, DARNER_THIN_UPLOAD_ORDER=1, DARNER_THIN_UPLOAD_WAIT_US=50000, DARNER_FIRST_START_PRELOAD=0, DARNER_LOG=info, DARNER_LONG_FRAMES=1, DARNER_BENCH_CSV, and DARNER_TIMELINE=0,6 with a 4-second stall timeout. DARNER_FIND_INDEX is the stock A/B variable. The phase timings use extra local trace scopes enabled only on the separate diagnostic image.

Log files attached

Sanitized excerpts are in the two tables. All four stock traces loaded the same mapped host pipeline library and reached Present 3, then the harness stopped each launch. Host Present-call timing was 0.692 / 1.679 / 0.839 / 0.729 ms. The measurements cover CPU-side scheduling and host presentation. Time of first visible screen content and sustained gameplay remain unmeasured in this test.

Are you working on a fix?

Investigating the operations that precede buffer_sides under the registry write lock. I have a local trace probe and a repeatable startup test.

### What you see On the RTX 4060, the first host frame interval containing title draws stalls at startup. The first swap-chain Present was already accepted. The affected row was Present 3, with two draws and zero recorded pipeline wait in all four stock runs. To reproduce, launch a Series S test profile with the warmed Darner cache described below. Keep eight thin translators and set `DARNER_FIND_INDEX` to `1/0/0/1` on separate launches. Collect `DARNER_BENCH_CSV` and a six-interval `DARNER_TIMELINE` from startup. Stop after the startup window. Match the first CSV row with draws to the pending recording in the timeline. | Stock `main` run | Index | First interval with draws | Title Present waits for prior send | Longest `shadow::lookup_buffer` wait in the early trace | | --- | --- | ---: | ---: | ---: | | A1 | on | 217.753 ms | 164.902 ms | 111.941 ms | | B1 | off | 173.462 ms | 143.440 ms | 89.635 ms | | B2 | off | 164.480 ms | 138.373 ms | 89.308 ms | | A2 | on | 209.854 ms | 166.742 ms | 112.075 ms | Both off runs shortened this startup interval. A following draw still waited in `lookup_buffer`. A separate local diagnostics build on the same base measured the following phases (one capture per mode, for attribution): | Index | Reader acquiring registered-buffer lock | Critical draw materializing a registered buffer under write lock | Within that span, before `buffer_sides` | Within `buffer_sides` | | --- | ---: | ---: | ---: | ---: | | on | 107.568 ms | 107.915 ms | 99.946 ms | 7.874 ms | | off | 115.271 ms | 115.374 ms | 107.647 ms | 7.632 ms | The reader's lock wait overlaps the critical draw's materialization span by about 107.5 and 115.2 ms respectively. The long span begins before the ordinary allocation helper. The exact pre-allocation operation remains open. This follows the first-draw symptom observed while testing worker counts in [#37](https://git.gtahub.st/TrustNo1/Darner/pulls/37#issuecomment-872036). ### Before you post - [x] I read the pinned known-issues thread at the top of the issue list (https://git.gtahub.st/TrustNo1/Darner/issues). If my problem is listed there, I reply in that thread instead of opening this. - [x] This issue is about one problem. - [ ] I verified the game files and run no mods. ### RAY TRACING in F1 Off. ### GPU and driver NVIDIA GeForce RTX 4060 8 GB, driver 621.40. ### CPU, RAM and Windows version Ryzen 7 5800X (16 logical threads), 32 GB RAM, Windows 11 Pro build 26300. ### Darner release or commit `f3840d73` on `main`. I built the stock and local diagnostics images with Rust 1.98.1 using `cargo build --locked --offline -j 2 --profile fast --features diagnostics -p darner`, line-table symbols enabled and incremental compilation disabled. ### Settings Series S, 1920×1080 output, DLSS Quality, DLSS FG 2×, RT and HDR off, half textures. Isolated test profiles. Each launch began with byte-identical warmed Darner caches. `DARNER_ADAPTER=RTX 4060`, `DARNER_THIN=1`, `DARNER_THIN_THREADS=8`, `DARNER_THIN_HEAP_ORDER=1`, `DARNER_THIN_UPLOAD_ORDER=1`, `DARNER_THIN_UPLOAD_WAIT_US=50000`, `DARNER_FIRST_START_PRELOAD=0`, `DARNER_LOG=info`, `DARNER_LONG_FRAMES=1`, `DARNER_BENCH_CSV`, and `DARNER_TIMELINE=0,6` with a 4-second stall timeout. `DARNER_FIND_INDEX` is the stock A/B variable. The phase timings use extra local trace scopes enabled only on the separate diagnostic image. ### Log files attached Sanitized excerpts are in the two tables. All four stock traces loaded the same mapped host pipeline library and reached Present 3, then the harness stopped each launch. Host Present-call timing was 0.692 / 1.679 / 0.839 / 0.729 ms. The measurements cover CPU-side scheduling and host presentation. Time of first visible screen content and sustained gameplay remain unmeasured in this test. ### Are you working on a fix? Investigating the operations that precede `buffer_sides` under the registry write lock. I have a local trace probe and a repeatable startup test.
TrustNo1 changed title from [performance][startup][memory] First draw waits for a registered buffer being materialized to First draw waits for a registered buffer being materialized 2026-12-06 03:20:49 +00:00
Sign in to join this conversation.
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#409
No description provided.