Repository navigation
Conversation
|
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:
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/ The rest of the new 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 AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
2c384da to
dfcd403
Compare
|
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 ( |
|
Independent verification, merged onto current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Fix verification from the Wine/RDNA3 lane: re-merged the updated head It now passes in isolation on the merged lane ( 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 AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
vladbondarenko97
left a comment
There was a problem hiding this comment.
Two problems I checked against the head (dfcd403) and main (930e8b4):
1. The pipeline library cannot hit in a later run. graphics_pso_name and compute_pso_name in pipeline_library.rs mix in rs_ptr, the raw COM pointer of desc.pRootSignature:
let rs_ptr = desc.pRootSignature.as_ref().map_or(0, |rs| windows::core::Interface::as_raw(rs) as usize as u64);
h1 = (h1 ^ rs_ptr).wrapping_mul(0x100_0000_01b3);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_range writes the wrong descriptor index when a copy crosses a 256-slot page. For view heaps, slot() (console_heap.rs:331–338 on main) gives each page its own place in the shared heap: index = first + 2 * (k - k0), with first per page from page_of. copy_range instead computes dst.index + k * 2 for every k, as if the shared heap were contiguous across pages. Once dst.k + k crosses 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 that dst.k + n stays inside the heap (h.n) before writing dst.at + k * step.
Calling slot() (or page_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.
|
Linux (Wine + vkd3d-proton) + NVIDIA test of 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, Tested
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
Not tested: a native D3D12 driver, where the library stores real driver blobs (8 KB after three runs of about 500 translated pipelines each ( AI use: Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the tests and the title three times with |
dfcd403 to
2e6c458
Compare
|
Thank you for the detailed profiling and analysis (@Royalflamejlh). All three points have been addressed in commit \2e6c458:
|
|
@UnkwnDev Setup: as in my comment above, except: Tested
With 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 ( Read
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 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. |
2e6c458 to
8dbf4cb
Compare
|
@Royalflamejlh Thanks for the detailed profile and trace analysis. We have updated the branch with commit
|
8dbf4cb to
a771990
Compare
|
Thanks for the thorough review and catch.
Tested clean at head a771990 (cargo test -p xcl pipeline_library: 6/6 passed; cargo test -p xcl console_heap: 4/4 passed). |
…criptor heap staging
a771990 to
19381fb
Compare
|
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. |
|
@UnkwnDev Setup: as in my first comment, except: Tested
The summary line came at the end of each run, which here is the title's watchdog, so 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
Not tested: a native D3D12 driver; the 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. |
|
Regression run of Against the limits in CONTRIBUTING.md: 100 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
This 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, we introduce an ID3D12PipelineLibrary1 caching layer to persist driver-compiled hardware PSOs under %LOCALAPPDATA%\xcl\pso\host-pipelines.bin.
In translated_graphics_pso and translated_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, and fixed-size pipeline state fields including InputLayout and NodeMask.
To prevent padding byte discrepancies across compilers and platforms, D3D12_BLEND_DESC, D3D12_DEPTH_STENCIL_DESC, and D3D12_RASTERIZER_DESC are hashed explicitly field-by-field, ignoring internal alignment padding.
On warm runs, LoadGraphicsPipeline and LoadComputePipeline return the precompiled driver pipeline immediately, reducing DXIL-to-ISA driver compilation hitches on Intel Arc and other D3D12 hardware.
Pipeline serialization and atomic disk writes are serialized under SAVE_IO so concurrent background threshold saves and present/shutdown saves remain strictly monotonic; store_graphics and store_compute trigger save(false) when added >= 16.
Telemetry summary logging at exit (log_summary()) reports GRAPHICS_LOADED, COMPUTE_LOADED, GRAPHICS_STORED, and COMPUTE_STORED counts so cache hit rates remain observable even on runs that store nothing.
Empty pipeline library creation explicitly forwards a null pointer to ensure clean fallback under vkd3d-proton / Wine.
Coalesced descriptor heap staging:
In crates/xcl/src/hle/d3d12x/console_heap.rs, copy_range batches multi-slot descriptor copies by calculating destination addresses and indices directly, splitting at 256-slot PAGE_SLOTS boundaries so destination indices correctly match each page's distinct shared heap allocation. It clamps to the remaining heap capacity of both source and destination heaps, writing contiguous 64-byte chunks to GPU-mapped memory.
Tested
Regression run
Previous revision a771990 (smoke rerun needed on head 19381fb):
main (beaa245):
PR (a771990):
Not tested
AI use