Repository navigation
Conversation
|
Native Windows check on Ryzen 7 5700X3D, Rust 1.100.0 MSVC. I compiled the The separate overflow control used four producers, 8,192 numbered Info lines and a parent process that deliberately left the child's stderr pipe unread until the producers and One scope detail for the test suite: a direct Rust This exercises the logger and native Windows pipe behavior without a GPU or retail smoke run. AI disclosure: OpenAI Codex (GPT-6.2 Sol) implemented and ran the process harness and drafted this report. |
…ller
log::write echoed every Info line to stderr synchronously, on whichever
thread logged, after the file line. A stderr that nobody reads blocks
that write: a pipe whose reader stopped, or a Windows console with text
selected. Each thread that logged then stopped right after its file
line, including the title's own threads inside a console call, and the
title froze with nothing in the log to say why.
The echo now goes through a bounded queue to an "xcl-stderr" thread. A
caller never waits: with the queue full (4096 lines) the line is
dropped and counted, and the next line echoed says how many were left
out. The file write is unchanged and still comes first. log::flush
gives the echo up to 200 ms to catch up, so lines from the end of a run
still reach the console.
Measured on an M5 Pro, macOS 27.2.1, CrossOver 26.3 + D3DMetal, with the
test title presenting 1920x1080 frames on the 60 Hz frame clock and
stderr connected to a pipe whose reader never reads:
- before: the title's frames stopped about 2 s in; xcl.log ended at 69
lines, each logging thread right after one line;
- after: 240 s at 60 fps to the end, 402 log lines, exit code 0.
an_unread_stderr_does_not_stop_the_thread_that_logs (new) runs this
test binary again as a child whose stderr is a pipe the test never
reads; the child logs 4000 lines and must exit within 30 s. It fails
before this change ("logging stopped on a stderr nobody reads") and
passes after; the blocked pipe and the queued lines stay in the child.
218bc95 to
4a99fce
Compare
|
@andrewDoing thanks for the native check, and for the point about the test. I changed it as you suggested ( |
|
Review (head 4a99fce, diff read, not a merge-check; draft,
Fine: the file write is unchanged and still comes first, so AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
No open or merged PR moves the stderr echo off the logging thread; #2286 and #2634 only add stderr messages when the log cannot be written, and #1831 adds a separate error writer. Part of #258. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
log::writecopies every Info line to stderr on the thread that logged it, after the file line. When nothing reads stderr, that write blocks: a pipe whose reader stopped, or a Windows console with text selected in it. Each thread that logs then stops right after its file line, including the title's own threads inside a console call, and the title freezes with nothing in the log to say why. Part of #258.What is in it
crates/xcl/src/log.rs: the stderr copy goes through a bounded queue (4096 lines) to anxcl-stderrthread, so a caller never waits. With the queue full a line is dropped and counted, and the next line copied says how many were left out. The file write is unchanged and still comes first.log::flushgives the copy up to 200 ms to catch up.an_unread_stderr_does_not_stop_the_thread_that_logs: runs the test binary again as a child whose stderr is a pipe the test never reads; the child logs 4000 lines and must exit within 30 s. It fails without the change ("logging stopped on a stderr nobody reads").Tested
x86_64-pc-windows-gnu; head4a99fceonmain9dfbe3e.log::tests(debug,--test-threads=4): 2 passed, 0 failed. With the old blocking echo put back,an_unread_stderr_does_not_stop_the_thread_that_logsfails after 30 s.xcl.logended at 69 lines; after, 240 s at 60 fps to the end, 402 log lines, exit code 0 (measured on my Mac branch with the same change).Regression run
scripts/smoke.ps1. I am asking on macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258 for a pair.Not tested
AI use