Repository navigation
ci: add the performance standard's jobs, off until a caller opts in - #118
Merged
Merged
Conversation
ci.yml takes run-scaling-gate and run-bench-compare, both false by default, and bench-suites and bench-target for the comparison. - scaling-gate runs the caller's pnpm test:perf, the scaling gate from @cosyte/test-utils/perf, and fails when it fails. - bench-compare runs on a pull request only. It builds the head and, in a worktree, the base, then runs cosyte-bench compare for each suite, interleaved on one runner. The Markdown goes in the job summary and the results-v1 documents in the bench-comparison artifact. Its one step ends 0 whatever happens: a regression is a warning, never a red check. self-check.yml turns both on against the CI caller fixture with the real tools from npm, and performance-artifacts checks the kept document. Claude-Session: https://claude.ai/code/session_016orFiSvUThaQbgX8v14PXz
The pre-push PHI scan reads an email-shaped string as an email with a non-test domain. git accepts a bare word as user.email, which is all these throwaway repositories need. Claude-Session: https://claude.ai/code/session_016orFiSvUThaQbgX8v14PXz
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.
What
The performance standard's two jobs in the shared CI, both off until a caller opts in.
ci.ymltakes four new inputs, after every existing one:run-scaling-gateandrun-bench-compare(bothfalse),bench-suites("") andbench-target("dist/index.mjs"). They add two jobs aftermutation, with noneeds:, onubuntu-latestat the first Node line:scaling-gateinstalls from the lockfile and runspnpm test:perf, the caller's run of the scaling gate from@cosyte/test-utils/perf. It fails when that fails, so a caller can make it required. Timeout 15 minutes.bench-compareruns on pull requests only. It checks out the whole history, installs and builds the head, adds a worktree at the base commit and installs and builds it there, then runscosyte-bench compare(from@cosyte/bench) for each suite: everybench/*.bench.mjsandbench/*.bench.ts, or the onesbench-suitesnames. The comparison interleaves 12 rounds of base and head on one runner. The Markdown goes in the job summary. The results-v1 documents (validated withcosyte-bench check) and the Markdown go in thebench-comparisonartifact for 30 days.bench-comparenever fails. Everything runs in one step that ends 0. A regression (tool exit 1) becomes a warning annotation, a case it could not measure (exit 2) becomes a notice, and each of these ends the step with a note in the summary: a base that does not build, a missing suite, no suites, and a spent 600 second budget. Timeout 20 minutes, to catch a hung install.self-check.yml:systemsturns both jobs on againsttest/fixtures/ci-caller/. The fixture now installs the real@cosyte/bench0.1.1 and@cosyte/test-utils0.1.4. Itstest:perfruns the scaling gate andassertScalingGateFireson a synthetic line splitter, and fails on a skip.bench/greeting.bench.mjsis its suite. A newperformance-artifactsjob (pull requests only,needs: [systems]) requires the kept document to be a results-v1comparisonwith at least one case.test/performance-jobs.test.mjs. The job and input lists that other tests pin now include the new ids. Each is an addition, and no existing id was renamed.Why
The performance standard in cosyte/config (decision 0005) has two instruments:
Section 7 of the decision says the comparison is a reusable job in this repository. Both tools are now on npm (
@cosyte/bench0.1.1,@cosyte/test-utils0.1.4), so libraries can opt in.A caller that sets none of the new inputs gets two skipped checks,
ci / scaling-gateandci / bench-compare, and no other change.Proof
node --test test/performance-jobs.test.mjsagainst the base failed all 11 of 11 tests. With the change it passes, and the full suite passes 1296 of 1296.harness gate: actionlint 1.7.12 with shellcheck,node --test "test/*.test.mjs",check-no-emdash,package-lists. All passed.Self-check / systemsrun, which turns both inputs on against the fixture with the real tools. Measured wall times of the new jobs:systems / scaling-gate: 32s. The gate passed on both axes, and the self-check measured a quadratic split at 15.34, against a ceiling of 8.systems / bench-compare: 35s. The base was built frommainin a worktree, and the 12 rounds took about 20s. Result:count the greetings 64 lines, +0.4%, interval -0.9% to +2.4%,no-regression.cosyte-bench checkreported "a valid comparison document, schema version 1".performance-artifacts: 3s (no-regression, 12 round(s)).verify, and the slowestverifyleg took 57s, so the new jobs fit well inside 15 minutes.cosyte-bench compareof the fixture suite gaveno-regressionover 12 rounds.jqread that document with the checksperformance-artifactsruns.Choices
continue-on-error. The comparison is one script that maps every outcome to an annotation and exits 0. The alternative was a job-levelcontinue-on-error, which still shows a red check. To undo this, split the script into steps.node-versions, likecoverage-ratchetandmutation. The standard's calibration was taken on Node 24, so a caller whose first line is 22 compares on a Node the standard has not calibrated. That is acceptable while the comparison is advisory. Abench-node-versioninput would undo this.github.event.pull_request.base.sha, checked out as a worktree underRUNNER_TEMP. The suite file is the head's, and both builds are handed to it, ascosyte-bench compareexpects.@cosyte/benchand@cosyte/test-utils, not stand-ins, sosystemsproves the tools work as well as the wiring. The fixture'stest:perftreats a skip as a failure. If a runner ever pushes a phase underMIN_PHASE_MS, the fix is to grow the fixture (count.n,size.sizeintool.mjs).t@example.invalidas an email with a non-test domain. So the test repositories intest/ci-systems.test.mjsandtest/performance-jobs.test.mjsnow use a bare word foruser.email.Kind: code
https://claude.ai/code/session_016orFiSvUThaQbgX8v14PXz