Repository navigation
static-sched: time jobs before spawning their processes - #784
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The timestamp now precedes spawning, so the recorded wall includes the delay before Popen returns.
Non-blocking
⚠ Report the Python self-test run: tools/static-sched.py:369.
The reported bash tools/mac-static.sh --self-test invokes the scheduler's run mode through tools/mac-static.sh:209; it does not execute this new case.
Run python3 tools/static-sched.py --self-test, attach its output, and correct the claim that the reported command includes the delayed-spawn case.
Checked
Duplicates: the new fixture function late delegates spawning to the existing Popen; it adds no scheduler owner.
Complexity: no Rust functions changed. The scheduler adds no branch; the test adds a subprocess fixture.
Silent failure: 1 subprocess-result site followed; its return code is asserted, and failed assertions make the self-test return 1.
Tests: mutation inspection shows that restoring the post-spawn timestamp excludes the injected 1-second delay. Both wall assertions reject a 2-second record for sleep 3.
Gates: no existing threshold, case or pin changed; the PR reports FAIL-first for the delayed-parent reproduction.
Adversarial: spawn errors still propagate; stop signals remain deferred through registration; a child that exits before registration remains waitable. Both scheduler callers use the corrected owner.
Escape catalog: no C1–C4 pattern matched. This change touches tool code, with no inference hot path.
Notes
The Python self-test was not rerun during validation; the mutation result above is from code inspection.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
static-sched가 작업 시간을 실제보다 짧게 기록하던 결함을 고쳐서, 부모 프로세스가 늦게 깨어나도 3초 작업이 3초로 읽히게 합니다.What and why
tools/static-sched.pyread the start time of a job aftersubprocess.Popen()returned. When the scheduler process is descheduled between the child starting andPopen()returning, the child has already run for that long, and the job wall loses it. Under load a 3 s step could read a wall of 2 s, and themac-staticself-test that checks "a 3 s step reads a wall of 2 s" went red on a DGX Spark.The start time is now taken just before
Popen()and stored with the job (tools/static-sched.py:239and:242). A new case in the existing self-test wrapsPopenso that it returns one second late, runssleep 3, and expects both the.wallfile and the recorded time in the times file to be at least 3.Release notes: Fixed:
static-schedno longer under-reads a job's wall time when the scheduler is delayed after starting the job.Code shape
cargo fmtandcargo clippy: no Rust changes (one Python file).Duplication found or removed (
path:line), or "none": none.What I ran
Head
186efcc5cf15a410cb470a672165c9c14ce1182d, baseaafe24c61578ee5839a0508a323d13e7bddc781d(main). Both checks ran on one DGX Spark.Exit code 0. This includes the new delayed-spawn case.
A separate load reproduction ran eight attempts with 24 CPU burners, then a case where the parent returns late from
Popen():Exit code 0. The same delayed-parent case against the code before this change read
LOAD delayed_parent=1 sleep=3 wall=2, and the reproduction ended withFAIL-first: sleep 3 is reported below 3 under CPU load and delayed spawn registration.I did not run the full
just contrib-checktiers or any GPU gate: the change is a scheduler tool in Python and touches no device path.Hardware (if the change is for a machine)
One DGX Spark, running only the two checks above. No GPU is used by this change.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.