Skip to content

test(perf): scale timing bounds by a measured machine-speed factor#760

Open
haakon-e wants to merge 1 commit into
mainfrom
he/perf-thresholds
Open

test(perf): scale timing bounds by a measured machine-speed factor#760
haakon-e wants to merge 1 commit into
mainfrom
he/perf-thresholds

Conversation

@haakon-e

@haakon-e haakon-e commented Jul 9, 2026

Copy link
Copy Markdown
Member

Purpose

Remove the recurring false failures in test/performance_tests.jl on slow CI runners (notably the Julia 1.12 GitHub-hosted runners, which run the microphysics benchmarks several times slower than the reference machine the hardcoded bounds were tuned on).

What

Measure a machine-speed factor once per suite by benchmarking a fixed transcendental workload (calibration_workload) against a reference minimum runtime (REFERENCE_CALIBRATION_NS), clamped to [1, MAX_SPEED_FACTOR]. Every timing assertion scales its bound by this factor: min_run_time becomes min_run_time * SPEED_FACTOR[].

Why

The timing bounds are absolute nanosecond limits tuned on one machine. On a slower runner every bound is proportionally too tight, so type-stable, non-regressed code fails purely on wall-clock time. Scaling the bounds by a measured per-machine factor keeps the same regression sensitivity on fast machines while removing the false failures on slow ones. The memory and allocation assertions are machine-independent and unchanged.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.95%. Comparing base (d85cec0) to head (c93f6dc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #760   +/-   ##
=======================================
  Coverage   92.95%   92.95%           
=======================================
  Files          56       56           
  Lines        2880     2880           
=======================================
  Hits         2677     2677           
  Misses        203      203           
Components Coverage Δ
src 93.75% <ø> (ø)
ext 69.47% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haakon-e
haakon-e force-pushed the he/perf-thresholds branch from c93f6dc to b3ecafb Compare July 9, 2026 05:59
Author timing bounds for the reference machine (a linux GPU node) and scale
them at runtime by a machine-speed factor measured once per suite from a
fixed calibration workload, so strict reference bounds hold on slower
GitHub-hosted runners without loosening them on the machines where
regressions must be caught.
@haakon-e
haakon-e force-pushed the he/perf-thresholds branch from b3ecafb to 3ea7055 Compare July 9, 2026 06:19
@trontrytel trontrytel added the CI tests & docs All things that matter label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI tests & docs All things that matter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants