Shaders: direct_sweep misclassifies translator panics as timeouts #2377
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?
Imported from ivall/xcl. Originally posted by ahmetbagci8 on 2026-11-25T17:39:19Z.
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.Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T20:48:54Z.
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.