You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci(perf): base-vs-new journey benchmarks on hosted runners (CPU + counts, off the shared host) - #4834
Adds a Perf bench workflow that measures base vs new install journeys on hosted runners, so performance claims no longer wait for a quiet developer host.
Request:scripts/perf/bench_ci.sh request BASE NEW [journeys] [fixtures] [pairs] [rtt] pushes a short-lived perf-bench/* branch holding bench-request.env. bench_ci.sh fetch BRANCH waits for the run, prints the table and deletes the branch. Callers only do I/O.
Run: 3 runners each run interleaved base/new pairs (ABBA order) of tests/benchmarks/journeys.py, with the two CLIs installed non-editable from the two SHAs.
Report: CPU p50 per side (user+sys incl. children, wait4), the median per-pair new/base ratio (which cancels runner-to-runner speed differences), and deterministic counts (requests, spawns). Wall time is never reported.
Harness: brings in the CPU and spawn-count journeys harness from danielmeppiel-perf-scoreboard-and-uv (tests only), which the workflow needs.
Security:contents: read, no secrets, no pull_request_target, and persist-credentials: false on every checkout (SHAs are fetched anonymously). The request file is read as KEY=VALUE, never sourced, and every value is regex-validated before it reaches a run step via env:. No other workflow fires on perf-bench/**; every other push trigger is filtered to main or specific paths.
Does this PR complete the issue, or what remains? It completes it. QL W3b reviewed the trigger and permissions: ACCEPT, 0 blockers; both suggested hardenings are applied.
pytest tests/benchmarks/test_scaling_guards.py -k test_bench: 4 passed (paired-ratio math, failed sample fails the report, missing shard fails the report, a hung command is killed at the deadline). This module runs in CI Tier 2 (ci-integration.yml).
python scripts/check_test_assertions.py: no finding in the changed modules.
End to end on hosted runners:
Branch copy of this workflow: run 45073693293 (4a1f9fd -> f0dab6c, tree-10, 9 pairs per side, about 4 min). Its counts match local counts exactly.
This branch with the hardenings: A/A run 45076411610 (same SHA on both sides) gave a paired ratio of 1.003, so the noise floor is about 1%.
Review fixes (Copilot round 1): fetch returns a failed run's status; the report fails on incomplete shards; timed runs keep the command timeout; the scoreboard preset honors explicit flags.
Changelog
One fragment per section, changelog.d/<pr>.<section>.md, holding
one line: user-visible effect first, 25 words or fewer, ending with (#PR); breaking changes only under upgrade notes; no Highlights; no
new lines under ## [Unreleased]. See changelog.d/README.md and .github/instructions/changelog.instructions.md.
… counts)
Agents push a request branch and read the summary; three hosted runners
run interleaved base/new pairs of the journeys harness. CPU (wait4,
incl. children) and deterministic counts only, never wall time.
Co-authored-by: Copilot App <[email protected]>
…steps via env
QL W3b hardenings on #4825: persist-credentials false on every checkout
(the bench fetches the two SHAs anonymously) and no inline expressions
in run scripts.
Refs #4825
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Benchmark tooling can report success despite failed or missing samples, while measured commands lack timeouts, presets override explicit workload options, and the new report regression tests are excluded from CI.
Adds hosted base-vs-new performance benchmarking for APM install journeys, moving measurements off shared developer machines without making benchmarks a required PR check.
Changes:
Adds a three-runner workflow and request/fetch script for interleaved comparisons.
Reports CPU timing, paired ratios, request counts, and subprocess counts.
Extends the journey harness with warm-lockfile scenarios, scoreboard support, and report regression tests.
File
Description
tests/fixtures/perf/README.md
Documents new journeys, CPU measurements, counts, and scoreboard usage.
tests/benchmarks/test_perf_benchmarks.py
Adds paired-ratio and failed-sample regression tests.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Incomplete benchmark data can be reported as successful, and the fetch script masks workflow failures, preventing callers from reliably distinguishing valid measurements from failed runs.
Both request validators accept abbreviated SHAs, but git fetch URL "$sha" does not resolve a SHA prefix into a full commit ID. A normal 7- or 8-character commit prefix is treated as a remote ref name and fails with couldn't find remote ref, before either CLI can be benchmarked. Resolve accepted prefixes to full commit IDs before fetching, or require 40-character SHAs consistently in the dispatcher and workflow.
Failed records can overwrite successful sample counts
tests/benchmarks/ci_bench.py:106
CPU samples exclude failed records, but the counts below come from the last record regardless of success. If the last pair fails during setup or partway through install, its empty or partial counters replace the counts from earlier successful samples while their CPU median is retained. Select the last successful record for requests, spawns, and modules too; leave counts unavailable if none succeeded.
Report regression tests are excluded from PR CI
tests/benchmarks/test_perf_benchmarks.py:245
These two report regression tests are not selected by PR CI or the merge queue, despite the PR's validation claim. The Linux selection (.github/workflows/ci.yml:510-515) excludes tests/benchmarks, and the integration workflow selects only test_scaling_guards.py from that directory (ci-integration.yml:281). Move the tests into a CI-collected component test module with the required promise marker, or add a focused PR-time invocation.
…d wait4; preset honors explicit flags
- bench_ci.sh fetch returns the run's failure after printing the table
- ci_bench report fails when a side has fewer samples than runners x pairs
- journeys timed runs keep the command timeout (kill and reap on deadline)
- the scoreboard preset only fills options the caller did not pass
- bench tool tests move to test_scaling_guards.py, which CI runs (Tier 2)
Refs #4825
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The benchmark workflow can produce spurious failures on branch deletion and accepts unfetchable short SHAs, while uninstall profiling leaves stale installed state that causes subsequent benchmarks to measure an altered fixture.
No open issues 🎉
3 previously missed issues
In code that hasn't changed since last review
Ignore request-branch deletion events
.github/workflows/perf-bench.yml:47
fetch deletes the request branch (scripts/perf/bench_ci.sh:57), which fires another matching push with github.event.deleted=true and the default branch's SHA. Validation then fails because main has no bench-request.env, creating a spurious failed run after a successful benchmark. Skip deletion events here, as .github/workflows/merge-train.yml:63 does for its temporary branches.
Resolve abbreviated SHAs before fetching
.github/workflows/perf-bench.yml:121
Both request validators accept abbreviated commit IDs (7-39 hex characters), but git fetch <url> <sha> cannot resolve a remote commit abbreviation: it treats that string as a remote ref name. A request using an ordinary short SHA therefore passes validation and then fails all three shards, even when the commit exists. Resolve abbreviations to full commit IDs before fetching, or require 40-character SHAs in both the dispatcher and workflow validation.
Reset cached install state after profiling uninstall
tests/benchmarks/journeys.py:604
With --runs 1 --profile, profiling uninstall calls installed() again and then removes a dependency while leaving is_installed=True. The following compile setup skips reinstalling, so it measures the altered project instead of the full fixture. Clear the cached installed state in a finally block around the profiling call at lines 637-638 as well.
… regenerate
Keeps #4843's native observation (a root half plus the enabledPlugins declaration half, native_gaps). Builds _surface_hits on train 5's entry-aware surfaces (JsonEntry, MergedHooks) and _observable. projected_cells keeps #4843's native projection plus the shared-root loose skill (#4559). #4751fixed#4744, so the user-scope bin target-change cell drops its strict known and is required (known 9 -> 8, L15).
Co-authored-by: Copilot App <[email protected]>
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
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.
Description
Adds a
Perf benchworkflow that measures base vs new install journeys on hosted runners, so performance claims no longer wait for a quiet developer host.scripts/perf/bench_ci.sh request BASE NEW [journeys] [fixtures] [pairs] [rtt]pushes a short-livedperf-bench/*branch holdingbench-request.env.bench_ci.sh fetch BRANCHwaits for the run, prints the table and deletes the branch. Callers only do I/O.tests/benchmarks/journeys.py, with the two CLIs installed non-editable from the two SHAs.wait4), the median per-pair new/base ratio (which cancels runner-to-runner speed differences), and deterministic counts (requests, spawns). Wall time is never reported.danielmeppiel-perf-scoreboard-and-uv(tests only), which the workflow needs.contents: read, no secrets, nopull_request_target, andpersist-credentials: falseon every checkout (SHAs are fetched anonymously). The request file is read as KEY=VALUE, never sourced, and every value is regex-validated before it reaches a run step viaenv:. No other workflow fires onperf-bench/**; every other push trigger is filtered to main or specific paths.Issue and approved scope
Issue: Fixes #4825
Human scope-approval comment: #4825 (comment)
Does this PR complete the issue, or what remains? It completes it. QL W3b reviewed the trigger and permissions: ACCEPT, 0 blockers; both suggested hardenings are applied.
Type of change
Testing
Validation evidence:
uvx [email protected] check tests/(the uv.lock pin): passed.uvx [email protected] format --check tests/: passed.python -m tests.quality.taxonomy --changed: passed (tm006).pytest tests/benchmarks/test_scaling_guards.py -k test_bench: 4 passed (paired-ratio math, failed sample fails the report, missing shard fails the report, a hung command is killed at the deadline). This module runs in CI Tier 2 (ci-integration.yml).python scripts/check_test_assertions.py: no finding in the changed modules.Review fixes (Copilot round 1):
fetchreturns a failed run's status; the report fails on incomplete shards; timed runs keep the command timeout; the scoreboard preset honors explicit flags.Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
Not applicable: no behaviour covered by an OpenAPM
req-XXXchanges.