Repository navigation
Audit audio and codec GGUF cohort - #586
Merged
Merged
Conversation
Performance Comparison
|
justinchuby
force-pushed
the
justinchuby-add-mmproj-gguf-cohort
branch
from
August 25, 2026 15:41
33a0d38 to
0768c8c
Compare
Audit PocketTTS, Qwen3-TTS, Talkie, and WavTokenizer decoder semantics against the pinned llama.cpp loaders and converters. Pin suffix-exact tensor inventories, defer unsupported graphs without aliasing components, reject task misdispatch through the existing pre-graph capability gate, and document companion/state/ISTFT and quantization requirements. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Reject every non-importable GGUF architecture before quantization, config extraction, registry lookup, or graph construction while preserving deferred versus disabled exception semantics. Separate Talkie's 362 loader-created tensors from its 80 converter-only gain sidecars and document the fail-closed policy. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Reject standalone clip/mmproj inputs through the normal early disabled-architecture gate for local, Hub, API, and CLI routes. Allow clip only when an internal multimodal builder validates it as a companion to a text GGUF. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Resolve Hub mmproj references through a private companion-only path that permits clip metadata while rejecting non-clip companions before download. Keep the public primary GGUF resolver fail-closed for standalone clip inputs. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Inspect the bounded GGUF metadata header of the exact selected companion file instead of repository-level architecture metadata. Resolve and download the immutable revision, strip cross-origin auth, support requests and httpx Hub clients, and revalidate the downloaded local header before dispatch. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Use descriptor-relative target reads where supported and a reparse-point-checked, identity-verified path fallback on Windows. Record specialized coverage for stacked GGUF model registrations so generic coverage gates do not misclassify their bespoke tasks. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Carry one root identity through path-based config and tokenizer reads, checking it before and after each resource and after the pair completes. Reject directory replacement before mixed target resources can be accepted. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Keep the existing main-branch phimoe_gguf exemption and remove the duplicate entry replayed from the older stacked history. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
justinchuby
force-pushed
the
justinchuby-add-audio-codec-gguf-cohort
branch
from
August 25, 2026 15:45
1fe0c7e to
0dc4ddc
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens Mobius’s GGUF integration around the newly audited audio/TTS/codec cohort and improves multimodal mmproj companion handling, while preserving a strict “deferred until proven” posture (fail early, pin upstream inventories, and avoid accidental task/graph aliasing).
Changes:
- Mark the C09 audio cohort (pockettts/qwen3tts/talkie/wavtokenizer-dec) as explicitly deferred with pinned tensor inventories and misdispatch guards.
- Strengthen GGUF build gates so deferred architectures and standalone
clipfail before config extraction/output creation, and add an mmproj companion preflight path for Hub references. - Harden draft target resource loading (safer open semantics across platforms) and extend documentation/tests to lock in the new invariants.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/model_coverage_test.py | Adds skip-list entries for diffusion model_type aliases now present in the registry. |
| tests/cli_test.py | Adds CLI tests + a minimal GGUF writer helper to ensure deferred/disabled architectures fail before output creation. |
| src/mobius/integrations/gguf/_upstream.py | Extends upstream architecture payload with converter_extra_tensor_names. |
| src/mobius/integrations/gguf/_upstream_data/llamacpp_pin.json | Pins tensor family/name inventories for the audited C09 cohort, including converter-only extras. |
| src/mobius/integrations/gguf/_mmproj.py | Routes mmproj path resolution through a companion-aware resolver and allows mmproj-specific validation. |
| src/mobius/integrations/gguf/_mmproj_test.py | Adds tests covering clip allowance only in companion context and remote companion TOCTOU-style revalidation. |
| src/mobius/integrations/gguf/_draft.py | Improves safe target resource opening/validation, including non-dir_fd fallback and root stability checks. |
| src/mobius/integrations/gguf/_draft_test.py | Adds tests for safe open behavior when dir_fd isn’t supported (symlink/root-swap rejection). |
| src/mobius/integrations/gguf/_builder.py | Adds early architecture gating semantics, a structural GGUF header parser, and Hub exact-file mmproj preflight + immutable revision pinning path. |
| src/mobius/integrations/gguf/_builder_test.py | Adds regression tests ensuring early failure before downstream stages and validates exact-file mmproj preflight behavior. |
| src/mobius/integrations/gguf/_arch_registry.py | Registers C09 cohort architectures as DEFERRED with explicit reasons to prevent incorrect task aliasing. |
| src/mobius/integrations/gguf/_arch_registry_test.py | Pins C09 inventory expectations and asserts misdispatch refusal invariants. |
| docs/api/build_from_gguf.md | Documents the C09 cohort audit/pinning and mmproj companion header preflight behavior. |
Suppressed comments (1)
src/mobius/integrations/gguf/_builder.py:449
kv_countis a count of metadata entries but it’s currently compared tolen(data)(bytes), which doesn’t provide a real safety bound. This also means a crafted header can pick a very large (but still <= len(data))kv_countand force a long loop before hitting a truncation error. Add a byte-derived upper bound (based on a minimal-per-entry encoding) and a reasonable hard cap.
kv_count = struct.unpack_from("<Q", data, 16)[0]
if kv_count > len(data):
raise ValueError(f"{source!r} declares an impossible GGUF metadata entry count.")
offset = 24
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+438
to
+444
| element_type, offset = read_uint32(offset) | ||
| count, offset = read_uint64(offset) | ||
| if count > len(data): | ||
| raise ValueError(f"{source!r} declares an impossible GGUF metadata array size.") | ||
| for _ in range(count): | ||
| offset = skip_value(element_type, offset, depth=depth + 1) | ||
| return offset |
Comment on lines
+546
to
+551
| For a Hub companion reference, Mobius range-reads only the bounded metadata | ||
| header of the exact selected filename, verifies that file is `clip`, resolves | ||
| the repository ref to an immutable commit, and downloads that same revision. | ||
| Repository-level GGUF metadata is not used because mixed text+mmproj repositories | ||
| describe the text architecture there. The downloaded local header is validated | ||
| again before multimodal builder dispatch. |
justinchuby
added a commit
that referenced
this pull request
Aug 25, 2026
Preserve the post-#586 fail-closed quantization policy during the hybrid cohort replay. Keep explicit float fallback execution coverage, validate the complete MTP schedule, and pin the new quantized-import architectures. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
justinchuby
added a commit
that referenced
this pull request
Aug 25, 2026
## Summary - add pinned llama.cpp GGUF support for `lfm2`, `qwen35`, `qwen35moe`, and `qwen3next` - reconstruct exact per-layer attention/recurrent schedules and validate architecture dimensions and metadata fail-closed - enforce suffix-exact mixer tensor contracts, safe fused expert/V-head transforms, and no-drop quantization handling - emit deterministic mixed KV/conv/recurrent state ABIs and reject incompatible generic/static cache tasks - document pinned real-artifact header censuses and keep all four runtime verdicts deferred pending independent full-logit and stateful generation parity Stacked on #586 (`justinchuby-add-audio-codec-gguf-cohort`). Routed-expert Qwen3.5-MoE/Qwen3-Next MTP blocks are explicitly rejected until the MTP sidecar can represent their experts; dense Qwen3.5 MTP remains supported. ## Validation - `1640 passed` — full `src/mobius/integrations/gguf` suite - `6105 passed, 52 skipped` — broad non-integration suite - two unchanged unrelated `glm_moe_dsa` failures remain in ONNX checker/output shape inference - full `lintrunner f --output oneline --all-files` passed - final high-confidence review found no significant issues --------- Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5e542579-8cc6-4fcf-9019-0af2824b73bf
justinchuby
added a commit
that referenced
this pull request
Aug 25, 2026
## Summary - validate GGUF metadata tables before invoking `gguf.GGUFReader` - bound array counts by remaining encoded bytes and a 1,000,000-element safety cap - fast-skip fixed-width arrays and safely bound nested/string arrays - share validation with remote architecture header preflight while preserving big-endian files and continuation shards - add adversarial coverage for huge counts, truncation, nested arrays, and the valid cap boundary ## Tests - `python -m pytest src/mobius/integrations/gguf/_reader_test.py src/mobius/integrations/gguf/_builder_test.py -q --tb=short` - `python -m pytest src/mobius/integrations/gguf/_reader_test.py src/mobius/integrations/gguf/_builder_test.py src/mobius/integrations/gguf/_shard_set_test.py src/mobius/integrations/gguf/_preflight_test.py -q --tb=short` - `python -m pytest src/mobius/integrations/gguf/_docs_test.py -q --tb=short` - `python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q -k "not phi4mm and not apply_weights_unknown" --tb=short -n auto` - `lintrunner f --output oneline src/mobius/integrations/gguf/_header.py src/mobius/integrations/gguf/_reader.py src/mobius/integrations/gguf/_reader_test.py src/mobius/integrations/gguf/_builder.py src/mobius/integrations/gguf/_builder_test.py` Follow-up to review comment #586 (comment). Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pockettts,qwen3tts,talkie, andwavtokenizer-decagainst llama.cpp8d9af256337d1a501250f9bbf4c0859a654bddd6Decisions
pockettts_spkencandpockettts_gensidecars; its primary GGUF has no semantic LM head.Qwen3TTSForConditionalGenerationorQwen3TTSTokenizerV2Model; speaker encoder, 15-codebook predictor, and code-to-wave decoder are companion-owned.T x 1282ISTFT parameters, not waveform audio; exact 24-kHz/hop-320 reconstruction remains processor-owned.All four remain
DEFERRED: the GGUFs are valid, but complete Mobius graphs and independent parity evidence do not yet exist.Validation
python -m pytest src/mobius/integrations/gguf/_arch_registry_test.py src/mobius/integrations/gguf/_upstream_gap_test.py src/mobius/integrations/gguf/_builder_test.py -q --tb=short(876 passed)glm_moe_dsashape-inference failure (5,989 passed, 52 skipped)lintrunner --output oneline --all-files