experiment: async_std::fs::File cpu.pct reliability 100x#82
Draft
rochdev wants to merge 18 commits into
Draft
Conversation
RUSAGE_CHILDREN only updates after a child exits and is waited for, so the rusage snapshot taken at signal time is identical to the original baseline. Only wall.time and instructions (Linux) are post-ready; document this accurately in README and spec.
The pipe already signals child exit via EOF when the write end closes, so racing the pipe against child.status() is unnecessary. Sequential await is simpler and removes the futures dependency entirely.
…ed CI flakiness on macOS) async_std::fs::File on macOS uses kqueue-based I/O: when the pipe event fires, the async task is rescheduled through the executor before resuming. That extra scheduling hop means proc_pidinfo is called slightly later than with spawn_blocking, which uses a dedicated OS thread that calls proc_pidinfo synchronously right after the read returns with no scheduler hop in between. On a loaded CI runner that window is large enough for the process state to change, causing proc_pidinfo to return None and the CPU subtraction to be skipped.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experiment to measure reliability of
async_std::fs::Fileinread_one_byteon CI.Runs
ready_signal_cpu_pct_bounded100 times and reports pass/failure count.If
cpu.pct.wall.timeexceeds 100% on any run, that counts as a failure.See companion PR for
spawn_blockingcomparison.🤖 Generated with Claude Code