Repository navigation
Conversation
…to-directory map The map was code three times (refset `DIRS`, the fixture bin's `SOURCES.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`), and the fixture bin names a family by it (`Source::family`; refset is a regular dependency of bloomery-model); - 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]>
There was a problem hiding this comment.
Verdict: MUST_FIX: duplicated validators, an internal constant exported as public API and a misleading node-address instruction need mechanical fixes.
Must fix
1. Share the Python table parser
tools/gate-batch.sh:4866 and tools/recipes.py:6596 independently define the same row grammar, duplicate-key check and empty-table rule. This is R14 duplication. Share the reader now, before another table change needs two edits.
Move RecipeError and fixture_table to tools/bloomery/fixture_dirs.py using this complete module. In recipes.py import both names from that module; delete their old definitions, FIXTURE_DIR_NAME and PROFILE_DEFAULT_LINE.
class RecipeError(Exception):
"""A recipe, tree or tool the parser cannot read."""
def fixture_table(dirs_text, ref_paths_text):
import re
rows = {}
for n, line in enumerate(dirs_text.splitlines(), 1):
if not line.strip() or line.startswith("#"):
continue
cols = line.split("\t")
if (len(cols) != 2
or not re.fullmatch(r"[A-Za-z0-9_-]+", cols[0])
or not re.fullmatch(r"[a-z0-9-]+", cols[1])
or cols[1] == "none"):
raise RecipeError(
f"tools/fixture-dirs.tsv: line {n} ({line!r}) is not "
"`<family><TAB><dir>`: never `none`")
if cols[0] in rows:
raise RecipeError(
f"tools/fixture-dirs.tsv: line {n}: the family "
f"{cols[0]!r} is in the table twice")
rows[cols[0]] = cols[1]
if not rows:
raise RecipeError("tools/fixture-dirs.tsv: no row")
profile = re.findall(
r'^: "\$\{BLOOMERY_MODEL:=\$\{BLOOMERY_REF_MODEL_PROFILE:-([A-Za-z0-9_]+)\}\}"$',
ref_paths_text, re.M)
if len(profile) != 1:
raise RecipeError("tools/ref/ref-paths.sh: expected one default profile")
return rows, profile[0]Replace gate-batch's fixture_table with:
def fixture_table():
if not FIXTURE_TABLE:
sys.path.insert(0, os.path.join(root, "tools"))
from bloomery.fixture_dirs import RecipeError, fixture_table as read_table
try:
with open(os.path.join(root, "tools/fixture-dirs.tsv"), encoding="utf-8") as fh:
text = fh.read()
with open(os.path.join(root, "tools/ref/ref-paths.sh"), encoding="utf-8") as fh:
paths = fh.read()
rows, _ = read_table(text, paths)
except OSError as e:
fail(f"{e.filename} cannot be read ({e.strerror}): the fixture tier's family table is read there")
except RecipeError as e:
fail(str(e))
FIXTURE_TABLE.append(
(set(rows), {a for a, d in rows.items() if d == "self"}))
return FIXTURE_TABLE[0]In its self-test setup add:
mkdir -p "$t/tools/bloomery"
cp "$(dirname "$self")/bloomery/fixture_dirs.py" "$t/tools/bloomery/fixture_dirs.py"Update the three table-error expectations to the shared messages: fixture-dirs.tsv: no row, line 7 .*glm5next.* is not .<family><TAB><dir>., and line 7: the family .qwen4exp. is in the table twice. This removes more definitions and lines than it adds.
2. Reuse the variable-name validator
tools/gate-batch.sh:4421 duplicates the variable-name grammar in VAR at tools/gate-batch.sh:4721. R14 requires one owner; reuse the existing validator so a grammar change needs one edit.
Move the existing VAR definition to replace ENV_VAR, deleting its old declaration:
VAR = re.compile(r"^[A-Za-z_][A-Za-z0-9_]*$")Replace the added validation line with:
novar = sorted({v for _, v in calls if not VAR.fullmatch(v)})3. Keep SELF private
crates/refset/src/fixture.rs:49 adds a public API used only inside this module and its unit tests. R13 permits pub only for another crate's caller. Keep it internal before callers depend on it:
const SELF: &str = "self";4. Document node addresses through the batch environment
justfile:2174 advertises NAME@K=V for BLOOMERY_TIER_NODES. Following it with gate-gpu-qwen38-nodes-remote@BLOOMERY_TIER_NODES=192.0.2.10:9000 makes the item parser at tools/gate-batch.sh:4720 read 9000 as recipe arguments; :5085 rejects them because this recipe takes none. This is a proven misleading comment (kind B). Correct the instruction so users can supply a node address. Replace lines 2174–2175 with:
# BLOOMERY_TIER_NODES a batch defers it by name (needs-env); a run by hand exits 67 before a build.
# Set it through BLOOMERY_BOX_ENV='BLOOMERY_TIER_NODES=192.0.2.10:9000'.Checked
Duplicates: both table readers and variable-name validators confirmed; dryer reported no pairs.
Complexity: crapper reported no flagged function.
Silent failure: both Python readers reject malformed, duplicate and empty table rows by name.
Tests: isolated current/proposed parser checks and item-syntax reproduction passed; full suites were not run.
Gates: no thresholds moved in the supplied diff.
Escape catalog: no C1–C4 match among these findings; no ledger lessons in force. No inference hot path changed.
Notes
GPU evidence names cards, commits and gate output, but omits the model filenames required by CONTRIBUTING.md.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
| const DIRS_TABLE: &str = include_str!("../../../tools/fixture-dirs.tsv"); | ||
|
|
||
| /// A row's `dir` for a family with no fixture file of its own: a command runs on the profile's file, and there is no directory. | ||
| pub const SELF: &str = "self"; |
There was a problem hiding this comment.
R13: SELF is used only inside this module and its unit tests; keep the constant private.
| pub const SELF: &str = "self"; | |
| const SELF: &str = "self"; |
|
Superseded by #507 (rebased onto main). |
What and why
Two commits.
1.
tools/fixture-dirs.tsvis the one table of the architecture-to-fixture-directory map. The map was code three times (crates/refset/src/fixture.rsDIRS,crates/model/src/bin/fixture.rsSOURCES.family, thecaseintools/ref/ref-paths.sh) and was scraped from one of them by four scripts. A new family meant editing all of them. Nowrefset::fixture::dir_ofreads the file (include_str!), the fixture bin names a family by it (Source::family),ref-paths.sh,refset-publish.shandcheck-recipes.shread it by awk, andtools/recipes.pyandtools/gate-batch.shread it with their own tsv reader instead of a regex over the shell case. A missing file, a malformed row, a repeated architecture and anonedirectory are named errors in each reader.bloomery-refsetmoves from[dev-dependencies]to[dependencies]ofbloomery-model(the bin needs it; refset depends on gguf only, so no cycle).2. A gate that needs an env variable is deferred by name.
gate-gpu-qwen38-nodes-remoteneedsBLOOMERY_TIER_NODES; a batch that sets none ended it red withnames 0 addresses, the gate one. The recipe now opens its box command withtools/ref/needs-env.sh <recipe> <VAR>(exit 67, names the variable, before a build or a lock).tools/gate-batch.shreads the call as it reads real-only's and fixture-only's: an item whose env and the batch'sBLOOMERY_BOX_ENVdo 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 indeferred.list. A deferral of a tier's own kind comes first.Release notes: internal — one table for the fixture directories; a batch defers a gate that needs a variable by name.
Per-model copies
ce96affca):crates/refset/src/fixture.rs:46DIRS(6 rows);crates/model/src/bin/fixture.rs:114,124,132,142,152,161SOURCES.family;tools/ref/ref-paths.sh:96-103case rows (8); the readers of those rows by regex or grep:tools/recipes.py:6587(FIXTURE_CASE,FIXTURE_ROW),tools/gate-batch.sh:4700(fixture_table()) and its fake case in the self-test tree,tools/refset-publish.sh:72(awk overDIRS),tools/check-recipes.sh:471.tools/fixture-dirs.tsv, 9 rows (6 directories, 3self), the one owner. No per-model code.Proof
Move class (no kernel, launch or byte formula is touched; no file under
crates/gpu*changed).FIXTURE_NEWunset and set) = 168 cases: 138 give identical variables, messages and exit codes. The other 30 are the five profiles with no row in the fixture tier; they differ in one message,(the table in …/ref-paths.sh)became(no row in …/fixture-dirs.tsv).tools/fixture-dirs.tsvonly; the clean runs before and after were green in every reader's Mac test:cargo test -p bloomery-refset fixture::,recipes.py --self-test, thefixturevariantsandfixturedirsblocks ofcheck-recipes.sh,refset-publish.sh --self-test,gate-batch.sh --self-test --part 13):glm5nextdirectory: red in refset, recipes.py, the check-recipes blocks and refset-publish.qwen38andv41directories: the same four.nonedirectory: red in refset, recipes.py, gate-batch (and the check-recipes blocks fornone).qwen3moefromselfto a directory: red in the check-recipes block.nemotron_hsurvived all five Mac tests, so this PR adds a pin for it (part 13 runs the real tree's classes and wants both Nemotron families placed in the fixture tier; FAIL-first on the dropped row), and a refset test that every architecture with a family of fixture sets has a directory. Droppingdeepseek41is red in recipes.py, check-recipes and gate-batch as well.fixturebin test (every_spec_has_one_source_row…, which now pins the sixfetchnames) against these mutants.gate-batch.sh --self-test, clean runs 101 of 101 in part 12 before and after): no deferral at all, red 20; an empty value counted as set, 2; the batch'sBLOOMERY_BOX_ENVignored, 2; the DONE line withoutneeds_env=, 1; the tier count taking the needs-env items, 12; no check that the call opens the box command (part 14), 4; the guard exiting 66 instead of 67, 3; the guard reading the wrong name, 3. 8 of 8 killed. The cases: deferral in either tier, solo and chain recipes, by closure, item env and batch env, an empty value, the run.log line, the DONE counter,deferred.list, a batch of deferred items only, beside a real-only item, the dry run, the five named errors, and the guard's exit codes.just mac-static origin/mainat the rebased headc49d1508c): fmt-check, combos, check-arch, check-comments, check-defaults, check-levers, check-loads, check-ptx-names, check-records, check-rustflags, check-unsafe, check-waits rc 0. Red, not from this change: lint (68 warnings against the ratchet 41, none in a touched file; the same count is on main), andcheck-recipesin four self-tests that fail on the Mac (ref/cold-blocks,narrow-scan,ptx-compare; all three also fail on an export of origin/main taken before the rebase; andstack-watch, which fails under the parallel run and passes alone). Also green:recipes.py check(134 gate rows),pr-gate-lines.py --self-test,gate-batch.sh --self-test(702 of 702 on the full tree at the head).What the narrow does here
just affected origin/main --narrowkeeps the full list: 183 of 183 gate recipes. Two of the changed files select every box recipe by themselves:tools/ref/ref-paths.shandtools/fixture-dirs.tsvare inBOX_GLOBALS(every box command sources the one and reads the other), andcrates/model/Cargo.tomlis a package manifest that stays whole.recipes.py reachfor the changed Rust files names 100 gates throughcrates/refset/src/fixture.rs. I did not runjust narrowon the box: with these three 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 release train.GPU Evidence
Box:
nvidia-smi --query-gpu=name,driver_version --format=csv,noheaderprintsNVIDIA GeForce RTX 3090, 615.71.09andNVIDIA RTX A6000, 615.71.09. Headc49d1508c(base753df0aea), own remote dir~/repo/bloomery-b2-fixmap, all jobs through the box queue,tools/gate-batch.sh --round-ledger.Fixture tier,
--listof the nine gates plusgate-gpu-qwen38-nodes-remote, second run on the warm dir:DONE total=10 red=1 tier=fixture skipped=1 wall=2278s laneA=2176s laneB=2277s deferred=30 needs_env=1. The first run'sgate-gpu-libended rc 124 at the 900 s bound on the cold build of the new dir (DONE total=10 red=1 canary=red gate-gpu-lib unrun=7 wall=935s); nothing in it was a test failure.just gate-gpu-qwen4exp-e2e(rowqwen38)gpu-gate.sh: gate_qwen4exp_e2e ran 78 s (exit 0)just gate-gpu-ds41-step(rowv41)gpu-gate.sh: gate_deepseek41_step ran 35 s (exit 0)just gate-gpu-glm5next-e2e(rowglm5next)gpu-gate.sh: gate_glm5next_e2e ran 66 s (exit 0)just gate-gpu-qwen35moe-e2e(rowqwen35moe)gpu-gate.sh: gate_qwen35moe_e2e ran 16 s (exit 0)just gate-gpu-nemotron-h-moe-e2e(rownemotron-bolt)gpu-gate.sh: gate_nemotron_h_moe_e2e ran 11 s (exit 0)just gate-gpu-nemotron-e2e(rownemotron)/models/fixtures/nemotron; the line isref-paths.sh: BLOOMERY_TIER=fixture: the family 'nemotron_h' has no fixture file, no /models/fixtures/nemotron/*-00001-of-*.gguf (\fixture generate` writes it); not running it on its real file (exit 66)`, which is the row read and the directory namedjust gate-fixture-budgettest result: ok. 1 passedjust gate-gpu-libtest result: ok. 273 passed; 0 failedjust gate-gpu-gates-libc49d1508c,test result: ok. 124 passed; 0 failed; 3 ignoredandok. 5 passed(skipped in the second run, green in the round ledger)just gate-gpu-qwen38-nodes-remoterc=deferred needs-env, no box call; the second run's DONE line counts it inneeds_env=1Real tier (
--tier real),DONE total=2 red=1 wall=926s:just gate-fixtures2644 rc 0:test result: ok. 2 passedandok. 39 passed.just gate-refsets2643 rc 101, not from this change:hw_refset: 192 set(s) in place, 15 failed. All 15 are sets this box does not hold (tokenizer-llamaand the gemma-embedding and gemma-embedding2 sets:cannot read …/MANIFEST.tsv: No such file or directory); nofxset fails.229 passed; 1 failedis that one hw test.Not run: the box
fixturebin's names test against table mutants (above), and the remaining gates of the 183: they ride the release 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