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). |
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 |
19381fb to
2727c0d
Compare
|
@Royalflamejlh @Toons29 Applied the lock-ordering refinement from review and rebased onto
A fresh |
|
@UnkwnDev Setup: as in my earlier comments, except: Tested
Not tested: the unit tests at 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. |
|
@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 |
|
@UnkwnDev Setup: as in my earlier comments, except: Tested
Not tested: the suite at this head; a run that ends other than by 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. |
8d0d2a1 to
7866911
Compare
|
Rebased onto
Verified after the final edit on Windows (Intel Arc A770):
|
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, 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