Direct DXIL: defer cold console_geometry during cached_only PSO probes #2103
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!2103
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Decodere on GitHub · 2026-11-25 04:18 UTC · original
Decodere:fix-1269-dxil-gs-defer→main· +87 −3 · 1 files · 1 commits · openWhat 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.In `crates/xcl/src/gpu/recomp/pso.rs`, `compile_console_shader` (CS, VS, PS) and `compile_console_mesh` (MS) all check `dxc::defer()` before running cold Direct DXIL translation during `dxc::cached_only()` async PSO probes, but `console_geometry()` omitted that guard. Under `XCL_DIRECT_DXIL=1` + `dxc::cached_only()`, it ran `kernel::translate_geometry()` synchronously on the render thread — and when the pass-through mesh shader was already warm in DXC's cache, `dxc::cached_only()` even returned `(Ok(TwoPass), missed = false)` instead of deferring. Factor `console_geometry_with(..., direct: bool)` so tests can exercise both paths without mutating the `XCL_DIRECT_DXIL` environment variable, and add `if dxc::defer() { return Err("DXIL not compiled yet".into()); }` at the top of the direct DXIL branch before `kernel::translate_geometry`, leaving the HLSL path (`direct = false`) unchanged. Add unit tests verifying that direct `console_geometry_with` defers with `missed == true` inside `dxc::cached_only()` even when the pass-through mesh shader is warm, still succeeds outside `dxc::cached_only()`, and that the HLSL path still hits cleanly inside `dxc::cached_only()`. Part of #1269 (related to #1896) Assisted-by: Google Antigravity (Gemini 4 Neon)@JJAutoCompare on GitHub · 2026-11-25 04:34 UTC · original
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.@DavidM1911 on GitHub · 2026-11-25 06:02 UTC · original
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!
@thehollowedone on GitHub · 2026-11-25 09:10 UTC · original
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.
@oni-swr on GitHub · 2026-11-25 19:44 UTC · original
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)).
@ClosetPie107 on GitHub · 2026-11-25 19:54 UTC · original
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.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.