xcl run: say on stderr when the log or report.json cannot be written (#2277) #2286
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!2286
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2286"
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?
@Creaa on GitHub · 2026-11-25 12:26 UTC · original
Creaa:diagnostics/report-write-failures→main· +88 −7 · 2 files · 1 commits · openWhen XCL cannot create its log or write
report.json, it now says so once on stderr, with the path and the OS error, and the run goes on. Before, both failures were dropped: the run looked normal, the console showed aLog:path that did not exist, and there was nothing to attach to a bug report. Fixes #2277.What is in it
crates/xcl/src/log.rs:initopens the log through a newopen(p)that returns the error ofcreate_dir_allorFile::createwith the path;initprintsxcl: cannot create the log folder … / cannot open the log …: <OS error>.eprintln!, notxlog_*: the log is what failed, and its stderr echo is off unless the title setslog_to_stderr.crates/xcl/src/report.rs:write_finalwrites through a newsave(path, text); a failure printsxcl: cannot write the report …: <OS error>once per process (the report is written on several exit paths).a_log_that_cannot_be_opened_names_its_pathanda_report_that_cannot_be_written_names_its_path: a path under an existing file fails with a message naming it; a normal path still writes.Both messages go through
log::warn, a best-effort write to stderr that drops its own error:eprintln!panics when stderr cannot be written (a closed pipe), and these messages come exactly when the log is already unusable (found by @luckyteagirl in review);a_warning_to_a_broken_stderr_is_droppedchecks it with a writer that fails withBrokenPipe.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4: 1426 passed, 0 failed, 46 ignored. SKIPPED: the wave64 GPU tests (no wave64), the direct-DXIL f16/f32 cases refused per #1426,heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(Developer Mode is off), andtest_title_draws_with_a_root_signature_under_the_debug_layer/uploads_start_from_each_subresources_state(no D3D12 debug layer installed).XCL_DATA_ROOTpointing at a root whose<title>\logsis a file: onmainthe run exits 0 and prints nothing about it; with this PR it exits 0 and prints (OS messages translated; the machine's Windows is not English.)Regression run
main:
this PR:
Not tested
AI use
🤖 Generated with Claude Code
@nnonno91 on GitHub · 2026-11-25 15:00 UTC · original
Independent Windows check of
cb29250d8a5197a1f40ab96ab173e84564a7235dwith a log file and a report file blocked independently.Tested
cargo build --locked --workspacepassed.xcl.logorreport.jsonin its own temporary data root. This prevented the launcher's rotation from clearing the obstruction. Rancargo test --locked -p xcl --test e2e test_title_draws_with_a_root_signature_under_the_debug_layer -- --exact --nocapture --test-threads=1withXCL_NETWORK=0andXCL_ADAPTER=AMD Radeon.Not tested
Full disk, a retail title, the parent revision and the full workspace suite.
AI use
OpenAI Codex (GPT-6.2 Sol) adapted the temporary fixture, ran the checks and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 17:17 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@DavidM1911 on GitHub · 2026-11-26 08:15 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on--test-threads=1rerun (1312 passed, 0 failed, 27 ignored, 82s). Intermittent single-test flake — tracked in #1978.Thanks!
— Devin
@luckyteagirl on GitHub · 2026-11-26 08:51 UTC · original · reviewed
At exact head
c095117e(basee1d84b7, current mainb49be18), the two new error-reporting paths can turn the promised recoverable log/report I/O failure into a panic if stderr itself cannot be written. This is a source-derived review; I did not run a closed-pipe fixture.log::inituseseprintln!afteropen(p)fails, andreport::write_finaldoes the same aftersave()fails. Rust documents thateprintln!panics on a stderr write error. A valid redirected stderr pipe whose reader has closed is one such case. The new tests call onlyopen/save, so they do not cover the outer nonfatal path. This matters most when the log and report paths are already unwritable, since stderr may be the only remaining diagnostic channel.Could both paths use a best-effort stderr write and discard its error, as the runner already does for
SKIPPEDnotices? A subprocess with a valid but broken stderr pipe, or a small injected writer that returnsBrokenPipe, could assert that the production warning path returns without unwinding while retaining the once-only report guard.AI assistance: two GPT-6.2 Sol agents checked the source and Windows stderr behavior; GPT-6.2 Astra verified the exact-head paths and official Rust documentation.
c095117e14to3550516dfa@Creaa on GitHub · 2026-11-26 12:05 UTC · original
@luckyteagirl thanks, right:
eprintln!panics on a stderr it cannot write, and these two messages come exactly when the log is already unusable. Fixed in3550516(squashed into the PR's commit): both now go throughlog::warn, which writesxcl: <message>to stderr and drops the write's own error, as the runner does forSKIPPED;report::write_finalkeeps its once-only guard.a_warning_to_a_broken_stderr_is_droppedchecks it with a writer that fails withBrokenPipe(no panic) and a normal one (the line as before).Full suite and the smoke run rerun on the new head (1426 passed, 0 failed, 46 ignored; smoke block in the description).
AI use: Claude Code (Claude Opus 5.5) made the change, ran the checks and drafted this reply.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.