Shaders: bypass caches when DXIL optimization is disabled #2013
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!2013
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2013/head"
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?
@luckyteagirl on GitHub · 2026-11-25 00:42 UTC · original
luckyteagirl:codex/dxil-no-opt-cache→main· +2 −2 · 1 files · 1 commits · merged 2026-11-25 10:42 UTCAddresses item 2 of #1895.
XCL_DXIL_NO_OPTchanges the Direct DXIL output while the translated shader cache still uses the normal identity. A debug run can therefore put unoptimized DXIL in the cache and serve it to later normal runs. This change bypasses both translated caches whenever the override is present.What is in it
crates/xcl/src/gpu/recomp/pso.rsaddsXCL_DXIL_NO_OPTto the existing cache bypass list.Tested
1512961b3e518a3cec275b6f85968eabff2a9befonmain6567c5f. Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL1.9.2609.5, debug build.shader_cache_bypasses_debug_overridestest failed with the new case before the fix (0 passed, 1 failed), then passed after it (1 passed, 0 failed).cargo build --locked --workspace -j 2passed.XCL_ADAPTER=6800MandXCL_REQUIRE_GPU=1,cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-outputcompleted across 20 test binaries with 854 passed, 143 failed, and 45 ignored. Six explicitSKIPPEDtests are included in the passed count:gpu_raw_window_view_reaches_its_top(no GPU),pso_measurement_compiles_an_exact_synthetic_record(device error),placed_title_textures_share_vram_and_preserve_pixels(no reserved cube with mips),test_title_draws_with_a_root_signature_under_the_debug_layer(missingd3d12SDKLayers.dll),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows), anduploads_start_from_each_subresources_state(no D3D12 debug layer).0x887A0005), followed by failures in other GPU tests.cargo build --locked --release -p xcl -j 2passed. A locally owned title ran for 7 seconds on this head and main400e638869ee8e8f8238079db3b70fce2abd3c2b: each showed one frame, no crash, and no device removal. Peak process commit was 6,973 MB on this head versus 7,069 MB on main.Regression run
main:
PR head:
Not tested
The 7-second title run did not set
XCL_DXIL_NO_OPTand logged zero draws, so it did not exercise the changed cache-bypass path. Longer title runs, other adapters, and newer AMD drivers.AI use
OpenAI Codex (GPT-6, exact variant not exposed in this session) implemented the fix and test case, ran the checks, reviewed the diff, and drafted this description.
@anes66 on GitHub · 2026-11-25 00:46 UTC · original
CPU-only public-path check on exact head
1512961b3e518a3cec275b6f85968eabff2a9bef: the override bypasses populated normal disk and RAM entries for compute, vertex and pixel requests, preserving those entries. Optional test companion 23014df, directly on this head, adds one test only.Tested
XCL_DXIL_NO_OPT=all,XCL_DIRECT_DXIL=all, and an isolated scratch cache. It seeds a disk marker, then a different RAM marker, for each of Compute/Vertex/Pixel. The publicconsole_to_dxil_incall must reject the deliberately invalid synthetic input instead of returning either marker. Subsequent direct cache probes must find both original entries unchanged. Parent environment is untouched.cargo test --locked -p xcl --lib gpu::recomp::pso::shader_cache_tests:: -- --nocapture --test-threads=1: 15 passed / 0 failed / 0 ignored, no skips. The runtime control edit was removed before the final passing run and commit.Not tested
Full workspace/GPU suite, valid-shader optimized/unoptimized output, mesh/geometry paths, release, retail regression or newer-main integration. Marker entries exercise routing and preservation; they are not executable shaders. No competing upstream PR.
AI use
Codex (GPT-6; exact variant unavailable) wrote the test and temporary control, ran CPU validation and prepared this report.
@DavidM1911 on GitHub · 2026-11-25 04:01 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!