D3D12.X: persist compute blobs when the RAM cache is full #2740
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!2740
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2740"
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?
@ZekkJJ on GitHub · 2026-11-26 09:35 UTC · original
ZekkJJ:codex/compute-driver-cache-ram-budget→main· +55 −14 · 1 files · 1 commits · openA slow translated compute PSO can compile successfully after the 512 MiB compute blob RAM cache fills up. Preserve its driver blob for the disk cache even if it cannot be admitted to RAM. This extracts the standalone fix from the NVIDIA reference stack in #2706 and retains the original author of
ee0183fd.What is in it
crates/xcl/src/hle/d3d12x/real.rsgives the caller the driver blob for disk retention and independently checks the RAM budget. Regular translated compute and the two-pass compute path use the same policy.Tested
Exact head
9ecae592ea3a1ba2b41db0167e06da435b271791on NVIDIA GeForce RTX 4060 Laptop (616.56), Ryzen 7 8845HS, Windows 11 build 26200.9974, Rust 1.98.1 MSVC, DXC 1.8.2502.11.cargo test --offline --locked -p xcl --lib compute_blob_tests -- --nocapture --test-threads=1passed 3 with zero skips.cargo test --offline --locked -p xcl --test gpu_compute_e2e -- --nocapture --test-threads=1reported 7 passed and 1 runtime heap-window skip. The skipped case passed on this exact revision in a focused rerun withXCL_HEAP_WINDOWS=1.The exact-head debug workspace build and complete RTX 4060 Laptop run reported 1436 passed, 0 failed, and 47 ignored. There were 26 runtime skip markers (21 no native wave64, 3 refused wave32 per-lane operations, 1 no heap windows, and 1 Windows Developer Mode unavailable).
The first 60-second smoke pair recorded 388 frames on the head against 499 on main, below the frame threshold. Both completed with zero crashes and device removals. The isolated 120-second pair below repeats the comparison.
Regression run
Clean release builds on the same RTX 4060 Laptop GPU and retail workload. XCL used a separate title state and DXIL cache for each run.
Main
PR head
Not tested
AI use
Claude Code (Claude Fable 5.2) assisted the original commit. OpenAI Codex (
gpt-6.2-sol) adapted it to current main, added the duplicate accounting check, ran validation, and prepared this submission.@Decodere on GitHub · 2026-11-26 10:24 UTC · original
Independent RTX 4060 (8 GB) / Windows 11 verification of PR #2740 at
9ecae592ea3a1ba2b41db0167e06da435b271791(exact parentorigin/mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full source review.Setup
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)title: 29640639viascripts/smoke.ps1 -Seconds 60(XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)Targeted RTX 4060 release unit tests (
9ecae592)cargo test --release -p xcl --lib a_blob_over_the_memory_budget_still_reaches_its_caller -- --nocapture: 1 passed, 0 failed, 0 ignored (0.00 s, exit0).cargo test --release -p xcl --lib hle::d3d12x::real::compute_blob_tests:: -- --test-threads=4: 3 passed, 0 failed, 0 ignored (0.00 s,0skipped, exit0).cargo test --release -p xcl --lib hle::d3d12x::real::driver_cache:: -- --test-threads=4: 4 passed, 0 failed, 0 ignored (0.00 s,0skipped, exit0).cargo test --release -p xcl --lib hle::d3d12x::real:: -- --test-threads=4: 61 passed, 0 failed, 0 ignored (0.85 s,0skipped, exit0).Observations
keep_compute_blobeven whenCOMPUTE_BLOBS_MAXis reached passesa_blob_over_the_memory_budget_still_reaches_its_caller, allcompute_blob_tests::anddriver_cache::cases, and the full 61-testhle::d3d12x::real::module in--releaseon this RTX 4060 host with0skips.exit: 0x0,1519frames shown,60 60 60steady-state presents per 2 s,0device removals,0crashes,13992 MBpeak commit vs parentb49be183's14018 MB/1518frames).Paired 60 s RTX 4060 smoke (
b49be183vs9ecae592)Parent
origin/main(b49be183):PR #2740 head (
9ecae592):Limits of coverage
9ecae592(only targetedcompute_blob_tests::,driver_cache::, andhle::d3d12x::real::release tests plus paired quiet 60 s smoke).COMPUTE_BLOBS_MAXduring live cold compute PSO compilation was not triggered in this run (that overflow-to-caller path is exercised bya_blob_over_the_memory_budget_still_reaches_its_caller).RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.AI use
Ran the targeted release unit tests and paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts and smoke blocks were taken directly from
cargo testandscripts/smoke.ps1outputs.@sage-sage on GitHub · 2026-11-26 10:30 UTC · original
Test report: passes on NVIDIA. Exact head
9ecae592(its base is currentmainb49be18, so head = merged).Tested
cargo test --workspace -- --test-threads=4: 1436 passed, 0 failed, 47 ignored;a_blob_over_the_memory_budget_still_reaches_its_callerpassesmainon this machine (wave64, debug layer, Developer Mode, heap windows)Not tested
Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
@thehollowedone on GitHub · 2026-11-26 10:51 UTC · original
Independent synthetic D3D12 cache-boundary check of PR head
9ecae592against its parentb49be183on Windows 11 build 26300, RTX 3080 Ti (621.35), rustc 1.99.1 MSVC, and DXC 1.8.2502.11.I added the same uncommitted, test-only fixture to each checkout. It compiles an 86,012-byte synthetic compute DXIL program, sets the process-local compute-blob accounting to the 512 MiB limit without allocating 512 MiB, creates a real D3D12 PSO, and checks for a saved driver blob and a second PSO created from that disk blob. A 300 ms delay in the test's create callback crosses the disk-retention threshold; it is not a driver compile-time measurement.
cargo test --offline --locked -p xcl --lib full_compute_blob_budget_writes_and_reloads_driver_blob -- --nocapture --test-threads=1:driver blob written despite full RAM cache.reused=true.This exercises the real compute-PSO disk path at the simulated RAM boundary. It does not cover the two-pass path, a naturally full cache during a title run, or a change in frame rate. Synthetic shader only; no game files or diagnostics were used. AI use: Codex (GPT-6.2 Sol) wrote and ran the test fixture and drafted this report.
@emirduran707 on GitHub · 2026-11-26 10:58 UTC · original
Independent AMD RDNA4 (native wave64) verification of exact PR head
9ecae592ea3a1ba2b41db0167e06da435b271791on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC1.9.2602.17).Tested
cargo build --workspace(debug): passed (0errors).cargo test --workspace --no-fail-fast -- --test-threads=4:1434 passed, 2 failed, 47 ignored(8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1heap_window_out_of_memory_falls_back_to_the_switch_formno heap windows, 1pso_measurement_compiles_an_exact_synthetic_recordWindows Developer Mode off).hle::d3d12x::real::compute_blob_tests::a_blob_over_the_memory_budget_still_reaches_its_callerpassed.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1andfuzz_validate_and_gpu_3) are pre-existing on unmodifiedmainon this RX 9060 XT / driver32.0.31044.16.cargo build --release -p xcl+ 60 s retail-title smoke test (scripts/smoke.ps1, offline):(Compare against
mainb49be183on this machine:1603 frames, 18576 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@oni-swr on GitHub · 2026-11-26 11:02 UTC · original
Independent AMD RX 7800 XT / Windows 11 test report for PR #2740 at exact head
9ecae592ea3a1ba2b41db0167e06da435b271791(parentmainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7; the head had not moved when tested). Unit/integration tests only; no title was run.Tested
32.0.31035.1003), Windows 11 Pro build 10.0.26200, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.8.2502.11 (Windows SDK 10.0.26100), debug build, separate target dir.XCL_ADAPTER=7800,XCL_REQUIRE_GPU=1,-j 4on every cargo command.cargo test -j 4 -p xcl --lib compute_blob_tests -- --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored, 0 SKIPPED (includesa_blob_over_the_memory_budget_still_reaches_its_caller).cargo test -j 4 -p xcl --lib hle::d3d12x -- --test-threads=4: 255 passed, 0 failed, 2 ignored.cargo test -j 4 -p xcl --test gpu_compute_e2e -- --test-threads=1: 7 passed, 0 failed, 0 ignored; 1 SKIPPED (heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).cargo test -j 4 -p xcl --lib -- --test-threads=4: 1309 passed, 1 failed, 27 ignored. The one failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722: res[30] = 0x1, CPU 0x7fffffff), the known AMD failure tracked in #2115. It is in the DXIL fuzzer, which this PR does not touch, so I did not rerun it onb49be18. Every other test passed.Not tested
compute_blob_tests) was exercised.cargo test --workspacewas not run in full (only the commands listed above), and not in--release.mainwas not rerun for comparison; thefuzz_validate_and_gpu_1attribution to main rests on #2115.AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report, coordinated by Claude Code (Claude Opus 5.5). All counts are from the runs described.
@SzczepanGrela on GitHub · 2026-11-26 13:20 UTC · original
RX 9070 / Wine cache-boundary verification, including GPU output and reuse in a fresh process.
Tested
9ecae592ea3a1ba2b41db0167e06da435b271791against mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7.8293130ebe370b1+(local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, releasex86_64-pc-windows-gnu.#[cfg(test)]module appended to both revisions. All original source bytes were preserved and checked against their pinned inventories.cs_6_6,-Od) to identical 25,520-byte DXIL on both sides, then callsreal::compute_container. It sets only the process-local RAM accounting to 512 MiB with an empty map, without allocating 512 MiB. A 300 ms delay in the native-create callback crosses the existing 250 ms disk-retention threshold; this is not a driver-time measurement.XCL_NETWORK=0, private XCL caches and enabled privateVKD3D_SHADER_CACHE_PATHdirectories. Each repetition starts with empty XCL/native caches; the head's following fresh process retains that repetition's caches.The same focused Windows libtest was invoked through GE-Proton Wine with
--exact,--nocaptureand--test-threads=1, in three paired repetitions:Every invocation made exactly one successful native PSO-create call, with no explicit cold retry, and dispatched the resulting PSO. GPU readback matched the CPU reference in all nine processes. All nine retained zero RAM-cache entries and accounting of 536,870,912 bytes. Main failed only at
driver blob written despite full RAM accounting, after the successful GPU check. The head's relaunches returnedreused=true; their saved blob hashes remained unchanged. No claim about compilation inside the driver follows from these counters.Additional unchanged-code checks:
a_blob_is_found_only_for_the_same_program_root_signature_and_flags_and_is_forgotten: 1 passed on each revision.a_blob_over_the_memory_budget_still_reaches_its_caller: 1 passed.hle::d3d12x::real::driver_cache::tests::: 4 passed per revision at both--test-threads=1and4.An initial fixture-sizing probe was excluded: its 14,000-byte DXIL was below the unchanged 16 KiB retention gate. The results above use the corrected, identical 25,520-byte fixture.
Not tested
Two-pass compute, console-shader translation, a naturally full cache during a title run, native Windows, full workspace suite, retail/smoke workloads, performance or FPS.
AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, wrote the local fixture, ran and independently checked the paired tests, and drafted this report. Publication authorized by the account owner.
@throny on GitHub · 2026-11-26 13:38 UTC · original
Two contributors checked independently and found that #2574 solves the same problem (for #1833) in a different way: #1607, group D127. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
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.