Skip to content

Perf: add benchmark regression gates and historical evidence #50

Description

@chrisbbreuer

Parent: #44
Related: #45, #53, #62, #97

Goal

Keep performance work measurable and prevent accepted wins from silently regressing without turning ordinary CI into a noisy hardware contest.

Landed controls

  • Versioned raw TSV samples and rendered reports retain exact date, host/CPU, OS, Zig, zig-js/zig-gc/zig-regex revisions, system JavaScriptCore version, and power metadata.
  • The comparison driver validates the complete symmetric matrix, exact sample indexes/counts, stable checksums, cross-engine equal work, runner alternation, a 50 ms full-run timing floor, and per-row min/max/RSD.
  • Publishing raw/report evidence refuses a dirty tracked worktree and captures metadata before generated outputs modify the tree.
  • zig build benchmark-comparison-test exercises matrix and publication guards in ordinary CI without compiling or running benchmarks.
  • The manual-only Performance workflow, added in c7e52fb1, runs the full macOS/JSC matrix with configurable sample/lane counts and retains its artifacts for 90 days. It never runs on pushes or pull requests and never gates ordinary CI.
  • 0ff34466 adds the controlled history/publication tool. It reruns the full raw-matrix validation, reproduces the paired Markdown report byte-for-byte, and then generates the marker-delimited README scorecard.
  • History comparison requires exact host, OS, Zig, zig-gc, zig-regex, JavaScriptCore, matrix, jobs, and sample-count matches. Volatile battery details are normalized while power source and charging state remain part of the identity.
  • Every engine row is retained with baseline/current medians, delta, and both RSDs. A zig-js row gates only when median wall time worsens by more than 10% and both RSDs are at most 5%; JSC rows remain visible environmental controls. The exact baseline/current report paths and zig-js revisions are recorded in the artifact.
  • The manual workflow always generates a README scorecard artifact and optionally accepts a committed controlled baseline pair to produce the per-row history artifact or reject an incompatible run. Failed validation still uploads available evidence.

Current accepted evidence

The generated calculation corrected the previously hand-copied 2.63x / 2.94x / 2.94x aggregate summary to the raw-derived 2.67x / 2.95x / 2.91x, demonstrating the drift this issue was intended to eliminate.

Acceptance criteria

  • Store versioned raw samples and rendered reports with exact commit/environment/power metadata.
  • Add deterministic standalone harness/unit checks to ordinary CI.
  • Add a manually triggered full performance workflow that does not gate ordinary CI.
  • Compare only like-for-like host/runtime configurations and retain explicit historical baselines.
  • Define a minimum timing floor, expose repeated-sample dispersion, and apply a conservative noise-aware policy only to controlled runs.
  • Fail publication when the tracked worktree is dirty and capture metadata before generated outputs change the tree.
  • Link optimization commits and resulting benchmark deltas from their workload issues.
  • Keep README headline numbers generated from the latest accepted report rather than manually copied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions