Repository navigation
Conversation
This was referenced Nov 29, 2026
This was referenced Nov 30, 2026
lukaslw-lab
reviewed
Nov 30, 2026
lukaslw-lab
left a comment
Contributor
There was a problem hiding this comment.
Reviewed f3793797 by reading the diff, then ran it merged onto main 44a3ad5a with #3506, #3464, #3521 and #3097 (no tests run). Reads correct; one point for the rebase.
- Long run for "Not covered" (360 s from a save, native only, RTX 3080 Ti): main alone stops at the #3451 fault after 125 s; with this PR and #3506, three runs reached 360 s. This does not separate the two PRs.
- Concurrent preparation of different keys looks safe: a compiler per call (
d3d12_draw.inl:774), DXIL and frontend cache writes go through unique temp files and a rename, and the catalog sits behind a mutex. - Rebase: main's
NativeShaderTimer(d3d12_xs_device.cpp:433) assumes both native paths holddraw_lockand logsdraw_lock_ms. After this PR the graphics time is unlocked: 14.5 s over 56 compiles in our run. Rename it or measure only the locked part.max_ticksload-then-store can also lose a maximum now.
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3451 (graphics part, taken over in #3451 (comment) and #3451 (comment)).
Draft, kept as a draft under our open-PR cap in #3514.
Why
In a long local run of the application, presents stopped about 32-37 s before the application's watchdog fault, while cold graphics translations were being loaded and compiled under
draw_lock. #3506 moves this work off the lock for compute only.The approach follows @lukaslw-lab's compute design in #3467 (worker/unlocked translation); this PR is a separate implementation for graphics.
What changes
src/startup_stubs/d3d12_draw.inl: preparing the translation of a cold graphics key now runs on the initiating call withdraw_lockreleased. Preparation covers the key hash and plain-key.txtprobe, request writes, manifest and bytecode reads, eligible native compilation and translated root signature creation, for base keys and RTV variants.attach_device(d3d12_xs_device.cpp) now writes the device global under the lock.CREATE_NEW, renamed without replace.docs/startup-runtime.mdgets a section on the lock scope. The edit also removes the sentence saying native translation covers compute only.What stays under the lock
Translated PSO creation and command recording. Moving PSO creation is a follow-up.
Tests
New, in
tests/cmake/startup_graphics_published_load.cmake, each on WARP and hardware:startup_graphics_published_load_unlock_*: with a cold load paused, a draw on another key and a guest queue submission complete before the load is released.startup_graphics_published_load_concurrent_*: a same-key peer waits and the key is prepared once; an interrupted attempt is retried after its deadline and not before; a result prepared on a superseded device is not installed.startup_graphics_published_load_native_backoff_*: in native-only mode, an abandoned preparation is not re-entered before each deadline and is re-entered after it, for 1, 2, 4, 8, 16, 32 and 32 s.startup_graphics_published_load_precedence_*: published translation before native.Results at f379379 on main 5b86df1:
ctest -j1 -R '^startup_graphics_published_load_': 8/8 passed, no skips.native_backofftakes about 96 s per adapter because it probes the real backoff intervals.ctest -j4 -R '^(startup_indirect_|startup_stream_consumer|startup_native_graphics_draw_|native_rtv_variant_|startup_manifest_retry$)': 106/106 passed.^(startup_indirect_|startup_stream_consumer|startup_slot57_|native_fixed_mesh57_|startup_translated_|startup_draw_): 138 tests, 135 passed, 2 skipped (startup_draw_depth_target_debug_*), 1 failed (native_fixed_mesh57_waterfall_fine_hardware, the known tests: native_fixed_mesh57_waterfall_fine_hardware fails on main (mip 1 colour read where mip 0 is expected) #3489 failure).Environment for these runs. They are host runs of our own code, not runs in an isolated environment.
_hardware)_warp)devpreset,X2W_WITH_OPUS=OFFdevpreset,X2W_WITH_OPUS=OFFMutations, each applied alone and rebuilt:
unlock("independent draw or guest submission stalled behind the graphics load"),concurrentconcurrent(timeout)concurrentconcurrent("interrupted graphics key never retried")concurrentprecedencenative_backoff, both adaptersThe last one and the first were run at or after e8ad9ad. The other five were run on an earlier head of this branch (cd49b0c with the two fixes that followed), not repeated at f379379.
Not covered
.rtvrequest is not published and native is not tried for that key.native_backoffuses wall-clock margins (250 ms at the 1 s step). It passed with both adapters in parallel, but a heavily loaded host could miss the margin.