Skip to content

chore(perf): report per-request operation counts in perf compare - #5224

Merged
thymikee merged 2 commits into
mainfrom
t3/perf-operation-count-report
Nov 29, 2026
Merged

thymikee merged 2 commits into
mainfrom
t3/perf-operation-count-report

Conversation

@thymikee

@thymikee thymikee commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

pnpm perf:compare judged timing and failures only. It now appends, per step, what one request used: daemon process spawns, runner command sends, and runner preflights.

  • Each count is the median over successful samples with a request log. more/fewer means outside the range of covered baseline nights.
  • Each count is labelled covered or not instrumented (Android: runner sends and preflights). A measured 0 stays distinct from missing profile and no successful sample.
  • A target with an executable-origin refusal (chore(perf): record the measured executable origin and refuse cross-origin timing verdicts #5204) gets no count comparison.
  • A change is a workflow warning. Nothing fails the run; a hard budget is a later decision.
  • Counts come from samples[].profile in existing summaries, so earlier nights serve as baseline.

Not counted: client-side, synchronous, and runCmdDetached spawns; status, shutdown, adoption-probe sends. detached: true spawns count: the log doesn't mark them.

Validation

Head 89e3e15bb3: operation-counts Vitest, 10 passed; profile and compare last ran at 64b59a79d5. CI owns other gates.

Warnings replaying nightly artifacts at 64b59a79d5, each against up to 7 earlier nights (all exit 0):

night 11-29 11-28 11-27 11-26 11-25
iOS (106 steps) 0 44 3 3 0
Android (105 steps) 0 2 1 0 0

All 44 on iOS 11-28 are fewer spawns. On 11-27, automation/alert-open shows 18 spawns vs 6 and 13 sends vs 5, beside its timing regression.

Risks: GitHub caps warning annotations per step; timing warnings print first; the job summary lists all. Self-review was a cold re-read, without an independent reviewer.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

The nightly comparison judged timing and failures only. It now also compares,
per step, the daemon process spawns, runner command sends, and runner
preflights of a request, labels what each count covers, and never reads a
missing request log as zero. Runs of mixed executable origin are skipped. A
changed count is a warning.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.70 MB 6.70 MB 0 B
Package (unpacked) 6.70 MB 6.70 MB 0 B
Package (download) 2.05 MB 2.05 MB -14 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 18.1 ms 19.4 ms +1.3 ms
CLI --help 41.3 ms 42.3 ms +1.1 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread scripts/perf/profile.ts Resolved
Comment thread scripts/perf/README.md Resolved
Comment thread scripts/perf/README.md Resolved
A settled exec event does not record `detached`, so the spawn counter counts
those spawns. State that, and pin it with real spawns. Say when the count
comparison skips a target and which baseline nights judge a change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@blacksmith-sh

This comment has been minimized.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 89e3e15

No open findings.

Reviewed with this repository's own Sentinel configuration (8b60400e9e2f).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at 89e3e15, and no code changes are required. All 22 checks pass.

Not blocking, take or leave: writeComparison writes only the timing comparison to comparison.json, so a reader of that nightly upload sees no operation counts (they could be added as a sibling field, or the gap noted in the README), and hasProfile treats a profile with no phases as missing while aggregateProfiles counts it as profiled, so an empty log can show spawnCount 0 in one section and "missing profile" in the other (a follow-up could move one shared predicate into profile.ts and use it in both places).

The earlier open threads no longer apply and can be resolved: the spawn scope text now says detached: true spawns are included, and a test asserts 2 spawns with real host-kit calls; the origin refusal text now matches the whole-target refusal in compareOperationCounts; the baseline night text now matches countRow, which skips missing-profile and no-successful-sample nights.

Not verified here: nightly artifacts were not replayed, so the warning-count table in the PR description is unconfirmed. Tests were not run locally. It was also not confirmed that every older nightly summary captured the debug-level exec settled events; the harness on main passes --debug, but a summary from a harness without it would read spawns as a covered 0.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 29, 2026
@thymikee
thymikee merged commit 4a2b624 into main Nov 29, 2026
29 of 31 checks passed
@thymikee
thymikee deleted the t3/perf-operation-count-report branch November 29, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant