Skip to content

Validate Gemma4 GGUF tokenizer reconstruction - #651

Merged
justinchuby merged 6 commits into
mainfrom
justinchuby-verify-gemma-tokenizers
Aug 27, 2026
Merged

justinchuby merged 6 commits into
mainfrom
justinchuby-verify-gemma-tokenizers

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  • validate exact gemma4 GGUF-native tokenizer reconstruction against immutable artifact/source pins and llama.cpp 8d9af256337d1a501250f9bbf4c0859a654bddd6
  • preserve granite-embed-multi-311m as deferred: its pinned modern-bert artifact declares no pre and only exercises effective fallback gemma4
  • commit exact llama.cpp outputs plus deterministic Gemma4 qualification inputs; network-free tests reconstruct through the current production path and compare all 480 tokenization and detokenization outputs
  • verify the pinned 6,309,288-byte archive SHA before decompression, then strictly stream USTAR under a 48,025,600-byte ceiling with exact regular-member names/count/sizes/hashes, duplicate rejection, zero padding, and no PAX/GNU extensions or trailing data
  • prove behavior and archive-policy drift fail through cleanup mutation and adversarial archive regressions
  • keep artifact revisions in evidence only and scope Gemma control-token exceptions to GEMMA4 validation

Evidence

  • Gemma4: unsloth/gemma-4-E2B-it-GGUF@0314792d7f1f7e229411f620751375812bb9faf2, gemma-4-E2B-it-UD-IQ2_M.gguf, 2,290,860,128 bytes, SHA-256 3d95ada2a122c9c0b42803317239b64b262ac9226a307ff895b3d87eec0c2acd; 480/480 native tokenize and detokenize cases match
  • Granite fallback: SandLogicTechnologies/granite-embedding-311m-multilingual-r2-GGUF@f142535239859391fbef67aaf886d96500ad9fa8, 240,602,528 bytes, SHA-256 4cddb0ecb0ee45fcd1da37c007a608662568477a76ce5e12c14f7b34f002709e; 480/480 fallback cases match without promoting the absent exact identifier

Validation

  • full generator --check against pinned llama.cpp and immutable inputs
  • focused tokenizer/oracle/docs/census: 124 passed
  • adversarial archive coverage: compressed tamper/truncation, extra/duplicate/missing members, oversize, bad hash, symlink, PAX extension, decompression ceiling, and nonzero trailing data
  • broad serial: 8,627 passed, 64 skipped, 12 deselected
  • lintrunner --output oneline --all-files
  • targeted mypy for all changed production/evidence/generator files
  • iterative independent review; final review found no significant issues

@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 26, 2026 15:20
@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 20a29ed → 4048785

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 68 68 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 105 105 +0.0% ⚪
gpt2 model_size_bytes 324 KB 324 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 60 60 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 56 56 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 94 94 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 58 58 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 54 54 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 60 60 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 265 265 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 127 127 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 450 450 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 176 176 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

justinchuby added a commit that referenced this pull request Aug 27, 2026
## Summary

- classify every unresolved authoritative GGUF architecture, projector,
tokenizer, MTP, and speculative-draft route exactly once
- generate concrete implementation, evidence, ABI/dependency, artifact,
and rejection batches from live registries
- preserve exact registry reasons in machine-readable census records and
reconcile PRs #645, #651, #652, and #656 without claiming open work as
supported
- distinguish ordinary runtime evidence from ORT GenAI
heterogeneous-state schema issue #605
- pin availability-only F16/Q8_0 sidecar identities for LFM2-VL and
Pixtral without implying tensor closure, graph parity, or runtime
support

## Census

- 285 unresolved routes: 144 architectures, 60 projectors, 57
tokenizers, 22 MTP routes, and 2 draft routes
- 67 immediately implementable
- 95 evidence-only
- 100 dependency/runtime-ABI blocked
- 4 artifact unavailable
- 19 intentionally rejected

## Validation

- generated documentation check
- 1,371 focused GGUF tests passed, 1 skipped
- broad deterministic suite: 8,467 passed, 62 skipped, 1 subtest passed
- Ruff/format lint passed
- strict mypy passed for changed source modules
- independent incremental review found no significant issues

## Waivers

- no large model payloads downloaded; availability pins use immutable
repository revisions plus API-reported LFS SHA-256 and byte size
- open PRs #651/#652/#656 are dependency records only and are not
promoted as current-main capability
- no unsupported cache/state ABI is forced; packed quantized support
remains governed by existing fail-closed capability records

Do not merge yet.

---------

Signed-off-by: Justin Chu <[email protected]>
Copilot-Session: d1a98adf-88cb-471b-8c46-7a84083db24c
justinchuby and others added 3 commits August 27, 2026 08:29
Add artifact-scoped Gemma4 native reconstruction evidence against the pinned llama.cpp oracle, while keeping granite-embed-multi-311m deferred because its modern-bert artifact only exercises the absent-pre Gemma4 fallback. Preserve declared and effective tokenizer pre identities separately in the census and generated documentation.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Record the exact GGUF-only type-4 token range and the Gemma4 fallback control/EOG override without promoting the absent granite-embed-multi-311m route.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Replace hash-only route summaries with a deterministic bounded-header generator and committed exact llama.cpp token and detokenization outputs. Scope Gemma-specific control-token exceptions to GEMMA4 validation and preserve Granite as a deferred fallback-only route.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-verify-gemma-tokenizers branch from 858f0ce to e19e67b Compare August 27, 2026 15:43
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 20a29ed → 4048785

Model Sub-model Changes Status

No architecture changes detected. ✅


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

justinchuby and others added 3 commits August 27, 2026 08:58
Commit deterministic bounded-header and official tokenizer inputs so network-free tests materialize the current production reconstruction and compare all 480 llama.cpp tokenization and detokenization results. Add a cleanup-policy mutation proving behavior drift fails the replay.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Verify the pinned compressed archive identity before streaming XZ/tar extraction. Enforce the exact regular-file allowlist, member sizes and hashes, duplicate rejection, payload totals, and decompression ceiling with adversarial regressions.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Observe every streamed tar header directly so PAX and GNU extensions cannot bypass validation, and require all bytes after the USTAR terminator to be zero. Cover hidden extension headers and nonzero trailing data with adversarial tests.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby merged commit 0cea508 into main Aug 27, 2026
23 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-verify-gemma-tokenizers branch August 27, 2026 17:57
justinchuby added a commit that referenced this pull request Aug 27, 2026
Close standalone Granite attention-factor metadata, record merged PR #651 in the authoritative route census, and regenerate deterministic GGUF support documentation after rebasing the cohort.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 27, 2026
Close standalone Granite attention-factor metadata, record merged PR #651 in the authoritative route census, and regenerate deterministic GGUF support documentation after rebasing the cohort.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 27, 2026
Close standalone Granite attention-factor metadata, record merged PR #651 in the authoritative route census, and regenerate deterministic GGUF support documentation after rebasing the cohort.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 71862fcb-bc9a-4734-b047-b5376afabc3e
Signed-off-by: Justin Chu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants