Repository navigation
Conversation
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Note
Not tested
AI use
|
GonZiin
left a comment
There was a problem hiding this comment.
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 outer translated::cached_in receives the formatted error, treats it as cacheable and writes an .err marker. The next call for that shader returns the saved error before calling the translator or compiler.
Tested
- Windows 11 Pro build 26300, Ryzen 7 7800X3D, Rust 1.100.0 MSVC, debug. I ran
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. - Base
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.
|
Duplicate note: #1472 (opened two minutes earlier) also fixes #1412, in the same two files ( AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this. |
…lity
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 xcl-dev#1412.
Assisted-by: Antigravity (Gemini 4 Neon)
451ae68 to
3db920c
Compare
|
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. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Ran on the PR's head (3db920c): RTX 5070 Laptop (Blackwell, driver 616.87), cargo build --workspace: ok One design question: every raw error from compile() that starts with "dxc: " is Not tested: the runtime effect across repeated boots (no retail pack here), |
…lity Adapt Alp Pesen's xcl-dev#1474 to staging 7209e87. Preserve direct backend and adapter identities. Carry typed failures across translation, compilation and caching. Persist only deterministic refusals. Ignore legacy rejection markers. Bypass caches for shader diagnostic overrides. Original-commit: 3db920c Assisted-by: Antigravity (Gemini 4 Neon) Assisted-by: Codex (gpt-6.2-astra)
|
Test report at the current head
(This PR is in duplicate group D7 with #1472 in #1607.) AI-assisted (Claude Code). Synthetic tests only. |
Caches deterministic translator refusals and DXC compile failures on disk in capability-scoped
.errmarkers so repeated boots do not re-lower refused programs or re-invoke DXC on deterministically failing HLSL.Fixes #1412.
What is in it
crates/xcl/src/gpu/recomp/dxc.rs:compilestarting with"dxc: ") in{key:016x}.err(atomic write-to-tmp + rename, tagged with magicXCLDXCE1,key,src.len(), and the formatted error message). Becausekeyalready hashesCARGO_PKG_VERSION,toolchain_identity()(dxcompiler.dll+dxil.dllsize/mtime),profile,entry, andsrc, updating DXC or changing the generated HLSL automatically invalidates prior markers.{key:016x}.errboth on the fast path (beforeCACHED_ONLY) and inside the flight + process lock after waiting, returning the exact original error text with zero additional DXC invocations (compilationsandcompilation_failuresremain flat on subsequent runs).cached_onlydeferrals; exposecached_only_missed()forpso.rs.dxc_compile_failure_is_cached_and_skips_recompilation.crates/xcl/src/gpu/recomp/pso.rs:mod translated, persist translator refusals and compile errors intranslated/v2/{ident:016x}/{fnv64}_{stage}_{sampler_base}_{windows}_{split}.err(tagged with magicXCLTERR1,ident,blob.len(),hash2(blob), and the exact refusal reason string).identhashesXCL_TRANSLATOR_SOURCE_ID(all translator/recompiler sources inbuild.rs) anddxc::toolchain_identity(), and the filename encodesstage,sampler_base,windows, andsplit_wave64, any translator/spec update, DXC update, or wave-mode change automatically invalidates prior markers. Debug/capability env overrides continue to bypass the cache completely viacache_allowed, andcached_onlydeferrals or transient errors are never cached.translated_cache_caches_refusals_by_capability_identity.Regression run
Baseline (
main, warm shader/PSO cache):This PR (
perf/cache-shader-refusals, warm shader/PSO cache):Tested
Hardware: Windows 11 Pro for Workstations (Build 26300), Intel Core i9-9900K, 32 GB RAM, AMD Radeon RX 6800 (16337 MiB VRAM, Driver
32.0.21045.29003),rustc 1.100.0 (0ef1bc386 2026-11-09).cargo test -p xcl --lib gpu::recomp::dxc:::15 passed; 0 failed; 0 ignored; 0 skipped.cargo test -p xcl --lib gpu::recomp::pso:::12 passed; 0 failed; 1 ignored; 0 skipped.XCL_REQUIRE_GPU=wave64,mesh cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:769 passed; 3 failed; 41 ignored; 0 skipped. All 3 failures are the pre-existing RDNA2placed_title_textures_share_vram_and_preserve_pixels+ 2VRAM_TEST_LOCKPoisonErrorcascades on unmodifiedmain(tracked in D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #470)..\scripts\smoke.ps1 -Game '<game folder>\YouKnowWho'on3db920c6102e009a0d2a841f39e179e9bc2dccc5(see Regression run above).Not tested
AI use
Antigravity (Gemini 4 Neon) implemented the capability-scoped negative cache markers and unit tests in
crates/xcl/src/gpu/recomp/dxc.rsandcrates/xcl/src/gpu/recomp/pso.rs, and ran the full test suite and smoke run.