D3D12.X: retain a successful heap-window pipeline #2803
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2813"
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?
Imported from ivall/xcl. Originally posted by CryingLaughing on 2026-11-26T14:07:46Z.
Related to #2459.
A heap-window refusal can remain recorded after pipeline creation has already recovered through an internal fallback. The outer retry now keeps the result when the creation call succeeds and returns a pipeline. Compute, graphics, and mesh creation share the check. A recorded refusal on final failure remains eligible for switch-form retry.
What is in it
crates/xcl/src/hle/d3d12x/real.rs.Tested
ff2ef9297438f2c81775edb6aeac36c618bbe8cfon Windows 11 25H2 build 26200.9974, Core i5-13600K, RTX 4080 driver 621.01, Rust 1.100.0 x64 MSVC, DXC 1.8.2502.11.retry_keeps_successful_pipelines_and_consumes_the_refusal_flagpassed with five scripted outcomes and no capability skips.gpu_memory_windows_from_the_heappassed on the RTX 4080 with no capability skips. The fixture reads two 1 MiB-backed windows spaced 4 GiB apart.cargo build --workspace --locked -j 4andcargo test --workspace --locked -j 4 -- --test-threads=4 --show-outputcompleted. Tests reported 1,436 passed, 0 failed, 47 ignored across 37 harnesses. The pass count includes 29 capability skips.Independent RTX 4060 Laptop verification by retrope13 reported 1,436 passed, 0 failed, and 47 ignored in the debug workspace, and 12 passed in the release retry and compile-gate tests. Independent GPU check
On the exact head, an independent RTX 3060 test with driver 610.88 injected a heap-window pipeline refusal. The native D3D12 path made one switch-form retry and created the compute pipeline. The test passed 1/0/0 with no skips. Independent injected-refusal check
On RX 9070 under Wine, an independent native probe covered the exact head and its integration with current main
8b957bec. Both kept the first successful pipeline in three fresh processes each. The clean-main control rebuilt it and failed the retain-first check. The probe used an injected marker and real native pipeline creation. Independent retain-first comparisonRegression run
Independent retail smoke by Anon64 compared release builds of main and this exact head on an RTX 3060 12 GB (driver 581.80), Core i9-14900KF, and Windows 11 build 26200. The 60-second runs used the same title. The head retained 99.7% of the baseline frames and used 100.1% of its peak commit, with zero crashes or device removals. The run did not establish whether the title reached the changed code.
main:
PR:
Not tested
Imported from ivall/xcl. Originally posted by retrope13 on 2026-11-26T14:32:56Z.
Independent RTX 4060 Laptop (8 GB, DXC
1.9.2602.17) verification and diff review of#2813(ff2ef929) againstmain(b49be183): full debug workspace suite + release retry/compile tests green, 0 failures. No title was run.Tested
32.0.16.2140, wave32), Intel Core i5-14500HX (14C/20T), 24 GB RAM, Windows 11 26H2 (build26300.9818),rustc 1.100.0(stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0DXC1.9.2602.17,XCL_ADAPTER=NVIDIA.cargo test --locked -p xcl --lib -- retry_keeps_successful_pipelines_and_consumes_the_refusal_flag gpu_memory_windows_from_the_heap --test-threads=4 --nocapture: 2 passed, 0 failed, 0 ignored, 0 skipped (0.29 s).cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4:main(b49be183): 1435 passed, 0 failed, 47 ignored#2813(ff2ef929): 1436 passed, 0 failed, 47 ignored (+1 new test, 0 failures)realretry & compile-gate tests (--release):cargo test --release --locked -p xcl --lib -- hle::d3d12x::real::heap_window_retry_tests:: hle::d3d12x::real::big_compile_tests:: --test-threads=4: 12 passed, 0 failed, 0 ignored (0.25 s).Diff Review (
b49be183..ff2ef929)driver_psopaths (create_pso_adopted,finish_two_pass) flow through the three updatedwith_switch_fallbacksites (translated_compute_pso,translated_graphics_pso,translated_mesh_stream).ComputeBuild::CachedWholehittingE_OUTOFMEMORYfollowed bydispatch_chain::buildsucceeding (real.rs:4415-4429), andfinish_two_passcached compute pass hittingE_OUTOFMEMORYfollowed by uncachedcompute pass retrysucceeding (real.rs:6093-6105). Retaining the result avoids both a redundant switch-form recompile and leaking the COM ref already written into*ppv.retry_heap_window_failureshort-circuitssucceeded(&result)before reading*ppv, clearsHEAP_WINDOW_OOMon both entry and exit, and cannot re-armHEAP_WINDOW_OOMduringin_switch_form(sincedriver_psogates onmem_windows() & HEAP_WINDOWS != 0).Not Tested
E_OUTOFMEMORYrefusals, retail smoke runs, AMD / Intel GPUs, and the 47#[ignore]/SKIPPEDtests.AI disclosure: Antigravity (Gemini 4 Neon, XHigh) ran the builds/tests, reviewed the diff, and drafted this report.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-26T14:44:18Z.
Regression run of
ff2ef92on a newer retail title: no device removal, no crash, frames and commit within the limits.Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main
b49be18(this PR's base) and of this PR's exact head,scripts/smoke.ps1 -Game <title>for 60 s withXCL_NETWORK=0and A pressed every 4 s from 20 s. Main ran before and after a batch of 11 PRs and peaked at 23,855 and 23,844 MB, so the baseline held steady over the batch.main:
this PR:
99 % of main's frames, 100 % of its peak commit. One run each.
Not tested: the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD.
AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-26T16:50:02Z.
RX 9070 / Wine targeted check of
ff2ef9297438f2c81775edb6aeac36c618bbe8cf.Tested
Compared the exact PR source, current main
8b957bec6f82495aec940944c6bf47faa02db590, and current main with this PR's diff applied. The PR's parent isb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7. The integration applied without conflicts; its additions, deletions and surrounding diff context independently matched the original PR delta. These were source copies with the test additions below, not clean Git checkouts.RX 9070 16 GB, PCI
1002:7550, RADV GFX1201 / Mesa26.3.1-arch3.5(mesaandvulkan-radeonpackages3:26.3.1-5), Ryzen 7 7700, CachyOS7.3.0-5-cachyos, GE-Proton11-12 Wine 11.0 Staging with ntsync. Native d3d12/d3d12core/dxgi, vkd3d-proton8293130ebe370b1+with local assertions-disabled build, DXC/DXIL1.9.2602.17, Rust1.97.1, releasex86_64-pc-windows-gnu.XCL_NETWORK=0,XCL_ADAPTER="AMD Radeon RX 9070",XCL_REQUIRE_GPU=wave64,XCL_HEAP_WINDOWS=1,XCL_DXC_THREADS=1; separate enabled XCL/vkd3d/Mesa caches per process.Build each source copy:
Run the resulting libtest executable directly through that Wine binary:
N=1andN=4: exact head and integrated head each 12 passed / 0 failed / 0 ignored per invocation; current main 11/0/0. Six invocations total.XCL_DIRECT_DXIL=0and1, 1/0/0 in all 12 invocations. No changed original assertions. A test-only capture saved the already-synchronised result and mapped words. Independently checked 3168 expected words: scalar/vector loads, both 64-lane store vectors, atomic counter 64 and unchanged counter 0 in the other window. Each window had 1 MiB backing; addresses were 4 GiB apart. Captured DXIL matched across revisions for each backend and differed between the two backends.The native probe calls the actual
with_switch_fallback, using test wrappers for its old/new signatures. Its callback creates real native compute PSOs from one owned no-op HLSL shader and injects the thread-local refusal marker. Both flatOption<HRESULT>and nested compute return shapes were checked. For successful recovery with a non-null PSO, current main called the builder twice and replaced the first object; both PR variants called once and retained its pointer. Failed marked results, success with null output and markedNonemade two builder calls; unmarked failure/success and a stale entry marker made one. The marker was clear after every case.All 126 callback cases were checked from logs and saved JSON. Across the nine probes, 114 native PSOs exported nonempty 112-byte cache blobs; fixture DXIL and blob bytes matched across runs. All references, including overwritten baseline objects, were retained explicitly and then released. The local probe constructed PSOs only; GPU dispatch coverage comes from the separate original heap-window test. All 27 harness invocations had 0 ignored and 0 capability skips.
Not tested
Actual driver-induced memory refusal, internal cached/chain recovery, complete translated compute/graphics/mesh entry points, graphics or mesh PSOs in the local probe, expanded UMA windows, full workspace suite, native Windows, other adapters, retail data,
scripts/smoke.ps1, FPS or title memory/performance effects.AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) audited the diff, wrote local test-only fixtures/capture, ran the checks, independently verified saved results/source/executable hashes, and drafted this report. Publication authorized by the account owner.
Imported from ivall/xcl. Originally posted by Smokeyqdqd on 2026-11-26T17:02:04Z.
Verified the failure path on
ff2ef9297438f2c81775edb6aeac36c618bbe8cfwith the real D3D12 backend on an RTX 3060 12 GB (610.88), Ryzen 7 5800X, Windows 11 build 26200, rustc 1.100.0 MSVC, debug.With
XCL_ADAPTER=3060andXCL_HEAP_WINDOWS=1, I rancargo test --locked --offline -p xcl --test gpu_compute_e2e -- heap_window_out_of_memory_falls_back_to_the_switch_form --exact --nocapture --test-threads=1. The test injected a heap-window pipeline allocation failure. The log showed one switch-form retry followed by successful compute pipeline creation. 1 passed, 0 failed, 0 ignored, zeroSKIPPEDlines.This was a synthetic failure injection. Actual VRAM exhaustion and retail workloads were outside the run.
AI use: Codex (GPT-6.2 Astra) ran the test, checked the log and drafted this comment.
Pull request closed