Repository navigation
fix(gguf): keep the Muse companion seed out of the target namespace - #125
Conversation
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_32dd7d9c-0005-463d-b7e6-8d8e76a82cfb) |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d667eba59f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9135a104-45d8-44c8-9f8a-0f5929b98e9a) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39e76c408b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A target config carrying neither quantization alias seeded both from the companion block, and the rescope loop then read the draft's own `language_model.model.layers.*` entries as target overrides and moved them one wrapper deeper — the exact spelling a target projection resolves to. The merged block is now built once, rescoping only entries that came from a target alias, and assigned to both aliases. Closes #123 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCBk7iwMve89ru8c116kki
A config that already carries `dflash_config` was merged by a previous companion pass, and the draft profiles that pass wrote share the target overrides' spelling. Rescoping them again reinvents the phantom target override, so fail closed instead. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCBk7iwMve89ru8c116kki
The guard's `is_dflash` conjunct was behaviourally load-bearing but unobserved: dropping it left every test green while a mixed-quant mmproj against a merged sidecar was wrongly refused. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCBk7iwMve89ru8c116kki
…e marker `prepare_muse_secondary_config` refused any DFlash pass over a config carrying `dflash_config`, on the premise that it is the only writer of that key. The primary conversion copies `--config-dir`'s config.json verbatim (gguf.rs:3724), so pointing `--config-dir` at an already converted Muse directory propagates the marker into the fresh staged output and every subsequent `--draft` pass was refused — with advice to use a fresh output directory the CLI already stages. Clearing the marker in the primary is not the fix: the block is only rebuilt when `do_quantize` or a visible source profile applies, so a float source or a K-quant source without `--gguf-kquant` carries the previous draft's per-layer entries through with it. Stripping the marker there would drop the signal and keep the ambiguity. Refuse instead when the marker sits beside an entry still under the namespace the rescope walks — the state that actually cannot be attributed — and name that entry in the error. The condition binds the block rather than the running companion: a vision pass rescopes the same target block and invented the same phantom. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCBk7iwMve89ru8c116kki
39e76c4 to
e43256a
Compare
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_d5edfbd5-d830-4163-b1e6-c921179b7b34) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e43256a8ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
`dflash_config` is optional, and `MuseGlimmerConfig`'s `Option<MuseGlimmerDFlashConfig>` reads an explicit JSON `null` as absent. The companion guard's marker used `get(...).is_some()`, which tests key presence, so a target config that spells the field out as null and carries an unscoped per-layer override was refused on its FIRST quantized companion pass as an already-merged draft. Key the marker on a non-null value so it means what the loader means. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCBk7iwMve89ru8c116kki
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_0c5402d4-6009-4704-a6cf-cba5289e72f4) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e3289cee5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The copied-marker regression test converts a Q4_0/Q4_1 primary, so the conversion rebuilds both aliases one wrapper deeper and the guard is never reached — deleting the guard leaves that test green. A primary whose GGUF is dense and that is not asked to quantize rebuilds neither alias, so the `--config-dir` block reaches the merge verbatim, draft overrides included; that is the arm the refusal actually fires on and it had no coverage. The comment above the guard asserted the primary always rebuilds the block, which that arm falsifies. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MCBk7iwMve89ru8c116kki
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9ee39101-0240-44eb-b389-82a8651e3fad) |
When the target
config.jsoncarries no quantization block,prepare_muse_secondary_configseeded both aliases from the companion's block and then ran the target rescope over that seed. The companion's per-tensor keys are already spelled in the draft namespace, so the rescope invented a target override that was never asked for.Severity: latent today, loud tomorrow
The seeding branch is reachable only when the target has no quantization block at all, which means an entirely float target.
build_projectioncomputes the per-layer quant but only consumes it insideif params.contains_key("{prefix}.scales"), and a float target has no scales — so the override is discarded. Today the user gets a bogus key inconfig.jsonand nothing else.Two ways it stops being harmless, both verified rather than assumed:
--config-dir: the function readsoutput_dir/config.json, so any repeat against an already-converted output dir reaches it.top_modebecomesSome, so the "packed weights but config.json has no quantization mode" check no longer fires. A quantized target with no alias would go from a loud refusal to a silent mis-decode.The fix
Build the merged block once and assign it to both aliases, and rescope only a block that came from a target alias. When no target block exists, the companion's block is used as-is — its per-tensor entries are restated verbatim by the profiles loop immediately after, so not rescoping them loses nothing.
This subsumes #120's sibling fix;
single_alias_target_does_not_produce_disagreeing_companion_aliasesstill passes.One deliberate behavior change. Two aliases that are both present and disagree now error instead of each being transformed independently. That input is already unloadable —
select_quantization_blockrejects it — so the alternative was silently picking one half, possibly the wrong one. This function runs before the destructive save, so the failure simply moves earlier.Gate
companion_seed_does_not_rescope_draft_keys_into_the_target_namespace, on the same fixture as the existing test — which is the point, since that test produces the phantom and never notices. It asserts anti-vacuity first (the fixture really has neither alias, or the seeding branch never runs and the test proves nothing), then that the draft's own override survives, the literal phantom is absent, and — writing the config out and reading it back through the real loader — that no key resolves onto any target projection across 52 layers × 8 projections plusembed_tokens.Mutation-checked in two stages: restoring the old shared-seed rescope makes it fail; then, still mutated, disabling the literal-phantom assertion leaves it failing at the resolver loop. So the spelling-independent half is not carried by the literal one.
clippy --all-targets0 warnings.utils::gguf::73,convert220,models::muse_glimmer::216,models::quant_dispatch::41 — 0 failures.Repeated companion merges: refused, not silently merged
A reviewer raised that a repeated companion pass re-creates the phantom, because
target_blockthen holds thedraft profiles the previous pass wrote and the rescope cannot tell them from genuine target overrides.
Correcting this PR's earlier claim. An earlier revision of this description said the fix "turned a loud
failure into a silent one" on the second pass. That is wrong, and it was checked by running
prepare_muse_secondary_configfrom bothmainand this branch over three chained passes. For a target thatcarries a quantization alias — uniform, single-alias, or with an explicit per-layer override — the two
revisions are bit-identical at every pass:
main's rescope loop moves the previous pass's draft keysexactly as this one does. The repeated-pass phantom is pre-existing and unchanged in kind.
The only shape whose pass index moved is a target with no quantization block, and that shape is issue
#123: on
mainthe companion seed put the phantom there on pass 1, somain's pass-2 error wasmaintripping over its own corruption rather than a guard worth preserving. That shape is also inert — no
quantization block means a float target, and
build_projectionconsumes the resolved override only insideif params.contains_key("{prefix}.scales").The obvious discriminator does not exist. Excluding entries whose key is also a companion profile key
looks like it would work, and does not: the SafeTensors target converter writes genuine target overrides at
the same spelling the draft uses — that is the only reason the rescope loop exists — and
companion_quantization_keeps_target_and_dflash_layers_distinctpins a real target q6k override at exactlythe key the draft owns as q4k. Key-identity would delete a real target pin, and value-identity fails whenever
a Q4_K target meets a Q4_K draft. Separating the two provenances needs the companion to write under its own
on-disk namespace, which is a format decision with migration consequences.
So the ambiguous input is refused instead — keyed on the ambiguity itself, not on a marker.
A first attempt keyed the refusal on
dflash_configalone, on the premise that this function is the onlyon-disk writer of it. A reviewer showed that premise is false: when
--config-dirpoints at an alreadyconverted Muse directory, the primary conversion copies that config forward, marker included, so the draft
pass would always refuse — and the suggested remedy, a fresh output directory, is what the CLI already does.
The obvious repair, clearing the marker in the primary, is strictly worse, and the reason is the decisive
fact here: the primary does not always rebuild the quantization block. When the source is neither quantized by
this run nor carries preserved source quantization, the copied block passes through verbatim, previous draft
entries and all. Clearing the marker there would remove the signal and keep the ambiguous data, so the phantom
would come back silently. Verified by probe rather than argued.
The refusal therefore requires both conditions:
dflash_configThe marker means a non-null
dflash_config. Key presence alone disagreed with the loader, whoseOption<MuseGlimmerDFlashConfig>maps a JSON null toNone— so an explicit null would have refused a firstcompanion pass. No writer in the tree emits a null; the schema permits it and two copy paths preserve it, so
this is marker/loader alignment rather than an observed failure.
Why no further narrowing is needed, which the earlier rounds did not establish: a Muse main-GGUF primary that
rebuilds the block always writes it one wrapper deeper, into
language_model.model.language_model.layers.*.So any unscoped key present when the guard runs was copied from a config describing a different
checkpoint, or written by a previous secondary merge. There is no input where a correct, current block reaches
the guard. A dense primary is the case that makes this visible: it rebuilds nothing, the copied block survives
verbatim, and disabling the guard there writes the issue-#123 phantom outright.
It also binds the block rather than the running companion. The rescope loop walks the target block, so a
vision pass over a merged config invents the same phantom; an
is_dflashconjunct would have let it through.The error now names the offending key and gives advice the user can act on: point
--config-dirat the basemodel directory rather than a converted output, or re-run the primary so it rebuilds the block.
Five mutations were run and each observed failing: dropping either half of the condition, restoring the
marker-only guard, re-adding the
is_dflashconjunct, deleting the guard entirely, and — as the anti-vacuityproof — making the primary strip
dflash_config, which fails the test's on-disk marker assertion.Still open, deliberately. A stale
dflash_configis still written into an output that has nodraft.safetensors, when--config-dirpoints at a converted output and no--draftis given. It is inert atload, since the loader returns early when the draft file is absent, and clearing it is the unsafe move above.
Removing it properly means clearing the bare-prefix entries alongside it, in the primary path every family
shares — a larger blast radius than this PR. The same pass-through arm also leaves a quantization block that is
stale for the new weights independently of DFlash; that is pre-existing and untouched.
Separately,
muse_projection_quant's bare-namespace fallback resolves a target prefix down to the draft's ownkey, so a target projection with no scoped override still picks up draft geometry. That is asserted as
intended by
target_and_dflash_quantization_namespaces_stay_distinct, so it is a design question, not this bug.Fixes #123
🤖 Generated with Claude Code
https://claude.ai/code/session_01MCBk7iwMve89ru8c116kki