Skip to content

Report performance measures over a limit in one pull request comment instead of failing CI - #1211

Closed
dfed wants to merge 3 commits into
mainfrom
claude/timing-comment-only
Closed

dfed wants to merge 3 commits into
mainfrom
claude/timing-comment-only

Conversation

@dfed

@dfed dfed commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

A performance row over its limit no longer fails CI. "Check Generate Time on Linux" and "Check Function Compile Time on Linux" report it as a warning, and a new job, "Post Timing to the Pull Request", writes their reports into one comment on the pull request that every run rewrites, with the change's tool against the newest release's beside the comparison with main.

This covers every measure of the check: wall time, peak memory, .safedi size, and a growth row's time, memory, size and generated code. A wall time differs between runners and between runs, so a failure on it was answered by running the job again. A change that moved another measure was answered by a commit that moved a limit and a run of every check again. Neither found a defect that a reader of the figures would not.

No limit changes: the limits are what the report calls "over". What still fails is a shape or a growth row the tool cannot generate or does not finish, and every check of correctness.

Scripts/perf-watch.py is how a row over its limit is seen and owned instead of met as a red build. Given a report file, or --commit SHA to fetch the report of that commit's newest CI run, it lists every row over its limit with its ratio and limit, how the row moved since an earlier run (--before, --before-commit), and every other row whose ratio got worse.

A pull request from a fork gets no comment, since its token cannot write; the reports stay in the two jobs' summaries. A comment that cannot be posted is a warning.

Generated output: unchanged

Tests

The scripts' self-tests cover the new modes (--report-time, --report-measures, --report-only): every finding over a limit is a measure, and a shape the tool refuses is not and still fails. perf-watch.py --self-test reads a sample report with rows over a limit in each table, against an earlier one, and refuses a report with no rows; CI runs it beside the other self-test. This pull request's own run is the first to post the comment.

Found and not fixed

  • A growth row's wall time has the noise of any wall time, so its ratio in the comment moves between runs. Planned as a follow-up pull request that adds instruction counts, which are the same on every run, to the growth rows.
  • perf-watch.py reads the report's Markdown tables rather than a file made for it. Left: both scripts are in one repository and the self-test reads the same table layout, so a change to one that breaks the other fails CI.

https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo


Generated by Claude Code

"Check Generate Time on Linux" and "Check Function Compile Time on Linux"
failed on wall times, which differ between runners and between runs of one
runner, so a failure was answered by running the job again. Both now report
a wall time over its limit as a warning, and "Post Timing to the Pull
Request" writes their reports into one comment that every run rewrites,
with the change's tool against the newest release's beside the comparison
with main. Peak memory, `.safedi` size, generated code, a shape the tool
cannot generate and a log with no time in it fail as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo
@dfed dfed self-assigned this Dec 2, 2026
…erf-watch.py

Peak memory, `.safedi` size and the growth rows failed "Check Generate Time on Linux" as wall time did, and a
change that moved one was answered by a commit that moved a limit and a run of every check again. Under
`--report-measures`, which CI now passes, each is reported in the pull request's timing comment and fails nothing;
a shape or a row the tool cannot generate still fails. No limit changes.

`Scripts/perf-watch.py` reads a run's report, from a file or from a commit's newest CI run, and lists every row
over its limit with its ratio and limit, how it moved since an earlier run, and every other row that got worse.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo
@dfed dfed changed the title Report wall times in one pull request comment instead of failing on them Report performance measures over a limit in one pull request comment instead of failing CI Dec 2, 2026
@dfed
dfed marked this pull request as ready for review December 2, 2026 16:34
@dfed
dfed enabled auto-merge (squash) December 2, 2026 16:34
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Timing of e839d23

Wall times measured in this run. A wall time, peak memory, size or growth row over its limit is reported here and fails no check; a shape the tool cannot generate still fails "Check Generate Time on Linux". Every run rewrites this comment, and a check that did not run in it is not listed.

generate, head against base: 0 failure(s).

Every shape and row

generate time and peak memory, head against base: median of 5 alternating runs; a shape fails at 2 times the base's wall time or 1.3 times its peak memory, and C1500-mock-chain, E32-inline-mocks, S12-mocks, S16 also at 1.1 times the base's median peak of 5 more runs with one allocator arena. APP100x800x3, APP300x3000x3, E24-public-mock, MR20x1000-many-roots, ORD400-ordinary are compared on their runs with one arena alone, at 1.3 or at the shape's own memory limit.

Shape Runs Base wall / CPU Head wall / CPU Head / base (wall) Base peak Head peak Head / base (peak) Generated code Verdict
every shape 0 not compared: the head tool is the base tool

.safedi size, head against base: a module fails at 2 times the base's bytes.

Shape Module Base bytes Head bytes Head / base Verdict

Growth, the head tool alone: each row at its layers and at 2 more, or at the two numbers it names; median of 3 alternating runs for time, and of 3 more with one allocator arena for peak memory. A measure fails at 2 times the smaller graph's, or at the limit beside it.

Row Layers Wall: fewer layers, more, ratio Peak memory .safedi bytes Generated code Verdict
P-seam-hole-at-every-screen 6 and 8 0.332 s, 2.701 s, 8.14 (limit 13) 60.8 MB, 200.5 MB, 3.30 (limit 5.5) 291416 bytes, 3379022 bytes, 11.60 (limit 12.5) 80978 bytes, 123266 bytes, 1.52 within the limits
L-label-declared-again 9 and 11 0.055 s, 0.060 s, 1.09 47.4 MB, 48.1 MB, 1.01 10443 bytes, 12982 bytes, 1.24 17699 bytes, 22475 bytes, 1.27 within the limits
K-mock-at-every-screen 6 and 8 0.082 s, 0.385 s, 4.71 (limit 6.5) 51.9 MB, 81.7 MB, 1.57 3135 bytes, 4255 bytes, 1.36 972037 bytes, 9574045 bytes, 9.85 (limit 10.5) within the limits
M-public-mock-layers 6 and 8 0.122 s, 0.390 s, 3.19 (limit 5) 50.8 MB, 58.0 MB, 1.14 6955 bytes, 9179 bytes, 1.32 428063 bytes, 3552741 bytes, 8.30 (limit 9) within the limits
MH-public-mock-hole-at-every-screen 6 and 8 0.326 s, 2.528 s, 7.76 (limit 12.5) 62.2 MB, 184.2 MB, 2.96 (limit 5.5) 224758 bytes, 2506094 bytes, 11.15 (limit 12.5) 751871 bytes, 6212036 bytes, 8.26 (limit 9) within the limits
Q-seam-own-module-paths 9 and 11 0.108 s, 0.121 s, 1.12 48.7 MB, 49.0 MB, 1.01 10422 bytes, 12665 bytes, 1.22 59796 bytes, 75892 bytes, 1.27 within the limits
B-cycles-through-instantiators 3 and 5 0.067 s, 0.071 s, 1.05 (limit 27) 46.0 MB, 46.3 MB, 1.01 (limit 3.6) 1706 bytes, 2680 bytes, 1.57 4492 bytes, 7990 bytes, 1.78 within the limits
W-ring-of-screens-that-open-each-other 10 and 12 0.039 s, 0.040 s, 1.02 (limit 4) 45.9 MB, 46.3 MB, 1.01 2498 bytes, 2962 bytes, 1.19 7147 bytes, 8555 bytes, 1.20 within the limits
WL-ring-of-screens-receiving-labels 2 and 4 0.250 s, 0.684 s, 2.74 (limit 5.5) 62.7 MB, 99.4 MB, 1.59 (limit 2.4) 46751 bytes, 60851 bytes, 1.30 50201 bytes, 76701 bytes, 1.53 within the limits
BM-mocks-of-cycles-through-instantiators 2 and 4 0.092 s, 2.840 s, 30.81 (limit 48) 49.7 MB, 167.9 MB, 3.38 (limit 6.5) 1262 bytes, 2221 bytes, 1.76 108891 bytes, 28647642 bytes, 263.09 (limit 275) within the limits
F9-public-mock-seam-chain 3 and 5 0.291 s, 3.378 s, 11.59 (limit 16) 52.6 MB, 202.2 MB, 3.84 (limit 6) 108330 bytes, 3474647 bytes, 32.07 (limit 36) 279360 bytes, 4961431 bytes, 17.76 (limit 19) within the limits
H-seam-holes-in-cycles 3 and 5 0.130 s, 1.703 s, 13.08 (limit 22) 48.2 MB, 88.6 MB, 1.84 (limit 2.6) 22299 bytes, 1376085 bytes, 61.71 (limit 65) 28228 bytes, 121080 bytes, 4.29 (limit 5) within the limits
TA-all-to-all-tangle 4 and 6 0.137 s, 2.870 s, 20.88 (limit 27) 49.8 MB, 163.4 MB, 3.28 (limit 4.7) 32535 bytes, 1247861 bytes, 38.35 (limit 47) 78851 bytes, 5566907 bytes, 70.60 (limit 83) within the limits
LS-layered-screens-opening-screen-above 6 and 8 0.044 s, 0.048 s, 1.10 46.6 MB, 45.1 MB, 0.97 3824 bytes, 5040 bytes, 1.32 11776 bytes, 15982 bytes, 1.36 within the limits
LST-layered-screens-opening-screen-above-over-twin-cycle 4 and 6 0.073 s, 0.765 s, 10.47 (limit 13) 48.4 MB, 79.7 MB, 1.65 1358 bytes, 1811 bytes, 1.33 3427 bytes, 4893 bytes, 1.43 within the limits
LSH-seam-layered-screens-opening-screen-above-hole-at-leaves 3 and 5 0.142 s, 2.614 s, 18.41 (limit 26) 50.2 MB, 140.7 MB, 2.80 (limit 4.5) 29722 bytes, 1005186 bytes, 33.82 (limit 38) 79021 bytes, 3078304 bytes, 38.96 (limit 47) within the limits
O-only-if-available-at-every-screen 6 and 8 0.043 s, 0.046 s, 1.08 46.2 MB, 46.7 MB, 1.01 3364 bytes, 4438 bytes, 1.32 9413 bytes, 12671 bytes, 1.35 within the limits
R-received-instantiator-at-every-screen 6 and 8 0.046 s, 0.052 s, 1.12 46.4 MB, 46.7 MB, 1.01 3230 bytes, 4316 bytes, 1.34 21143 bytes, 31547 bytes, 1.49 within the limits
N-rename-at-every-screen 8 and 10 0.046 s, 0.050 s, 1.08 46.9 MB, 47.2 MB, 1.01 4432 bytes, 5507 bytes, 1.24 13439 bytes, 16889 bytes, 1.26 within the limits
V-renames-in-alternate-layers 10 and 12 0.053 s, 0.058 s, 1.08 47.3 MB, 47.7 MB, 1.01 6952 bytes, 8388 bytes, 1.21 22258 bytes, 27706 bytes, 1.24 within the limits
VO-only-if-available-renames-in-alternate-layers 10 and 12 0.054 s, 0.058 s, 1.09 47.5 MB, 47.9 MB, 1.01 7027 bytes, 8475 bytes, 1.21 22277 bytes, 27729 bytes, 1.24 within the limits
PR-parents-router 8 and 10 0.044 s, 0.047 s, 1.07 46.6 MB, 46.7 MB, 1.00 4300 bytes, 5373 bytes, 1.25 15705 bytes, 19869 bytes, 1.27 within the limits
PRS-seam-parents-router 8 and 10 0.089 s, 0.096 s, 1.07 47.4 MB, 47.1 MB, 0.99 7954 bytes, 9849 bytes, 1.24 17103 bytes, 21357 bytes, 1.25 within the limits
T-leaves-reached-twice-at-depth 1 and 3 0.497 s, 1.519 s, 3.06 (limit 6) 83.5 MB, 161.3 MB, 1.93 (limit 3.8) 214719 bytes, 665319 bytes, 3.10 (limit 3.5) 419959 bytes, 1288909 bytes, 3.07 (limit 3.5) within the limits
CH-chain-of-instantiators 1000 and 2000 0.282 s, 0.557 s, 1.98 (limit 2.3) 65.5 MB, 85.6 MB, 1.31 (limit 2.3) 107683 bytes, 219498 bytes, 2.04 (limit 2.3) 207492 bytes, 423492 bytes, 2.04 (limit 2.3) within the limits
RG-ring-of-instantiators 1000 and 2000 0.331 s, 0.734 s, 2.21 (limit 2.3) 66.2 MB, 89.5 MB, 1.35 (limit 2.3) 112707 bytes, 229523 bytes, 2.04 (limit 2.3) 234611 bytes, 477611 bytes, 2.04 (limit 2.3) within the limits
DC-chain-of-declarations-at-depth 2 and 4 0.813 s, 1.647 s, 2.03 (limit 2.3) 105.1 MB, 165.2 MB, 1.57 (limit 2.3) 341402 bytes, 693402 bytes, 2.03 (limit 2.3) 703337 bytes, 1415337 bytes, 2.01 (limit 2.3) within the limits
LC-chain-inside-lazy-cycle-function 2 and 4 1.325 s, 2.735 s, 2.06 (limit 3.2) 145.4 MB, 244.0 MB, 1.68 (limit 2.3) 565618 bytes, 1174902 bytes, 2.08 (limit 2.3) 1182142 bytes, 2394938 bytes, 2.03 (limit 2.3) within the limits
DL-deep-lazy-cycle 300 and 600 0.088 s, 0.151 s, 1.71 (limit 2.3) 50.6 MB, 54.7 MB, 1.08 (limit 2.3) 24944 bytes, 50144 bytes, 2.01 (limit 2.3) 53193 bytes, 106593 bytes, 2.00 (limit 2.3) within the limits
TS-leaves-reached-from-two-screens 2 and 4 0.762 s, 1.624 s, 2.13 (limit 2.3) 105.6 MB, 165.2 MB, 1.56 (limit 2.8) 317851 bytes, 647451 bytes, 2.04 (limit 2.3) 565355 bytes, 1150955 bytes, 2.04 (limit 2.3) within the limits
TC-leaves-reached-three-times-down-chain 2 and 4 0.497 s, 1.005 s, 2.02 (limit 3.6) 82.6 MB, 120.5 MB, 1.46 (limit 2.1) 211144 bytes, 431644 bytes, 2.04 (limit 2.3) 455533 bytes, 915033 bytes, 2.01 (limit 2.3) within the limits
TW-components-on-two-wide-screens 2 and 4 0.998 s, 2.007 s, 2.01 (limit 2.5) 121.1 MB, 193.2 MB, 1.59 (limit 2.3) 440981 bytes, 875561 bytes, 1.99 (limit 2.3) 790823 bytes, 1558723 bytes, 1.97 (limit 2.3) within the limits
BL-back-links-to-feature-entries 1 and 3 0.051 s, 0.052 s, 1.02 47.0 MB, 47.4 MB, 1.01 7344 bytes, 7394 bytes, 1.01 25102 bytes, 25352 bytes, 1.01 within the limits
BL4-back-links-to-most-feature-entries 4 and 6 0.052 s, 0.054 s, 1.02 (limit 6) 47.2 MB, 47.3 MB, 1.00 (limit 2.4) 7425 bytes, 7475 bytes, 1.01 25477 bytes, 25727 bytes, 1.01 within the limits
BLO-back-links-with-state-only-if-available 1 and 3 0.070 s, 0.107 s, 1.53 (limit 8) 48.2 MB, 50.3 MB, 1.04 7409 bytes, 7459 bytes, 1.01 25156 bytes, 25406 bytes, 1.01 within the limits
BLS-back-links-with-feature-labels-over-shared-tree 1 and 3 0.634 s, 1.011 s, 1.59 105.9 MB, 141.6 MB, 1.34 (limit 2.3) 260378 bytes, 435233 bytes, 1.67 375861 bytes, 642061 bytes, 1.71 within the limits
MB-calling-mocks-of-many-hole-types 40 and 80 0.312 s, 0.634 s, 2.03 (limit 2.2) 58.3 MB, 67.1 MB, 1.15 36220 bytes, 69448 bytes, 1.92 2316408 bytes, 4639408 bytes, 2.00 (limit 2.2) within the limits
LP-lifelike-chain-under-the-plugin 5 and 10 0.578 s, 1.169 s, 2.02 (limit 2.35) 73.6 MB, 97.2 MB, 1.32 0 bytes, 0 bytes, 1.00 3542265 bytes, 6777708 bytes, 1.91 (limit 2.2) within the limits
LPB-lifelike-chain-with-back-edges 5 and 10 1.954 s, 3.889 s, 1.99 (limit 2.3) 141.6 MB, 227.5 MB, 1.61 (limit 2.3) 0 bytes, 0 bytes, 1.00 (limit 2.3) 15693355 bytes, 26376804 bytes, 1.68 (limit 2.3) within the limits

The compiler's time on single functions: 0 finding(s), reported and not failed.

The compiler's time on single functions of SafeDICore, release build.

Measure Function Time Limit Verdict
optimizing static SafeDICore.DependencyTreeGenerator.holes(of: SafeDICore.Instantiable, generator: SafeDICore.ScopeGenerator, bindsReceivesAgain: Swift.Bool, namesApartAtRoot: SafeDICore.DependencyTreeGenerator.PublicMockRootLevel.NamesApart, parameters: [SafeDICore.SeamSignature.Parameter], assembledPlaces: SafeDICore.SeamAssembledPlaces?, factsView: SafeDICore.SeamFactsView?, receiversByParameter: [SafeDICore.Property : [SafeDICore.SeamSignature.Receiver]], proof: SafeDICore.TypeAccessProof, instantiables: [SafeDICore.TypeDescription : SafeDICore.Instantiable]) -> SafeDICore.DependencyTreeGenerator.HolesAndPlaces (the longest within the limit) 2.7 s 10 s within the limit
type-checking instance method SafeDICore.(file).SeamPlacesDrafts extension.declarationListDifferences(from:parameters:) (SeamPlacesDrafting+Reentries.swift:69) (the longest within the limit) 3.6 s 5 s within the limit

@dfed
dfed disabled auto-merge December 2, 2026 20:08
dfed added a commit that referenced this pull request Dec 2, 2026
… and read peak memory on two figures (#1212)

## Summary

Two changes to how CI treats performance, landed together because the second is built on the first. This also lands #1211, which closes as landed here.

**A performance row over its limit no longer fails CI.** "Check Generate Time on Linux" and "Check Function Compile Time on Linux" report it as a warning, and a new job, "Post Timing to the Pull Request", writes their reports into one comment on the pull request that every run rewrites, with the change's tool against the newest release's beside the comparison with main.

This covers every measure of the check: wall time, peak memory, `.safedi` size, and a growth row's time, memory, size and generated code. A wall time differs between runners and between runs, so a failure on it was answered by running the job again. A change that moved another measure was answered by a commit that moved a limit and a run of every check again. Neither found a defect that a reader of the figures would not.

No limit changes: the limits are what the report calls "over". What still fails is a shape or a growth row the tool cannot generate or does not finish, and every check of correctness.

`Scripts/perf-watch.py` is how a row over its limit is seen and owned instead of met as a red build. Given a report file, or `--commit SHA` to fetch the report of that commit's newest CI run, it lists every row over its limit with its ratio and limit, how the row moved since an earlier run (`--before`, `--before-commit`), and every other row whose ratio got worse.

A pull request from a fork gets no comment, since its token cannot write; the reports stay in the two jobs' summaries. A comment that cannot be posted is a warning.

**Every shape's peak memory is read on two figures.** The timed runs, as before, and runs with one allocator arena (`MALLOC_ARENA_MAX=1`), which only the four largest shapes and the shapes with a limit of their own took. A shape is over its limit on either, at the same limit. The shapes already compared with one arena alone are unchanged. Neither figure does the other's work:

- With glibc's default arenas, one tool's peak on one graph sits at one of several levels. A chain of 1,500 declarations peaked at about 76 MB or about 100 MB with the same tool, which read as 1.34 times its base against a limit of 1.3 on a change that used no more memory. The figure with one arena beside it says whether the tool allocated more.
- One arena reuses what a tool freed, so it hides a tool that holds more. A tool built to generate twice and hold the first result read 1.02 times its base with one arena on that chain and 1.01 on an app of 300 modules, and 1.23 and 1.32 in the timed runs. Of six shapes, only one was over its limit with one arena.

Generated output: unchanged

## Tests

The scripts' self-tests cover the new modes (`--report-time`, `--report-measures`, `--report-only`): every finding over a limit is a measure, and a shape the tool refuses is not and still fails. `perf-watch.py --self-test` reads a sample report with rows over a limit in each table, against an earlier one, and refuses a report with no rows; CI runs it beside the other self-test. The self-test of the generate time check gains four cases for a shape held on both memory figures: twice the memory in the timed runs alone is one finding, half more with one arena alone is one, half more on both is two, and a fifth more is none.

## Found and not fixed

- A growth row's wall time has the noise of any wall time, so its ratio in the comment moves between runs. Planned as a follow-up pull request that adds instruction counts, which are the same on every run, to the growth rows.
- `perf-watch.py` reads the report's Markdown tables rather than a file made for it. Left: both scripts are in one repository and the self-test reads the same table layout, so a change to one that breaks the other fails CI.
- A tool that holds a second parse of a module is under every memory limit on both figures (1.02 to 1.11 times on six shapes), so this check does not see that class of regression. Left: seeing it needs a tighter limit, which the timed runs cannot carry and which one arena carries only for the largest shapes.
- One arena is not level between hours either: one tool's median on the chain read 75.3 MB and later 71.8 MB. Left: both tools run in the same step, so the ratio is unaffected.
- Every shape now takes five more runs of each tool, which lengthens the step by a time its next run measures. Left: the step has no time limit.
@dfed

dfed commented Dec 2, 2026

Copy link
Copy Markdown
Owner Author

Landed as part of #1212.

@dfed dfed closed this Dec 2, 2026
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