Repository navigation
model: add Flint header reader and truthful coverage refusals - #680
Conversation
|
Final-head integration confirmation after #677 R14 correction690feb7: rebuilt the disposable combined tree from reader ec6fd8f + tokenizer b562a65 + Jinja81028b9/690feb7. Re-executed real-header reader -> original GGUF template -> corrected common renderer -> tokenizer on51 contexts. All51 rendered byte strings match Jinja2, all token-ID sequences match pinned official HF. Four EOG and no BOS/EOS retained; program=None; no pretokenizer coverage gap. Final reader all-target clippy -D warnings and external malformed-header smoke also completed successfully. |
There was a problem hiding this comment.
Verdict: MUST_FIX: Two metadata validators repeat contracts that should have one owner.
Must fix
1. Share the per-layer bool validator (kind B, R14)
crates/model/src/arch/flint/hparams.rs:37 duplicates crates/model/src/arch/gemma_embedding2/hparams.rs:187: exact-length bool arrays and the same named error.
Consolidating now removes a function and prevents validation changes from needing two edits.
Move this definition into arch/mod.rs; delete Flint's mask and Gemma's sliding definitions:
fn per_layer_bool(
split: &Split,
suffix: &str,
n_layer: usize,
) -> Result<Vec<bool>, PlacementError> {
per_layer_items(split, suffix, n_layer)?
.iter()
.enumerate()
.map(|(l, v)| {
v.as_bool()
.ok_or_else(|| metadata(split, suffix, format!("has no bool at layer {l}")))
})
.collect()
}In Flint, replace the per_layer_items import with per_layer_bool and replace both mask calls:
let swa = per_layer_bool(split, "attention.sliding_window_pattern", layers)?;
let rope = per_layer_bool(split, "attention.rope_pattern", layers)?;In Gemma, remove the unused per_layer_items import and replace the sliding call:
let sliding = crate::arch::per_layer_bool(split, "attention.sliding_window_pattern", n_layer)?;2. Reuse the finite-positive metadata validator (kind B, R14)
crates/model/src/arch/flint/hparams.rs:115 repeats the predicate and error already owned by crates/model/src/arch/mod.rs:299.
Reusing that owner removes the extra error branch so future validation changes stay in that owner. Replace the scale match with:
let scale = match optional_f32(split, "expert_weights_scale")? {
None => {
defaults.push("expert_weights_scale = 1 (llama.cpp's default)".into());
1.0
}
Some(_) => finite_positive(split, "expert_weights_scale")?,
};Non-blocking
⚠ Record FAIL-first evidence: crates/model/tests/flint_meta.rs:16. The PR body records passing runs only. Show the metadata gate failing with the old condition at crates/models/src/need.rs:524; the normalization count should become 35 instead of 49. This demonstrates the new gate catches the coverage defect.
Checked
Duplicates: 19 new functions/types/constants. The dryer bool-validator pair and the repeated finite-positive predicate are confirmed.
Complexity: diagnostics report new Hparams::read=47 and spec::read=21. Enum consumers add arms; needs adds the normalization guard.
Silent failure: absent scale records its default, absent RoPE dims use the full head, and inactive windows become None. Malformed present metadata returns named errors.
Tests: static mutation review, not executed. Restoring the old need.rs:524 guard fails the normalization-count assertions. Changing < to <= at spec.rs:58 fails the dense/routed assertions. Metadata, shape and optional-bias refusal assertions are present.
Gates: no existing pins or cases moved. The new header gate is hw_-prefixed and ignored.
Escape catalog: C1–C4 do not match.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/routed_legs.rs, crates/gpu/src/fault.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
Addressed both R14 items and the actual CI registration failures in 526fc1a. Review and CI correctionBoth R14 requests are addressed: Flint's SWA/RoPE masks and GemmaEmbedding2's sliding mask now use one exact-length The original failed CI log was retrieved successfully from job120083956052. Its107-unit T0 run had exactly two red units: Executed on the corrected worktree:
Executed NoPE regression proof in a disposable worktree: restoring the previous rotation-only guard makes the pinned-header gate exit101 at No NVIDIA runtime was executed. The earlier CUDA-aware compile evidence remains compile-only; card evidence is requested separately from the maintainer. @midagedev Thank you for offering your box in #632. Could you run the owning card gates on 526fc1a (the fault/lib consumer and routed-leg dispatch, |
There was a problem hiding this comment.
Since the last review:
- Bool-array validator: fixed at crates/model/src/arch/mod.rs:371. Both model-local copies are removed.
- Scale validator: fixed at crates/model/src/arch/flint/hparams.rs:104. Present values use the existing owner.
Verdict: CLEAN: Both earlier must-fix items are resolved, and the new commits introduce no proven defect.
Checked
Duplicates: 2 new items checked by Grep: the shared bool validator and the scale-default test. No additional duplicate found; dryer reports 0 candidate pairs.
Complexity: Hparams::read is 45, down from the prior review's 47; spec::read remains 21. The flagged Arch::from_name=16, Arch::name=17 and needs=63 reflect previously reviewed arm/guard additions.
Silent failure: 4 paths followed: Flint's two masks, GemmaEmbedding2's mask and Flint's scale. Invalid present metadata returns named errors through arch::spec. Only absent scale defaults, with a recorded explanation.
Tests: static mutation review. Flint's metadata_refusals_name_the_invalid_input fails if arch/mod.rs:359 accepts oversized masks or flint/hparams.rs:104 bypasses finite_positive. Gemma's a_key_of_another_model_is_named fails if gemma_embedding2/hparams.rs:78 substitutes a default mask for a scalar. router_scale_defaults_only_when_absent fails if flint/hparams.rs:104 always returns 1 or :101 drops the default record.
Gates: removed refusal examples are covered by the expanded tables. No existing gate is relaxed. Five new model-tax PIN rows explain the architecture-enum occurrences.
Escape catalog: C1–C4 do not match. The incremental diff touches metadata/load-time code, tests, documentation and registry tables.
Notes
Tests were reviewed statically; no builds or tests were executed during this review.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/routed_legs.rs, crates/gpu/src/fault.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
526fc1a to
a186b0a
Compare
There was a problem hiding this comment.
Since the last review:
- Bool-array validator: fixed at crates/model/src/arch/mod.rs:371. Both readers use the shared owner.
- Scale validator: fixed at crates/model/src/arch/flint/hparams.rs:104. Present values use finite_positive.
Verdict: CLEAN: The rebase preserves fault reporting and Flint's execution refusal, with no proven new defect.
Checked
Duplicates: 0 new definitions in the interdiff; the moved arm reuses StepOrder and FaultSite::ALL. Dryer reports 0 pairs. Its excluded GPU mapping was inspected manually.
Complexity: crapper's Hparams::read=45 and spec::read=21 are unchanged reviewed code. Arch::from_name=16, Arch::name=17 and needs=63 retain the reviewed enum/guard additions. The relocated step-order match gains one harmless arm.
Silent failure: 0 new suppression sites. Followed the moved mapping through Fault::in_order, sites_in and Display: all known sites and unknown mask bits remain visible. program_of(Flint) remains None; the routed gate skips Flint before its program lookup.
Tests: static mutation check of crates/gpu/src/arch/step_order.rs:334. Replacing ALL with an empty slice fails every_step_order_names_every_site_exactly_once; changing "Flint" to another name fails every_step_order_is_named_as_its_architecture. The extended every_arch helper includes Flint.
Gates: no tolerance or test removed or relaxed. The deleted fault.rs tax row is obsolete: step_order.rs is already listed in tools/model-registries.txt:10 in both trees.
Escape catalog: C1–C4 do not match. The interdiff changes fault-reporting registration, its test enumeration and one obsolete table row; no hot-path work is added.
Notes
Review used source inspection and an in-memory consistency check. No builds or Rust tests were executed. The PR carries no NVIDIA card gate output; its CUDA evidence is compile-only.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/routed_legs.rs, crates/gpu/src/arch/step_order.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
There was a problem hiding this comment.
Since the last review:
- Bool-array validator: remains fixed. Both readers use crates/model/src/arch/mod.rs:371.
- Scale validator: remains fixed. Present scales use the shared validator at crates/model/src/arch/flint/hparams.rs:104.
Verdict: CLEAN: The added documentation accurately describes the shared fault decoder and Flint's neutral registry entry.
Checked
Duplicates: no new functions, types or constants in the incremental diff. The added paragraph describes existing owners.
Complexity: this increment changes documentation only; no function or branch changes.
Silent failure: 0 new suppression sites. Checked fault formatting against the device decoder, GPU re-export and model error path. Unknown mask bits remain visible.
Tests: no tests added or changed; mutation checks are not applicable to this documentation update. No builds or Rust tests were run.
Gates: no gate, tolerance, lint or test changed.
Escape catalog: C1–C4 do not match. No hot path changes.
Adversarial checks: the documented paths exist; Flint uses FaultSite::ALL in code order. program_of(Flint) remains None, and the routed gate refuses Flint before its program lookup.
Notes
The PR reports CUDA compilation but supplies no NVIDIA card gate output. GPU evidence remains absent.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/shared/routed_legs.rs, crates/gpu/src/arch/step_order.rs and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
Current-head integration and verification: The original conflict was the upstream common-fault cutover: fault layout/decoding moved to While the local integration candidate was being checked, @juliankang4 published the concurrent rebase ( Machine: Linux 7.0.0-38-generic x86_64, i5-12600K, no NVIDIA device; nightly-2026-08-28,
Full T0 on this head: The existing eight untracked compiler artifacts in the reader worktree were preserved (same inode, size and mtime). CUDA verification used a separate disposable worktree. That worktree, the external consumer and bounded-header scratch data have now been removed; no verification scaffold was committed. No NVIDIA execution, Flint inference, payload/weight-content validation or physical-card gate result is claimed. The remaining |
|
@Burntgogi Thanks for the contribution. The review is done, so I'm merging this. |
Refs #632; third independent CPU/header slice after #677 and #678. This PR does not enable Flint inference or a serve seat.
Change
Current integration and verification (
d0c2d19)Preserves the maintainer's concurrent rebase (
913437a/a186b0a) onto mainc5fb0868b, including the newer MTP and tokenizer changes. The follow-up is a normal fast-forward documentation commit: fault layout/decoding stays inbloomery_device::fault, and Flint's neutral order is registered ingpu::arch::step_order. The obsolete fault implementation and its tax rows are not restored.Verified at
d0c2d190ccaff19d6df5addae0db252d22ffc522: model library 476 passed / 5 ignored; pinned real-header gate 49 layers / 779 tensors / 49 QK norms / 35 rotary layers / 49 sinks; all-target model/models/placement clippy passed; external real-header consumer and named malformed-metadata refusals passed; CUDA-linked host-only fault-order tests 4/4; CUDA-awaregate_routed_legsrelease build passed; base-aware model-tax check passed; full T0 38 units, 0 red. No GPU kernel or physical-card result is claimed.Complete current-head evidence and commands. The earlier slice-specific evidence below is historical and is not substituted for these rerun checks.
Initial host verification (
ec6fd8f)Linux 7.0.0-38-generic x86_64, i5-12600K/64GiB, no NVIDIA; nightly-2026-08-28; RUSTFLAGS=-C target-cpu=native. Base40fec962613b9f08e8318f7a53c133d4f58e65e8; reader commit ec6fd8f.
Boundaries
No payload read, full-weight digest, weight/license equivalence, fixture redistribution, reference-logit result, CUDA execution or timing claim. The artifact’s other/flint-preview header versus official Apache-2.0 provenance conflict remains documented. No runtime/body/app/seat/fixture placeholder is added. The metadata gate deliberately accepts a verified header prefix, reconstructs a strict Layout/Split::header_only, and never fabricates weights.
Earlier review and CI correction (
526fc1a)Both R14 requests are addressed: Flint's SWA/RoPE masks and GemmaEmbedding2's sliding mask now use one exact-length
per_layer_boolowner; both old copies are deleted. Flint's optional router scale uses the existingfinite_positiveowner when present, without parsing the value twice; omission still records and applies the1.0 default. Consumer tests cover malformed masks and absent/valid/invalid scales.The original failed CI log was retrieved successfully from job120083956052. Its107-unit T0 run had exactly two red units:
check-levers(the header harness's BLOOMERY_MODEL read was unregistered), andcheck-model-tax(Flint's architecture directory was unregistered, consequently misclassifying its shared GLM XML parser reference). Added the existing harness/family registrations and dated exact-count rows for the existing exhaustive enum consumers. No GLM exception, ignored check, threshold relaxation or workflow change.Executed on the corrected worktree:
program=NoneandNeed::Programretained.-D warnings:passed; formatting passed.LC_ALL=C bash tools/contrib-check.sh --tier t0:DONE tier=t0 total=107 red=0 wall=421s. Both previously red checks now pass. This is local T0 evidence; new-head GitHub CI must report independently.Executed NoPE regression proof in a disposable worktree: restoring the previous rotation-only guard makes the pinned-header gate exit101 at
(35,35,49) != (49,35,49)for norms/rotary/sinks. The corrected guard passes. The mutant was not committed.No NVIDIA runtime was executed. The earlier CUDA-aware compile evidence remains compile-only; card evidence is requested separately from the maintainer.