Repository navigation
xcl run: a panic on any thread is written to xcl.log - #2005
Royalflamejlh wants to merge 2 commits into
Conversation
A panic was printed to stderr only. One of XCL's own threads that panics is gone for the rest of the run, and `xcl.log`, the file a report carries, had no line of it: in a retail title's run under Wine (RTX 4060 Ti) `xcl-sync-watchdog` panicked as it started (the race xcl-dev#1926 fixes) and the log reads like any other stall. The host installs a panic hook that writes the thread's name, the place and the message as an ERROR line, then calls the hook that was there. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Code review on
Remaining before merge:
|
|
A regression run under Wine on Linux on the retail title: no device removal, no crash, frames level with Tested
Regression run main (first run): this PR: The second Not tested
AI use
|
Empirical verification — PR #2005 (
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent Windows run on ecda938. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
An isolated fixture released two named workers from one barrier to panic with multiline messages. With logger stderr echo disabled, each wrote one complete error line to the file, and the previous hook ran once per worker. With the new hook omitted, the previous hook still ran twice and the file assertion failed.
|
A panic on any thread of the host is now written to
xcl.logas an ERROR line, as well as to stderr. Until now it went to stderr only, so the file a report carries had nothing of it. One of XCL's own threads that panics is gone for the rest of the run, and the run then reads like any other stall.Seen in a retail title run of ours (Linux through Wine and vkd3d-proton, RTX 4060 Ti 16 GB, a local tree at
c3af1d7): stderr hadthread 'xcl-sync-watchdog' (2032) panicked at crates/xcl/src/hle/d3d12x/list_x.rs:1374:55: called Option::unwrap() on a None valueat the first bridged GPU wait (97.6 s), andxcl.loghad no line of it. The log has 8 bridged waits after that and noreleased on CPU to prevent GPU hangline, and the title's own watchdog ended the run at 149.5 s; the run does not show that a release would have changed that end. That panic is the start-up race #1926 fixes; this change does not touch it. It is 1 of the 142 title runs of ours under Wine on 23 and 24 November that bridged a wait (the 134 of 24 November are the ones counted in our comment on #1926); we only found it because the harness keeps stderr.Related to #1452 and #505 (the waits that thread releases); it fixes neither. It is a diagnostic: the next thread that dies shows in the log.
What is in it
crates/xcl/src/log.rs:log_panicsinstalls a panic hook that writesthread '<name>' panicked at <file>:<line>:<col>: <message>at ERROR level (flushed at once, like every ERROR line), then calls the hook that was installed before, so stderr andRUST_BACKTRACEbehave as before. A thread without a name is written asthread ''. A panic that XCL catches (a DXC worker's, DirectStorage's parallel decoding) is logged the same way. Withlog_to_stderron, the line is on stderr twice (XCL's echo and Rust's own).crates/xcl/src/host.rs: the host calls it right afterlog::init. Thexcl shaders,inspectand other commands are not changed.log::tests::a_panic_is_in_the_log: a named thread panics and the log file has its name, the place and the message.Tested
cargo build --release -p xclof0eccc4e(onmain8e87fc7): builds, with 2 warnings, asmain8e87fc7has there.cargo test --workspace --no-fail-fast -- --test-threads=4(debug) on0eccc4e: 987 passed, 4 failed, 45 ignored; the new test passed. The headecda938differs from0eccc4ein comments only (−4 +1 lines). The four failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0to_3; the same four failed onmain689f2dbon this machine earlier the same day (971 passed, 4 failed, 45 ignored).main8e87fc7itself was not run.no wave64, 3 wave32 per-lane forms refused, 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_record(the driver cache cannot be turned off without Windows Developer Mode).ecda938itself:cargo test --workspace -- a_panic_is_in_the_log --test-threads=1(debug), 1 passed, 0 failed (1 run).Regression run
scripts/smoke.ps1, unchanged, 60 s on the same machine, 1 run each. Themainblock isaa9ab8a, the newestmainbuilt there; the head is based on8e87fc7.main:
PR:
Not tested
main8e87fc7.extern "system"functions: Rust runs the hook and then aborts the process, so the line should be the last one in the log. No run showed that case.AI use