Skip to content

feat(bench): measure warm_incremental_s per arm in the artifact-serving bench - #2210

Merged
zackees merged 1 commit into
mainfrom
agent/2196-warm-incremental
Nov 28, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/2196-warm-incremental

Conversation

@zackees

@zackees zackees commented Nov 28, 2026

Copy link
Copy Markdown
Member

feat(bench): measure warm_incremental_s per arm in the artifact-serving bench

Decision 6 of docs/design/artifact-serving-decisions.md lists
warm_incremental_s as the no-regression guard for the non-first-build case,
and the harness only measured the cold number. Each trial now runs a second
build in the SAME cache root after one line is appended to the sketch's own
translation unit, so the served arm answers from its cached prebuilt tree and
the control arm from its installed framework, and both numbers measure link
plus one recompiled unit.

A comment change would not do: the compiler's cache hashes what the
preprocessor produced, so a comment can hit the previous object and report a
warm build that compiled nothing. The probe is an external-linkage constant
(extern "C" const unsigned fbuild_serving_probe_<n> = <n>u;), which cannot be
elided, cannot warn as unused, and changes exactly one unit. The original bytes
are restored on every exit path and the restore is verified -- leaving the
caller's project edited is not an acceptable failure mode for a measurement.

Additive in the document: warm_s / warm_incremental_s are optional per arm,
schema stays 1, so a measurement written before this change still loads and
simply does not gate warm. The 10 % gate applies to the warm p50 as well when
both documents carry one, and a warm build failure names its phase ("served
warm arm exited ...") instead of being reported as a cold one.

Also corrects the module and ci/README notes that still listed
bytes_downloaded as open; #2207 records it in prebuilt_libs.

Tests (real output, TMPDIR=/tmp):

  • ci.test_artifact_serving_bench 35 passed / 0 failed (7 new: the probe is
    appended and restored, warm is reported per arm, a project with no .ino/.cpp
    refuses to measure, a warm failure names its phase, a warm-only regression
    fails the gate, a baseline without warm trials does not gate warm, and a
    document without warm trials still loads).
  • Full drift suite (the ci-workflow-drift unittest line) 661 passed / 0 failed.
  • ruff format + check clean, check_python_complexity clean,
    check_python_types 0 errors, check_workflow_concurrency OK,
    gate_script_coverage --budget 0 OK.

RED proven twice: with the probe write removed the rebuild/restore test fails
(0 != 2 warm builds) and the warm-failure test does not raise; with the warm
gate branch neutered the warm-regression test reads "pass" instead of "fail".
Both restored + touched and re-run green.

Still open for #1882 decision 6: fallback_rung_histogram -- the ladder does
not expose rung numbers yet, so recording one would be a fabricated histogram.
A real measurement still needs a published tree (maintainer bucket upload); the
nightly workflow stays green-and-idle until one appears.

#2196 stays open.

…ng bench

Decision 6 of docs/design/artifact-serving-decisions.md lists
`warm_incremental_s` as the no-regression guard for the non-first-build case,
and the harness only measured the cold number. Each trial now runs a second
build in the SAME cache root after one line is appended to the sketch's own
translation unit, so the served arm answers from its cached prebuilt tree and
the control arm from its installed framework, and both numbers measure link
plus one recompiled unit.

A comment change would not do: the compiler's cache hashes what the
preprocessor produced, so a comment can hit the previous object and report a
warm build that compiled nothing. The probe is an external-linkage constant
(`extern "C" const unsigned fbuild_serving_probe_<n> = <n>u;`), which cannot be
elided, cannot warn as unused, and changes exactly one unit. The original bytes
are restored on every exit path and the restore is verified -- leaving the
caller's project edited is not an acceptable failure mode for a measurement.

Additive in the document: `warm_s` / `warm_incremental_s` are optional per arm,
schema stays 1, so a measurement written before this change still loads and
simply does not gate warm. The 10 % gate applies to the warm p50 as well when
both documents carry one, and a warm build failure names its phase ("served
warm arm exited ...") instead of being reported as a cold one.

Also corrects the module and ci/README notes that still listed
`bytes_downloaded` as open; #2207 records it in `prebuilt_libs`.

Tests (real output, TMPDIR=/tmp):
- `ci.test_artifact_serving_bench` 35 passed / 0 failed (7 new: the probe is
  appended and restored, warm is reported per arm, a project with no .ino/.cpp
  refuses to measure, a warm failure names its phase, a warm-only regression
  fails the gate, a baseline without warm trials does not gate warm, and a
  document without warm trials still loads).
- Full drift suite (the ci-workflow-drift unittest line) 661 passed / 0 failed.
- ruff format + check clean, `check_python_complexity` clean,
  `check_python_types` 0 errors, `check_workflow_concurrency` OK,
  `gate_script_coverage --budget 0` OK.

RED proven twice: with the probe write removed the rebuild/restore test fails
(0 != 2 warm builds) and the warm-failure test does not raise; with the warm
gate branch neutered the warm-regression test reads "pass" instead of "fail".
Both restored + touched and re-run green.

Still open for #1882 decision 6: `fallback_rung_histogram` -- the ladder does
not expose rung numbers yet, so recording one would be a fabricated histogram.
A real measurement still needs a published tree (maintainer bucket upload); the
nightly workflow stays green-and-idle until one appears.

#2196 stays open.
@zackees
zackees added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 7e8c511 Nov 28, 2026
32 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant