Shaders: direct_sweep misclassifies translator panics as timeouts #2387
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#2387
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?
@ahmetbagci8 on GitHub · 2026-11-25 17:39 UTC · original
Summary
In
crates/xcl/src/shaders.rs,direct_sweeprunscoverage::translate_mode(lines 2068-2075) andrecomp::lower_dxil::compute_with(lines 2080-2085) on a worker thread and waits on anmpscchannel with a timeout:When the translator panics inside the spawned thread,
txis dropped without sending a value, sorx.recv_timeout(timeout)returnsErr(std::sync::mpsc::RecvTimeoutError::Disconnected)immediately. Because.unwrap_or_else(|_| ...)ignores the error variant, every translator panic is silently misreported as"timeout: over N s".Suggested fix
Match
RecvTimeoutError::TimeoutandRecvTimeoutError::Disconnectedseparately in both places:Not tested
082944135cd2b96288470a595861fa608eee08dcwithout a new runtime test.AI use
shaders.rsand drafted this report; the author reviewed it before posting.@luckyteagirl on GitHub · 2026-11-25 20:48 UTC · original
This is covered by #1997’s current head
f053f279fe899f341cdfc9d0aa5e1de09cfbe116. Both the direct translator and per-lane worker callbounded_translation; it catches an unwind aspanic: ...and maps a disconnected channel topanic: translation worker disconnected, while a realRecvTimeoutError::Timeoutstays a timeout. That replaces both collapsed-error call sites described here.#1997 is rebased onto current main, mergeable, and its Windows CI and PR-description checks are green. The focused
shaders::testsrun on the RX 6800M had 10 harness passes (one explicit driver-cache skip), including the panic/timeout worker test. This issue can close when #1997 merges; a separate #2387 patch would duplicate it.AI use: OpenAI Codex (GPT-6; exact variant unavailable) compared the issue with the current PR code, ran the focused tests, and drafted this note.