Skip to content

feat(ci): record the Dylint gate cold/warm measurement from bosn runs - #2092

Merged
zackees merged 2 commits into
mainfrom
agent/dylint-measure-1643
Nov 19, 2026
Merged

zackees merged 2 commits into
mainfrom
agent/dylint-measure-1643

Conversation

@zackees

@zackees zackees commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What this adds

ci/measure_dylint_gate.py — a recorder for the measurement half of #1643.

#1643 asked for cold / fresh-engine-warm / changed-source-warm / identical-input
reuse numbers "including checkout, setup, compiler, cache restore/save and
aggregation overhead", each carrying its "exact source/tree, workflow closure,
actual runtime/tool/target identity, executed steps, cache writer provenance and
payload handoff".

A Bosn run record already states all of that. bosn ci show RUN --json carries
sha, git_tree, tree_digest, payload_sha256, engine_id, act_version,
act_binary_digest, runner_image, the engine/runner manifest digests, and
every job's sections with per-step duration_ms, started_at and
conclusion; the log stream carries the snapshot/cache lines. So the missing
piece was a reader, not another run. This module reads and attributes, and never
invokes the gate.

Rules it enforces (each one is a test)

  • Attribution, by job role and literal step name: checkout, setup,
    work, cache, aggregation, plus the aggregate-stage frame overhead.
    wall - serial step sum is reported as a gap, not an overhead, because a
    negative gap is how a run with concurrent jobs looks — the first real run
    measured here has wall 894228 ms, serial 905139 ms, gap -10911 ms.
  • Regimes are proven, never inferred. identical-input reuse (equal
    tree_digest + payload_sha256), fresh-engine warm (equal tree, different
    engine_id), changed-source warm (different tree, same engine).
    cold is reported as NOT PROVABLE: a Bosn record has no cache-state
    field, so elapsed time is not evidence of a cold cache.
  • No failing run becomes evidence. A run whose conclusion is not success,
    or that executed no step at all, is rendered for diagnosis but never paired.
  • Malformed records raise instead of producing a number.

Receipts

  • uv run --no-project python -m unittest ci.test_measure_dylint_gate — 16 tests, OK
    (attribution arithmetic, skipped-step exclusion, all four pair classes, failed
    and cross-closure exclusion, provenance sampling, four malformed-record cases).
  • Full drift self-test set, exactly the workflow command: 612 tests, OK (TMPDIR=/tmp).
  • ci/check_python_types.py — 0 errors, 0 warnings, 0 notes;
    ci/check_python_complexity.py — clean; ruff format --check + ruff check — clean;
    ci/gate_script_coverage.py --budget 0 — clean; ci/render_workflows.py --check — clean.
  • Real runs, both real successes in the local Dylint lane:
## 37607e2c  dylint.yml  workflow_dispatch/minimal   wall 1458448 ms
## e8725c7b  dylint.yml  workflow_dispatch/minimal   wall  894228 ms
pairs: changed-source warm: 37607e2c -> e8725c7b  1458448 -> 894228 ms (-564220)
regime coverage: changed-source warm PROVEN by 1 pair; cold NOT PROVABLE

and the two identical-tree failures (46fa132e, c72a3245, both be539476)
are rendered with evidence: NO and excluded from every pair — which is the
point of that rule.

These two runs were concurrent, on a host at loadavg 19–33/16, so the numbers
above are not presented as a controlled cold/warm comparison; the report says
so itself, because Bosn records carry no host-load field.

Wiring

Registered in ci/local_suites.py (DRIFT_UNITTEST_MODULES) and in the
ci-workflow-drift.yml self-test step — test_local_suites fails if a new
ci/test_*.py is referenced by nothing. No workflow was added.

#1643 stays open (remaining cells: a controlled cold measurement on an idle
host with a cleared cache, ancestor physical payload reuse, a second
fresh-checkout consumer, and release fresh execution).


Follow-up commit 9f4e570e (no force)

The first CI run's Render-and-diff failed test_repository_is_currently_clean. Cause, and it is
worth knowing: ci/check_python_types.py checks only tracked files, so in the worktree the new
module was still untracked and my local whole-tree run passed vacuously. Once committed it showed two
real basedpyright errors (a JsonValue appended to list[str], and a nested-dict union not
assignable to JsonValue). Fixed by narrowing the log record's text and building each run's JSON
through a typed _run_json builder, plus a test that the record serializes and carries the demanded
identity fields. Final counts: 17 tests, drift self-test set 613 tests OK, type gate
0 errors / 0 warnings / 0 notes on the now-tracked tree.

#1643 closed its parity half in #1646 and left the measurement
half open. A bosn run record already carries everything that half asks to
record -- source and tree identity, payload digest, the pinned engine/act/
runner digests, and every executed step with its duration_ms -- so the missing
piece is a reader, not a run.

ci/measure_dylint_gate.py attributes those step durations into the overheads
the issue names (checkout, setup, work, cache, aggregation, frame), samples the
log stream for snapshot/cache provenance, and classifies pairs of runs only
from their identity fields: identical-input reuse, fresh-engine warm,
changed-source warm. `cold` is reported as NOT PROVABLE, because a bosn record
has no cache-state field and elapsed time is not warmth. A run that did not
complete successfully is rendered but never paired.

Registered in ci/local_suites.py and the drift self-test step so the new test
module is wired, per the local-suites guard.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The whole-tree gate failed on the PR: two nested containers were inferred as
dict[str, ...] unions instead of JsonValue. Narrow the log record's `text`
before appending it, and build the JSON record through typed locals (one
builder per run) so each literal is checked against JsonValue rather than
inferred from its nesting. Adds a test that the record is serializable and
carries the demanded identity fields.

Note for the next reader: `ci/check_python_types.py` only checks TRACKED
files, so running it in a worktree with the new module still untracked passes
vacuously. Commit first, then run it.
@zackees
zackees added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 4851600 Nov 19, 2026
31 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 19, 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