Skip to content

recipes, refset: two red checks on main (feature combos, an absent family's sets) - #835

Merged
midagedev merged 4 commits into
mainfrom
mainfix3
Oct 26, 2026
Merged

midagedev merged 4 commits into
mainfrom
mainfix3

Conversation

@midagedev

Copy link
Copy Markdown
Owner

Two checks were red on main.

1. mac-static feature combos. tools/recipes.py resolve_call split a multi-package call (-p bloomery-device -p bloomery-metal --features bloomery-metal/...) per package and gave every feature word to each package. cargo refuses bloomery-metal/... on -p bloomery-device alone (rc 101). Now each split shape keeps only words its package's dependencies name, and Tree.resolve refuses by name a word no selected package can take. Self-test cases added to _st_basics; red on the old code, green now.

2. gate-refset and refset-check. The hf-qwen4exp-nvfp4 sets are not on the box by design: their only consumer, gate-gpu-qwen4exp-nvfp4, opens with needs-env.sh … BLOOMERY_CARD_ALL_EXPERTS and is deferred by name here. The in-place checks still demanded them (4 FAIL, rc 101). A NEEDS_ENV row now names that family as deferred where the variable is unset; with BLOOMERY_CARD_ALL_EXPERTS=1 the check is strict as before (4 FAIL, rc 101). A test holds the table to the justfile's needs-env recipes.

Evidence (box, this branch): just gate-refset rc 0, 226 set(s) in place, 0 failed, 1 deferred, 309 passed; just refset-check rc 0, 390 set(s), 0 failed, 1 deferred.

Found by the nb43 session; fixed by a Sonnet round, reviewed and finished by the lead.

🤖 Generated with Claude Code

midagedev and others added 3 commits October 26, 2026 22:25
…age's dependencies name, and a feature word no selected package can take is refused by name

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eferred where that fact is unset, and stays strict where it is set

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ted in levers-direct.txt

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 26, 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: MUST_FIX: NEEDS_ENV writes the variable name twice and carries a function pointer that one row does not need.

Must fix

1. NEEDS_ENV states one fact twice and holds an element it does not need

crates/refset/src/arch/mod.rs:96-105: the row names "BLOOMERY_CARD_ALL_EXPERTS" (line 98), and card_all_experts names it again (line 104). The third tuple field (fn() -> bool) and the function exist only to read that same variable. Two copies in one diff are a finding, and the function pointer is an element with one user. Nothing here needs a per-row predicate: the table already has the variable name, and the check is "set and not empty" for every row (the same rule as needs-env.sh). Today, if someone edits one of the two names, the table and the check disagree and nothing turns red: the unit test compares only the table's name with the justfile.
Fix: the table holds (family, var), and deferred reads the variable. This removes one function and one tuple field.

static NEEDS_ENV: &[(&Family, &str)] = &[(&qwen4exp::nvfp4::HF, "BLOOMERY_CARD_ALL_EXPERTS")];

#[must_use]
pub fn deferred(f: &Family) -> Option<&'static str> {
    NEEDS_ENV
        .iter()
        .find(|(g, _)| std::ptr::eq(*g, f))
        .map(|&(_, var)| var)
        .filter(|var| std::env::var_os(var).is_none_or(|v| v.is_empty()))
}

Also in the test (line 264): .map(|&(f, var)| (f.name, var.to_string())). The use line does not change.

Non-blocking

⚠ No test turns red if deferred is inverted: arch/mod.rs:114. Mutant: .filter(|…| set()) instead of !set(). The table test compares names only. The two checks that would catch it (hw_every_set_in_place_is_its_familys, refset-check) run on the box, and only show it as a changed count. The PR body says the strict case (variable set → 4 FAIL, rc 101) was run by hand; a test would keep it. Direction: only if you can do it without a new parameter or layer; otherwise leave it.

Checked

  • Duplicates: 4 new items checked (NEEDS_ENV, deferred, card_all_experts, depends_on), plus needs_env_of; the variable name repeats inside the diff (must fix 1). No existing owner of "family waits on a variable" found. dryer: 0 pairs.
  • Complexity: crapper flagged nothing.
  • Silent failure: 3 sites followed (deferral by unset variable, the fp == pname / depends_on drops in resolve_call, needs_env_of returning None). A deferral is named in output and counted in the summary line; a feature word dropped for a package is covered by the named error in Tree.resolve. refset-check <family> <paths> skips deferral by design.
  • Tests: needs_env_rows_are_the_families_whose_consumers_open_with_needs_env protects the table against the justfile: removing the row, or changing the variable in the justfile, turns it red. The new _st_basics cases: dropping the depends_on filter in resolve_call turns want red; dropping the new elif in resolve turns the j case red.
  • Gates: no pin, band or tolerance moved. tools/levers-direct.txt row added for the new env read; matches the existing gatestoml rows.
  • Escape catalog: no pattern matched (no shell changed).
  • Hot path: none (tools and a reference-set check).

Notes

  • No nvidia-smi line or commit hashes in the body; the change touches no GPU crate, so no speed or card claim is made.

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

@midagedev

Copy link
Copy Markdown
Owner Author

On must-fix 1: the suggested form is the round's first version. tools/check-levers.sh refused it, and pre-push stopped it: crates/refset/src/arch/mod.rs:106: reads a variable whose name is not a literal, a same-file const or the parameter of a helper. A direct read must name its variable by literal so the registry check can list it (tools/levers-direct.txt). So each row keeps its own reader. The name in the row stays because the test compares it with the justfile's needs-env.sh recipes. The reason is now a comment on the reader.

@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: the new commit answers the earlier must-fix; it only changes a doc comment.

Since the last review:

  • Must fix 1 (NEEDS_ENV names the variable twice, one function pointer): answered by the author. The new comment at arch/mod.rs:102-103 says tools/check-levers.sh reads a variable only by a literal or a same-file const. I checked check-levers.sh:125-171. The claim is true. My suggested fix (var_os(var) with var from the table row) would be red there ("reads a variable whose name is not a literal"). I withdraw it.
  • Non-blocking item (no test turns red if deferred is inverted, arch/mod.rs:115): still open, not answered. It stays non-blocking.

Checked

  • Duplicates: no new item in this commit (a comment only). The earlier batch stands; dryer: 0 pairs.
  • Complexity: crapper flagged nothing.
  • Silent failure: no code changed; the earlier 3 sites stand.
  • Tests: none added or changed in this commit; the earlier mutation result stands.
  • Gates: no pin, band or tolerance moved.
  • Escape catalog: no pattern matched (no shell changed).

Notes

  • No nvidia-smi line or commit hashes in the body; the change touches no GPU crate and makes no speed claim.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

host Host crates: qdot, threads, engram, engram-lab, runtime, sampler, levers, decision, vision, refset 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