Shaders: translations made with XCL_SAFE_BARRIER=0 are cached and reused by later runs #1409
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#1409
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@pvfreis on GitHub · 2026-11-24 15:41 UTC · original
On
main(930e8b4),XCL_SAFE_BARRIER=0(0c02b87) changes the HLSL the recompiler emits fors_barrierin multi-wave compute programs (emit.rs:553), but it is not incache_allowed's list of variables that turn the translation caches off (pso.rs:448-451), and the cache key (ShaderKey, and the file name and header intranslated) does not include it. So a run, orxcl shaders --precompile, withXCL_SAFE_BARRIER=0stores those programs' DXIL with the plain group barrier, and later runs without the variable load it before any translation, so the early-exit-safe barrier of0c02b87is silently missing for them. In the other order,XCL_SAFE_BARRIER=0has no effect on programs already in the cache. Either way it lasts as long as those cache files are used (same translator sources and DXC).Run on
main(local tests, not for upstream; no GPU needed): translating a 128-thread compute program withS_BARRIERgives HLSL withxcl_s_barrier();with the variable unset and without it withXCL_SAFE_BARRIER=0, and the assertion!cache_allowed(Stage::Compute, |n| n == "XCL_SAFE_BARRIER")fails. The cache round trip itself was read, not run.Suggested fix: add
"XCL_SAFE_BARRIER"to the list incache_allowedand toshader_cache_bypasses_debug_overrides(pso.rs:907). #1284 (XCL_LOOP_BUDGET), #245 (XCL_CS_PAD_ALL,XCL_NO_CS_PAD) and #613 (XCL_DXC_ARGS) add names to the same list and test, so a fix touches the same lines.Found by reading the code and confirmed with local tests on
mainby Claude Code (Claude Opus 5.5 found it, Claude Sonnet 5.5 ran the tests, Claude Fable 5.2 re-checked it); checked by a person before posting.github-bot referenced this issue2026-11-26 04:53:09 +00:00
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:42 UTC · original
claiming:
XCL_SAFE_BARRIERgoes intocache_allowed's list, andshader_cache_bypasses_debug_overridesgets an assertion for it that fails on main. PR shortly.Written with Claude Code (Claude Opus 5.5).