Skip to content

Record changepoints in their own table, with a list and a status change - #1588

Draft
epompeii wants to merge 1 commit into
u/ep/changepoint/model-testfrom
u/ep/changepoint/table
Draft

epompeii wants to merge 1 commit into
u/ep/changepoint/model-testfrom
u/ep/changepoint/table

Conversation

@epompeii

Copy link
Copy Markdown
Member

Changepoints get a table of their own, a list, a view, and a status change. A changepoint is a version at which a line stepped, judged against a threshold's changepoint model. It is held as a candidate, which no user sees, until enough consecutive scans confirm it; then it is active, and a user may dismiss it. This change stores and serves changepoints and gives the detector the functions it writes them with; it detects nothing itself. The endpoints, the CLI commands, and the detector functions are Bencher Plus only; the migration runs on every server.

What changes

  • Schema. A new changepoint table. Its line is the head, testbed, spec, benchmark, variant, measure, and metric name: the variant makes one series of the many a threshold's parameters match, and the spec means a testbed moved to new hardware starts a new line. Each row names the version the step lands on, the threshold and the changepoint model it was judged against, what was measured (mean_before, mean_after, stddev_before, stddev_after, pvalue, tstatistic, degrees_of_freedom), its status, created, and modified. It goes with its project, version, benchmark, or variant; a deleted spec leaves it with no spec; and its head, testbed, measure, threshold, and model stay while it stands, as a boundary holds them. Indexes serve the list by project, status, and modified, the read of one line, and every foreign key.
  • Scan history. A new changepoint_scan table keeps what each scan measured, up to the one that confirmed the changepoint. A candidate holds its latest scan's numbers; a confirmed changepoint holds its confirming scan's, and they never change after.
  • Statuses. candidate, active, dismissed, silenced, and withdrawn. A candidate is never served: it is never listed, even with a filter, and its view and its status change are a 404.
  • GET /v0/projects/{project}/changepoints lists one status, active by default, newest modified first, with filters for status, branch, testbed, benchmark, measure, and archived, a sort by created or modified, paging, and X-Total-Count.
  • GET /v0/projects/{project}/changepoints/{changepoint} serves one changepoint with its scans, oldest first. The list serves none.
  • PATCH /v0/projects/{project}/changepoints/{changepoint} moves a changepoint between active and dismissed, both ways. A silenced or withdrawn changepoint refuses with a 400 that names its status.
  • The JSON names the threshold, given at the changepoint's head and version so it names its branch and the changepoint model it was judged against, then the benchmark, the variant, the metric name, every measured field, percent_change from the means (0 when the mean before is 0, and absent when it is not finite), the status, created, and modified. tstatistic is absent when it is infinite, as it is between 2 constant sides.
  • Permissions follow the alerts: anyone may read a public project's changepoints, a private project's need view, and a status change needs edit or a project key.
  • Head replacement. In the same transaction that silences the old head's alerts, its active changepoints become silenced with a new modified, and its candidates are deleted. A dismissed, silenced, or withdrawn changepoint keeps its status and modified.
  • Threshold changes. Emptying or replacing a threshold's changepoint model, by an update, a report, a reset, or a start point clone, deletes the threshold's candidates, which no user saw. A threshold delete deletes its candidates and their scans in the same transaction; any other changepoint refuses the delete with a 409, as a boundary does, and the refusal keeps the candidates.
  • Detector functions in bencher_schema: insert a candidate, count a scan, confirm, withdraw an active changepoint (never a dismissed or silenced one), and delete a candidate. No function rewrites the measured fields of a confirmed changepoint.
  • CLI. bencher changepoint list, view, and update, which mirror bencher alert. list takes --status, --branch, --testbed, --benchmark, --measure, --archived, and the usual paging and sort; update takes --status active or --status dismissed.

Tests

lib/api_projects/tests/changepoints.rs covers the list's default, each status filter, the other filters, the sort, and paging; that a candidate is never listed, viewed, or changed; the view and its scans; the status change both ways and its refusals; the permissions; a project's isolation; the head replacement through a branch reset; the candidates a threshold update, a report, a reset, a clone, and a threshold delete delete; that every delete leaves no changepoint pointing nowhere; and the migration down and up. Unit tests in bencher_schema cover each detector function, the frozen numbers of a confirmed changepoint, the head replacement, and the percent change, and the CLI has parse tests for each command.

Nothing writes a changepoint until the detector in the change above. This change merges with the changes above and below it.

@epompeii
epompeii added this pull request to stack #1536 November 27, 2026 01:29
@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBencher
Branchu/ep/changepoint/table
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
5.35 µs
(+2.92%)Baseline: 5.20 µs
5.49 µs
(97.51%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.21 µs
(+3.35%)Baseline: 5.04 µs
5.32 µs
(97.91%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
26.63 µs
(-0.79%)Baseline: 26.84 µs
28.65 µs
(92.94%)
Adapter::Rust📈 view plot
🚷 view threshold
4.57 µs
(+2.29%)Baseline: 4.47 µs
4.68 µs
(97.67%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.56 µs
(+2.12%)Baseline: 4.46 µs
4.68 µs
(97.34%)
🐰 View full continuous benchmarking report in Bencher

@epompeii
epompeii force-pushed the u/ep/changepoint/table branch from 9851796 to 33d77cb Compare December 1, 2026 23:03
@epompeii
epompeii force-pushed the u/ep/changepoint/table branch from 33d77cb to 9fdbfa1 Compare December 2, 2026 23:06

This branch has not been deployed

No deployments
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.

1 participant