Shaders: cache translator refusals and DXC compile failures by capability #1474
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!1474
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1474/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?
@AlpPesen on GitHub · 2026-11-24 16:39 UTC · original
AlpPesen:perf/cache-shader-refusals→main· +398 −20 · 2 files · 1 commits · merged 2026-11-25 18:22 UTCFixes #1412.
Repeated boots re-attempt the same deterministic translator refusals and DXC compile errors on every run because only successful
.dxil/ translated blobs are persisted on disk.What is in it
.err) for deterministic translator refusals incrates/xcl/src/gpu/recomp/pso.rs(translated::cached_inandtranslated::cached_rerouted, keyed by capability/source/rerouted identity so any translator, DXC, wave-mode, or direct-DXIL update invalidates them).: dxc:, excludingInternal Compiler error:) incrates/xcl/src/gpu/recomp/dxc.rswhile keeping transient failures (E_OUTOFMEMORY0x8007000EfromCompileorGetStatus,Internal Compiler error:, cross-process mutex lock errorsDXIL cache: ..., missing/olddxcompiler.dll,cached_onlydeferrals, invalid DXIL containers) uncached and retryable.pso.rs(including directtranslated::cached_reroutedcoverage) anddxc.rscovering capability/version invalidation,cached_onlydeferral isolation, cross-process lock errors, and transient vs deterministic DXC errors.Tested
rustc 1.100.0, DXC1.9.2602.17.cargo test -p xcl --lib gpu::recomp::pso: 22 passed, 0 failed, 1 ignored, 0 skipped.cargo test -p xcl --lib gpu::recomp::dxc: 16 passed, 0 failed, 0 ignored, 0 skipped.06c9f55.Not tested
06c9f55.Regression run
AI use
@GonZiinand@pvfreison transient DXC/lock/internal errors andcached_reroutedtest coverage, rebased onto06c9f55, ran the tests and pairedscripts/smoke.ps1runs, and drafted this PR description.Persist deterministic negative cache markers (.err) alongside positive shader cache entries so repeated boots do not re-lower refused programs or re-invoke DXC on deterministically failing HLSL: - dxc.rs: cache deterministic DXC compiler rejections (raw error starting with 'dxc: ') in {key:016x}.err (keyed by crate version, DXC toolchain identity, profile, entry, and HLSL source). Subsequent runs return the identical error text with zero DXC invocations. Transient/missing-DLL errors and cached_only deferrals are never cached. - pso.rs: cache translator refusals and compile errors in translated/v2/{ident:016x}/...err (keyed by XCL_TRANSLATOR_SOURCE_ID, DXC toolchain identity, blob hashes/length, stage, sampler_base, windows, and split_wave64). Updating translator sources, DXC DLLs, or wave mode automatically invalidates prior markers; debug/capability env overrides bypass the cache via cache_allowed. Fixes #1412. Assisted-by: Antigravity (Gemini 4 Neon)github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@futurepro62 on GitHub · 2026-11-24 17:19 UTC · original
Full-suite run, since this PR has no test report yet. Tested exact head
451ae68(on its baseb7aa9f3). Passes on both GPUs.Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4, run alone: 772 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.fine_timer_makes_short_sleeps_short(Sleep(1) took 6.71 ms), a timing check this PR doesn't touch. It passed when run alone.dxc_compile_failure_is_cached_and_skips_recompilation,translated_cache_caches_refusals_by_capability_identity.XCL_ADAPTER=radeon): 772 passed, 0 failed, 41 ignored, nothing skipped.Note
Not tested
AI use
@upipibi on GitHub · 2026-11-24 17:47 UTC · original
Duplicate note: #1472 (opened two minutes earlier) also fixes #1412, in the same two files (
dxc.rs,pso.rs). It has a review and an AMD Windows test on its head (a56a7c7). The two use different on-disk markers:.errwithXCLDXCE1there,.failwithXCLFAIL1here. A cache directory would then hold one or the other depending on which lands, so it is worth choosing before either merges. Comparison only: I haven't run either.AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this.
@AlpPesen on GitHub · 2026-11-24 18:39 UTC · original
Thanks @GonZiin for the catch! Updated ranslated::is_cacheable_error in 3db920c so errors formatted by the lower DXIL cache (DXIL cache ...) are only cached when DXC itself deterministically rejected the HLSL (: dxc: ), keeping transient failures like Compile: ... (0x8007000E) or invalid-container outputs retryable. Added unit test coverage for both cases in ranslated_cache_caches_refusals_by_capability_identity and reran scripts/smoke.ps1 on 3db920c.
@DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@kais7654 on GitHub · 2026-11-24 19:47 UTC · original
Ran on the PR's head (3db920c): RTX 5070 Laptop (Blackwell, driver 616.87),
Windows 11 26H2, rustc 1.100.0.
cargo build --workspace: ok
cargo test -p xcl --lib gpu::recomp: 191 passed, 0 failed, 18 ignored
(includes shader_cache_retries_failed_and_deferred_compiles and the dxc cache
statistics tests)
One design question: every raw error from compile() that starts with "dxc: " is
treated as deterministic and cached for the toolchain identity's lifetime. Are
all "dxc: " failures really deterministic? An out-of-memory inside DXC
mid-compile would produce the same prefix and then be cached until the DXC
version changes, so a transient failure would never be retried. Does something
exclude those (or should only defined refusal classes be cached)?
Not tested: the runtime effect across repeated boots (no retail pack here),
and no Windows-path check of the .err invalidation on a DXC upgrade.
AI use: my local Mistral Vibe agent fetched the branch, ran the build/tests
above and drafted this comment; I checked the diff.
@upipibi on GitHub · 2026-11-25 06:26 UTC · original
Test report at the current head
3db920c: RTX 3070 (Ampere, driver 616.56), Windows 11, debug.cargo test -p xcl --lib -- --test-threads=4: 723 passed, 1 failed, 21 ignored. The failure ishle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime(no samples played within its fixed wait while the machine was loaded). This PR doesn't touch XAudio2; #1600 gives those voice tests a longer wait.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu_ --skip gpu_sparse_vram: 98 passed, 0 failed.(This PR is in duplicate group D7 with #1472 in #1607.)
AI-assisted (Claude Code). Synthetic tests only.
@pvfreis on GitHub · 2026-11-25 13:21 UTC · original
Two errors that can be transient are kept as refusals at
7f97ba3. Tested on its base426a5a7(mainhas not toucheddxc.rsorpso.rssince).process_cache_lock(&file)?(dxc.rs:873) returns "DXIL cache: cannot create the cross-process mutex" as it is, andis_cacheable_error(pso.rs:360) treats only a text withstarts_with("DXIL cache "), with a space, as an error of the lower cache. Socached_reroutedwrites the.errmarker, and later calls return it before translating, until the marker is deleted or the translator or DXC changes. The comment above the check says lock errors stay retryable.starts_with("DXIL cache")would cover both forms.Compilecatcheshlsl::Exceptionand returns a successful call whose status is the exception's HRESULT, with the text "Internal Compiler error: " plus its message (dxcompilerobj.cpp, the catch afterSetStatusAndPrimaryResult). One of them is transient:IFT(CreateMemoryStream(...))throws E_OUTOFMEMORY this way. XCL formats any failing status asdxc: ...(dxc.rs:533) and drops the code, so this becomesdxc: Internal Compiler error:and the DXIL layer caches it (tested), as does the translated layer (by reading). Ordinary HLSL errors have status E_FAIL, so keeping the status and not caching E_OUTOFMEMORY would separate them. I don't know how often a title hits it: the out-of-memory errors in #1710 were the other form ("Compile: ... (0x8007000E)"), which is not cached.The refusal tests in
pso.rsall go throughcached_in, which is test-only since #2120, so the marker branch ofcached_rerouted, the one a title runs, is not checked by any test. Callingcached_reroutedthere would cover it.cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4, debug, RTX 3060, passed / failed / ignoredmain426a5a7+ two testsTest 1 calls
cached_reroutedwith a realcompile_cached_inwhile an event holds the mutex's name, soCreateMutexWreally fails; then the event is closed and the same call is made again. Onmainthe second call compiles; here it returns the mutex error without running the closure. Test 2 givescompile_cached_in_observedthe internal error's text and then a good result. The failure the rows share is the e2e title test (presentsis 0 in my sandbox); 24 SKIPPED lines in both logs. #1472 (its duplicate) has the same two filters, by reading its head9e1a79e.Not tested: a real DXC internal error, a title. I can post the tests.
AI use: Claude Code (Claude Opus 5.5) read the change, wrote and ran the tests; checked with Claude Fable 5.2.
@AlpPesen on GitHub · 2026-11-25 14:01 UTC · original
Thanks @pvfreis for the detailed review and tests! All three points are fixed in
f51058f(rebased onto06c9f55):pso::translated::is_cacheable_errornow matchesreason.starts_with("DXIL cache")(covering both"DXIL cache "and"DXIL cache: cannot create the cross-process mutex"), so cross-process mutex errors stay retryable.Internal Compiler error:/E_OUTOFMEMORY:dxc::compilenow preservesE_OUTOFMEMORY(dxc (0x8007000E): ...) instead of formatting it asdxc: ..., and bothdxc::is_cacheable_dxc_errorandpso::translated::is_cacheable_errorreject"Internal Compiler error:".cached_reroutedcoverage: Addedtranslated_cache_rerouted_caches_refusals_and_skips_transient_errorsinpso.rscoveringcached_reroutedrefusal caching, direct-translator version invalidation, cross-process mutex lock errors, and DXC internal compiler errors, plus an internal-error case indxc.rs.Verified on AMD RX 6800 (
gpu::recomp::pso: 22 passed,gpu::recomp::dxc: 16 passed, plus fresh paired 60 ssmoke.ps1runs).@thehollowedone on GitHub · 2026-11-25 14:15 UTC · original
Independent check of f51058f on Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC and DXC 1.8.2502.11.
The clean head built with
cargo build --offline --locked --workspace -j 6.cargo test --offline --locked --workspace -j 6 --no-fail-fast -- --test-threads=4 --nocapturefinished with 1,268 passed, 0 failed, 46 ignored, including 26 runtime skips in the pass count. The stock rerouted-cache tests covered cross-process lock errors and DXC internal errors staying retryable.I also exercised the production DXC disk cache from four fresh test processes with one synthetic HLSL input and a private cache directory. The first process made one compiler attempt and wrote one refusal marker. The next process replayed the diagnostic in normal and cached-only modes with zero compiler attempts and no deferral. Corrected HLSL compiled once and passed DXIL validation. Deleting the refusal marker made the original input reach DXC again. All four runs passed with zero skips using
cargo test --offline --locked -p xcl --lib -j 6 local_dxc_cache_persists_across_processes -- --test-threads=1 --nocapturewith a test-only fixture.Synthetic inputs only. No retail run or induced DXC out-of-memory failure.
AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the temporary fixture, ran the tests and drafted this report.
@S1m0ne1997 on GitHub · 2026-11-25 15:02 UTC · original
Test report for
f51058f787a62d3a4964029f0279335a1832da68(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 1268 passed, 0 failed, 46 ignored.dispatch_chain_native_wave64_builds_whole(no wave64),a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu(no wave64),coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu(no wave64),cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu(no wave64),the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu(no wave64),a_per_lane_2d_or_3d_group_runs_on_the_gpu(no wave64),const_and_null_mask_operands_agree_with_hlsl_on_the_gpu(const_mask, wave64: no wave64),f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); f16 arithmetic, wave64: no wave64),f32_programs_on_the_gpu(f32 arithmetic, wave64: no wave64; f32 compares, wave64: no wave64),f64_programs_on_the_gpu(f64, wave64: no wave64),integer_programs_on_the_gpu(integer arithmetic, wave64: no wave64; integer carries, wave64: no wave64),mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(mask_ff0_flbit, wave64: no wave64),gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache (Windows Developer Mode is required): L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D)),test_title_draws_with_a_root_signature_under_the_debug_layer(no d3d12SDKLayers.dll),uploads_start_from_each_subresources_state(no D3D12 debug layer (L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D))).Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head with no changes tocrates/, both run with thescripts/smoke.ps1ofmain, which hashes the name of the game folder)main:
this PR:
Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
@oni-swr on GitHub · 2026-11-25 17:30 UTC · original
AMD run on
f51058f7(PR head, merges cleanly intomain68a284a; I tested the head as it is, not the merge).Machine: AMD Radeon RX 7800 XT (RDNA3, native wave64), driver 32.0.31035.1003, Windows 11 Pro 10.0.26200, Rust 1.100.0
x86_64-pc-windows-msvc, DXC 1.8.2502.11 (Windows SDK 10.0.26100.0), debug build, clean checkout, noXCL_SAMPLE_*.Tested
dxc_compile_failure_is_cached_and_skips_recompilation,translated_cache_caches_refusals_by_capability_identity,translated_cache_rerouted_caches_refusals_and_skips_transient_errors: 3 passed, 0 failed.cargo test --workspace --no-fail-fast -- --test-threads=4: 1267 passed, 1 failed, 46 ignored, 7SKIPPEDlines (f16 and f32 conversion per-lane forms refused, and one test with no heap windows).gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722:res[30] = 0x1, CPU0x7fffffff); it fails identically onmain68a284a, so it is not this PR's.Not tested
scripts/smoke.ps1pair, so the PR'sxcl-smokeregression run is not covered here, and the effect on a real cold start was not measured.AI use: Claude Code (Claude Sonnet 5.5) ran the commands and wrote this report for oni-swr.
@ClosetPie107 on GitHub · 2026-11-25 17:42 UTC · original
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head
f51058f787a62d3a4964029f0279335a1832da68(merged locally ontomain68a284a, clean merge).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)Tested (
XCL_REQUIRE_GPU=wave64,VKD3D_CONFIG=ignore_shared_fence,--test-threads=1 --nocapture)gpu::recomp::pso: 23 passed, 0 failed, 1 ignored (0 skipped)gpu::recomp::dxc: 16 passed, 0 failed, 0 ignored (0 skipped)Not tested
AI use
@DavidM1911 on GitHub · 2026-11-26 05:27 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@GonZiin on GitHub · 2026-11-24 17:28 UTC · original · reviewed
The translated-shader cache can persist a transient DXC error and prevent a retry. The lower DXIL cache excludes a failed compiler invocation such as
Compile: … (0x8007000E). The outertranslated::cached_inreceives the formatted error, treats it as cacheable and writes an.errmarker. The next call for that shader returns the saved error before calling the translator or compiler.Tested
cargo test -p xcl --lib review_a_transient_dxc_error_allows_retry -- --nocapturewith one temporary probe appended topso.rsin an isolated checkout. The probe injects the formatted DXC out-of-memory error on the first call and supplies a successful compile result on the second.b7aa9f3bd212088e0d927439284dc5ed325ce3c7retried once and returned the successful result. Head451ae68ed5e1493b663a65064cb4b6976efdd097returned the original error with zero retry calls.The outer cache should persist deterministic translator refusals and let the lower cache handle compiler errors, or carry retryability through the result type. This would keep transient or invalid-output errors retryable even after the outer cache sees them.
Not tested
Real system memory exhaustion, GPU behavior and retail titles. The probe injected the error at the translated-cache boundary.
AI use
Codex (
gpt-6.2-sol) reviewed the error path, wrote and ran the probe, and drafted this review.