Repository navigation
fix(learning): stop discarding runs and undercounting CPU - #78
Merged
Merged
Conversation
Most measured runs never counted as successful, so no workload variant could earn the evidence that adaptive overlap and exact predictions need. Every sample failed when a worker started or exited while it was being read, and one failed sample marked the whole run incomplete. The last sample of nearly every job also failed by racing the job's own exit, and a job seen as finished before its receipt was cleaned up lost its run. A sample is now complete when it read every process that lasted through it. A failed sample counts only if the job is sampled again, and it never advances the last observation, so a real gap still fails finalization. Samples of a job the queue reports as finished add nothing to its evidence, and recorded duration is the job's actual execution time. Native CPU counters are Mach ticks, about 41.67 ns on Apple Silicon, but were treated as nanoseconds. They are now converted with the timebase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marc Went <marc@went.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Marc Went <marc@went.io>
This was referenced Nov 5, 2026
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.
Summary
Most measured runs recorded as incomplete, so no workload variant could earn evidence for overlap or exact predictions. On Apple Silicon, CPU also read about 42 times too low.
This is the first of three PRs. Per-repository grouping and the project and operation browse hierarchy follow separately.
Evidence
Same four jobs on a private daemon and scheduler, including one with constant worker churn:
main): 0 of 4 runs successful, peak CPU 0.01 cores, 0 of 12 complete samples on the churn job.After: 4 of 4 runs successful, CPU 0.36 to 0.38 cores, 11 of 12 samples complete.
TestResourceDarwinCPUTimeIsNanosecondsreported 0.006 s against the kernel's 0.251 s.After: passes.
scripts/test-go-runtime.sh core-1andcore-2andscripts/lint.shpass locally on the code commit. Mutation checks confirm the new finalization, restart and admission tests fail when each behaviour is removed. The fullscripts/validate.sh, including its vulnerability check and tooling shards, did not run locally. Intel relies on hosted CI.Independent reviews (Claude Opus 5.5) found five regressions during this work, all fixed here: a stall hidden by a failed final sample, a good late sample discarding a run, post-finish samples changing evidence, a job first seen finished stopping every scheduler tick, and admission ignoring what a finished job holds.
Merge Danger
Door: two-way
Runs recorded by this version stay in history after a revert, but the schema does not change.
Blast Radius: scheduling
See
docs/handoffs/learning-measurement.md.🤖 Generated with Claude Code