Skip to content

fixture: one table for the architecture-to-directory map; a named deferral for a gate that needs an env variable - #507

Merged
midagedev merged 6 commits into
mainfrom
b2-fixmap2
Oct 19, 2026
Merged

midagedev merged 6 commits into
mainfrom
b2-fixmap2

Conversation

@midagedev

Copy link
Copy Markdown
Owner

Supersedes #402 (rebased onto origin/main 49ae7bebf; Shingler's four must-fixes are in).

What and why

Four commits.

1. tools/fixture-dirs.tsv is the one table of the architecture-to-fixture-directory map. The map was code in several places (refset DIRS, the architecture registry's fixture family, the case in tools/ref/ref-paths.sh) and four scripts scraped one of them. Now refset::fixture::dir_of reads the file (include_str!); ref-paths.sh, refset-publish.sh and check-recipes.sh read it by awk; tools/recipes.py and tools/gate-batch.sh read it through one Python reader. The registry rows keep their family literal (a static cannot read a file), and a new registry test holds each row to the table, both ways. A missing file, a malformed row, a repeated architecture and a none directory are named errors in each reader. The table has a qwen38d self row, which main added to ref-paths.sh after the first version of this change.

2. A gate that needs an env variable is deferred by name. gate-gpu-qwen38-nodes-remote needs BLOOMERY_TIER_NODES; a batch that sets none ended it red with names 0 addresses, the gate one (seen again in the #386 batch below). The recipe now opens its box command with tools/ref/needs-env.sh <recipe> <VAR> (exit 67 before a build or a lock). tools/gate-batch.sh reads the call as it reads real-only's: an item whose env and the batch's BLOOMERY_BOX_ENV do not set the variable is rc=deferred needs-env, counted as needs_env=<n> in the DONE line and written into deferred.list.

3. Review fixes. tools/bloomery/fixture_dirs.py is the one Python reader (RecipeError, fixture_table); recipes.py imports it and gate-batch.sh drops its own row grammar. The needs-env variable check reuses the item parser's VAR. refset::fixture::SELF is private. The node address of gate-gpu-qwen38-nodes-remote is documented through BLOOMERY_BOX_ENV (an item's NAME@K=V reads :9000 as arguments).

4. The scratch trees of the mac-check and ptx-compare self-tests copied recipes.py alone; they now copy its module too (mac-check self-test was 12 failed, ptx-compare red, before).

Release notes: internal — one table for the fixture directories; a batch defers a gate that needs a variable by name.

Per-model copies

  • Removed (paths at base 753df0aea): crates/refset/src/fixture.rs:46 DIRS (6 rows); tools/ref/ref-paths.sh:96-103 case rows; the readers of those rows by regex or grep: tools/recipes.py (FIXTURE_CASE, FIXTURE_ROW), tools/gate-batch.sh (fixture_table() and its fake case in the self-test tree), tools/refset-publish.sh:72, tools/check-recipes.sh:471.
  • Added: tools/fixture-dirs.tsv (10 rows: 6 directories, 4 self), the one owner; tools/bloomery/fixture_dirs.py, the one Python reader. The registry's literals stay and are pinned.

Proof

Move class (no kernel, launch or byte formula is touched; no file under crates/gpu* changed).

  • ref-paths.sh unchanged in behaviour (checked on the first version, 14 profiles x 2 tiers x 3 root states x 2 modes = 168 cases: 138 identical variables, messages and exit codes; the 30 others are profiles with no row, which differ in the one message that names the table). Not redone after the rebase beyond the box runs below.
  • FAIL-first by a mutant on the table (each edits tools/fixture-dirs.tsv only; clean runs before and after green in every reader's Mac test: cargo test -p bloomery-refset fixture::, recipes.py --self-test, the fixturevariants and fixturedirs blocks of check-recipes.sh, refset-publish.sh --self-test, gate-batch.sh --self-test --part 13), rerun on the rebased head: rename glm5next: red in refset, recipes.py, check-recipes, publish; swap qwen38 and v41: the same four; a repeated row and a none directory: red in refset, recipes.py, gate-batch (and check-recipes for none); qwen3moe from self to a directory: red in check-recipes; drop nemotron_h: red in gate-batch part 13 (the pin for it), drop deepseek41: red in four.
  • FAIL-first for the registry pin, on the box. arch::registry::tests::a_fixture_family_is_the_tables_directory with glm5next's directory renamed in the table: rc 101, Compiling bloomery-model in the log; on the clean table: rc 0.
  • FAIL-first for needs-env (8 mutants of the new lines, gate-batch.sh --self-test, all killed; as in fixture: one table for the architecture-to-directory map; a named deferral for a gate that needs an env variable #402).
  • Self-tests on the head: recipes.py --self-test ok (190 gate recipes, 0 failures), gate-batch.sh --self-test 707 of 707, mac-check.sh and ptx-compare.sh --self-test ok, cargo test -p bloomery-refset 249 passed.
  • Mac static tier (just remote-static origin/main on the second Mac, head f94c01122): fmt-check, lint (33 = ratchet), combos, check-arch, check-bounded, check-comments, check-defaults, check-emb2, check-levers, check-loads, check-model-tax, check-oracle-tree, check-ptx-names, check-records, check-rustflags, check-unsafe, check-waits rc 0. check-recipes rc 1 for one self-test only: ref/lease, 5 cases bounded-restore-* (tools/ref/lease.sh is not in this change; the same 5 cases failed on that Mac for an unrelated tree earlier, and ref/lease.sh --self-test is green on my Mac for both origin/main's export and this head).

What the narrow does here

just affected origin/main --narrow keeps the full list: tools/ref/ref-paths.sh and tools/fixture-dirs.tsv are in BOX_GLOBALS (every box command sources the one and reads the other). I did not run just narrow: with these files it cannot narrow, and the scans would prove only that no kernel moved, which the diff shows. The batches below are the own-target gates of the changed files plus one gate per table row; the rest of the list belongs to the train.

GPU Evidence

Box: nvidia-smi --query-gpu=name,driver_version --format=csv,noheader prints NVIDIA GeForce RTX 3090, 615.71.09 and NVIDIA RTX A6000, 615.71.09. Head f94c01122 (base 49ae7bebf), own remote dir ~/repo/bloomery-b2-fixmap, jobs through the box queue, tools/gate-batch.sh --round-ledger. Fixture files (first shard): /models/fixtures/qwen38/qwen38-fixture-00001-of-00001.gguf, v41/v41-fixture-00001-of-00004.gguf, glm5next/glm53-fixture-00001-of-00003.gguf, qwen35moe/qwen35moe-fixture-00001-of-00001.gguf, nemotron-bolt/nemotron-bolt-fixture-00001-of-00001.gguf, nemotron/nemotron-nano-fixture-00001-of-00001.gguf.

Fixture tier, 13 items, --no-canary: DONE total=13 red=1 tier=fixture skipped=0 wall=216s laneA=216s laneB=206s deferred=33 real_only=1 needs_env=1. Green: gate-gpu-lib (19 s this time), gate-gpu-gates-lib, gate-gpu-qwen4exp-e2e (row qwen38), gate-gpu-ds41-step (v41), gate-gpu-glm5next-e2e (glm5next), gate-gpu-qwen35moe-e2e (qwen35moe), gate-gpu-nemotron-h-moe-e2e (nemotron-bolt), gate-nemotron-meta (nemotron), gate-fixture-budget, gate-arch-registry (the registry pin). gate-gpu-nemotron-e2e: rc=deferred real-only. gate-gpu-qwen38-nodes-remote: rc=deferred needs-env, no box call.

Red, not from this change: gate-gpu-nemotron-serve rc 1 (load_and_listen: 1 slot(s) at 4096 positions ... take 2382530560 bytes on a card that holds 1073741824): the Nano fixture (staged on 2026-10-17) has a 1 GiB card budget and this seat gate was never run on it; before, the tier refused with rc 66. A fixture gap, not the table.

Earlier tries of the same batch with the canary stage ended canary=red gate-gpu-lib (rc 124 at the 900 s bound, twice: 27 hw_ tests never finished). That is the gate-gpu-lib hang on main (a driver-lock cycle, lead rounds libhang and tixrace on it); no file under crates/gpu is in this change.

Real tier, DONE total=2 red=0 tier=real skipped=0 wall=46s: gate-fixture rc 0, gate-refset rc 0.

Not run: the remaining gates of the full list; they ride the train.

This PR was written by a bot (a Claude Sonnet 5.5 agent in the Claude Code harness) under the lead's direction.

🤖 Generated with Claude Code

midagedev and others added 4 commits October 19, 2026 23:14
…to-directory map

The map was code in several places (refset `DIRS`, the architecture registry's fixture `family`, the case in ref-paths.sh) and was scraped from one of them by four scripts. Now one file holds it:

- refset reads it by `include_str!` (`dir_of`, `first_shard_in`); the registry's rows keep their `family` literal (a static cannot read a file) and a new registry test holds each fixture row to the table, both ways;
- ref-paths.sh, refset-publish.sh and check-recipes.sh read it by awk; tools/recipes.py and tools/gate-batch.sh read it with their own tsv reader instead of a regex over the shell case;
- a missing file, a malformed row, a repeated architecture and a `none` directory are named errors in each reader.

Behaviour is the same: ref-paths.sh at base and here gives identical variables, messages and exit codes over every profile, tier and root state (but the one message that names the table).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eds-env)

`gate-gpu-qwen38-nodes-remote` needs BLOOMERY_TIER_NODES; a batch that sets none ended it red with `names 0 addresses, the gate one`. The recipe now opens its box command with `tools/ref/needs-env.sh <recipe> <VAR>` (exit 67, naming the variable, before a build or a lock). gate-batch reads the call as it reads real-only's and fixture-only's: an item whose env and the batch's BLOOMERY_BOX_ENV do not set the variable is deferred in either tier, never called, never red: `rc=deferred needs-env`, `needs_env=<n>` in the DONE line, a comment line in deferred.list. The deferral of a tier's own kinds comes first.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ivate SELF, node-address comment)

- tools/bloomery/fixture_dirs.py is the one Python reader of tools/fixture-dirs.tsv and ref-paths.sh's default profile (RecipeError, fixture_table). tools/recipes.py imports it and drops its copy; tools/gate-batch.sh imports it instead of a second row grammar, duplicate-key check and empty-table rule. The self-test trees carry the package.
- gate-batch.sh: the needs-env variable check reuses the item parser's VAR.
- refset: `SELF` stays private to the module and its tests.
- justfile: the node address for gate-gpu-qwen38-nodes-remote is set through BLOOMERY_BOX_ENV (an item's NAME@K=V reads `:9000` as arguments).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… carry recipes.py's table reader

recipes.py now imports tools/bloomery/fixture_dirs.py. The two self-tests that copy recipes.py into a stand-in tree copied it alone, so recipes.py ended with ModuleNotFoundError there (mac-check: 12 failed, ptx-compare: red). Each now copies the module beside it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@midagedev midagedev added documentation Improvements or additions to documentation host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 19, 2026
github-actions[bot]
github-actions Bot previously approved these changes Oct 19, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: No must-fix defect found in fixture lookup or environment-based gate deferral.

Checked

Duplicates: the fixture map comes from tools/fixture-dirs.tsv; recipes.py and gate-batch.sh share the Python reader. Dryer reported 0 qualifying Rust pairs.
Complexity: crapper flagged no changed function. The changes cover fixture lookup and tool scheduling; no inference hot path changes.
Silent failure: Rust table parse errors panic with the table name; the Python parser raises named errors. Shell lookups without a row exit 66. Missing required environment values produce explicit needs-env deferrals.
Tests (static mutation audit): changing a registered family's fixture directory fails registry.rs:356. Accepting malformed rows in fixture.rs:68 fails parser rejection cases. Removing the deferral branch at gate-batch.sh:4990 breaks scheduling assertions; the tests also assert deferred counts, lists and absence of box calls.
Gates: no tolerance, threshold or lint level moved. Shared-table tests replace shell-case scraping tests. The PR reports FAIL-first results for table mutations, the registry assertion and needs-env handling.
Escape catalog: C1–C4 checked; no matching defect found in the additions.

Notes

Validation used static inspection; Rust/tool self-tests and GPU gates were not rerun. The PR's GPU section supplies card lines, commit hashes and batch summaries, but omits full gate invocations and their output.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

…GiB)

The Nano fixture recorded 1 GiB, sized above its tensor data (about 0.93 GB) on the premise that nothing plans against it. The serve seat does: its one-slot plan at the least context it tries (4096 positions) takes 2382530560 bytes, so in the fixture tier gate-gpu-nemotron-serve ended `load_and_listen` red (`take 2382530560 bytes on a card that holds 1073741824`) where it used to defer with rc 66 before the fixture was staged.

The budget is 3 GiB now. With it the seat's plan halves from 262144 to 65536 positions and refuses the rung above (`need=3422717952 room=3221225472`), so the gate's default-context clauses still have a rung to refuse. Only the header value of the fixture changes; the weights are the same bytes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@midagedev

Copy link
Copy Markdown
Owner Author

5. The Nano fixture's recorded card budget holds the serve seat. gate-gpu-nemotron-serve ended red in the fixture tier (load_and_listen: take 2382530560 bytes on a card that holds 1073741824): the fixture recorded 1 GiB, sized above its tensor data on the premise that nothing plans against it, and the serve seat does. The budget is 3 GiB (crates/model/src/arch/nemotron_h/fixture.rs). With it the seat's plan halves from 262144 to 65536 positions and refuses the rung above (need=3422717952 room=3221225472), so the gate's default-context clauses still have a rung to refuse. Only the header value of the fixture changes; the weights are the same bytes.

Box evidence for commit 5 (head 69a5f44bd, same dir and queue): before, on the staged 1 GiB fixture, gate-gpu-nemotron-serve rc=1 229s (DONE total=1 red=1; the same red in the two earlier batches). After the staged fixture was regenerated by fixture fetch nemotron (937,446,048 bytes, header budget 3221225472; the 1 GiB one kept as /models/fixtures/nemotron.old-budget-1073741824, as for qwen38): DONE total=5 red=0 tier=fixture skipped=0 wall=51s laneA=42s laneB=51s deferred=0 for gate-gpu-nemotron-serve (rc 0, 14 s), gate-gpu-nemotron-h-moe-serve, gate-arch-registry, gate-fixture-budget and gate-nemotron-meta. This replaces "Red, not from this change: gate-gpu-nemotron-serve" in the GPU Evidence above.

@midagedev
midagedev enabled auto-merge (rebase) October 19, 2026 17:50

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the last review: there were no must-fix or non-blocking items to resolve.

Verdict: MUST_FIX: The fixture gate's memory cap increases without the required dated pin.

Must fix

1. Pin the increased fixture gate budget

crates/model/src/arch/nemotron_h/fixture.rs:61 raises the fixture-tier memory cap from 1 GiB to 3 GiB. box.sh exports this metadata as BLOOMERY_CARD_BUDGET, which controls whether the serve gate's plan is accepted. CONTRIBUTING.md requires a dated PIN and reason when a gate threshold moves; the new prose supplies only the reason.
Adding the pin now avoids reconstructing this gate change later. Replace the constant line with:

// PIN(2026-10-19): one Nano fixture slot at 4096 positions needs more than the old 1 GiB cap.
pub const CARD_BUDGET: u64 = 3 << 30;

Non-blocking

⚠ Record the repaired serve run: crates/model/src/arch/nemotron_h/fixture.rs:61. The body records the earlier 1 GiB failure, with no successful run after this change. Regenerate the Nano fixture, run BLOOMERY_TIER=fixture just gate-gpu-nemotron-serve, and attach its output. This checks that the staged file carries the new budget before the batch runs again.

Checked

Duplicates: 0 new items; the existing budget remains the owner. Dryer reported 0 qualifying pairs.
Complexity: crapper flagged no changed function. This is fixture generation and load planning; no inference hot path changes.
Silent failure: 0 new default/error-suppression sites. The budget reaches named plan refusals; usable and free card memory still cap it.
Tests: none added or changed. Static mutation audit: restoring 1 GiB and regenerating the fixture makes the existing serve gate fail its load-and-listen clause, consistent with the reported failure.
Gates: one fixture gate budget increased; its dated pin is missing.
Escape catalog: no C1–C4 pattern matches the new hunk.

Notes

Validation was static; no tests or GPU gates were rerun. GPU evidence lacks full gate invocations and output for this change.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

/// tries (4096 positions), about 2.4 GB in all, so the budget sits above that
/// with room for the rungs above. The engine attach sets the value its
/// placement reads.
pub const CARD_BUDGET: u64 = 3 << 30;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixture gate's increased memory cap needs the dated PIN required for moved gate thresholds.

Suggested change
pub const CARD_BUDGET: u64 = 3 << 30;
// PIN(2026-10-19): one Nano fixture slot at 4096 positions needs more than the old 1 GiB cap.
pub const CARD_BUDGET: u64 = 3 << 30;

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the last review:

Must-fix 1: fixed at crates/model/src/arch/nemotron_h/fixture.rs:61. The budget now has a dated pin and its reason.

The prior serve-run advisory is excluded by incremental-review scope: the new commit changes only the pin comment.

Verdict: CLEAN: The added pin resolves the prior must-fix, and this incremental diff changes no executable code.

Checked

Duplicates: 0 new items checked; dryer reported 0 qualifying pairs.
Complexity: crapper flagged no function; no executable code or inference hot path changed.
Silent failure: 0 new sites; only a comment was added.
Tests: none added or changed; no tests rerun.
Gates: the existing 3 GiB budget now has PIN(2026-10-19) and the reason. This incremental diff does not change the value.
Escape catalog: no C1–C4 patterns match the added line.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@midagedev
midagedev merged commit 821d7b8 into main Oct 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset model The CPU engine and model files: crates/model, models, hf, gguf, tokenizer, jinja tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant