Skip to content

ci: restore the prompt parity fixtures from a verified cache - #1885

Merged
davidtai merged 6 commits into
devfrom
ci/cache-pinned-fixtures
Nov 8, 2026
Merged

davidtai merged 6 commits into
devfrom
ci/cache-pinned-fixtures

Conversation

@davidtai

@davidtai davidtai commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Provider CI downloaded the same hash-pinned prompt parity fixtures from models.darkbloom.ai on every run. On a slow Darkbloom VM this failed shard 1: in run 42330647893 (attempt 1) the 17 MB Nemotron contract did not finish inside the flat 120 s deadline (prompt fixture provisioning failed: contract download timed out), so the parity summary found no reports.

This PR:

  • Caches the prompt parity fixtures in an Actions cache keyed by the hash of their manifests. The script still checks every byte against its pin.
  • Scales the download deadline with the contract's missing bytes, with a bound.

Inventory: network fixture downloads in the provider and cluster test jobs

Download Step (job) Size Pinning Cache before this PR
v1 prompt contracts (7: Gemma 4 x3, GPT-OSS, Qwen x3), tokenizers, templates and configs Verify public prompt golden vectors (provider shard 1) 172 MB per run before: the two identical Gemma 4 contracts already shared one contract directory. 87 MB unique: the Gemma 4 and the Qwen contracts share their tokenizer.json and Qwen its vocab.json SHA-256 per file and aggregate digest in fixtures/prompt-contract/v1/manifests/*.json none
Nemotron prompt contract Verify pinned Nemotron prompts (provider shard 1) 17 MB same, fixtures/prompt-contract/nemotron/manifests/*.json none
MiMo prompt metadata (4 files, Hugging Face at a pinned revision) Prepare pinned public MiMo metadata (every provider shard) about 4 MB, with the image metadata SHA-256 in prepare-mimo-prompt-fixtures.py mimo-metadata-v1-<hash of the pin scripts>
MiMo image HTTP metadata (4 files, models.darkbloom.ai) same step in the same 4.3 MB entry size and SHA-256 in prepare-mimo-audio-fixtures.py FILES same entry
MiMo audio codec and video (1.87 GB codec, 6.9 MB mp4, metadata) Prepare selected MiMo audio fixture (last provider shard, only when MIMO_AUDIO inputs change) 1.89 GB, 1,575 MiB compressed size and SHA-256 in FILES mimo-audio-source-v2-<codec sha256>
Synthetic MiMo provider fixtures Prepare bounded synthetic MiMo provider fixtures none (offline) n/a n/a
Cluster jobs (runtime, focused, GPU, release checks) n/a no fixture download; the build tools (CMake from the image or a checksum-verified release, the Metal toolchain) are build-job setup, not fixtures n/a n/a

Change

  • scripts/prepare-prompt-fixtures.py --download-cache DIR (set by both parity scripts from PROMPT_PARITY_DOWNLOAD_CACHE). DIR holds one file per pinned SHA-256, in the same layout as the MiMo metadata cache. The new restore_file and store_file in scripts/verified_download_cache.py read and write it.
    • An entry is copied only if the opened file is a regular file with the pinned size and SHA-256.
    • A missing, linked, special, short, long or changed entry, or one that cannot be read, is downloaded. The verified download then replaces the entry.
    • If the script cannot store an entry, it prints the error and continues; the run does not fail.
    • The script prints, for each contract, how many artifacts came from the cache, how many bytes it downloaded and how long that took.
  • Deadline: the limit for each contract is 120 s plus its missing bytes at 128 KiB/s, at most 900 s. Before, every contract had a flat 120 s.
    • Examples: 256 s for Nemotron (17 MB) and 376 s for a Gemma 4 contract (32 MB). A contract whose files all come from the cache has the 120 s floor.
    • The floor rate is just below the slowest measured transfers: under 142 KB/s for Nemotron in run 42330647893, and 169 KiB/s for the test products artifact in the same job (265.8 MiB in 1,574.8 s). At that rate, a cold v1 parity step (87 MB unique, downloaded once) takes about 11 min.
    • The 900 s cap stops a stalled transfer instead of hanging, and matches the audio script's per-attempt --max-time 900.
  • Workflow (provider-tests.yml, provider shard 1):
    • Restore verified prompt fixture downloads runs before the parity steps. Path: /private/tmp/dinf-ci/prompt-fixture-cache. Key: prompt-fixtures-v1-${{ hashFiles(v1 and Nemotron manifests) }}, exact match only.
    • Save verified prompt fixture downloads runs on SAVE_CACHES (pushes to dev and master), only if both parity steps passed and the key missed. Pull requests save nothing.
  • Budget: the new entry holds 104 MB before compression. A Darkbloom host keeps 10 GiB per repository and evicts the least recently used entries first. Blacksmith keeps its own colocated cache. In GitHub's cache this repository uses 8.86 GB of 10 GB now: its largest entries are Swift builds (about 1.7 to 2 GiB each) and an old PR-scoped audio entry.

Audio codec: already cached, and its cache misses on Darkbloom

The codec cache already existed. Its step times in the 60 most recent CI (dev) runs (2026-11-06 to 2026-11-07):

Runner Runs Cache Prepare selected MiMo audio fixture (s)
Darkbloom 6 6 misses 103, 149, 194, 201, 631; one cancelled at 485
Blacksmith 1 miss, then saved (dev push) 34
  • A Darkbloom host serves only the entries it saved itself, and only dev pushes save. So each host needs its own dev push that changes the MIMO_AUDIO inputs.
  • The 1,575 MiB entry also competes in each host's 10 GiB LRU with the daily Swift build entries.
  • Caching more in this repository does not fix this. The fixes are a cache that all Darkbloom hosts share (sandbox side), or letting pull requests save fixture caches. Both are policy changes, which this PR does not make.

Before and after (prompt parity steps, measured in CI)

Before: the same 60 CI (dev) runs, one row for each job.

Step Darkbloom: median (min to max) Darkbloom failures Blacksmith: median (min to max)
Verify public prompt golden vectors 67 s (42 to 283), n=31 1 (contract download timed out) 35 s (33 to 38), n=20
Verify pinned Nemotron prompts 31 s (26 to 121), n=31 1 (contract download timed out) 32 s (30 to 34), n=20

Each step time includes the Swift test run (about 30 s).

After: this PR's CI (dev) run 42335305794. In both attempts, shard 1 ran on Blacksmith and missed the cache: no entry exists under the new key until a dev push saves one.

Attempt Runner Prompt fixture cache Verify public prompt golden vectors Verify pinned Nemotron prompts v1 bytes downloaded Nemotron bytes downloaded
1 Blacksmith miss (1 s) 31 s 32 s 87.0 MB (was 172.5 MB) 17.1 MB
2 Blacksmith miss (1 s) 31 s 32 s 87.0 MB 17.1 MB

On a miss, the v1 step now downloads each shared artifact once: 87.0 MB instead of 172.5 MB. Before this PR, the v1 step on Darkbloom took 67 s at the median and 283 s at the slowest, of which about 30 s is the Swift test run. On a miss, the download part of that time now moves half the bytes. On a hit, the step downloads nothing.

No Darkbloom number after the change exists yet. The router sent shard 1 of both attempts to Blacksmith, and a dev push has to save the entry before any run can hit it. The first dev push after the merge saves the entry. After that, a run on the same host should show Cache restored from key: prompt-fixtures-v1-645076f1… and N of N artifacts from the download cache, 0 downloaded.

Validation

  • No builds or tests ran on the laptop. CI runs the self-tests: scripts/test-prepare-prompt-fixtures.py and scripts/test-provider-ci-workflow.py in Check the CI plans.
  • New script tests cover:
    • a cache hit with no network request;
    • an entry that is tampered, short, long, a symbolic link, a directory or a FIFO: each one is downloaded and replaced;
    • a read error from the cache: the artifact is downloaded;
    • a cache that cannot store: provisioning still passes;
    • a restore never overwrites an existing output;
    • the deadline formula, and that bytes from the cache do not count toward it.
  • Workflow tests pin the restore and save steps, the key, the path, the save condition and both parity environments.
  • Restore path: a pull request run saves nothing, and dev has no entry under the new key until this PR merges. The restore code path was validated inside this PR's run instead. The script restores an artifact from the download cache through the same restore_file call, whether the entry came from actions/cache or from an earlier contract of the same run. In both attempts, 7 artifacts came from entries that an earlier contract had stored:
gemma-4-26b-8bit: 0 of 5 artifacts from the download cache, 5 downloaded (32221758 bytes) in 1.5 s
gemma-4-26b-qat-4bit: 1 of 5 artifacts from the download cache, 4 downloaded (53253 bytes) in 0.6 s
gpt-oss-20b: 0 of 6 artifacts from the download cache, 6 downloaded (27941221 bytes) in 1.3 s
qwen3.5-35b-a3b: 0 of 6 artifacts from the download cache, 6 downloaded (26725672 bytes) in 1.6 s
qwen3.6-35b-a3b-vl-mtp-mxfp8: 2 of 6 artifacts from the download cache, 4 downloaded (34768 bytes) in 0.8 s
EigenLabs/Qwen3.8-27B-4bit-mtp: 4 of 6 artifacts from the download cache, 2 downloaded (13393 bytes) in 0.3 s
nvidia-nemotron-3.5-lightning: 0 of 5 artifacts from the download cache, 5 downloaded (17091035 bytes) in 0.8 s

The actions/cache round trip of a flat directory of SHA-named regular files is the same one the MiMo metadata cache already uses. That cache hits in this run: Cache restored from key: mimo-metadata-v1-….

CI results for head c35382f:

Refactor pass

Result: PASS, with two small changes.

  • 08530afa15: the deadline comment in prepare-prompt-fixtures.py, the cache comment in provider-tests.yml and docs/developer/test.md now describe the code, not its history (no run number, no "before", no size that will drift).
  • 13234208c6: provider-release-cache.yml now runs its pull request validation when scripts/verified_download_cache.py changes. The release lane's prompt parity runs prepare-prompt-fixtures.py, which now imports that module.
  • Checked with no change needed: the cache reuses the MiMo metadata cache's layout, module, path root and save rule (SAVE_CACHES, exact key, save only on a miss). The key hashes the manifests, and every entry is re-verified by size and SHA-256, so a changed fixture cannot be served stale. A restore failure only warns, and the parity steps do not depend on the restore step, so a miss downloads. ci-component-paths.py already lists the module. Check the CI plans passed.
  • Merged origin/dev with signed merge commits (31c6401453, 37d0a442f1, which brings in Keep each reader in the test reader trackers so the audio fault tests end the audio reader #1886).

CI on 37d0a442f1: CI (dev) 42343792026 and SDK 27 release preparation 42343791852 passed, with both provider shards and Check the CI plans. Shard 1 ran on a Darkbloom host and missed the cache (Cache not found for keys: prompt-fixtures-v1-645076f1…), as expected for a pull request. The v1 step took 34 s and Nemotron 26 s, against a 67 s and 31 s Darkbloom median before. On 13234208c6, shard 1 failed only in testAFailedAudioReaderPassIsReadAgainAndReported, the dev flake that #1886 fixed.

Limitations

  • The first dev push after the merge saves the entry on its own host. Other Darkbloom hosts download until a dev push that runs the provider tests lands on each of them.
  • The release qualification lane (provider-release-build) gets the scaled deadline, but no cache.

🤖 Generated with Claude Code

Both Prompt Parity steps downloaded their hash-pinned prompt artifacts
(205 MB for the 7 v1 contracts, 87 MB of them unique, and 17 MB for
Nemotron) from models.darkbloom.ai on every run, with a flat 120 s per
contract. On a slow Darkbloom VM the Nemotron contract timed out at
under 142 KB/s (run 42330647893) and failed shard 1.

- prepare-prompt-fixtures.py --download-cache takes an artifact from a
  content-addressed directory (verified_download_cache.py restore_file
  and store_file) only when the entry is a regular file with the pinned
  size and SHA-256; any other entry is downloaded and replaced, and a
  failure to store is ignored. Shared tokenizers download once.
- A contract's deadline is 120 s plus its missing bytes at 128 KiB/s,
  at most 900 s. Each contract prints its cache and download counts.
- Provider shard 1 restores the directory keyed by the hash of the
  prompt-contract manifests and saves it on dev and master pushes after
  both parity steps pass. Both parity scripts pass
  PROMPT_PARITY_DOWNLOAD_CACHE through.
- Self-tests pin the steps, the key and the save condition, and cover
  every invalid entry, a read error, a failed store and the deadline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Error Error Nov 8, 2026 3:28pm UTC
d-inference-console-ui-dev Error Error Nov 8, 2026 3:28pm UTC
d-inference-landing Ready Ready Preview Nov 8, 2026 3:28pm UTC
darkbloom-status Ready Ready Preview Nov 8, 2026 3:28pm UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 8, 2026 3:28pm UTC

Request Review

…le changes

prepare-prompt-fixtures.py, which the release lane's prompt parity runs,
now imports scripts/verified_download_cache.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidtai
davidtai merged commit fe4de14 into dev Nov 8, 2026
27 of 30 checks passed
@davidtai
davidtai deleted the ci/cache-pinned-fixtures branch November 8, 2026 18:03
jonathan308 added a commit that referenced this pull request Nov 8, 2026
…d) into fix/reasoning-effort-every-value

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 8, 2026
…ember-relay

Three docs conflicts, each kept to both sides' facts:

- README.md: dev's text (every choice serves in the background, #1899), with this branch's "darkbloom --opencode
  on either Mac". That renders dev's <!-- pending LS-3: in a pair, start with opencode on either Mac. --> marker, deleted.
- docs/provider/local-first.md: dev's Only me log line and "No start screen prints the key" (bannerShowsKey is
  gone in dev), with this branch's pair sentences (the pair's API keeps the saved port; it takes this Mac's own key),
  which replaced "darkbloom restart for the pair's own API" and "the same key on both Macs" (review N4).
- docs/reference/configuration.md: the [local] port row has this branch's pair scope (the ownAPIPort clause now
  names the solo server too) and dev's mode = "local"; the writers table keeps this branch's cluster-service row and
  dev's new "Nothing" row (mode flags are saved now).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 8, 2026
…e-choice

One conflict, in docs/reference/configuration.md: the `[local] route` row sits
next to #1899's `[local] port` row. Both sides are kept: this PR's `route` row
(the running local API reads it again; `account_key_needed`) and #1899's `port`
row (the desktop app's local mode saves it with `mode = "local"`).
StartCommand+Modes.swift merged by itself, and the four router sites still pass
the config file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 8, 2026
…at/tools-wait-for-model

- StartCommand+Tools.swift: `setUpToolsBesideDaemon` keeps #1899's
  `waitSeconds` and two-argument `waitForAPI`, and this branch's
  `noteTools`; the doc comment says both.
- cli-reference.md: #1900's banner sentences ("no start screen shows
  it"), then this branch's step 4, whose run-again rule replaces dev's
  sentence about a model without a context.
- quickstart.md: both pending markers go (LS-1's and LS-4's), each
  rendered by its own PR.
- ToolAddressTests: the hooks test's `waitForAPI` takes #1899's two
  arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 8, 2026
…tools-default-model-and-names

#1904's fixes from its independent review (Ctrl-C as the wait ends,
`localhost` as this Mac, the run-again line by the process's word, the
wiring tests) and its merge of dev (#1899, #1900, #1905, #1885, #1917).
- ToolIntegrationStep.configure: #1904's `afterWait` (the wait's list and
  the process's word), then this branch's `resolve(here:)` for a pair.
- local-first.md: this branch's URL in the "already serves" line, then
  #1899's Only me wait.
- developer/test.md: the three new suites in the filter, and both rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch had an error being deployed

2 failed and 3 active deployments
Preview – d-inference-landing — fe7d2314 Deployed Nov 8, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — fe7d2314 Deployed Nov 8, 2026 by vercel[bot]
Preview – darkbloom-status — fe7d2314 Deployed Nov 8, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — fe7d2314 Deployed Nov 8, 2026 by vercel[bot]
Preview – d-inference — fe7d2314 Deployed Nov 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant