Skip to content

feat(rescore): log a pass's CPU time and assertion expiries beside its elapsed time - #2297

Merged
ryanbr merged 1 commit into
ryanbr:mainfrom
Iskrata:fix/rescore-pass-suspension-log
Sep 18, 2026
Merged

ryanbr merged 1 commit into
ryanbr:mainfrom
Iskrata:fix/rescore-pass-suspension-log

Conversation

@Iskrata

@Iskrata Iskrata commented Sep 17, 2026

Copy link
Copy Markdown

What this PR does

Adds one always-on line after re-score: done:

re-score: cost cpu=150.0s elapsed=8813.2s cpuShare=2% assertionExpired=1 backgrounded=true
  • cpu is process CPU time (getrusage, user + system) across the pass.
  • assertionExpired counts how many times the noop.rescore execution assertion's expiry handler fired during the pass.

Why

It answers the question raised on #2280, which the log could not answer until now. re-score: done … in N ms is uptime, and uptime keeps running while the process is suspended, so a long elapsed time looks the same in both of these cases:

  1. the pass was suspended and resumed across wakes;
  2. the assertion expired and the pass ran on, detached, past its grant.

Neither leaves a cpu_resource_fatal, and only the first means a backgrounded pass reliably finishes. CPU time next to elapsed time separates them: a pass that spends a few percent of its elapsed time on CPU was mostly suspended, and assertionExpired says whether the grant ran out on the way.

It also covers the safety-net concern from that review. If pacing stops holding the limit on some device, cpuShare climbs towards the limit before any kill, and a kill still shows up on the next launch as the #1538 resuming a pass an earlier attempt could not finish line.

Type of change

  • Diagnostics

How it was tested

  • RescoreBackgroundSchedulerTests: the line format for the field shape and for an unreadable CPU clock, and process CPU time advancing under load. The suite passes (23 tests).
  • doc_comment_lint.py is clean; parity_ratchet.py --base upstream/main --offline reports 0 errors.

Checklist

  • No new build warnings introduced
  • Follows the conventions in docs/CONTRIBUTING.md
  • I did not commit generated output (Strand.xcodeproj/) or any secrets/keystores

@ryanbr
ryanbr merged commit de111a9 into ryanbr:main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants