Skip to content

Default the BMF version per project - #1016

Merged
epompeii merged 1 commit into
develfrom
u/ep/parameters-api/project-gate
Sep 14, 2026
Merged

Default the BMF version per project#1016
epompeii merged 1 commit into
develfrom
u/ep/parameters-api/project-gate

Conversation

@epompeii

@epompeii epompeii commented Aug 26, 2026

Copy link
Copy Markdown
Member

Each project now carries a bmf_version: the Bencher Metric Format version a report payload is read as when it declares none.

The field

bmf_version is a project field. It starts at 0 for every project, new and existing, so a payload with no key reads as it always has. It is visible to anyone who can see the project. Only a server admin can move it: a PATCH /v0/projects/{project} that carries bmf_version from anyone else is refused, and a PATCH that does not carry it is the patch it has always been for that caller. Nothing ratchets, so an admin can move it back just as easily.

A default, not a ceiling

A payload that declares bmf_version is read at the version it declares, on any project, in either direction. A project at 0 takes an explicit 1 and a project at 1 takes an explicit 0. Only the absent key follows the project. That is what lets a project move from v0 to v1 gradually: an admin flips the default once most of a project's harnesses write v1, and the rest declare 0 until they catch up.

Since #1015 the declared version is a contract over the payload, and the project's default is read through that contract. On a project set to 1, a v0 payload with no key is refused with the contract's 400, because it parses as version 0 and is read as version 1. Every non-JSON adapter parses as version 0, so on such a project those harnesses declare bmf_version: 0.

Where the version is resolved

Report ingest and /v0/run resolve the version once, where the report is created, and everything downstream reads the resolved value. A job based run stores the resolved version on its job config, so the runner's output parses at the version the run was accepted at, whatever the project says by the time the job completes. A config stored before the key still reads as version 0.

Tested

A new project reads back at 0. On a project set to 1, a v1 payload with no key ingests, and it normalizes to the same report as the same payload with null and with an explicit 1; a v0 payload with no key is refused by the contract, naming both versions. An explicit 0 ingests on a project at 1 and an explicit 1 ingests on a project at 0. An admin moves the field both ways. A non-admin carrying the field is refused, and the same patch without the field succeeds. /v0/run with no key follows the project the same way, and a job based run stores the project's version on its config when the key is absent and the declared version when it is present.

@epompeii
epompeii force-pushed the u/ep/parameters-api/project-gate branch from 6d81122 to 4a7733e Compare August 26, 2026 06:31
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

馃惏 Bencher Report

ProjectBencher
Branchu/ep/parameters-api/project-gate
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.26 碌s
(+10.37%)Baseline: 4.77 碌s
5.60 碌s
(93.90%)
Adapter::Magic (JSON)馃搱 view plot
馃毞 view threshold
5.05 碌s
(+9.22%)Baseline: 4.62 碌s
5.37 碌s
(94.07%)
Adapter::Magic (Rust)馃搱 view plot
馃毞 view threshold
28.32 碌s
(+8.51%)Baseline: 26.10 碌s
28.36 碌s
(99.86%)
Adapter::Rust馃搱 view plot
馃毞 view threshold
4.72 碌s
(+27.49%)Baseline: 3.71 碌s
5.39 碌s
(87.71%)
Adapter::RustBench馃搱 view plot
馃毞 view threshold
4.69 碌s
(+26.59%)Baseline: 3.70 碌s
5.38 碌s
(87.18%)
馃惏 View full continuous benchmarking report in Bencher

@epompeii
epompeii force-pushed the u/ep/parameters-api/project-gate branch 2 times, most recently from ae947aa to f9f485d Compare August 26, 2026 08:01
@epompeii
epompeii force-pushed the u/ep/parameters-api/project-gate branch from f9f485d to c420967 Compare August 27, 2026 03:46
@epompeii
epompeii force-pushed the u/ep/parameters-api/project-gate branch from c420967 to 92a351f Compare August 27, 2026 05:11
Base automatically changed from u/ep/parameters-api/bmf-version to devel September 13, 2026 21:08
@epompeii
epompeii force-pushed the u/ep/parameters-api/project-gate branch from 92a351f to ddcbfd7 Compare September 13, 2026 22:21
@epompeii epompeii changed the title Gate BMF payload versions per project Default the BMF version per project Sep 13, 2026
@epompeii
epompeii marked this pull request as ready for review September 13, 2026 22:49
Each project now carries a `bmf_version`: the Bencher Metric Format version a
report payload is read as when it declares none. It starts at 0 for every project,
new and existing, so a payload with no key reads as it always has. It is visible to
anyone who can see the project, and only a server admin can move it: a PATCH that
carries the field from anyone else is forbidden, and a PATCH without it is the
patch it has always been.

The project's version is a default, not a ceiling. A payload that declares
`bmf_version` is read at the version it declares, on any project, in either
direction. That is what lets a project move from v0 to v1 gradually: an admin
flips the default once most of a project's harnesses write v1, and the rest
declare 0 until they catch up.

Under the contract, a v0 payload with no key is refused on a project set to 1,
because it parses as version 0 and is read as version 1. Every non-JSON adapter
parses as version 0, so on such a project those harnesses declare `bmf_version: 0`.

Report ingest and `/v0/run` resolve the version once, where the report is
created. A job based run stores the resolved version on its job config, so the
runner's output parses at the version the run was accepted at, whatever the
project says by the time the job completes.
@epompeii
epompeii marked this pull request as draft September 14, 2026 03:09
@epompeii
epompeii force-pushed the u/ep/parameters-api/project-gate branch from ddcbfd7 to 545adce Compare September 14, 2026 03:09
@epompeii
epompeii marked this pull request as ready for review September 14, 2026 03:42
@epompeii
epompeii merged commit e73cfc0 into devel Sep 14, 2026
68 checks passed
@epompeii
epompeii deleted the u/ep/parameters-api/project-gate branch September 14, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant