Repository navigation
feat(ci): record the Dylint gate cold/warm measurement from bosn runs - #2092
Merged
Merged
Conversation
#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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --jsoncarriessha,git_tree,tree_digest,payload_sha256,engine_id,act_version,act_binary_digest,runner_image, the engine/runner manifest digests, andevery job's
sectionswith per-stepduration_ms,started_atandconclusion; the log stream carries the snapshot/cache lines. So the missingpiece was a reader, not another run. This module reads and attributes, and never
invokes the gate.
Rules it enforces (each one is a test)
checkout,setup,work,cache,aggregation, plus the aggregate-stageframeoverhead.wall - serial step sumis reported as a gap, not an overhead, because anegative 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.identical-input reuse(equaltree_digest+payload_sha256),fresh-engine warm(equal tree, differentengine_id),changed-source warm(different tree, same engine).coldis reported as NOT PROVABLE: a Bosn record has no cache-statefield, so elapsed time is not evidence of a cold cache.
success,or that executed no step at all, is rendered for diagnosis but never paired.
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).
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.and the two identical-tree failures (
46fa132e,c72a3245, bothbe539476)are rendered with
evidence: NOand excluded from every pair — which is thepoint 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 theci-workflow-drift.ymlself-test step —test_local_suitesfails if a newci/test_*.pyis 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-difffailedtest_repository_is_currently_clean. Cause, and it isworth knowing:
ci/check_python_types.pychecks only tracked files, so in the worktree the newmodule was still untracked and my local whole-tree run passed vacuously. Once committed it showed two
real basedpyright errors (a
JsonValueappended tolist[str], and a nested-dict union notassignable to
JsonValue). Fixed by narrowing the log record'stextand building each run's JSONthrough a typed
_run_jsonbuilder, plus a test that the record serializes and carries the demandedidentity 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.