Repository navigation
Record fail-closed MiniCPM tokenizer evidence - #660
Merged
Merged
Conversation
Performance Comparison
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds pinned, fail-closed tokenizer mismatch evidence for MiniCPM GGUF artifacts (MiniCPM-2B and MiniCPM3-4B), binds that evidence to a fixed llama.cpp oracle corpus, and updates GGUF tokenizer inspection logic to allow only architecture-scoped legacy pre=default combinations while keeping tokenizer materialization deferred.
Changes:
- Add a new MiniCPM tokenizer oracle fixture (
444cases/route) and bind it to new mismatch-evidence records. - Extend
inspect_gguf_tokenizer()to accept legacytokenizer.ggml.pre="default"only for PLaMo2 andgeneral.architecture in {"minicpm","minicpm3"}undermodel="llama". - Introduce
GGUFTokenizerMismatchEvidencerecords + documentation table for pinned fail-closed routes, with tests ensuring they do not promote the genericdefaultcensus route.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/data/gguf_minicpm_tokenizer_oracle.json | Adds pinned llama.cpp oracle fixture metadata and first-mismatch witnesses for MiniCPM routes. |
| src/mobius/integrations/gguf/_tokenizer.py | Scopes legacy pre=default acceptance to MiniCPM architectures and PLaMo2 while keeping deferred materialization. |
| src/mobius/integrations/gguf/_tokenizer_test.py | Adds unit tests asserting MiniCPM legacy-default handling is architecture-scoped and still rejected elsewhere. |
| src/mobius/integrations/gguf/_tokenizer_mismatch_evidence.py | Adds immutable fail-closed mismatch evidence records with strict self-validation. |
| src/mobius/integrations/gguf/_tokenizer_evidence_test.py | Binds new oracle fixture to mismatch evidence and ensures mismatch evidence can’t promote the generic default route. |
| src/mobius/integrations/gguf/_docs.py | Renders a new “Pinned fail-closed tokenizer evidence” table from live mismatch records. |
| docs/api/build_from_gguf.md | Updates the published docs with the new fail-closed tokenizer evidence table. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
justinchuby
force-pushed
the
justinchuby-exact-minicpm-gguf
branch
from
August 27, 2026 06:02
4208326 to
caa94d3
Compare
Pin bounded GGUF headers and official tokenizer assets for MiniCPM and MiniCPM3, then preserve the score, type, merge, chat-template, and llama.cpp oracle divergences as architecture-scoped fail-closed evidence. Keep the legacy default pre identifier deferred rather than promoting its generic route. Co-authored-by: Copilot App <[email protected]> Copilot-Session: efad223f-3973-40c7-b001-e292e139f0bf Signed-off-by: Justin Chu <[email protected]>
Add an exact deterministic corpus and bounded-header refresh workflow that builds llama-tokenize from a clean pinned checkout, regenerates oracle hashes and mismatch witnesses, and is covered by default CI discovery. Fix legacy architecture validation and ambiguous Unicode lint findings. Co-authored-by: Copilot App <[email protected]> Copilot-Session: efad223f-3973-40c7-b001-e292e139f0bf Signed-off-by: Justin Chu <[email protected]>
Move MiniCPM and MiniCPM3 negative tokenizer evidence into the shared blocker registry introduced for PLaMo. Generalize that registry for zero-merge SentencePiece metadata while preserving bounded-header, source divergence, and reproducible oracle closure. Co-authored-by: Copilot App <[email protected]> Copilot-Session: efad223f-3973-40c7-b001-e292e139f0bf Signed-off-by: Justin Chu <[email protected]>
justinchuby
force-pushed
the
justinchuby-exact-minicpm-gguf
branch
from
August 27, 2026 07:56
caa94d3 to
44daccf
Compare
This was referenced Aug 27, 2026
justinchuby
added a commit
that referenced
this pull request
Aug 27, 2026
## Summary - canonicalize only the MiniCPM oracle generator source as explicit UTF-8 with LF line endings before computing `generator_sha256` - render, write, and `--check` the oracle fixture as exact UTF-8/LF bytes - pin the committed MiniCPM oracle fixture to LF in Git so Windows clean checkouts remain byte-canonical - add network-free LF/CRLF regression coverage without changing tokenizer semantics, pinned evidence, or expected result hashes ## Root cause PR #660 hashed `Path(__file__).read_bytes()`, so Git CRLF conversion changed the generator identity on Windows. Its text-mode fixture write/check boundary also allowed platform newline translation and universal-newline comparisons rather than enforcing one canonical artifact. ## Validation - `python -m pytest tests/generate_minicpm_tokenizer_oracle_test.py src/mobius/integrations/gguf/_tokenizer_evidence_test.py -q --tb=short` — 32 passed - `python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q -k "not phi4mm and not apply_weights_unknown" --tb=short` — 8,616 passed, 63 skipped, 12 deselected, 1 subtest passed - `lintrunner f --output oneline --all-files` — passed - independent GPT-5.6 Sol medium review — one Windows checkout finding fixed by pinning the fixture `eol=lf`; affected gates rerun successfully Signed-off-by: Justin Chu <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: efad223f-3973-40c7-b001-e292e139f0bf
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
llama.cpp@8d9af256337d1a501250f9bbf4c0859a654bddd6pre=defaultcombinations architecture-scoped and fail closed; the genericdefaultcensus route remainsdeferred-compiled-semanticsDisposition
mzwing/MiniCPM-2B-sft-bf16-GGUF@121e7290609857006939fca0ec64981009b806b9, Q2_K9e87235097895a22894c32a1e211f94b93b798d715cc7d99c8e846637927fd13openbmb/MiniCPM-2B-sft-bf16@4ec16344ac13e6ef5010aeecaa533369ac8eb53copenbmb/MiniCPM3-4B-GGUF@816dc79b35f92827e0d2d87aacea3567e49661a8, Q4_K_M64913247e927414ecf47fd3e9ea8e3f0c9acae293f583dfa7e24b8872e20fa4copenbmb/MiniCPM3-4B@d6b14ddaefdb11c624dd75c3c779549bc90b08cbBoth GGUFs flatten scores to
-1000, omit the official BPE merge tables, alter token types, and carry divergent chat templates. The first oracle mismatch is standalone你好,世界!: MiniCPM llama.cpp IDs[29951, 95495, 65, 2925, 67]vs source[95320, 23523, 65, 2925, 67]; MiniCPM3 IDs[29951, 59495, 65, 2925, 67]vs[59320, 23523, 65, 2925, 67].Tests
lintrunner f --output oneline --all-files