D3D12.X: a slow graphics pipeline waits at most 4 s once per build (#232) #267
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!267
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/267/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@heretic1321 on GitHub · 2026-11-23 22:08 UTC · original
heretic1321:fix/retail-null-write-232→main· +310 −6 · 3 files · 1 commits · closed without mergingPart of #232. Rebased cleanly onto
upstream/main(6bac4b4, headef98154), integrating#574and#690and addressing@Kalmarv's and@qinrxx's review findings.Root cause & change
main, graphics pipelines created lazily are sent toxcl-psoworkers atSetPipelineState, andbind::graphics_bound/execute_indirectthen callpso_async::resolve_wait, holding the title's recording thread without limit (and compiling on the title thread itself if no worker has taken the job yet). On NVIDIA GPUs where big translated shaders can take > 10 s, that stalls watched threads long enough to trip the title's watchdog (title+0x2215c35,*(int *)0 = 0, #232).crates/xcl/src/hle/d3d12x/pso_async.rs:resolve_for_draw/resolve_withinwithXCL_PSO_WAIT_MS(parse_wait_limit, default4000ms as a safety margin under #156's 23 s one-call watchdog trigger;0= unbounded).Pending::late): once one draw times out waiting for a graphics pipeline still building on a worker,p.lateis set so subsequent draws of that pipeline while it is still building return the stand-in immediately (incrementingSTANDIN_DRAWS) instead of holding a thread forN * limit.p.note_use()is called inresolve_withinso#690tracks used graphics pipelines, andresolve_waitlogs waits>= 2 s.draw_wait_tests(a_graphics_pipeline_waits_at_most_once_up_to_the_limit_and_never_builds_on_the_title_thread,compute_pipelines_and_no_limit_wait_as_before,wait_limit_parses_env_values).crates/xcl/src/hle/d3d12x/bind.rs:execute_indirectandgraphics_boundthroughpso_async::resolve_for_draw(keeping#574'sis_pendingskip inexecute_indirectandrs_gfxroot-signature binding for failed/PC pipelines, and usingpso_async::resolveinsidetrace_frame).execute_indirect_with_a_stand_in_binds_the_titles_root_signature_firstand addsexecute_indirect_skips_when_a_still_building_graphics_pipeline_times_outcovering a timed-out pending graphics stand-in.crates/xcl/src/hle/d3d12x/real.rs:standin_draws: usizetoD3d12Stats(report.json → d3d12.standin_draws).Overlaps
#891(Sr-0w) implements opt-inXCL_PSO_WAIT_MSacross both compute and graphics binds viaPending::late, and#533(XaviFortes) bounds compute waits.@imnicho's RTX 5080 retail run on043d1f7showed compute pipeline binds can also trip#232's watchdog when graphics waits stay under 4 s. Keeping this PR cleanly rebased and review-complete for the graphics-only path (where draws are safe to drop without corrupting compute state) unless maintainers prefer#891/#533.Tested
1.95.0, headef98154onupstream/main6bac4b4:AR_x86_64_pc_windows_msvc=llvm-ar cargo check --release --workspace --target x86_64-pc-windows-msvc— exit 0 (15.16s, 0 errors, 0 warnings).AR_x86_64_pc_windows_msvc=llvm-ar cargo check --tests --workspace --target x86_64-pc-windows-msvc— exit 0 (17.72s, 0 errors, 0 warnings).python3 scripts/pr_check.py --localverified all required sections and asset/model checks (failing only on the missing Windowsxcl-smokeblocks foref98154).b5c9057/043d1f7, NOT coveringef98154):@qinrxxtested043d1f7merged onto2997c9aon RTX 5080 (d3d12x::90/0/1;scripts/smoke.ps1 -Seconds 300: 5116 vs 5099 frames, 14991 vs 15011 MB; menus/pre-world only, 0standin_draws).@Chrysanatested043d1f7on RX 9070 XT (cargo test --workspace: 655/0/40, plus 60 ssmoke.ps1merged onto9ce2070: 1526 vs 1536 frames).@imnichotested043d1f7merged onto508a0c7on RTX 5080 (standin_draws: 0at 190 s watchdog; 4 title threads waiting inresolve_waitfor compute).@woreksamitested043d1f7on RTX 3060 (together with#214, plus conflict resolution onto6025201).@Kalmarvreviewedb5c9057and043d1f7on RTX 5070 Ti and WARP.Regression run
ef98154(no Windows GPU host here; earlier043d1f7smoke blocks from@qinrxxand@Chrysanado not coveref98154).Not tested
cargo test --workspaceexecution, GPU tests, andscripts/smoke.ps1/ retail title runs onef98154.AI use
Antigravity with Claude Opus 5.5: wrote the original change, initial tests, and root-cause notes.T3 Code / Antigravity, Orchestrator (Neon) / gemini-pro-orchestrator-neon: rebased ontoupstream/main(6bac4b4), added thePending::lateper-pipeline latch,execute_indirecttimeout test,parse_wait_limittest,p.note_use()call inresolve_within, and ran Linux-to-x86_64-pc-windows-msvccargo checkandscripts/pr_check.py --local.@vladbondarenko97 on GitHub · 2026-11-23 22:57 UTC · original
Tested on an NVIDIA RTX 3080 Ti (Windows 11 10.0.26300, driver 32.0.16.2124, DXC 1.9.2602.17, package 1.0.2.1 verified by hash). Built this branch on top of
9ab7d76(merge clean,-X theirs; both commits applied) and ran withXCL_NETWORK=0,XCL_ACTIVITY=1, lazy pipelines (default), frame dumps on.Result: the run still dies at the early assert before any frame — this PR does not change it here.
report.json:presents: 0,frame_boundaries: 0,shaders.unique: 0,translated_pipelines: 0,failed_pipelines: 0,called_stubs: []unhandled exception 0x80000003 in game_scarlett_master.exe+0x2237178,rax=0 rbx=0 rcx=0 rdx=0x66 r8=0x7efefefefefefeff r9=0x7f656f712d2f6073, vtablegame+0x677c997; stack+0x677c997, +0x579105c, +0x700b71d, +0x53ec0f0, +0x4fac3d79ab7d76and60565c4on this card, and the same first-chance exception under an unrelated clean-room layer (already reported in #301). So on this host the failure predates any pipeline build this PR could wait on.Two data points that may matter for the hypothesis:
Happy to run any revision of this PR on the 3080 Ti and return reports/traces. AI-assisted (Claude Code CLI via a model proxy).
@Kalmarv on GitHub · 2026-11-23 22:40 UTC · original · edited 2026-11-23 23:20 UTC
Review of b5c9057 against main
9ab7d76. The limit does what the description says in a synthetic frame (numbers below). Five things I would change or settle before it goes in.1. The 4 s default is not tied to a known threshold.
wait_for_commit, not a figure for the watchdog.300.0behind a random gate. Its author reads that as 300 ms and found every timestamp zero in a healthy run.XCL_PSO_WAIT_MS=1is the only way to ask for that, because0means no limit. If the threshold is tens of seconds, 4 s is under it.XCL_PSO_WAIT_MS=1run to the reporter's steps, and the breakpoint from #232 (which slot is stale says whether a draw wait is what the watchdog saw at all).XCL_PSO_WAIT_MS=1run and the breakpoint.2.
ExecuteIndirectpast the limit goes to D3D12 without the title's root signature.execute_indirectreturnspc(…)as soon as the pipeline is not a translated one (bind.rs:220).graphics_boundbindsrs_gfxfirst in the same situation (bind.rs:389), with the comment that a draw without a root signature is invalid and faults on WARP.set_graphics_root_signatureonly records it.rs_gfxbeforepc(…). The newexecute_indirect_with_a_stand_in_binds_the_titles_root_signature_firstpasses on Windows, and fails with the binding taken out (onlyExecuteIndirectis recorded).3. Merged with #214 (f007d4a) the tests do not compile.
cargo check --testsfails with E0428: both PRs add a#[cfg(test)] mod teststopso_async.rs.resolve_withinsends the build itself (p.sent.swap+send). #214 moves that intoenqueue, which also counts the pipeline inQUEUED. A pipeline first sent by a draw would be missing from the third number ofbackground_pipelines.queued, asend()helper,xcl-pso-urgentinresolve_wait) is of an older head. f007d4a does not changeresolve_wait.enqueue(p.clone())inresolve_within. #187 (c74b03a) merges with this PR cleanly too; its one line inbind.rsis elsewhere.draw_wait_tests. Merged, the lib tests build and the new tests of both PRs pass. Theenqueuepoint stands for the merged tree:resolve_withinstill does its ownsent.swap+send, so a pipeline first sent by a draw is not counted inQUEUED. The description says so and leaves it to whichever lands second.4. The limit is one budget per present interval for the whole process, not per draw or per thread.
PresentX. Everything drawn before the first present shares one 4 s. A thread that records while another thread keeps presenting gets a new 4 s after every present, so it can still be held for 4 s per unbuilt pipeline, back to back (also from the code).XCL_PSO_WAIT_MS=1the same 8 draws take 0.12 s in all. Remembering per pipeline that its wait was used up would keep the hold at one limit per pipeline.5. A draw past the limit is lost, not delayed.
DRAWS_PC) and draws nothing. Nothing replays it when the pipeline arrives. Later draws use the real pipeline.report.jsoncannot tell these draws from draws with PC pipelines (only the log lines can), and a graphics build is no longer taken by the thread that needs it, so it waits its turn behind everything queued atSetPipelineState. With a deep queue, or #214's two driver slots on NVIDIA, the budget buys less than 4 s of progress on the pipeline being drawn.report.json → d3d12.standin_draws) and the log line says the draw is lost. The remark about queue order is unchanged, and the description now states it.Tested
Synthetic frame, the same test on both trees (
bind::tests, local, not in the PR): two graphics pipelines whose builds take a fixed time (the job sleeps, then hands over a pipeline made beforehand) are first drawn in one frame throughset_pipeline_state/draw_instancedon a title list of a real D3D12 device. Times are the two draw calls and the whole frame (record, execute, fence).XCL_PSO_WAIT_MS9ab7d76pso_async::tests, release build of b5c9057): 2 passed, 0 failed.9ab7d76612 passed, 0 failed, 20 ignored; b5c9057 614 passed, 0 failed, 20 ignored. SKIPPED on this card on both:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64). Lib tests only: the integration tests incrates/xcl/testswere not run.cargo check --release -p xcl --libexit 0,--lib --testsexit 101 (E0428, above). In-memory merges of b5c9057 with f007d4a and with #187 atc74b03a: no conflicts.cargo test -p xcl --lib --no-runbuilds;draw_wait_tests2 passed, 0 failed;execute_indirect_with_a_stand_in_binds_the_titles_root_signature_first1 passed, and 0 passed, 1 failed with the binding removed; #214'sdormant_lazy_pipelines_are_not_counted_as_queued1 passed. The frame times for 043d1f7 under point 4 are from WARP with the same local test, each draw repeated; nothing at this head ran on the RTX 5070 Ti, and the whole suite was not rerun.Not tested
SetPipelineState. The rebind inbind_abiafter a stand-in draw in the same list is from reading.ExecuteIndirect, mesh and two-pass pipelines, more than one drawing thread.🤖 Claude Fable 5.2
@heretic1321 on GitHub · 2026-11-23 23:58 UTC · original
All five review points are addressed at
043d1f7, and the PR is now ready for review.ExecuteIndirect: binds the title's graphics root signature before any stand-in indirect draw (also covers a failed build and a plain PC pipeline), with a regression test that fails without it.XCL_PSO_WAIT_MS=1collapses it.XCL_PSO_WAIT_MS=1added to the reporter steps.draw_wait_tests; a real merged-tree build with #214 atf007d4apassescargo check --release -p xcl --lib --tests, so the collision is gone. If #214 lands first,resolve_withinshould callenqueue(p.clone()).report.json → d3d12.standin_drawsinstead of being log-only.What is still missing to merge: the two
xcl-smokeblocks fromscripts/smoke.ps1(one frommain, one from043d1f7) — I don't have a Windows host. The 4090 and 5070 Ti runs earlier were build/suite and synthetic only.@Kalmarv @vladbondarenko97 @yous0serious — would one of you run the smoke pair on
043d1f7against plainmainwith the same package and the same duration, and paste both blocks under Regression run? Note this branch is intended to be measured together with #214, so if the smoke shows the crash it can help to also run once withXCL_PSO_WAIT_MS=1.@woreksami on GitHub · 2026-11-24 01:39 UTC · original
Test report on NVIDIA, together with #214 (the stall it times out needs #214 to drain at all on this card).
Tested
XCL_NETWORK=0, the newer retail title from the README.maina6f5f7a+ #214 (960162e) + this PR (043d1f7), default limit (4 s): 24 draws hit the limit (not built after 4.0 s), and the title still reached #232's watchdog at ~303 s.XCL_PSO_WAIT_MS=150andXCL_DXC_THREADS=4: no watchdog in ~370 s; the run was ended by my RAM watcher, not by XCL. 0 draws hit the 150 ms limit in that run, so I can't tell whether the shorter limit or the fewer compile threads kept the watchdog away: two things changed at once.cargo test --release -p xcl --libon the merged tree: 642 passed, 0 failed, 21 ignored.Not tested
scripts/smoke.ps1; AMD.AI use
@qinrxx on GitHub · 2026-11-24 02:02 UTC · original
@heretic1321 we have a Windows host with an RTX 5080 and the retail title, and we'll run the smoke pair for
043d1f7tonight. That saves the others asking.043d1f7merged intomain2997c9a(no conflicts, nothing else in the tree, #214 not included),scripts/smoke.ps1 -Seconds 300.mainside: the block from our own regression run on2997c9a, same package, same duration and same presses. We're running it anyway for a related change we're preparing for #232 (compute pipelines built on the workers when made).XCL_PSO_WAIT_MS=1, as you suggested.We'll post the blocks here with the stand-in draw counts and long-wait lines from the logs.
AI use: Claude Code (Claude Opus 5.5) drafted this comment.
@imnicho on GitHub · 2026-11-24 02:05 UTC · original
Test report on the retail title and an NVIDIA card – the run listed under What the reporter must verify.
043d1f7merged ontomain508a0c7, release; #334, #266, #435, #490 and theCopyFromSubresourcefix (as in #539) are merged as well (this PC needs them to get as far as the world's graphics set-up).Machine: Intel Core i7-7700K (4 cores / 8 threads), 16 GB RAM, NVIDIA GeForce RTX 5080 16 GB (driver 610.47, 32-lane waves), Windows 10 22H2 (19045), rustc 1.100.0.
XCL_NETWORK=0, a pad script (XCL_PRESS_AT), defaultXCL_PSO_WAIT_MS.With this PR the title still ends by its null write (#232; at 190 s, 29 s after its last frame) – but not in a draw:
report.json → d3d12.standin_draws: 0, and no "not built after" line: the graphics waits this PR bounds were not what held the title in that run.pso_async::resolve_waitunderresolve_for_bind←bind::set_pipeline_state– waiting for a compute pipeline at its bind – and a fifth title thread was insidenvgpucomp64.dll, building that pipeline (a 316 KB translated compute program) for those 29 s. Allxcl-psoandxcl-dxcworkers were idle.How long those compute builds are – the same build with the title's null write stepped over (a local change, not a fix, so that the compiles finish and the run goes on), cold driver cache for these programs, 4 title threads building at once from ~165 s:
In that 15-minute run: 318 compute pipelines built (24.4 MB of DXIL), 438 DXC compiles (the DXIL cache had none of the world's programs), 39 stand-in draws (this PR at work, with the "not built after 4.0 s" lines), and no frame after about 150 s. For its last nine minutes mostly one title thread built compute pipelines one after another – 125 KB to 222 KB of DXIL each, DXC and then the driver, 4 to 8 a minute – with the other cores and the
xcl-psoworkers idle. The run before it had left three such programs (153 KB – 390 KB, 6 s – 22 s) in the driver's cache; this one did not wait for them again.Not tested: AMD;
XCL_PSO_WAIT_MS=1and=0; a second run on the driver cache this one filled; the draws in the world (not reached yet).AI use: Claude Code with Claude Fable 5.2 ran the builds and runs and wrote this report; every number is from a run on the machine named. No game files are attached.
@Chrysana on GitHub · 2026-11-24 02:48 UTC · original
Test report for
043d1f7on AMD RDNA4, which Not tested lists. On this card the new limit is never reached: no draw waited on a pipeline in any run, and the title runs as onmain.Setup: AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0
x86_64-pc-windows-msvc, DXC 1.9.2602.17. Retail title 1.0.2.1. Debug build for the tests, release builds for the runs.Tests:
cargo test --workspace --no-fail-fast -- --test-threads=4at043d1f7: 655 passed, 0 failed, 40 ignored.SKIPPED: the two debug-layer tests (the D3D12 debug layer isn't installed here).Title runs:
scripts/smoke.ps1 -Game <folder> -Seconds 60withXCL_PRESS_A_AT=14,17,21, same saved state.043d1f7is 52 commits behindmain, so it was also merged ontomain9ce2070(clean, local mergeb0fca42, not pushed):main9ce2070043d1f7merged onto9ce2070043d1f7(its own base4017f8f, which plays the intro video slowly)waited … s for … pipelineand nonot built afterline in any of the three runs, so the stall this PR limits didn't occur on this card within 60 s.Regression run (the PR merged onto
main, since its own base is far behind):main:PR merged onto
main:PR head:
Not tested: the limit itself (nothing reached it here); gameplay past the intro; runs longer than 60 s; with #214.
AI use: Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, read the logs, and wrote this report. The runs were made on my machine.
@qinrxx on GitHub · 2026-11-24 03:36 UTC · original
Smoke pair for
043d1f7, as offered above. Windows host, retail title, the same package and duration for both runs.Setup: NVIDIA GeForce RTX 5080 16 GB, driver 32.0.16.2124; AMD Ryzen 7 9800X3D; 31.6 GB RAM; Windows 11 Pro 26200; rustc 1.100.0; release builds; title 1.0.2.1.
main:2997c9a, no local changes.043d1f7merged intomain2997c9a. That's local merge commit83be934, with no conflicts and nothing else in the tree (#214 not included).scripts/smoke.ps1 -Seconds 300(it setsXCL_NETWORK=0,XCL_ACTIVITY=1), A pressed at 14 / 17 / 21 s throughXCL_PRESS_A_ATin both runs. DefaultXCL_PSO_WAIT_MS(4 s).Regression run
Against
main: 100.3 % of its frames, 99.9 % of its peak commit. No crash and no device removal in either run. The PR run did not end at the watchdog, so theXCL_PSO_WAIT_MS=1run was not needed.From the PR run's logs:
d3d12.standin_draws: 0. Nonot built afterline, and nowaited … for … pipelineline (no wait of 2 s or more).background_pipelines[13, 0, 57810], 3 compute pipelines built.What it does not cover: neither run got to world loading, where #232 stops.
So this is a regression check of the menus and loading before the world (nothing broke there). It doesn't test the draw waits this PR bounds: none reached the limit, or even 2 s.
Not tested: together with #214; world loading; AMD; other cards; a cold DXIL cache.
AI use: Runs: OpenCode with GLM (Z.ai) GLM-5.3, which executed the runs on the hardware above and extracted the numbers. Drafts: Claude Code (Claude Opus 5.5), which built XCL (both trees), checked the figures against the logs and
report.json, and wrote this comment. A human (Qinrxx) reviewed it before posting.@woreksami on GitHub · 2026-11-24 05:14 UTC · original
@heretic1321 this now conflicts with
main(#574's ExecuteIndirect skip inbind.rs, #690'snote_useandsubmit_lazy(…, key)inpso_async.rs). In case it saves you time, here is a resolution I tested; nothing is pushed anywhere.What it does
bind.rs: keepsmain's skip of an ExecuteIndirect whose pipeline is still being built (#574); this PR's side there only changed the comment above the root-signature bind.pso_async.rsresolve_wait: keeps bothp.note_use();(#690) and this PR'slet start = Instant::now();.draw_wait_tests: the threesubmit_lazycalls get #690's newkeyargument (0).Tested
main6025201+ this PR (043d1f7), merged as below:cargo test --release -p xcl --lib: 666 passed, 0 failed, 21 ignored; bothdraw_wait_testspass.XCL_PSO_WAIT_MS=150and no crash.Not tested
scripts/smoke.ps1, the workspace suite.Resolution (
git show --remerge-diffof the merge)AI use: Claude Code with Claude Opus 5.5 resolved the conflicts, ran the tests and wrote this comment.
@heretic1321 on GitHub · 2026-11-24 09:46 UTC · original
Rebased onto
upstream/main(6bac4b4) atef98154fe389c94736d241997c83bccb755c65bb(0 errors, 0 warnings onAR_x86_64_pc_windows_msvc=llvm-ar cargo check --release --workspaceand--tests).Thank you @qinrxx, @Chrysana, @imnicho, @woreksami, and @Kalmarv for all the reviews, test runs, and conflict notes!
Review points addressed in
ef98154:Pending::late) (@Kalmarv point 4, @qinrxx point 1): Once one draw times out waiting for a graphics pipeline still building on a worker,p.lateis latched so subsequent draws of that pipeline return the stand-in immediately (and incrementstandin_draws) instead of waitingN * limit. Updateddraw_wait_teststo assert the second draw returns immediately (< 100 ms).execute_indirecttest (@qinrxx point 2): Addedbind::tests::execute_indirect_skips_when_a_still_building_graphics_pipeline_times_outcovering a blocked graphics build afterlateis tripped, verifying#574's pending skip runs without waiting another limit and without calling PCExecuteIndirect.parse_wait_limitand addeddraw_wait_tests::wait_limit_parses_env_values.#574+#690) (@woreksami): Preserved#574's pendingExecuteIndirectskip and#690'sp.note_use()/submit_lazy(..., key)(and calledp.note_use()inresolve_withinso#690records used graphics pipelines).Note on overlap with
#891/#533:@imnicho's RTX 5080 run on
043d1f7showed that compute pipeline waits inresolve_waitalso hit#232's watchdog when graphics waits stayed under the limit (0standin_drawsat the 190 s abort), and#891(withXCL_PSO_WAIT_MSopt-in across compute + graphics) /#533address that side. This PR stays focused on the safe-by-default 4 s graphics-only bound (since dropping graphics draws does not corrupt compute state); happy to close if maintainers prefer#891alone, or ask for a freshxcl-smokepair onef98154if the default graphics bound is still wanted independently.mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@heretic1321 on GitHub · 2026-11-24 10:07 UTC · original
Closing as superseded by #891 (
5fab112/8cada26), which mergedXCL_PSO_WAIT_MS(with0/ unset waiting indefinitely) and thePending::latelatch directly intopso_async::resolve_wait, covering both compute binds and graphics draws.Thanks to @qinrxx, @Chrysana, @imnicho, @woreksami, and @Kalmarv for all the reviews and Windows/GPU test runs.
@qinrxx on GitHub · 2026-11-24 01:14 UTC · original · reviewed
Review of 043d1f7, on correctness and tests only. The diff was read against
main2997c9a.What I ran:
cargo test -p xcl --lib d3d12x:: -- --test-threads=44017f8f): 81 passed, 0 failed, 1 ignored;main2997c9a(merges without conflicts): 90 passed, 0 failed, 1 ignored. The three new tests pass.1. The limit applies per draw, so a thread that records several draws is still held for about the whole build.
resolve_withingives every draw the fullXCL_PSO_WAIT_MS, andeach_draw_waits_…asserts exactly that ("every draw gets the whole limit"). Take a 17 s NVIDIA build (#156) and a thread that records 5 draws with that pipeline: the draws wait 4 + 4 + 4 + 4 + 1 s, so the thread is held about 17 s, much the same as withresolve_wait. The limit only shortens the hold when each draw of a still-building pipeline comes from a different recording. Would a budget per pipeline work better? Once one draw has given up on a pipeline, later draws of it would not wait (resolve) until it is built. The test would then assert that the second draw returns at once.2. The new
execute_indirectpath is tested only with a failed build, not one that timed out.execute_indirect_with_a_stand_in_binds_the_titles_root_signature_firstusessubmit(standin, false, Box::new(|| 0)), so the pipeline is done and has failed, and the 4 s limit is never reached. A test with a build that is still running and a short limit would cover the case the PR is for: the stand-in returned at the deadline, then the root signature, thenExecuteIndirect.graphics_boundpast the limit has no test either. (From the code, the bind test would fail onmain, whose path doesn't bind the root signature, so it does cover that half. I didn't run it there.)3.
XCL_PSO_WAIT_MSis read once into aOnceLock.The tests get around this by calling
resolve_withindirectly, which is fine. Parsing the variable (0= no limit, junk = the default) has no test. That's minor and could stay as it is.Overlap with a change I'm preparing (for #232, compute pipelines):
xcl-psoworkers when the title creates them, so that the first bind usually finds them built. This PR keeps compute onresolve_wait, and nothing here would change.pso_async.rs(lines 3–8), and mine also changes thelazy()doc. Whichever lands second rebases. Mine changessubmit_as, which this PR doesn't touch.AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests above and wrote this review. I checked each point myself before posting.
@qinrxx on GitHub · 2026-11-24 01:15 UTC · original · reviewed
Review of 043d1f7, on correctness and tests only. The diff was read against
main2997c9a.What I ran:
cargo test -p xcl --lib d3d12x:: -- --test-threads=44017f8f): 81 passed, 0 failed, 1 ignored;main2997c9a(merges without conflicts): 90 passed, 0 failed, 1 ignored. The three new tests pass.1. The limit applies per draw, so a thread that records several draws is still held for about the whole build.
resolve_withingives every draw the fullXCL_PSO_WAIT_MS, andeach_draw_waits_…asserts exactly that ("every draw gets the whole limit"). Take a 17 s NVIDIA build (#156) and a thread that records 5 draws with that pipeline: the draws wait 4 + 4 + 4 + 4 + 1 s, so the thread is held about 17 s, much the same as withresolve_wait. The limit only shortens the hold when each draw of a still-building pipeline comes from a different recording. Would a budget per pipeline work better? Once one draw has given up on a pipeline, later draws of it would not wait (resolve) until it is built. The test would then assert that the second draw returns at once.2. The new
execute_indirectpath is tested only with a failed build, not one that timed out.execute_indirect_with_a_stand_in_binds_the_titles_root_signature_firstusessubmit(standin, false, Box::new(|| 0)), so the pipeline is done and has failed, and the 4 s limit is never reached. A test with a build that is still running and a short limit would cover the case the PR is for: the stand-in returned at the deadline, then the root signature, thenExecuteIndirect.graphics_boundpast the limit has no test either. (From the code, the bind test would fail onmain, whose path doesn't bind the root signature, so it does cover that half. I didn't run it there.)3.
XCL_PSO_WAIT_MSis read once into aOnceLock.The tests get around this by calling
resolve_withindirectly, which is fine. Parsing the variable (0= no limit, junk = the default) has no test. That's minor and could stay as it is.Overlap with a change I'm preparing (for #232, compute pipelines):
xcl-psoworkers when the title creates them, so that the first bind usually finds them built. This PR keeps compute onresolve_wait, and nothing here would change.pso_async.rs(lines 3–8), and mine also changes thelazy()doc. Whichever lands second rebases. Mine changessubmit_as, which this PR doesn't touch.AI use: Claude Code (Claude Opus 5.5) read the diff, ran the tests above and wrote this review. I checked each point myself before posting.
Pull request closed