d3d12x: persistent on-disk pipeline library caching and coalesced descriptor heap staging #1006
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!1006
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1006"
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?
@UnkwnDev on GitHub · 2026-11-24 10:19 UTC · original
UnkwnDev:arc-pso-library→main· +1064 −12 · 9 files · 3 commits · openThis pull request implements persistent on-disk pipeline state library caching (
ID3D12PipelineLibrary1) and coalesced descriptor heap staging in D3D12.X:Persistent on-disk pipeline library caching:
In
crates/xcl/src/hle/d3d12x/pipeline_library.rs, introduces anID3D12PipelineLibrary1caching layer to persist driver-compiled hardware PSOs under%LOCALAPPDATA%\xcl\pso\host-pipelines.bin.In
translated_graphics_psoandtranslated_compute_pso(crates/xcl/src/hle/d3d12x/real.rs), compiled pipelines are looked up by a 128-bit hash across deterministic root signature content (note_root_signature), translated shader bytecodes, samplers, and fixed-size pipeline state fields includingInputLayoutandNodeMask.D3D12_BLEND_DESC,D3D12_DEPTH_STENCIL_DESC, andD3D12_RASTERIZER_DESCare hashed explicitly field-by-field to ignore alignment padding.save(now)checks pending store counts andSAVE_INTERVAL_MSbefore takingSAVE_IO, andpresent.rscallssave_async()so periodic frame-present saves dispatch a bounded background save thread rather than serializing and writing on the present thread. Forced shutdown/close paths continue using synchronoussave(true). Telemetry summary logging at exit (log_summary()) reports graphics/compute load and store counts. Empty pipeline library creation passes a null slice pointer for clean fallback under vkd3d-proton / Wine.Coalesced descriptor heap staging:
In
crates/xcl/src/hle/d3d12x/console_heap.rs,copy_rangebatches multi-slot descriptor copies by calculating destination addresses and indices directly, splitting at 256-slotPAGE_SLOTSboundaries and clamping to remaining heap capacity on both source and destination heaps.Rebased onto
origin/main(568e7db), integratingpipeline_libraryload/store withcreate_graphics_pso_cachedinreal.rs, currently at commit8d0d2a1.Tested
8d0d2a1:cargo test -p xcl --lib pipeline_library -- --test-threads=1: 8 passed, 0 failedcargo test -p xcl --lib hle::d3d12x::real -- --test-threads=1: 46 passed, 0 failedcargo check -p xcl --tests: passedcargo test -p xcl --lib console_heap -- --test-threads=1: 7 passed at2727c0d;console_heap.rsunchanged in8d0d2a1)Regression run
Prior revision
19381fbdreported by@Toons29on AMD Radeon RX 9070 (smoke rerun needed on head8d0d2a1):Not tested
scripts/smoke.ps1at head8d0d2a1(no retail title on author machine)AI use
@SlopTart on GitHub · 2026-11-24 11:55 UTC · original
Linux / AMD RDNA3 run: the new pipeline-library corruption test fails deterministically under Wine.
Merged state: head onto main, clean merge, full suite 729 passed / 12 failed / 41 ignored; 11 known Wine-lane failures + mirror flake (#42 / #718) and one extra:
hle::d3d12x::pipeline_library::tests::corrupted_blob_falls_back_to_empty_library- fails 2/2 in isolation, panic atcrates/xcl/src/hle/d3d12x/pipeline_library.rs:309:library created after rejection.Reading: the test corrupts the on-disk blob, expects the loader to reject it and start empty; on this rig the loader path apparently produces/accepts a library after rejection. Could be Wine path/
fsbehavior (file still seen as valid at open time, or the reject path keyed on something environment-dependent), or a real ordering hole in the reject-and-recreate path. Deterministic here, so easy to reproduce on a Wine lane if you want a second datapoint.The rest of the new
pipeline_librarytests pass on this rig, including the persistence round-trips.Counts only, no game data.
Not tested: retail titles (none here), Windows, RDNA4.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@UnkwnDev on GitHub · 2026-11-24 12:12 UTC · original
Thanks for catching this.
The root cause was Rust slice passing semantics interacting with vkd3d-proton. In open(), creating the fallback empty library called device.CreatePipelineLibrary(&[]). In windows-rs, an empty slice passes s_ptr(), which evaluates to a non-null dangling pointer (
@DavidM1911 on GitHub · 2026-11-24 12:32 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
cargo test -p xcl --lib pipeline: 10 passed, 0 failed — includes the newpipeline_librarytests (corrupted_blob_falls_back_to_empty_libraryverified: a bad on-disk blob logs the rejection and starts fresh).AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@SlopTart on GitHub · 2026-11-24 12:44 UTC · original
Fix verification from the Wine/RDNA3 lane: re-merged the updated head
dfcd403onto current main and re-rancorrupted_blob_falls_back_to_empty_library, which failed 2/2 for me at the previous head (my comment above, paniclibrary created after rejectionatpipeline_library.rs:309).It now passes in isolation on the merged lane (
3c335f4, release profile). The empty-slice dangling-pointer explanation matches what I saw on the Wine side too: the rejection log fired but the "empty" library came back as a valid creation.Fixed on this axis. Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@Royalflamejlh on GitHub · 2026-11-24 14:52 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
dfcd403, 3 runs of 130 s in a row of a retail title: the library was saved and loaded again, but no pipeline was taken from it in either rerun, so the second and third runs were no faster than the first.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton 3.1 with the relaxed-vtable patch from #175 and a local dxil-spirv patch,
VKD3D_CONFIG=ignore_shared_fence. RTX 4070 12 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled tox86_64-pc-windows-gnu(rustc 1.98.0), DXC 1.9.2609.5,XCL_NETWORK=0,XCL_PSO_PRELOAD=0. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s throughXCL_PRESS_AT.dfcd403merged ontomain67a3735+ #684 (e56dbc3) without conflicts. Nohost-pipelines.binexisted before run 1.Tested
cargo test --release -p xcl --libforpipeline_libraryandconsole_heapunder Wine, on the merge: 7 passed, 0 failed.loaded host pipeline libraryat startsaved pipeline librarylineloaded … PSO from pipeline librarylinescompute PSO with the translated console CSlines[SHADER]lines)The stall after 100 s is the one of #662 in all three; in run 2 one compute pipeline of 1,108,268 B of DXIL was being built from 101 s to 128 s. The file grew by about the same amount each run.
Read
pipeline_library.rs:118and:132: the name of a pipeline mixes inpRootSignature's raw interface pointer. That is an address of this run, not the root signature's content, so the next run only finds a pipeline if its root signature happens to land at the same address. I think this is why nothing was loaded and why the file grows each run instead of settling, but I could not read the names out of vkd3d-proton's blob to show it;LoadGraphicsPipelinefailing for another reason under vkd3d-proton would look the same in these logs. The description says the hash covers root signatures; would hashing the root signature's bytes be what was meant?pipeline_library.rs:102(graphics_pso_name): of the pipeline's state the name takes the topology type, the number of render targets, the depth format, the sample count and the cull mode. Two pipelines of the same shaders that differ only in blend state, depth test or a render target's format get one name. What doesLoadGraphicsPipelinedo then on the drivers you tested: refuse the mismatching description, or hand back the stored pipeline?console_heap.rs:417(copy_range): the loop it replaces resolved every slot of the range withslot()and left out one that is in no heap; this one resolves the first and computes the rest. Can a title's count run past the end of its heap here? If it can, the copy now writes there.Not tested: a native D3D12 driver, where the library stores real driver blobs (8 KB after three runs of about 500 translated pipelines each (
report.json: 477, 476, 540) suggests vkd3d-proton stores next to nothing here); the preload of #690 on; the rest of the test suite; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the tests and the title three times with
XCL_PRESS_AT, compared the logs and wrote this report.@UnkwnDev on GitHub · 2026-11-24 15:38 UTC · original
Thank you for the detailed profiling and analysis (@Royalflamejlh). All three points have been addressed in commit \2e6c458:
Deterministic root signature hashing across process runs:
ote_root_signature(raw: usize, hash: u64)\ and
oot_signature_hash(rs). Root signatures now record their deterministic content hash (from their serialized bytecode for title-created signatures, and from static sampler keys and parameters for XCL ABI signatures). In subsequent runs, \pRootSignature\ resolves to its deterministic content hash regardless of host memory address.
Differentiating full pipeline state:
**Heap bounds check in \copy_range**:
emaining\ capacity to the end of the heap (\h.n.saturating_sub(k)).
= n.min(src.remaining).min(dst.remaining), preventing out-of-bounds copies if a title requests a range exceeding its allocated heap.
@Royalflamejlh on GitHub · 2026-11-24 16:53 UTC · original · edited 2026-11-24 17:04 UTC
@UnkwnDev
2e6c458fixes the names: in two reruns on Linux (Wine + vkd3d-proton) + NVIDIA the library was loaded, its pipelines were taken from it and the file stopped growing. What it holds is only what the title made before its last save, though, and here that leaves out nearly all the compute pipelines of the world load (327 of 334 in run 1), which were built again in each rerun.Setup: as in my comment above, except:
2e6c458merged ontomainb7aa9f3+ #684 (e56dbc3) without conflicts, runs of 125 s, and the A press came at 16 s instead of 44.8 s, so the times are not comparable with that comment's. Nohost-pipelines.binexisted before run 1.Tested
cargo test --release -p xcl --libforpipeline_libraryandconsole_heapunder Wine, on the merge: 7 passed, 0 failed.loaded host pipeline libraryat startsaved pipeline librarylinesgame+0x23cf683With
dfcd403the file grew from 2,832 to 8,176 B over three runs and nothing was loaded.Run 3 followed a 3 minute offline shader pass on this machine that filled other caches, so its earlier end is not the library's doing. One more start between runs 2 and 3 ended at 32.9 s in the fault that #751 is about (
msvcrt.dll+0xa52bundertitle_textures::subresources); it is not in the table.Read
pipeline_library.rs:248(save) runs frompresent.rs:755at most every 20 s, and at a clean exit (present.rs:318,loader.rs:415). In run 1 the last save was at 86.3 s, 327 of the 334 world-load compute pipelines were made after it, the last present was at 87.4 s and the run ended in the title's watchdog. So those pipelines never reached the file, and run 2 built 344 again. Would a save that does not depend on a present (after a number of stores, or from the worker that stored) be in scope here?pipeline_library.rs:264: a save with nothing added returns before the log line, so a rerun that loads everything prints no count of what it loaded. I counted loads from the builds that were missing. One line at exit with the two counters would let a tester see the hit rate.pipeline_library.rs:117: a root signature that was never noted hashes to 0. The fournote_root_signaturecalls are inreal.rs(:3402,:3423,:4990,:5002on the merge). No pipeline reaches a name that way on this tree: the three callers of the two name functions (real.rs:3587,:3986,:4004) take the root signature fromabi_rs_for(:3580,:3962), which notes it on both of its paths (:3402,:3423).pipeline_library.rs:140and:150hash the raw bytes ofD3D12_BLEND_DESCandD3D12_DEPTH_STENCIL_DESC, padding included (3 bytes after eachRenderTargetWriteMask, 2 afterStencilWriteMask). Here the names were stable (the file did not grow), so the padding was the same from run to run on this path; I did not check that it must be.Not tested: a native D3D12 driver, where the library stores real driver blobs (the 7,184 B file holds 36 pipelines, 21 graphics and 15 compute, at 112 B of blob each, so vkd3d-proton stores next to nothing here; compute builds took under 1 s in all in run 1, and about 34 s in run 2: two took 19.2 s and 14.4 s (902 KB and 727 KB of DXIL) and finished at 107.2 s and 121.6 s, after the last present, and the other 342 took 0.5 s together); the heap clamp in
copy_rangein a title run (its test passes); AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the new commit, built the tree, ran the tests and the runs, compared the logs and wrote this reply.
Edited 2026-11-24: the Not tested line said the library held "about 140" pipelines (it holds 36) and gave run 1's compute build time without run 2's; the third Read point was a question, which the tree answers. Nothing else changed.
@UnkwnDev on GitHub · 2026-11-24 18:13 UTC · original
@Royalflamejlh Thanks for the detailed profile and trace analysis. We have updated the branch with commit
8dbf4cbaddressing all three points:Batch store save trigger:
store_graphicsandstore_computenow triggersave(false)whenever a batch of 16 new pipelines accumulates (BATCH_SAVE_THRESHOLD = 16). Insave(),batch_readybypasses the 20s interval throttle so world-loading compute pipelines compiled in the background without active frame presentation are flushed directly to disk. In addition,report::write_final()now flushes the library on termination to ensure trailing pipelines are persisted.Structure padding sanitization:
Rather than hashing raw byte slices of descriptor structs,
hash_blend_desc,hash_depth_stencil_desc, andhash_rasterizer_descexplicitly hash individual fields. This prevents undefined padding bytes (such as the 3 alignment bytes following eachRenderTargetWriteMaskand 2 bytes followingStencilWriteMask) from affecting name hashes across compilers and platforms. Verified via unit testpadding_bytes_do_not_affect_pipeline_hash.Telemetry summary logging:
Added
log_summary()which outputsD3D12.X: pipeline library summary: {gl} graphics loaded, {cl} compute loaded, {gs} graphics stored, {cs} compute stored. This runs onsave(true)during clean exit, window close, andreport::write_final(), making cache hit rates visible on runs where zero new pipelines were stored.@UnkwnDev on GitHub · 2026-11-24 18:23 UTC · original
Thanks for the thorough review and catch.
Root signature hashing:
graphics_pso_name and compute_pso_name now incorporate deterministic root signature content hashes (note_root_signature) rather than ephemeral COM pointer addresses. The content hash is recorded at root signature creation and remains stable across process lifetimes and ASLR.
copy_range page boundary handling:
In crates/xcl/src/hle/d3d12x/console_heap.rs, copy_range now splits multi-slot copies across PAGE_SLOTS (256-slot) boundaries, querying slot() for each run so destination descriptors are renumbered using each page's distinct GLOBAL shared heap allocation. Range copying is clamped to remaining heap capacity for both source and destination heaps. Added a test in console_heap.rs verifying that descriptors copied across the page boundary receive the correct page-1 indices.
Tested clean at head a771990 (cargo test -p xcl pipeline_library: 6/6 passed; cargo test -p xcl console_heap: 4/4 passed).
@UnkwnDev on GitHub · 2026-11-24 18:53 UTC · original
Updated branch at 19381fb following a self-review pass:
Verified at 19381fb: cargo test -p xcl --lib pipeline_library (7/7 passed), console_heap (4/4 passed), real (28/28 passed). Note: scripts/smoke.ps1 still needs to be re-run against 19381fb to update the regression block.
@Royalflamejlh on GitHub · 2026-11-24 19:30 UTC · original
@UnkwnDev
19381fbdoes it: on Linux (Wine + vkd3d-proton) + NVIDIA the world load's compute pipelines now reach the file and the next run loads them. Three runs in a row from no library, by the new summary line: run 2 loaded 103 graphics and 224 compute pipelines, run 3 loaded 118 and 293, and 5 compute pipelines were still built.Setup: as in my first comment, except:
19381fbmerged ontomainc160d86+ #684 (e56dbc3) without conflicts, runs of 125 s, the A press at 16.2 to 18.5 s, all three after the 3 minute offline shader pass my last reply mentions. Nohost-pipelines.binexisted before run 1.Tested
cargo test --release -p xcl --libforpipeline_libraryandconsole_heapunder Wine, on the merge: 11 passed, 0 failed.loaded host pipeline libraryat startsaved pipeline librarylines (after the last present)game+0x23cf683The summary line came at the end of each run, which here is the title's watchdog, so
report::write_finalis reached on that way out too.The runs did not get shorter as more was loaded: run 2 ended 7.0 s sooner than run 1, run 3 0.4 s later. My guess at why: the file holds about 200 B for each pipeline under vkd3d-proton, too little to be the driver's compiled code, so a load would still leave the driver its work; I did not time a load. What ends these runs is the stall of #662; the 5 compute pipelines run 3 still had to build took 34.1 s between them, and one that is still building when the watchdog fires cannot be stored.
Read
pipeline_library.rs:370:savetakesSAVE_IObefore the check for nothing added at:374, andpresent.rs:755calls it on every present. So while a batch save from a build thread serializes and writes, each present waits for that write. With a 95 KB file I would not expect it to show here; I did not time it. Would it on a native driver, where the file is large? The two cheap checks could come before the lock.pipeline_library.rs:289,:330and:377: every 16 stores the whole library is serialized and written again, on the thread that built the sixteenth. Here that was 21 of run 1's 26 writes, of at most 70.5 KB. Has it been timed where a pipeline's blob is megabytes?Not tested: a native D3D12 driver; the
copy_rangechange in a title run (its tests pass); the preload of #690 on; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the new commits, built the tree, ran the tests and the three runs, compared the logs and wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
@Toons29 on GitHub · 2026-11-25 03:10 UTC · original
Regression run of
19381fbdon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % 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; I checked the blocks before posting.@UnkwnDev on GitHub · 2026-11-25 07:31 UTC · original
@Royalflamejlh @Toons29 Applied the lock-ordering refinement from review and rebased onto
origin/main(568e7db) at commit2727c0d(mergingcreate_graphics_pso_cachedwithpipeline_libraryload/store inreal.rs):pipeline_library::save(now)now performs the cheap pending-count /SAVE_INTERVAL_MSchecks before touchingSAVE_IO, and non-forced present-frame saves (!now) useSAVE_IO.try_lock()so frame presentation never stalls behind a background batch write.2727c0d:pipeline_library(7 passed),console_heap(7 passed),hle::d3d12x::real(46 passed),cargo check -p xcl --testsclean.A fresh
scripts/smoke.ps1run will be needed on2727c0dsince the branch was updated and rebased after19381fbd.@Royalflamejlh on GitHub · 2026-11-25 08:48 UTC · original
@UnkwnDev
2727c0ddoes what you say for the point I raised:save(false)now returns beforeSAVE_IOwhen nothing is pending, or when fewer than 16 are and the last save was under 20 s ago, and otherwise only tries the lock (pipeline_library.rs:364to:380), so a present no longer waits for another thread's write. It still writes the file itself when it gets to a due save first (the run's first, 16 pending, or 20 s since the last): the present thread made 17 of the 96 saves in these runs, each the run's first or 20 to 25 s after the one before. On Linux (Wine + vkd3d-proton) + NVIDIA the library still saves and loads across runs.Setup: as in my earlier comments, except:
2727c0dmerged ontomain568e7db+ #684 (e56dbc3), 100 s runs, A pressed at 16.2 to 18.5 s. Nohost-pipelines.binbefore runs 1, 4 and 5.Tested
process ends with status 0x3from insided3d12core.dll(vkd3d-proton), before the summary line, on the thread that had built all 8 of its compute pipelines (the last at 55.6 s), not the present thread. That was 1 s after its last present; the other four began the world load's burst of compute builds near their last presents, at 76 to 84 s, and run 1 had built none of it: its 8 builds match the 10 and 9 that runs 4 and 5 made before their bursts. Wine's error channel was off in run 1 and its console shows no message before the end; runs 4 and 5 repeated its start from no library with it on and did not end that way. Four other runs here have ended with status 3 since 23 Nov, all on another card, a tree without this pull request andwinevulkan.dllat the top of the stack. One run in five is too few to say whether it is the change.Not tested: the unit tests at
2727c0d; whether a loaded pipeline saves the driver's time here; Windows; AMD and Intel.AI use: Claude Code (Claude Opus 5.5) read the change, ran the title and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@UnkwnDev on GitHub · 2026-11-25 09:23 UTC · original
@Royalflamejlh Good observation on the present thread still performing due saves when it reached the 20 s / 16-pending threshold first (17 of 96 saves). Pushed commit
8d0d2a1sopresent.rsnow callspipeline_library::save_async(), which runs the atomicsave_duepre-check and dispatches a single-flightxcl-pso-savebackground thread when due. Frame presentation now performs zero serialization or file I/O, while shutdown paths keep synchronoussave(true). Re-verifiedpipeline_library(8/8),hle::d3d12x::real(46/46), andcargo check -p xcl --tests.@Royalflamejlh on GitHub · 2026-11-25 10:53 UTC · original
@UnkwnDev
8d0d2a1does it: on Linux (Wine + vkd3d-proton) + NVIDIA the present thread made 0 of the library's saves in 2 runs (31 and 3 saves), and the next run still loaded what the first saved.Setup: as in my earlier comments, except:
8d0d2a1merged ontomain568e7db+ #684, 100 s runs,XCL_PSO_PRELOAD=0,WINEDEBUG=err+all,fixme-all, A pressed at 16.4 s in both runs. Nohost-pipelines.binbefore run 1.Tested
XCL_RUN_SECONDS(100.0 s)store_pipelinecallssave(false)once 16 are pending (pipeline_library.rs:324), which made 25 of run 1's 31 saves, between 72.9 and 73.6 s.gamepad buttonsline, 590 frames on the start screen). It loaded the same 88,960 B and stored nothing, so run 2 began with run 1's file.Not tested: the suite at this head; a run that ends other than by
XCL_RUN_SECONDS(a crash, the title's watchdog); Windows; AMD and Intel.AI use: Claude Code (Claude Opus 5.5) read the change, ran the title and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@UnkwnDev on GitHub · 2026-11-25 16:05 UTC · original
Rebased onto
origin/main(0829441) and pushed commit7866911addressing the remaining review points:Non-blocking threshold saves (
@Royalflamejlh):store_pipelineincrates/xcl/src/hle/d3d12x/pipeline_library.rsnow triggerssave_async()instead of synchronoussave(false)atBATCH_SAVE_THRESHOLD(16), so build threads no longer serialize or writehost-pipelines.bininline.save_async()coordinates aSAVE_REQUESTEDflag withBG_SAVINGso stores arriving whilewrite_atomicallyis in flight are drained by thexcl-pso-saveworker; synchronoussave(true)remains only on shutdown/flush paths (WM_CLOSE,DLL_PROCESS_DETACH,report::write_final).Root signature hashing (
@vladbondarenko97):graphics_pso_nameandcompute_pso_nameuseroot_signature_hash/note_root_signature(no raw COM pointer addresses hashed). Also preserved the empty-fallback root signature hash indev_create_root_signature, noteddispatch_chain::buildroot signatures, preserveddred::labelon graphics library cache hits, and added unit testroot_signature_hash_is_stable_across_com_pointers.Paged
copy_rangeand bounds checks (@vladbondarenko97):copy_rangeincrates/xcl/src/hle/d3d12x/console_heap.rsto split across bothPAGE_SLOTS(256-slot view pages) andSAMPLER_PAGE_SLOTS(8-slot sampler pages fromorigin/main), clampntosrc.remaining.min(dst.remaining), reject mismatchedsrc.sampler != dst.sampler, and resolve unmapped sampler slots per-slot so exhausted shared sampler heaps keep reserved index0.copy_range_crosses_noncontiguous_pages_and_clamps_oobverifying cross-page descriptor index mapping across non-contiguous view and sampler pages as well as OOB source/destination clamping.Verified after the final edit on Windows (Intel Arc A770):
cargo test -p xcl --lib pipeline_library -- --test-threads=1: 9 passed, 0 failedcargo test -p xcl --lib console_heap -- --test-threads=1: 10 passed, 0 failedcargo test -p xcl --lib hle::d3d12x::real -- --test-threads=1: 57 passed, 0 failedcargo clippy --workspace --all-targets --locked: zero errors or new warnings in our touched lines/files (full-- -D warningsfails on pre-existingorigin/mainlints such asclippy::approx_constantinlower_valu.rs,lower_wide.rs, andrecomp/lower.rs).@DavidM1911 on GitHub · 2026-11-26 03:32 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.7866911370toec5bac9930@UnkwnDev on GitHub · 2026-11-26 05:19 UTC · original
@DavidM1911 Rebased onto
origin/main(b49be18) at commitec5bac9:crates/xcl/src/hle/d3d12x/console_heap.rspreserving both upstream sampler-heap tests andcopy_range_crosses_noncontiguous_pages_and_clamps_oob.compute_containerinreal.rsforComputeBuild(mode != ComputeBuild::Chain) and populated theremainingfield inuav_clear_handles_translate_console_slotsinlist_x.rs.crates/.Verification on Windows (Intel Arc A770,
--test-threads=1):cargo test -p xcl --lib pipeline_library: 9 passed, 0 failedcargo test -p xcl --lib console_heap: 13 passed, 0 failedcargo test -p xcl --lib hle::d3d12x::real: 60 passed, 0 failed@vladbondarenko97 on GitHub · 2026-11-24 14:25 UTC · original · reviewed
Two problems I checked against the head (
dfcd403) andmain(930e8b4):1. The pipeline library cannot hit in a later run.
graphics_pso_nameandcompute_pso_nameinpipeline_library.rsmix inrs_ptr, the raw COM pointer ofdesc.pRootSignature:That address is different in every process, so a name stored by one run never matches in the next, and the persistent library always misses. Hashing the root signature's serialized blob (or the hash XCL already uses for the root signature, e.g. the
[SHADER] rootsig <hash>value) would keep the names stable.2.
copy_rangewrites the wrong descriptor index when a copy crosses a 256-slot page. For view heaps,slot()(console_heap.rs:331–338 onmain) gives each page its own place in the shared heap:index = first + 2 * (k - k0), withfirstper page frompage_of.copy_rangeinstead computesdst.index + k * 2for everyk, as if the shared heap were contiguous across pages. Oncedst.k + kcrosses into the next page,w[0]gets an index in the wrong place of the shared heap, and the shader reads another descriptor. There is also no check thatdst.k + nstays inside the heap (h.n) before writingdst.at + k * step.Calling
slot()(orpage_of) per destination slot when the range crosses a page, or splitting the copy at page boundaries, would fix both.Review assisted by Claude Code (Claude Opus 5.5); I checked both points against the code above. Not run.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.