Skip to content

feat(prebuilt): record the serving rung so decision 6 can histogram fallbacks - #2215

Merged
zackees merged 2 commits into
mainfrom
agent/2196-served-rung
Nov 30, 2026
Merged

zackees merged 2 commits into
mainfrom
agent/2196-served-rung

Conversation

@zackees

@zackees zackees commented Nov 30, 2026

Copy link
Copy Markdown
Member

What

#1882 decision 6's last in-repo metric: fallback_rung_histogram. It cannot be a
histogram of rung numbers because the ladder materialises decision 5's rungs as an
ordered URL list — so the record now names the URL that actually answered, and the
bench bins each cold trial by it.

  • prebuilt::Artifact gains url: Option<String>: the URL whose body produced the file,
    or None when the bytes were already verified in the local cache (rung 1 — no request
    at all).
  • prebuilt::Obtained carries that value through extraction.
  • prebuilt_core::served_outcome records it in prebuilt_libs.source instead of
    asset.urls[0]. A mirror list's first entry is the one an ailing provider sits at, so
    naming it after a build that never reached it is exactly what makes the histogram blind
    to the outage it exists to catch. A reuse records "cache" (new
    prebuilt_record::CACHE_SOURCE), never a mirror.
  • ci/artifact_serving_bench.py reads each trial's record immediately after the cold
    build, before the warm build overwrites it
    (a warm build always answers cache), bins
    by served_bin(source) — host for a URL, cache/source for the two terminal rungs,
    unknown rather than silently dropping an unreadable value — and writes
    arms.<arm>.served_by plus a top-level fallback_rung_histogram. The document stays
    additive: a document without served_by still loads.
  • The design doc records that the bin is the answering source, not a rung number.

Tests (real output)

  • soldr cargo test -p fbuild-packages-fetch --lib prebuilt → 89 passed; 0 failed
    (new: artifact.url names the answered url, and the second fetch of a verified file
    reports None; the corrupt-first-mirror test asserts the second url answered;
    obtain_tests asserts a transfer names the rung and a reuse names none).
  • soldr cargo test -p fbuild-build-esp --lib prebuilt → 13 passed; 0 failed
    (served_outcome_reports_a_transfer_and_a_reuse_apart now asserts the record names
    mirror-two.example, which is deliberately not asset.urls[0], and that a reuse
    records cache).
  • soldr cargo test -p fbuild-build-engine --lib prebuilt_record → 6 passed; 0 failed.
  • uv run --no-project python -m unittest ci.test_artifact_serving_bench (TMPDIR=/tmp) →
    Ran 41 tests, OK (6 new, incl. "the accounting comes from the cold build not the
    warm one" and the bin/Gate/report round-trips).
  • soldr cargo fmt --all -- --check → exit 0.
  • uv run --no-project python ci/enforce_platform_boundary.py --print-totals →
    rows=0; dylint_rows=0.

RED proven: restoring served_from: Some(asset.urls.first()…) makes
served_outcome_reports_a_transfer_and_a_reuse_apart fail with
left: "https://example.invalid/v1/core.tar.zst" / right: "https://mirror-two.example/prebuilt/core.tar.zst"
(exit 101); restoring the fix and touching the file → 1 passed. The Python side is covered
by the cold-record test: reading the record after the warm build reports cache /
downloaded: false for a trial that transferred the archive.

Additive: prebuilt_libs keeps schema 1 and every existing field; documents without
served_by load with an empty histogram.

Refs #1882, #2196 (both stay open — the remaining cells are a published-tree measurement
and the owner bucket).

…gram fallbacks

`Artifact`/`Obtained` now carry the URL whose body produced the file (`None`
when the bytes were already verified in a local cache), and the served
`Outcome` records it in `prebuilt_libs.source` instead of `asset.urls[0]`.
`ci/artifact_serving_bench.py` bins each COLD trial by that value
(`fallback_rung_histogram`), read before the warm build overwrites the record.

Refs #1882, #2196.
… object

`document["arms"]` is `object`, so indexing it directly is
reportIndexIssue; the drift job's tracked-python-types pass caught it.
@zackees
zackees added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit ccc5ef4 Nov 30, 2026
41 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Dec 1, 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