Direct DXIL: defer cold console_geometry during cached_only PSO probes #2093
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2103"
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 Decodere on 2026-11-25T04:18:59Z.
What is in it
Adds the missing
dxc::defer()guard to the direct DXIL branch ofconsole_geometry()incrates/xcl/src/gpu/recomp/pso.rs, matchingcompile_console_shader(CS, VS, PS) andcompile_console_mesh(MS):real.rswrapstranslated_graphics_pso(includingtranslated_gs_pso->pso::console_geometry) indxc::cached_only()during async PSO cache probes. Whilecompile_console_shader(CS/VS/PS) andcompile_console_mesh(MS) all checkif dxc::defer() { return Err("DXIL not compiled yet".into()); }before cold direct DXIL translation,console_geometryomitted that check. UnderXCL_DIRECT_DXIL=1+dxc::cached_only(), it rankernel::translate_geometry()synchronously on the render thread — and whenmesh_passthrough_for()was already warm in DXC's cache,dxc::cached_only()returned(Ok(TwoPass), missed = false)instead of deferring.crates/xcl/src/gpu/recomp/pso.rs):console_geometry_with(vs, gs, ps, split_wave64, direct: bool)so unit tests can exercise both the direct DXIL and HLSL paths without mutatingXCL_DIRECT_DXIL, keepingconsole_geometrycalling it withcrate::gpu::dxil::kernel::enabled().if dxc::defer() { return Err("DXIL not compiled yet".into()); }at the top ofif direct { ... }right beforekernel::translate_geometry, leaving the HLSL path (direct = false) unchanged.geometry_defer_testsincrates/xcl/src/gpu/recomp/pso.rs):direct_console_geometry_defers_during_cached_only_even_with_warm_passthrough: constructs minimal synthetic console VS(ES)+GS containers, runsconsole_geometry_with(..., true)once outsidedxc::cached_only(confirming direct DXIL succeeds and warmingmesh_passthrough_forin DXC's cache), then verifiesdxc::cached_only(|| console_geometry_with(..., true))returnsErr("DXIL not compiled yet")withmissed == true.hlsl_console_geometry_keeps_warm_cached_only_hit: verifies the HLSL path (direct = false) still hits cleanly insidedxc::cached_only(Ok,missed == false) once warm.Part of #1269 (related to #1896)
Tested
rustc 1.100.0, DXC1.9.2609.5, release build.dxc::defer()inconsole_geometry_with):cargo test --release -j 4 -p xcl --lib geometry_defer_tests -- --nocapture --test-threads=1: 1 passed, 1 failed (direct_console_geometry_defers_during_cached_only_even_with_warm_passthroughpanicked:direct console_geometry must defer inside dxc::cached_only (missed=false)).cargo test --release -j 4 -p xcl --lib geometry_defer_tests -- --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored, 0 skipped.XCL_ADAPTER="Microsoft Basic Render Driver" cargo test --release -j 4 -p xcl --lib geometry_defer_tests -- --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored, 0 skipped.cargo test --release -j 4 -p xcl --lib gpu::recomp::pso:: -- --test-threads=1: 18 passed, 0 failed, 1 ignored (repeated_pso_shader_compilebenchmark is#[ignore]).cargo build --release --workspace: exit0.cargo test --release --workspace -- --test-threads=4: 1156 passed, 0 failed, 46 ignored across 21 test binaries, with 25SKIPPEDstderr lines:no wave64(32-lane RTX 4060 hardware)per-lane form: refused(#1426unsupported f16/f32 semantics in per-lane wave32 tests)cannot disable the driver cache (Windows Developer Mode is required)(pso_measurement_compiles_an_exact_synthetic_record)no heap windows(heap_window_out_of_memory_falls_back_to_the_switch_form)Regression run
Paired 60s
scripts/smoke.ps1runs on the same retail title (title: 29640639) and GPU (NVIDIA GeForce RTX 4060):Base (
origin/main,cbc296ab):This PR (
7743842a):No regressions (
1610vs1539frames,14511 MBvs14520 MBpeak commit,60 60 60presents per 2 s,0device removals,0crashes).Not tested
XCL_DIRECT_DXIL=1exercising legacy GS pipelines throughreal.rsasync PSO probes (the pairedscripts/smoke.ps1runs used the default translator configuration; direct GS deferral is covered bygeometry_defer_tests).dxc::defer()beforetranslate_geometryon the CPU and does not alter generated DXIL.AI use
dxc::defer()guard inpso::console_geometry, factoredconsole_geometry_with, authored the fix and unit tests inpso.rs, and ran all build, unit, WARP, workspace, and paired smoke checks.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:34:07Z.
Both CPU/DXC geometry cache tests passed on PR #2103 at
7743842ada44feff940b4785bf94e70b87b7d39c. The PR was open at that SHA before and after testing, and the checkout was clean and detached. I read the currentAGENTS.mdandCONTRIBUTING.md. The PR description contained the author’s same-head results, and the discussion had no independent same-head report.Tested on STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 build 26200.9974, Ryzen 7 3800X, Rust/Cargo 1.100.0
x86_64-pc-windows-msvc. Both tests logged DXC/DXIL 1.9.2609.5 loaded from%LOCALAPPDATA%\XclTooling\dxc-1.9.2609\bin\x64. The installed Arc A770 driver was 32.0.101.9175. Source inspection confirmed CPU-only execution before the run, and an unmatchedXCL_ADAPTERwas set as a precaution. Each test used privateTEMP/TMPand a fresh, emptyXCL_DXIL_CACHE, with two Cargo jobs and incremental compilation and dev/test debug info disabled.DXIL not compiled yetandmissed=true.missed=falseand returned byte-identical compute and mesh DXIL to the warm-up call.Each command exited
0. Total 2 passed, 0 failed, 0 ignored, 0 skipped.Not tested — GPU execution, live async PSO probes, retail titles, or the rest of the workspace suite.
AI use — T3 Code / Codex (
gpt-6.2-sol) inspected the fixtures, ran the tests, and wrote this report.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T06:02:39Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T09:10:33Z.
Independent Windows run on 7743842. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11.
The clean
cargo build --workspace --offline --locked -j 4passed.cargo test --workspace --offline --locked --no-fail-fast -j 4 -- --nocapture --test-threads=4finished with 1156 passed, 0 failed, 46 ignored, including both stock geometry-cache tests. Cargo's pass count includes 25 runtime skips (20 no native wave64, three unsupported per-lane forms, one unavailable driver-cache control and one no heap windows).A separate synthetic fixture exercised XCL's hooked
CreateGraphicsPipelineStateon the native backend. With direct DXIL enabled, the mesh shader cache warm, andXCL_LAZY_PSO=0, the async call returned a stand-in. A background worker replaced it with a native mesh PSO and its associated compute PSO. With async disabled, the same input produced both PSOs during the call. Both runs passed with zero skips and zero GS HLSL fallbacks. Removing only the new geometry defer guard made the async run build immediately and fail the stand-in assertion. The focused filter waslocal_gs_cached_probe_builds_both_native_pipelines.This covers PSO creation and worker routing. No draw or retail smoke was run. AI use: Codex (GPT-6, exact variant unspecified) prepared the scratch fixture, ran the tests and drafted this report.
Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T19:44:02Z.
AMD RX 7800 XT test report
Tested locally by merging PR head
7743842ada44feff940b4785bf94e70b87b7d39conto basemain3f2777019544c0ada2cd294aa792d3c378ff0df8(no push). The base is an ancestor of currentmainand both trees merge cleanly.Hardware and tools: AMD Radeon RX 7800 XT, driver 32.0.31035.1003; Windows 10 Pro; Rust 1.100.0 / Cargo 1.100.0; DXC 1.8.2502.11 (DXIL 1.8.2502.11). Debug test build.
cargo test --workspace --no-fail-fast -- --test-threads=4: 1,357 passed, 2 failed, 46 ignored. There were 7SKIPPEDreports: six GPU cases (wave32/wave64 variants for three unsupported instruction forms) and one heap-window case. The two failures and all 7SKIPPEDreports match the baseline (1,355 passed, 2 failed, 46 ignored).Not tested
AI use
Codex (gpt-6-luna) ran Phase 2 tests and wrote this report (Phase 1 pre-compile / initial baseline run used Claude Code (Claude Sonnet 5.5)).
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-25T19:54:27Z.
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head
7743842ada44feff940b4785bf94e70b87b7d39c(merged cleanly ontomain2898511).Hardware & environment
experimental-11.0-20261112),vkd3d-protonmasterec207194(3.2.0) +dxil-spirvb540c8a2+ relaxed-vtable patch (-Db_ndebug=true), DXVKv3.1.1-209, DXC1.9.2609.5, Rustx86_64-pc-windows-gnu(debug for tests, release for retail)Unit / GPU tests (
XCL_REQUIRE_GPU=wave64,XCL_DXC_DIR,VKD3D_CONFIG=ignore_shared_fence,--test-threads=1 --nocapture)gpu::recomp::pso::: 26 passed, 0 failed, 1 ignored (0 skipped)Combined retail sanity run (
main2898511+#2103,#838,#1250,#1733merged together;XCL_DIRECT_DXIL=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PSO_WAIT_MS=50,XCL_SPLIT_MIDLIST_WAIT=0,XCL_COHERENT_MB=1024,VKD3D_CONFIG=ignore_shared_fence,XCL_PSO_PRELOAD=0,XCL_NETWORK=0, warm PSO cache)45,841translated draws,154,125dispatches (+4,634chained split-compute),47,255Opus packets (0 errors),13.2 GiBpeak VRAM (0 GTT spill),15.1 GiBpeak RSS (vs19.3 GiBon cleanmain2898511).268.4 son the same pre-existingmain0xc0000005TOCTOU race intitle_textures::subresources(copy_nonoverlappingreading0x793a08000) also reproduced on cleanmain2898511(161.8 s).Not tested
AI use
main, ran the tests and combined retail run under Proton on this machine, and drafted this report.Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:16:27Z.
Review: COMMENTED
No concrete correctness defect found. The cached_only defer guard matches the existing direct CS/MS behavior and the focused tests cover the intended miss/hit paths. Nonblocking coverage gap: the direct fixture does not exercise a translate_geometry unsupported error followed by the existing HLSL fallback while cached_only. That is not a blocker, but would make the fallback contract clearer.
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-27T03:51:26Z.
I compared this guard and the overlapping guard in #2918 using the same two-PS synthetic ES+GS fixture. Clean Windows builds of
main8b957bec, #21037743842a, and #29184ddb971c. SDK DXC 1.8.2502.11, Rust 1.97.1 MSVC debug. A seed process first warmed the mesh passthrough DXIL on disk for both PS signatures. Each of five fresh processes per revision and mode then calleddxc::cached_only(|| console_geometry(...))with each PS, translated one PS variant normally, and repeated both cached-only probes.mainOk,missed=falseOk,missed=falsemissed=truemissed=truemissed=trueOk,missed=falsefor both signaturesSetting
XCL_RECOMP_WHY=1on #2918 bypassed its RAM cache and restored the #2103 results in five more processes. WithXCL_DIRECT_DXIL=0, both probes hit on all three builds. This confirms #2918 also covers the cold deferral fixed here and adds the warm in-process hit. It exercises the translation entry point with CPU/DXC only. GPU scheduling and retail impact were outside this check.OpenAI Codex assisted with verification.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T22:11:38Z.
merge-check claim
head:
7743842adaImported from ivall/xcl. Originally posted by throny on 2026-11-27T22:28:12Z.
merge-check
base:
2c717a04head:
7743842adamerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored
review: no blocking finding. The guard matches the existing defer guards for console shaders and mesh shaders. Known limit, measured in the thread: without a RAM cache every cached-only probe of a direct-DXIL geometry shader defers, even after an in-process translation; #2918 (open) overlaps this PR and adds that warm hit, so one of the two is redundant. The test fails without the change; like the existing pso tests it needs DXC and has no skip. Open, not blocking: the HLSL fallback is not exercised under cached-only.
performance: only with XCL_DIRECT_DXIL=1, where geometry-shader translation moves off the render thread; no translator source changes (reasoned).
verdict: safe to merge (decide between this and #2918)
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T01:12:24Z.
merge-check claim
head:
7743842adaImported from ivall/xcl. Originally posted by akimfomin on 2026-11-28T02:00:47Z.
A nearby producer/consumer check is AnyXboxX #575: an exact used key survives a warm build while unused variants stay cold. For the cache-only DXIL probe here, a synthetic pair with one published geometry key and one missing one can show that the miss does not build on the caller. The published key must still hit. This checks probe policy, independently of the existing runtime measurements.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T02:44:20Z.
merge-check
base:
753e8b1a25head:
7743842adamerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 6 other PRs' suites, in one queued job.
review: none. Whole diff read (pso.rs: console_geometry_with, defer under dxc::cached_only on the direct DXIL path, 2 tests). Inside cached_only a direct-DXIL legacy GS pipeline now returns "DXIL not compiled yet" (the caller's existing defer path) instead of translating synchronously on the calling thread; outside it and on the HLSL path nothing changes.
Re-frozen on main
753e8b1abefore posting (main changed this PR's files: README / build.rs / pso.rs / pso_async.rs, in code this PR does not touch); the merge diff was read again against it.performance: reasoned, not measured: with XCL_DIRECT_DXIL=1, a GS pipeline first met in a cached-only call is built later instead of stalling that call; default (HLSL) path unchanged.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 6635dd67226655209a41590a6a726c34df6103c6 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:23:27Z.
Triage (#1607) – head
7743842The fix is still needed: on main the direct-DXIL branch of
pso.rs:compile_console_geometry(whereconsole_geometry's body moved) still has nodxc::defer()check, unlikecompile_console_shaderandcompile_console_mesh. The PR conflicts with that refactor and needs a rebase that puts the guard intocompile_console_geometry.#2918 (opened later) adds the same guard as part of a RAM cache for the geometry pass, which main already has in another form.
The new tests compile through DXC without
runner::skip_test("no DXC")when DXC is missing.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.