Repository navigation
ref, qwen4exp: the NVFP4 oracle reads a cut only under the # fixture line of its first shard - #1122
Conversation
…` line of its first shard
There was a problem hiding this comment.
Verdict: MUST_FIX: fixture-line validation duplicates the MiniMax oracle's rules.
Must fix
1. Give fixture-line validation one common owner
tools/ref/qwen4exp-nvfp4-oracle.py:201 repeats tools/ref/mm31/dump_tf.py:1045: token parsing, duplicate rejection, budget exclusion and key/value comparison. These are shared fixture rules, with no architecture difference (R14, kind B).
Sharing them now prevents later validation fixes from reaching only one writer. The replacement removes 23 nonblank lines and adds 19, including imports and calls.
Add this definition to the existing tools/bloomery/manifest.py:
def check_fixture_line(meta, line, refuse):
"""Check an already prefixed fixture line against the first shard's metadata."""
keys = {k: v for k, v in meta.items() if k.startswith("bloomery.fixture.") and k != "bloomery.fixture.card_budget"}
held = {}
for token in line[len("# fixture\t"):].split(" "):
k, sep, v = token.partition("=")
if not sep or not k.startswith("bloomery.fixture.") or k in held:
raise refuse(f"--fixture-line: {token!r} is not one bloomery.fixture.* key=value, once")
held[k] = v
for k in sorted(keys.keys() | held.keys()):
if held.get(k) != keys.get(k):
raise refuse(f"--fixture-line states {k}={held.get(k, 'nothing')}, the first shard has {keys.get(k, 'nothing')}")After Qwen's standard-library imports, add:
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "bloomery"))
from manifest import check_fixture_lineReplace Qwen lines 200–210 with:
check_fixture_line(meta, line, SystemExit)After MiniMax's standard-library imports, add:
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "bloomery"))
from manifest import check_fixture_lineDelete MiniMax's local keys assignment at line 1037 and replace lines 1045–1055 with:
check_fixture_line(folder.meta(), given, Refusal)Refresh both writer pins after these edits.
Checked
Duplicates: 2 new functions checked; the shared validation block is finding 1. Dryer reported no pairs.
Complexity: crapper flagged no Rust functions; Python growth adds input-validation branches.
Silent failure: 4 new dictionary lookups followed; missing values produce named errors before checkpoint loading.
Tests: the validator compared the existing and proposed validation for both callers on 15 cases in memory: exact and reordered lines accepted, 13 invalid cases rejected. All three proposed modules parse. Resume assertions cover changed and missing layer metadata. Rust and GPU runs were not repeated.
Gates: the writer md5 matches the new pin; its dated reason is present. No tolerance moved.
Escape catalog: no matching patterns.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
…olds a cut's `# fixture` line to its first shard
There was a problem hiding this comment.
Since the last review: finding 1 is fixed. Both writers now delegate fixture-line validation to tools/bloomery/manifest.py:157.
Verdict: CLEAN: the shared validator preserves both writers' rejection rules, and both updated writer pins match their sources.
Checked
Duplicates: 1 new function checked by Grep; the earlier validation copies are removed. Dryer reported no pairs.
Complexity: crapper flagged no functions. The extracted Python validator retains the existing validation branches; its self-test adds cases.
Silent failure: 4 dictionary lookup sites followed. Missing, extra and changed keys produce named errors before saved state is consumed.
Tests: fixture self-test assertions passed in memory. Removing newline rejection (manifest.py:163), duplicate rejection (:170), or value comparison (:174) turns assertions red; including the budget (:166) rejects a valid fixture. Fourteen isolated MiniMax boundary cases preserve base acceptance and returned text. Vendor folders reject fixture lines; Qwen rejects stale, partial, absent, multiline and duplicate lines.
Gates: both writer hashes match their pins and carry dated reasons. No tolerance moved.
Escape catalog: no matching patterns. The changed production paths are tools, outside inference hot paths.
Notes
Full oracle suites, Rust tests and GPU gates were not rerun by the validator. The PR supplies a GB10 gate run with card, driver, commit hashes, command and output.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
|
On the box,
Nothing for you to do. We are re-dumping these sets on the box now and will post the gate lines here. |
|
Re-dump done on the box. The data files are byte-identical to the old sets; only the
Nothing needed from you. |
Qwen3.8 NVFP4 oracle이 cut의 첫 shard에 적힌
# fixture줄과 맞지 않는--fixture-line을 거부하도록 고쳤습니다.What and why
Fixes #1121. For a cut,
tools/ref/qwen4exp-nvfp4-oracle.pychecked only the first shard's source and revision and took--fixture-lineas given. A resume with the line of an earlier cut generation at the same path therefore kept an equal identity and mixed generations.--fixture-linemust now state everybloomery.fixture.*key of the first shard exceptcard_budget, each once and with the shard's value; a missing key, an extra key, a duplicate, a malformed token or a different value is refused with an error that names the key. The line is now the shard's real identity, so a regenerated cut changes the resume identity and--resumerefuses. The check lives once incheck_fixture_lineintools/bloomery/manifest.py, and both Python writers of a cut's sets call it: the NVFP4 oracle andtools/ref/mm31/dump_tf.py, which held a second copy of the same rule. The writers changed, so theHARNESSpin incrates/refset/src/arch/qwen4exp/nvfp4.rsmoves to the new md5a6612dbf9b703308d86474a5963e426dand theBUILDpin incrates/refset/src/arch/minimaxm31/mod.rstodump_tf-f9d49797b776. The oracle test gets a case that pauses on layers 0,1,2,3, regenerates the shard as 0,1,6,7, and resumes with the previous line (refused), plus a line without the layers key (refused).Release notes: Fixed: the Qwen3.8 NVFP4 oracle writer no longer resumes a saved state that belongs to another cut of the model.
Code shape
The review reads these first. A box left unticked needs one line of why.
copying it (
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, Inamed it below.
(tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
tools/check-comments.sh).PIN(YYYY-MM-DD):and its reason.
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
Upstream base
e68409b95f80af8d73cec49f193b444145c0501d, PR head1941ee1f2528a22d54579ffbc4dd82df11d8db62.Oracle self-test (two cases, including the new one):
Writer pin and format check:
Shared check and the MiniMax-M3.1 writer's tests, on a CPU host (torch 2.14.1+cpu, transformers 5.12.1):
Card gate on the restamped fixture sets (build
a6612dbf), none refused as stale:Hardware (if the change is for a machine)
NVIDIA GB10, driver 595.84, CUDA 13.3 (
nvidia-smiabove).AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.