Shaders: restore cached-only state after panics #2378
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!2378
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2378/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?
@mokkamokacaffe on GitHub · 2026-11-25 17:27 UTC · original
mokkamokacaffe:shaders/cached-only-panic-guard→main· +67 −4 · 1 files · 1 commits · closed without mergingA panic inside
dxc::cached_only()previously bypassed its thread-local cleanup. If an outer caller caught that panic, later shader requests on the same thread remained in cache-only mode and could silently fail as deferred cache misses.This addresses only the unclaimed TLS-state item from #1896. The mesh/geometry deferral and
xcl shaders --directworker handling are covered separately.Part of #1896.
What is in it
crates/xcl/src/gpu/recomp/dxc.rs: restore the previousCACHED_ONLYandMISSEDstate through an RAII guard during normal returns and panic unwinding.Tested
cargo check -p xcl --lib --tests --target x86_64-pc-windows-msvc: passed.git diff --check: passed.Regression run
xcl-smokeruns on currentmainand this PR’s exact head commit.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 19:12 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1 real failure, deterministic (also fails--test-threads=1, 1219/1):The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.
— Devin
@pablogonz12 on GitHub · 2026-11-25 19:56 UTC · original
Test report from Linux + Wine on AMD, since "Not tested" says the Windows test binary was not executed. This is the first execution of it that I can see: it runs under Wine here, on AMD RADV hardware. Prepared with AI assistance: DeepSeek V4.1 Flash in OpenCode; the commands were run by it and the output is pasted verbatim.
Setup
RADV GFX1201), AMD Radeon RX 9070 XT 16 GB (native wave64), Ryzen 9 9900X.WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b",VKD3D_CONFIG=ignore_shared_fence,WINEDEBUG=-all, DXC 1.9.2609.5 (01b62ad4).RUSTFLAGS="-C target-feature=+crt-static" cargo xwin test --workspace --release --target x86_64-pc-windows-msvc --no-run; runwine <xcl lib exe> --test-threads=1 <filter>.main2898511with this PR merged on top (clean merge, only this PR differs), head = 86c12ba.Result
2898511dxcgpu::recompThe new test passes:
The three
gpu::recompfailures are main's own on this box and are byte-identical before and after the PR (they are not related todxc.rs):Excluded from the counts
gpu::recomp::tests::jumps_to_outer_loop_heads_are_structuredaborts the test binary on Wine + RADV (exit status 5, #1246) on both trees; skipped on both sides and not counted.Not tested
dxcandgpu::recompwere run, because further chapters abort on this Wine lane as described above).AI use
@CalvyPZ on GitHub · 2026-11-25 22:44 UTC · original
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Pull request closed