D3D12.X: offload PSO builds, defer lazy compile-on-draw, and wire mmap ID3D12PipelineLibrary1 #2001
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!2001
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2001"
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?
@raylitebull on GitHub · 2026-11-25 00:35 UTC · original
raylitebull:feat/pso-mmap-lib-and-lazy→main· +2152 −132 · 7 files · 7 commits · openOffloads all PSO compilation off title threads with a shared per-frame wait budget (
pso_async), defers lazy PSO builds until firstDraw/Dispatch/ExecuteIndirect(XCL_LAZY_ON_DRAW), deduplicates used-only startup prewarm (XCL_PSO_PREWARM_USED), and wires a generational memory-mappedID3D12PipelineLibrary1cache (pso_library,pso_libinreal.rs, flushed on clean exit viapresent.rs) into compute, graphics, and mesh PSO creation paths.Part of #1833 (addresses Gaps #1–#5: off-thread PSO builds, bounded per-frame bind wait, deferred compile-on-draw, deduplicated used-only prewarm, and persistent memory-mapped
ID3D12PipelineLibrary1reuse).What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs,list_x.rs,frame.rs, &mod.rs:resolve_waitnever compiles synchronously on calling title threads unlessXCL_PSO_TITLE_BUILD=1; integrates#2080(WorkerItem::Pieceunified intoworkers(), urgent when parent is wanted),625a0f36(returningp.stand(pso)acrossresolve,resolve_for_bind,resolve_if_ready,resolve_withinincluding exhausted-frame-budget early returns, andresolve_sparedso stand-ins never reach the PC driver),#2176(Pending::spared,image_skip(),image_only(),resolve_spared), and#2178/#2296(drop_unstarted_job(&p)+ waking waiters onreleased()alongsidePcCallsframe clamping).frame_rem.is_zero()beforebegin_wait()and uses an RAIIWaitWantGuard(resolve_wait_with_budgetsunbounded path also holdsp.begin_wait()so bounded timeouts never clear an active unbounded waiter'swantedflag); limits the implicit defaultAfterFirstPresent(500 ms)frame budget to graphics PSOs (!p.compute) so compute dispatches are never deferred unlessXCL_PSO_FRAME_WAIT_MS=<ms>(Always) is explicitly set; unconditionally restores workerbase_priorityinbuild()underdemandlock.lazy_on_draw/resolve_for_bind(XCL_LAZY_ON_DRAW, default on whenXCL_LAZY_PSO != 0) defers building lazy pipelines pastSetPipelineState(passiveresolve_if_readylookup) until first draw/dispatch;prewarm_used_enabled(XCL_PSO_PREWARM_USED/XCL_PSO_PRELOAD) deduplicates duplicate shader keys.crates/xcl/src/hle/d3d12x/pso_library.rs: generational memory-mappedID3D12PipelineLibrary1(MmapPipelineLibrary) passing explicit(std::ptr::null(), 0)viaID3D12Device1_Vtbl::CreatePipelineLibraryfor Wine/vkd3d-proton compatibility, synchronizingLoad*+StorePipeline(lib_rw.read()) vs serialization (write) viaRwLock, waiting for in-flight saves duringflush(), and removing rejected/corrupt.plibfiles onopen_or_create.crates/xcl/src/hle/d3d12x/real.rs&present.rs:pso_lib::try_load_compute+store_pipelineinsidetranslated_compute_pso_once(preserving#1592dred::labelon library hits and keepingcompute_containeruntouched for#2080), plus graphics, stream, and meshpso_libwiring (flush_pipeline_libraryon clean close),Entry::Vacant-guardedinsert_cached_blobacrossCOMPUTE_BLOBS/GRAPHICS_BLOBS, deterministicstream_keycontent hashing, PCID3D12PipelineStateadoption (deliver_adopted), and debounced background save scheduler (should_background_save).pso_async::,pso_library::,pso_lib::tests,compute_blob_tests,graphics_blob_tests).Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto728e2548(008d9c1c).cargo check --workspace --tests: passed (0new warnings).cargo test -p xcl --lib pso_async::: 24 passed, 0 failed (including625a0f36,#2296,#2176,#2178,#1782, and all#2001tests).cargo test -p xcl --lib pso_library::: 3 passed, 0 failed.cargo test -p xcl --lib pso_lib::tests: 2 passed, 0 failed.cargo test -p xcl --lib compute_blob_tests: 2 passed, 0 failed.cargo test -p xcl --lib graphics_blob_tests: 5 passed, 0 failed.Regression run
scripts/smoke.ps1pair on008d9c1cvs728e2548has not been run yet. AMD and NVIDIA reviewers are invited to test on008d9c1cvs728e2548(includingscripts/smoke.ps1, cold/warmXCL_PSO_LIBRARY=1world loads,XCL_LAZY_PSO=1, and Linux/vkd3d-proton.plibcreation) and post results in the comments.Not tested
scripts/smoke.ps1pair on008d9c1c, fullcargo test --workspacesuite on008d9c1c, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton runtime.AI use
728e2548, and unit tests; the author reviewed the diff and test output.@WebIdentity1 on GitHub · 2026-11-25 00:47 UTC · original · edited 2026-11-25 00:50 UTC
Confirmed a bind-only escape from
XCL_LAZY_ON_DRAWon7244baadcf009af2a79e94c9fd9c6e7b41d89ab9. The sequence isSetPipelineState(A)followed bySetPipelineState(B), with no draw/dispatch.list_x::on_set_pipeline_statecompares B againstpso_async::resolve(s.bound_pso). That lookup queues A and callsnote_use(), defeating the new deferral policy for a discarded binding. The existing unit test only callsresolve_for_bind, so it misses this bookkeeping path.The small candidate below adds a passive
peekfor this identity comparison. It retains the real-PSO identity once built, without scheduling or recording use.Tested — native Windows 10 19045, Ryzen 7 7800X3D, Rust 1.98.1 MSVC, debug;
XCL_LAZY_PSO=1,XCL_LAZY_ON_DRAW=1:queued=[true,false],used=[true,false].[false,false]. The fixture then explicitly requests and completes both synthetic jobs before assertions/cleanup, checking that later demand still builds them.on_set_pipeline_statetracking routine with synthetic list/pipeline identities and job closures; it performs no COM draw or GPU driver compilation. Both builds recompiled XCL, and all 312 source-file hashes matched before/after.Candidate fix and deterministic regression (36 additions, 1 deletion)
Not tested: full workspace suite, this PR's pipeline-library changes, GPU output, retail smoke, or game-scale compilation-time/memory savings. This is a scheduling/usage-ledger finding, not a merge-readiness claim. No competing PR or source push.
AI use: Codex with GPT-6 Astra traced the hook, wrote the candidate and regression, ran the Windows comparison, and drafted this report.
@gsucristo on GitHub · 2026-11-25 00:57 UTC · original
Technical review findings:
Blocking
XCL_LAZY_ON_DRAWis bypassed bylist_x::on_set_pipeline_state(list_x.rs:839):on_set_pipeline_statecallssuper::pso_async::resolve(s.bound_pso)when switching away from a bound PSO, which still callsp.note_use()and enqueuess.bound_psofor compilation even if nothing was ever drawn with it. Needs a passive lookup inon_set_pipeline_state.released()while a thread waits without a budget (pso_async.rs,workers()&resolve_wait_with_budgets): Inworkers(), ifp.orphan.load(Ordering::Acquire)is true, the worker doescontinue;without setting*p.done = trueand callingp.cv.notify_all(). Any thread blocked inwhile !*done { done = p.cv.wait(done).unwrap(); }(e.g. before first present or withXCL_PSO_FRAME_WAIT_MS=0) will hang forever.StorePipelineandGetSerializedSize/Serialize(pso_library.rs,store&save_if_dirty):save_if_dirtycallsGetSerializedSize(), allocates a fixed-sizeMappedWriteFile, and callsSerialize(buf)without synchronizing against concurrentstore()calls on worker threads. A concurrentStorePipelinegrows the serialized size mid-save (E_INVALIDARG/ driver UB). Needs anRwLockor mutex synchronizingstorevsGetSerializedSize+Serialize.flush_pipeline_library()onWM_CLOSEdrops the final save if background saver is active (pso_library.rs:save_if_dirty,present.rs:wndproc):save_if_dirtyreturns immediately ifself.savingis alreadytrue, soWM_CLOSEproceeds straight toExitProcess(0)and killsxcl-plib-savemid-write, losing unsaved pipelines and leaving an orphaned.tmpfile.flush_now()should wait onsave_lockfor any active save to finish and then flush remaining dirty entries.Major
open_or_create(pso_library.rs) only deletes stale.plibfiles onDRIVER_VERSION_MISMATCH/ADAPTER_NOT_FOUND; a corrupt.plibreturningE_INVALIDARGstays as the latest generation and fails on every subsequent launch.pso_lib::stream_key(real.rs) hashes raw subobject payloads for non-RS/non-shader subobjects, which would hash transient pointers if called on streams containingINPUT_LAYOUT/STREAM_OUTPUT/VIEW_INSTANCING/CACHED_PSO.deliver_adopted(real.rs) passes a consoleriidto PC COMQueryInterface(which fails withE_NOINTERFACEand falls back toraw).@raylitebull on GitHub · 2026-11-25 01:14 UTC · original
Thanks for all the detailed catches,
@WebIdentity1and@gsucristo!Updated
#2001cleanly onto656c0e8(4d53a2c):list_x::on_set_pipeline_state): switched frompso_async::resolveto passivepso_async::resolve_if_readyso A -> BSetPipelineStateswitches no longer enqueue or mark-used a bound-but-never-drawn PSO (XCL_LAZY_ON_DRAWpreserved).pso_async.rs):workers(),preload(), andreleased()now set*p.done = trueand callcv.notify_all()on orphaned/released pending PSOs so unboundedresolve_waitcallers never hang.real.rs,pso_library.rs): addedRwLocksynchronizingStorePipeline(read) againstGetSerializedSize/Serialize(write), changedflush()on shutdown (WM_CLOSE) to wait onsave_lockfor any active background save instead of returning early, and removed rejected/corrupt.plibfiles onopen_or_create.real.rs):stream_keyhashes pointer-bearing pipeline stream subobjects (INPUT_LAYOUT,STREAM_OUTPUT,VIEW_INSTANCING; skipsCACHED_PSO) by pointed-to content, anddeliver_adoptedreturnsID3D12PipelineStatedirectly without querying console IIDs.Verified locally (
cargo check --workspace --tests,pso_async14 passed, 0 failed,pso_library3 passed, 0 failed,pso_lib::tests2 passed, 0 failed).@throny on GitHub · 2026-11-25 01:29 UTC · original
World-loading test of
7244baamerged ontomain279d3ea, on the retail title,XCL_DIRECT_DXIL=1, otherwise this PR's defaults. Two 15-minute runs in a row: the pipeline library cold, then warm. The XCL DXIL cache was warm for every compute program, from a full--precompile --only cs --pipelinesofmain177cd40(#1269).For comparison,
main177cd40with the same caches (compute warm, no pipeline library, one run): last presents at 94 s, then 82 graphics PSO builds in the driver and no further frames, but no watchdog in 900 s and commit at 31 GB.What I saw of the PR's own parts:
gen-00000009(47 MiB, memory-mapped) at 3 s and saved six more generations up to 73 MiB, the largest with 62 new pipelines (at 87 s).mainhit within their runs. One run each, so this may be run-to-run variation, but it is the opposite of what a warm library should do. A second warm run, orXCL_PSO_LIBRARY=0on a warm DXIL cache, would show which.Tested: RTX 4080 16 GB (32-lane waves), i9-12900K, 64 GB (commit limit 68 GB), Windows 11 26300, release build; no input after the menus.
Not tested: the suite on this head, a
mainrun at the same commit (279d3ea), repeat runs, AMD,XCL_PSO_LIBRARY=0/XCL_PSO_TITLE_BUILD=1.AI use: Claude Code (Claude Opus 5.5): ran the tests and wrote this; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
@Anon64 on GitHub · 2026-11-25 01:47 UTC · original
Regression run for this PR: head
7244baa, based onmain80f4819. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
80f4819:this PR:
No device removals or crashes; 101 % of main's frames, 93 % of its peak commit.
Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings:
XCL_DIRECT_DXILandXCL_HEAP_WINDOWSunset).Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@raylitebull on GitHub · 2026-11-25 01:53 UTC · original
Thanks for the detailed RTX 4080 world-load report,
@throny! Your run exposed two real root causes on7244baa, now fixed in1f1d681:37.3 GB) under skipped draws:resolve_withinwas callingp.want()before checkingframe_rem == 0and never cleareddemand.wantedafter a budget skip or timeout — allowing deferred cold huge PSOs to bypassbig_compile_turngates concurrently across workers.1f1d681now checksframe_rem.is_zero()beforebegin_wait()and uses an RAIIWaitWantGuardthat resetswanted = falseif a waiter abandons on budget exhaustion or timeout.4d53a2c'sRwLock+ orphan wakeup fix (previously missing on7244baawhen the 73 MiB save ran), the implicit defaultAfterFirstPresent(500 ms)frame budget was capping compute dispatches (4,096–20,692skipped dispatches ->Wait64BitValueXstalls).1f1d681now applies the implicit defaultAfterFirstPresent(500 ms)cap ONLY to graphics PSOs (!p.compute, while explicitXCL_PSO_FRAME_WAIT_MS=<ms>still covers both), and also takesself.lib_rw.read()aroundMmapPipelineLibrary::load_{compute,graphics,stream}for concurrentLoad*vsSerializesafety + addsdefault_frame_budget_only_defers_graphics_and_never_leaves_skipped_psos_wanted.Compiled cleanly in release (
0errors) and pushed1f1d681for GitHub ActionsBuild and test+ re-testing.@JJAutoCompare on GitHub · 2026-11-25 02:38 UTC · original
PR #2001 verification on STOR-WINLAB
Tested detached head
1f1d681439db77ea01a656dc8fc65aa4eabc7d1bwith a clean tracked worktree.Environment
DoublePrecisionFloatShaderOps=0.%LOCALAPPDATA%\XclTooling\dxc-1.9.2609\bin\x64. Rustrustc 1.100.0 (0ef1bc386 2026-11-09). Unoptimized Cargo dev/test profiles with debug info and incremental compilation disabled.Tested
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the GPU lock.cargo test -p xcl --lib <filter> -- --nocapturepassed for all three filters. Each had zero failures, ignores, and skip markers.hle::d3d12x::pso_async::— 15 passed. Covered off-thread PSO construction, lazy bind-to-first-use deferral, frame wait budgeting, release waking orphaned waiters, and used-only prewarm deduplication.hle::d3d12x::pso_library::— 3 passed. Covered latest-generation selection, empty/missing file handling, and preserving an open Windows mapping while saving a new generation.hle::d3d12x::real::pso_lib::tests::— 2 passed. Covered deterministic compute/graphics/stream keys and background save scheduling.async_compute_pso_registers_real_pso_and_not_standinandconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_backwithout skip markers. These exercised asynchronous compute PSO registration and synthetic compute dispatch/readback.Workspace suite
cargo test --workspace --no-fail-fast -- --test-threads=4ran once insideL:/XclTooling/Invoke-ArcTest.ps1and exited 101. Combined output is inL:\XclTooling\neon-slot-2\tmp\pr2001-suite.log.SKIPPEDlinesxcl library unit testsxcl binary unit teststests\bcpack_parity.rstests\console_dlls_e2e.rstests\console_shaders.rstests\disasm_e2e.rstests\e2e.rstests\gpu_compute_e2e.rstests\gpu_pso_e2e.rstests\heap_probe.rstests\low_va.rstests\pls_quota.rstests\predication_e2e.rstests\rpf_e2e.rstests\shaders_e2e.rstests\sparse_reinit.rstests\texture_states.rstests\xg_oracle.rsxcl-testtitle binary unit testsDoc-tests xclAll 20 harnesses reported results. The counts above are libtest totals. The 23 emitted
SKIPPEDlines span 13 test names and mark whole tests or individual subcases excluded from coverage.V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32).0x887A002D).Failures
25 unrelated by code path. These DXIL and recompiler unit tests use the direct D3D12 test runner and bypass the changed XCL PSO hooks. The 21 tests below failed at
CreateComputePipelineStatewith0x80070057(E_INVALIDARG). The f64 cases are consistent with the adapter's lack of FP64 shader support.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3gpu::dxil::ops_tests::doubles_match_cpugpu::dxil::ops_tests::groupshared_barrier_and_atomics_rungpu::dxil::round_tests::gpu_direct_f32_round_modes_dynamic_and_denormalsgpu::dxil::round_tests::gpu_direct_f32_round_modes_staticgpu::dxil::round_tests::gpu_direct_f32_round_preserved_denormal_times_inf_is_infgpu::recomp::lower_dxil::tests::f64_programs_on_the_gpugpu::recomp::tests::gpu_clamp_and_omod_per_instructiongpu::recomp::tests::gpu_f64_class_comparegpu::recomp::tests::gpu_f64_compares_with_nangpu::recomp::tests::gpu_f64_literal_high_wordgpu::recomp::tests::gpu_f64_math_randomgpu::recomp::tests::gpu_f64_rootsgpu::recomp::tests::gpu_f64_rounding_and_conversionsgpu::recomp::tests::gpu_float_compares_randomgpu::recomp::tests::gpu_frexp_f64_exp_and_mantgpu::recomp::tests::gpu_ldexp_f64gpu::recomp::tests::gpu_rndne_f64Four more direct-runner tests reported shader result mismatches.
gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction— fused overflow control returned infinity.gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mips— got 25.609375, expected 26.gpu::recomp::tests::gpu_valu_16_and_64_bit—v_add_f16did not preserve the high half.gpu::recomp::tests::gpu_wave64_ps_whole_wave_reductions— one channel read 217, expected 216.1 confirmed pre-existing.
test_title_runs_and_game_folder_is_untouchedreached the synthetic title'sRSSetDepthBiasX(-1000.5)check and saw blue[0, 0, 255, 255]where green was expected. The identical failure reproduced on the PR merge base656c0e8ca070bdc9d7cb197d264792ef49304865under the same Arc lock withcargo test -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --exact. The baseline recorded 0 passed, 1 failed, 0 ignored, and 2 filtered out inpr2001-baseline-e2e.log.Not tested
XCL_SAMPLE_RPFunset). Sample-gated early returns can appear as passes.d3d12SDKLayers.dllabsent). The debug-layer test returns early under libtest capture, so that return is outside the 23 emitted markers.ID3D12PipelineLibrary1persistence across title runs, including verified cache hits and shutdown flushing. Unit tests covered mapped-file generation and save scheduling.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against
pr2001-suite.logand published this report.@akimfomin on GitHub · 2026-11-25 02:50 UTC · original
raylitebull, PortBridge followed up on victory-fork's duplicate pipeline work by checking XCL's driver blob cache. The compute and graphics publish and removal routines are unchanged between your
1f1d6814head and maincbc296ab.A CPU fixture forces four publishers of the same 16-byte key through those exact routines. Both caches charge 64 bytes with 16 present, then retain 48 bytes of charge after removal. Checking the vacant entry under the existing map lock makes both report 16 before removal and zero afterward. Under a 64-byte test budget, all four independent 16-byte keys then fit.
Exact patch, method and result. The patch only changes in-memory publishing and accounting. The fixture mocks blob retrieval and does not measure driver work or startup time.
@Royalflamejlh on GitHub · 2026-11-25 03:13 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
1f1d681onmain2bdf047+ #684: with no library file yet, the pipeline library was not created, so nothing was saved. The empty library is asked for with a non-null pointer and length 0, which vkd3d-proton refuses withE_INVALIDARG. With a null pointer it was created, saved, and read back in the next run.Setup: Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch (neither touches
cache.c), RTX 4070 12 GB (driver 615.71.09), release build,XCL_PSO_PRELOAD=0and no other switch. Retail title 1.0.2.1, the first-run screens completed once and no story progress, A pressed when the title presents steadily. One run per column, in this order.Tested
main+ #6841f1d681pipeline librarylines in the logsaved(gen 1 to 5, 160 pipelines)opened … gen-00000005,graphics PSO loaded from memory-mapped pipeline libraryfrom 5.1 s, 2saved1f1d681as it is, made after the last column, opened the file those runs had left (gen-00000007). So only the first, empty creation fails.4d53a2con the samemain+ #684, preload on: 6 generations saved from gen 1 and noopenedline, so there the empty library is created as it is.Read
pso_library.rs:409:CreatePipelineLibrary::<ID3D12PipelineLibrary1>(&[])passes the empty slice's pointer with length 0. vkd3d-proton refuses that (libs/vkd3d/cache.c:2534,if (!blob_length && blob); a probe of the one call on this prefix:0x80070057with a non-null pointer,0with NULL),.ok()?drops it and nothing is logged. What I ran in its place:Not tested: a world load (no run presented after 91 s); whether the library saves time here;
scripts/smoke.ps1;XCL_LAZY_PSO=1; its unit tests at this head;1f1d681itself and the three lines on native Windows; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the diff, wrote and ran the probe and the three lines, ran the title and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@WebIdentity1 on GitHub · 2026-11-25 01:07 UTC · original · edited 2026-11-25 03:21 UTC
Both demand-lifecycle repairs are available as small commits
For adoption on
1f1d681439db77ea01a656dc8fc65aa4eabc7d1b, apply these in order:The second repair keeps
wanted_here()true while an unbounded title thread still waits, even if another bounded wait times out. Both fixes reuse the existing demand lock/guard. No competing PR and no cache-accounting or Wine library-creation changes.Combined validation: native Windows 10 Home 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74, Rust/Cargo 1.98.1 MSVC, DXC/DXIL 1.8.2502.11, debug.
XCL_ADAPTER=3090,XCL_PSO_TITLE_BUILD=0.The control's mixed-waiter regression reports an active unbounded waiter but
wanted_after_timeout=false waiters=0. The candidate reportstrue / 1, then zero after completion. The priority regression passes on both snapshots: bases -1/-2, boost to 0, restored -1/-2 after the build and inside the next unwanted job.Both retain the identical CLAMP mismatch (
gpu_clamp_and_omod_per_instruction, lane-0v_pk_add_i16, actual2146467856, expected2147516415). The control additionally failsd32s8_targets_take_their_own_size_of_video_memoryatlist.Close()with0x80004005; the candidate passes it. That D32S8 difference is not credited to the scheduling fix. No candidate-only failures; both Cargo test commands exit 101, so this is not an all-green suite.The same 26 explicit SKIPPED notices occur in each run: 19 native-wave64 subcases, three refused wave32 per-lane cases, two missing-debug-layer checks, one unavailable driver-cache-control check and one unavailable heap-window check. Data-dependent early returns do not establish retail coverage. All 314 source hashes match before/after execution and locally; the published tree matches the tested candidate exactly. XCL rebuilt for each snapshot.
Not tested: retail smoke, current-main integration, real driver-admission effects, compilation throughput, stutter or memory savings. The two native-thread regression fixtures check production demand/priority behavior with synthetic jobs. Required merge checks remain outstanding. Earlier isolated evidence and patches are preserved below.
AI use: Codex (GPT-6) prepared the fixes/tests, performed and verified the native Windows runs, and wrote this report.
Earlier isolated comparisons and patches
Priority cleanup: workspace comparison and cherry-pickable fix
The verified priority-lifecycle repair below is now available as commit 8be0af7, based directly on
1f1d681439db77ea01a656dc8fc65aa4eabc7d1b. Runtime change: 2 added / 3 removed lines, plus the regression. It restores the worker's base priority after the build finishes, under the existing demand lock. It does not include the separate mixed-waiter fix or PortBridge's cache-accounting change. No competing PR.Tested: native Windows 10 Home 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74, Rust/Cargo 1.98.1 MSVC, DXC/DXIL 1.8.2502.11, debug.
XCL_ADAPTER=3090,XCL_PSO_TITLE_BUILD=0.Both retain
gpu_clamp_and_omod_per_instruction: lane-0v_pk_add_i16 clamp, actual2146467856, expected2147516415. Both Cargo test commands exit 101. No candidate-only failure observed; not an all-green suite. The repaired regression again checks actual Windows thread priority: base -1/-2 → boost 0 during the build; control stays 0 after completion and in the next unwanted job, while the fix restores -1/-2 for both observations.Both runs emit the same 26 explicit SKIPPED notices: 19 unavailable native-wave64 subcases, three refused wave32 per-lane cases (f16 arithmetic, f16 packed, f32 conversions), two missing-debug-layer checks, one unavailable driver-cache-control check and one unavailable heap-window check. Data-dependent tests can return successfully without sample files, so raw pass counts are not retail coverage. All 314 source files matched before/after the Windows runs, locally, and in the published commit; XCL rebuilt each snapshot.
Not tested: retail smoke, actual driver-load scheduling benefit, stutter/throughput/CPU-use improvements, or current-main integration. The native priority probe uses dedicated test-owned threads calling production
build()twice, rather than taking over shared queue workers. This completes the local workspace check for the priority patch; required merge and retail checks remain outstanding.AI use: Codex (GPT-6) prepared the fix/test, ran and verified the Windows comparisons, and wrote this report.
Follow-up on
1f1d681: restore worker priority after an abandoned waitVerified a separate priority-lifecycle bug on exact
1f1d681439db77ea01a656dc8fc65aa4eabc7d1b. A wait boosts the compile worker to normal priority. The new timeout guard can then cleard.wanted, butbuild()restores the worker's base priority only ifd.wantedis still true. The next unwanted job inherits normal priority.Small candidate in
pso_async::build: always restorebase_priorityafter clearingworker_thread, under the existing demand lock. This preserves the lock ordering that prevents a latewant()from boosting a worker after cleanup. It restores priority when the build ends, not immediately on abandonment. This candidate is independent of the mixed-waiter fix below; neither comparison includes that patch.Tested — native Windows 10 Home 19045, Ryzen 7 7800X3D, Rust/Cargo 1.98.1 x64 MSVC, debug;
XCL_PSO_TITLE_BUILD=0.cargo test --locked -p xcl --lib -- hle::d3d12x::pso_async --test-threads=1 --show-outputThe regression uses test-owned native threads invoking production
build()twice. It checks the actual WindowsGetThreadPriority: initial bases -1 and -2, boosted priority 0 inside the first channel-gated job, then abandonment before releasing that job. Baseline recordsafter=0 next=0for both; candidate recordsafter=-1 next=-1andafter=-2 next=-2. Both modes are checked before the final failure assertion. Pending entries are removed and threads joined before the result assertions. Existing 15 controls still pass. Both 314-file source manifests matched before/after and local snapshots; XCL recompiled both.Not tested — actual shared-worker queue dispatch or driver compilation in this probe, GPU output, full workspace suite, retail smoke, stutter, CPU utilization or compilation throughput. This proves the priority leak and its cleanup fix, not a measured performance gain or resolution of the retail world-loading symptoms. No commit/push or competing PR; required merge checks remain separate.
AI use — Codex (GPT-6) identified the cleanup gap, wrote the candidate and regression, ran/verified the native comparison and prepared this update.
Independent candidate and regression
Follow-up on
1f1d681: keep unbounded waits in the new demand countVerified one remaining scheduling bug in exact
1f1d681439db77ea01a656dc8fc65aa4eabc7d1b.resolve_withinusesbegin_wait(), but the unbounded path inresolve_wait_with_budgetsstill callsp.want()directly. When a bounded waiter abandons the same pending pipeline, its guard sees zero counted waiters and clearswanted, even while the unbounded title thread remains blocked.wanted_here()then falsely tells the compile scheduler that nobody needs the build.A possible policy transition is a graphics wait begun before the first Present (uncapped), followed by a second wait after the implicit frame cap activates. The test supplies these two budget modes directly; I have not observed this sequence in a retail title or proved a resulting watchdog/OOM.
Candidate: replace the unbounded path's
p.want()withlet _want_guard = p.begin_wait();. It joins the same existing lifetime/count mechanism, leaving timeout and frame policy unchanged. One runtime line changed, plus a 32-line regression in the same file (33 additions / 1 deletion overall).Tested
Native Windows 10 Home19045, Ryzen7800X3D, Rust/Cargo1.98.1 x64 MSVC, debug. This is a real CPU-thread/worker test with a synthetic blocked job, not a GPU or driver compilation test.
XCL_PSO_TITLE_BUILD=0ensures the worker path.cargo test --locked -p xcl --lib -- hle::d3d12x::pso_async --test-threads=1 --show-outputinitial=true unbounded_active=true wanted_after_timeout=false waiters=0.initial=true unbounded_active=true wanted_after_timeout=true waiters=1; final count is zero after completion.The worker sends its actual
wanted_here()callback, then stays behind a channel gate. The test observes active demand before making the second wait expire on a1ms frame budget. It records that the first waiter is still blocked, then opens the gate, joins it, and removes the pending entry before assertions, including on baseline failure. It checks the scheduler's callback as well as the counter. Existing lazy-bind, default-frame-budget, orphan-release, prewarm, bounded-wait and worker-demand tests all pass with the candidate.Both314-file manifests matched before/after and the local snapshots; XCL recompiled both. No source commit/push or competing PR.
Not tested — full workspace, real GPU compile admission, retail world loading/watchdogs, actual commit-memory or performance effects, and other platforms. This fixes the false demand state; it does not establish that the earlier retail symptoms are resolved. Existing full-suite/retail requirements remain separate.
AI use — Codex (GPT-6) identified the uncounted path, wrote the one-line candidate and controlled regression, ran/verified the native comparison, and prepared this update.
Candidate and regression
Confirmed @gsucristo's blocking finding 2 on
7244baadcf009af2a79e94c9fd9c6e7b41d89ab9, with a small cancellation fix and deterministic reproducer.The worker's orphan branch skips the job without calling
complete, leaving an existingresolve_wait_for(..., None)waiter blocked onPending::done. The candidate marks cancellation done and notifies waiters inreleased(), under the existingdonemutex, after settingorphan. It does not depend on either worker queue progressing. An already-running build still reachescomplete, seesorphan, and releases its result instead of publishing it. No failed-build counter is incremented just for cancellation.The regression holds the worker queue while the waiter captures the pending entry, releases that entry, then opens the queue. It checks the waiter returns the existing stand-in fallback and the compiler closure never runs. On old code, a bounded test timeout captures the failure and the fixture explicitly wakes/joins the thread before failing; it does not leave a hung test process. A synthetic COM release counter separately verifies that
completestill releases a late result exactly once and does not publish it.Tested — native Windows 10 19045, Ryzen 7 7800X3D, Rust 1.98.1 MSVC, debug. Thread scheduling / fake object tests; no GPU dispatch or real driver compilation.
released job was skipped but its waiter never completed(Err(Timeout)).This patch is independent of the earlier passive-bind lookup patch. It is offered here for the author's integration, with credit for the finding above; #978 already covers not executing released jobs, and is not duplicated.
Not tested — full workspace suite, the two fixes combined, actual title object-lifetime races, real COM/driver builds, dedicated preload-cancellation ordering, retail smoke or whether this stall occurs during world loading. A returned stand-in is the existing resolver fallback; the test does not establish that using an object after another thread releases it is valid. Required main/head retail smoke remains outstanding.
AI use — Codex (GPT-6) implemented the candidate and regression, ran the native tests, reviewed the cancellation/late-completion ordering and prepared this report.
Candidate and regression: one file, 50 additions / 2 deletions
@DavidM1911 on GitHub · 2026-11-25 03:42 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@PracticalStudios on GitHub · 2026-11-25 03:43 UTC · original
Test report for
1f1d681in the retail title, RTX 3090 (Ampere, 32-lane waves): the world-load stop is unchanged, because the title waits in a compute bind.maincbc296a+ #684, with and without this PR (local merge), 300 s,XCL_PRESS_A_ATthrough the menus, DXIL and most driver blobs already cached,XCL_THREAD_DUMP_AT=100,140.resolve_wait_with_budgets, frombind::dispatchandbind::execute_indirect. The pipeline they wait for is still building on a preload worker: record56c0cd3b82a00c6e(22 089 020 B DXIL, no driver blob), started at 9.5 s, not finished at 300 s (the case of #1035).1f1d681), compute binds still wait without a limit, so this stop isn't covered.AI use: Claude Code (Claude Opus 5.5) ran the runs, read the symbolized dumps and wrote this report.
@Toons29 on GitHub · 2026-11-25 03:43 UTC · original
Regression run of
1f1d6814on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainoncbc296ab, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 101 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.@throny on GitHub · 2026-11-25 04:59 UTC · original
Retest at
1f1d681, merged ontomaincbc296a, with the same setup as my earlier report: RTX 4080,XCL_DIRECT_DXIL=1, otherwise this PR's defaults, warm XCL DXIL cache, two 15-minute runs in a row, no input after the menus.Compared with
7244baa:7244baapresented until 170 s, while skipping far more. The process commit no longer jumps, but it climbs steadily for 10 minutes after the presents stop, until my guard stops it at about 37 GB.main177cd40with the same warm caches stopped presenting at 94 s and stayed at 31 GB.So on this card the title still stops at about the same point as
main, now without the watchdog. What keeps commit growing after the presents stop would be the next thing to look at. I can rerun with a setting you name (XCL_PSO_LIBRARY=0,XCL_PSO_FRAME_WAIT_MS=…) on the same caches.Not tested: the suite on this head, AMD, a
mainrun atcbc296a.AI use: Claude Code (Claude Opus 5.5): ran the tests and wrote this.
@raylitebull on GitHub · 2026-11-25 10:47 UTC · original
Thanks for all the catches and test details,
@Royalflamejlh,@WebIdentity1,@akimfomin, and@throny!Updated
#2001cleanly onto6b3f1f1(69795220):.plibfix (pso_library.rs,@Royalflamejlh): pass explicit(std::ptr::null(), 0)viaID3D12Device1_Vtbl::CreatePipelineLibraryinstead of&[]so fresh empty library creation succeeds withoutE_INVALIDARG.pso_async.rs,@WebIdentity1):base_priorityinbuild()underdemandlock so abandoned waits never leakTHREAD_PRIORITY_NORMAL(an_abandoned_wait_restores_worker_priority_before_its_next_job).let _want_guard = p.begin_wait();on the unbounded wait path inresolve_wait_with_budgetsso a concurrent bounded timeout cannot clearwantedwhile an unbounded waiter is blocked (a_timed_out_waiter_does_not_cancel_an_unbounded_waiters_demand).real.rs,@akimfomin): checkEntry::Vacantunder the map lock ininsert_cached_blobfor bothCOMPUTE_BLOBSandGRAPHICS_BLOBSso racing duplicate publishes charge the byte budget once and free cleanly to zero (duplicate_blob_publishes_charge_budget_once_and_free_cleanly).Verified locally (
29/29unit tests passed:pso_async::17/17,pso_library::3/3,pso_lib::tests2/2,compute_blob_tests2/2,graphics_blob_tests5/5).@raylitebull on GitHub · 2026-11-25 11:01 UTC · original
Rebased
#2001cleanly ontof087b998(814d31a8), integrating#2176(5f4d32fb) and#2178(93c3eb7e) inpso_async.rs:Pending::spared,image_skip(),image_only(), andresolve_spared(routed throughenqueue(p, false)on the urgent/normal worker pool and checked insideresolve_wait_with_budgets), plus#2178's orphan job drain (p.job.lock().unwrap().take()) and all three@Royalflamejlh/@WebIdentity1/@akimfominfixes.31/31unit tests passed:pso_async::19/19,pso_library::3/3,pso_lib::tests2/2,compute_blob_tests2/2,graphics_blob_tests5/5) and pushed814d31a8.@throny on GitHub · 2026-11-25 10:58 UTC · original · edited 2026-11-25 11:12 UTC
Test report for exact head
814d31a(updated from6979522).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on814d31aas it is: 1235 passed, 2 failed, 46 ignored;SKIPPED: 25 lines (no wave64 on this adapter, and the like).main9633138(and inmain's CI):device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa: #2233 fixes it.pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translatorscripts/smoke.ps1, the retail title, 60 s, release builds,main9633138first, then this head. Both runs started without the preload list newer builds leave behind (used-pipelines.txtin the DXIL cache):main:
PR:
Not tested: AMD, the head merged onto current
main, a world load.AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety before it was built.
@Royalflamejlh on GitHub · 2026-11-25 12:56 UTC · original
@raylitebull
814d31afixes the empty library under vkd3d-proton. On Linux (Wine + vkd3d-proton) + NVIDIA, a run with no library on disk saved 6 generations. The run after it opened the last one at 4.9 s and loaded pipelines from it: it built 57 compute pipelines where the first run built 243.Setup: Fedora 44,
mainf087b99+ #684e56dbc3+ #2001814d31a(local merge93269d8), RTX 4070 12 GB (driver 615.71.09), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, release build, Series X profile,XCL_PSO_PRELOAD=0,WINEDEBUG=err+all,fixme-all. The first-run screens were completed once and there was no story progress; A was pressed when the title presented steadily (16.4 and 16.2 s). 1 run each of 100 s, in this order; thepso-libraryfolder was moved aside before run 1.gen-00000006at 4.9 sgen-00000001togen-00000006(10, 2, 2, 5, 2 and 307 new pipelines)gen-00000007(80 new)On
1f1d681a run with no library on disk saved nothing (my earlier comment).Not tested: whether loading from the library saves time or changes where the title stops (1 run each); the offloaded builds and the deferred compile; the suite at this head; Windows; AMD and Intel.
AI use: Claude Code (Claude Opus 5.5) ran the title and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@jeremymeseeks on GitHub · 2026-11-25 15:29 UTC · original
Retail title world load on native Windows, RTX 5070 Ti:
814d31a+ #684 vs its basef087b998+ #684Setup: Windows 10 22H2, Ryzen 7 9800X3D, 32 GB RAM, RTX 5070 Ti 16 GB, NVIDIA driver 621.01. Release build (
cargo build --release -p xcl). #684e56dbc3merged into both sides, the same base Royalflamejlh used (local merges: base08038f06, PRc976de10). XCL defaults; the only env vars were the onesscripts/smoke.ps1sets (XCL_NETWORK=0,XCL_ACTIVITY=1)..\scripts\smoke.ps1 -Seconds 300, with A pressed by hand promptly at the title screen in both runs. Base ran first, then the PR. No pipeline library on disk before the PR run.f087b998+ #684814d31a+ #684Result:
814d31afrom an empty start. The PR run savedgen-00000001togen-00000007(273, 2, 6, 330, 12, 1 and 1 new pipelines; 113 MiB), with 1 memory-mapped library hit at 58.2 s.#639, a 421012 B compute PSO that finished at 209 s. Gated compile finishes summed to 546 s, against 81 s on the base. I haven't checked whether the "gated (waited …)" log line means the same thing in both builds, so this is a raw log count, not a conclusion.Not tested: a second PR run that loads the saved library; repeat runs (one run each);
XCL_PSO_PRELOAD=0; current main (the PR conflicts with main); AMD and Intel. The A press was manual, so its timing varies by a few seconds between runs.AI use: Claude (Opus 5.5, claude.ai) planned the runs and wrote this comment from my run outputs (smoke manifests, report.json, xcl.log). I ran everything and checked the numbers.
@jeremymeseeks on GitHub · 2026-11-25 16:34 UTC · original
Follow-up: second PR run that loads the saved library (the "not tested" item above), RTX 5070 Ti, Windows
Correction to my comment above: the first PR run saved 20 library generations (
gen-00000001togen-00000014, last file 130 MiB), not 7 / 113 MiB. My summary had cut the list off. The other numbers there are unchanged.Setup: same machine, driver 621.01 and builds as above (base
08038f06=f087b998+ #684, PRc976de10=814d31a+ #684), release,.\scripts\smoke.ps1 -Seconds 300. This time A was scripted for both sides withXCL_PRESS_AT=20:A,25:A,30:A,35:A,40:A. Order: base, PR, base, PR. The library from the first PR run was left on disk; the second PR run also had what the first one added.gen-00000014(130 MiB), opened at 2.2 sgen-0000001d(220 MiB), opened at 2.3 sAll four: exit
0x0, 0 crashes, 0 device removals, no watchdog or AV line in 300 s.Result:
Not tested: which pipelines the remaining 14 compiles are and whether they ever finish; a cold driver cache;
XCL_PSO_PRELOAD=0; current main; AMD and Intel; more than one run pair per side.AI use: Claude (Opus 5.5, claude.ai) planned the runs and wrote this comment from my run outputs (smoke manifests, xcl.log). I ran everything and checked the numbers.
@jeremymeseeks on GitHub · 2026-11-25 16:52 UTC · original
Addendum: third run with the library (B2c), and which pipelines were still compiled
Same build (
c976de10=814d31a+ #684), same settings and scripted input as B2 above; it openedgen-00000023(243 MiB) from B2b. Exit0x0, 0 crashes, 0 device removals, last 2 s window with presents ends at 68.0 s, 7 driver compile starts.Compute pipelines with no driver blob (record, DXIL size, compile time, time queued before the compile started):
fcc06444…9e5896b2…84eee477…6c358c27…c82ff5e4…fbf10765…fb1c6d2d…fbf10765…2e1d03fb…75862c58…001714bf…af40329f…c0031f40…("queued" is the
gated (waited … ms)value on the finish line; I read it as time before the compile started.)Result:
Not tested: more library runs; more huge-compile slots (
XCL_HUGE_PSO_WANTED_CONCURRENCY); whether "no compile line" means a library hit or that the title didn't ask for that pipeline in B2c (the hits line showed 500 in B2a and B2b; I don't know whether that is a total or a milestone).AI use: Claude (Opus 5.5, claude.ai) wrote this from my xcl.log and smoke outputs. I ran everything and checked the numbers.
@raylitebull on GitHub · 2026-11-25 18:23 UTC · original
Thanks
@Royalflamejlhand@jeremymeseeksfor confirming Wine.plibcreation and the warm RTX 5070 Ti153 -> 70 -> 14 -> 7driver compile drop!Rebased
#2001cleanly onto728e2548(008d9c1c):#2080(direct-dispatch-split): unifiedbuild_piecesintoworkers()viaWorkerItem::Piece(urgent when parent is wanted, avoiding a duplicate thread pool) and wiredpso_lib::try_load_compute+store_pipelineinsidetranslated_compute_pso_once(preserving#1592dred::labelon library hits).625a0f36(shared stand-ins): routed all paths (resolve,resolve_for_bind,resolve_if_ready,resolve_withinincluding exhausted-frame-budget early returns, andresolve_spared) throughp.stand(pso)so stand-in shell handles never reach the PC driver.#2296(drop_unstarted_job+PcCallsclamping): updatedreleased(),workers(), andpreload()to wake waiters and drop unstarted orphaned jobs cleanly outside locks.cargo check --workspace --tests+36/36unit tests PASS):pso_async::24/24,pso_library::3/3,pso_lib::tests2/2,compute_blob_tests2/2,graphics_blob_tests5/5.Pushed
008d9c1c!@jeremymeseeks on GitHub · 2026-11-25 20:19 UTC · original
World load on
008d9c1c(+ #684) vs its base728e2548(+ #684), RTX 5070 TiSetup: Windows 10 22H2, Ryzen 7 9800X3D, 32 GB, RTX 5070 Ti, NVIDIA 621.01. Retail title, XCL defaults (
XCL_DIRECT_DXILunset).scripts/smoke.ps1 -Seconds 300 -Title retail-worldloadwithXCL_PRESS_AT=20:A,25:A,30:A,35:A,40:A. Order A-B-A-B. A =728e2548+ #684 (local98f8b104), B =008d9c1c+ #684 (localfee6a08e). Library folder emptied before B1; B2 reuses B1's library.Result
gen-00000001..gen-0000000e(119 MiB); B2 openedgen-0000000eat 2.2 s and loggedmemory-mapped pipeline library hits: 500at 67.0 s. Of the 11 compute PSOs that took ≥10 s or never finished in B1, 8 have no compile line in B2 and 3 showdriver blob suppliedand 1–7 ms.driver blob absent, 35–76 s each, 2 still unfinished at 300 s, never more than 2 compiling at once. In B1 these 9 records appear only as[SHADER] csload lines, with no compile. Same pattern as my B2b/B2c runs on the previous head.B2: compute PSOs that took ≥10 s
Not tested:
XCL_DIRECT_DXIL=1; a third library run on this head;XCL_PSO_LIBRARY=0; AMD / Intel; anything after world load.Report written with Claude (Opus 5.5) from my own run logs; I ran the tests.
@DavidM1911 on GitHub · 2026-11-26 07:05 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.@bmjask on GitHub · 2026-11-25 21:19 UTC · original · reviewed
High merit but not merge-ready: very large runtime diff with failed Windows/description checks, no full workspace suite, no main/head smoke pair, and no runtime GPU validation. Default-on .plib path needs end-to-end cold/warm driver proof that stored libraries are safely loaded across compute, graphics, stream, and two-pass—not just helper/keying tests. PSO wait/lazy defer also needs title validation across draw, dispatch, and ExecuteIndirect. Rebase and provide required evidence before substantive merge review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.