Skip to content

loom coverage: UD (Unsloth Dynamic) quants are quants (engine#3156) - #3508

Merged
bong-water-water-bong merged 1 commit into
mainfrom
loom-coverage-ud-quants
Nov 25, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
loom-coverage-ud-quants

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

loom_coverage_check.py cannot name an Unsloth Dynamic quant, so every UD-* card and row comes back with no quant at all. On the rows this repo actually gates, that reads as a false negative:

before  REQUANT   Qwen3.8-27B-UD-Q4_K_XL.gguf   unsloth-Qwen3.8-27B-UD-Q4_K_XL has (no quant named), we ship None
after   COVERED   Qwen3.8-27B-UD-Q4_K_XL.gguf   unsloth-Qwen3.8-27B-UD-Q4_K_XL (UD_Q4_K_XL) sha256 2a5f3565f39c

That row is routed and gate-passed (#3390, #3395), and the card binds our pinned bytes — the tool just could not say so.

Cause

QUANTS = re.compile(r"Q\d+_K_[MSL]|Q\d+_\d|IQ\d+_[A-Z]+|BF16|F16|MXFP4|AWQ", re.I) stops at Q4_K_M-shaped tags: Q4_K_XL matches nothing (X is not in [MSL]), so quant_of() returns None for the row and identity() names nothing for the card. Two smaller breaks hid behind it: the row's spelling comes from a file name (UD_Q4_K_XL) while the card's comes from its lock (UD-Q4_K_XL), and ud/xl survive _quant_token() as name tokens, so Qwen3.5-4B-UD-Q4_K_XL could not match the card Qwen3.5-4B-GGUF-loom at all.

Fix

  • QUANTS also matches UD[-_]?Q\d+_K_[A-Z]+ and Q\d+_K_[A-Z]+.
  • canon_quant() gives one spelling for comparisons (_ → -, upper).
  • _quant_token() drops the standalone ud / xl / xs / xxs tokens: they qualify the quant, so they must not separate a card from its row.

No verdict changed shape; the three verdicts still come from the same gate.

Evidence

Self-test unchanged: loom_coverage_check self-test: 11 ok, 0 failed.

Rows for the shipped cards that were not readable before the fix (card trees: the four 1bit-* cards staged from HF, plus the GLM card), same command, same pins:

COVERED Qwen2.5-Coder-1.5B-Instruct-Q4_K_M.gguf  Qwen2.5-Coder-1.5B-Instruct-GGUF-loom (Q4_K_M) sha256 cc324af070c2
COVERED Qwen2.5-Coder-7B-Instruct-Q4_K_M.gguf    Qwen2.5-Coder-7B-Instruct-GGUF-loom   (Q4_K_M) sha256 509287f78cb4
COVERED Qwen3-4B-Q4_K_M.gguf                     Qwen3-4B-GGUF-loom                    (Q4_K_M) sha256 f6f851777709
COVERED Qwen3.5-4B-UD-Q4_K_XL.gguf               Qwen3.5-4B-GGUF-loom              (UD_Q4_K_XL) sha256 b252c5610a42

Negative control, so this is not "matches everything now": a plain Qwen3.8-27B-Q4_K_XL row (no UD marker) matches bartowski-Qwen3.8-27B-loom and still reports the real disagreement —

REQUANT Qwen3.8-27B-Q4_K_XL.gguf  bartowski-Qwen3.8-27B-loom has ['Q4_K_M'], we ship Q4_K_XL

Refs #3156. Pairs with #3507 (our own 1bit-* cards were invisible): with both, the checker can answer for the cards and the quants the checklist actually ships.

QUANTS stopped at Q\d+_K_[MSL], so every UD-* card and every UD-* row named no quant at all:
the routed, gate-passed Qwen3.8-27B row read 'REQUANT ... has (no quant named), we ship None',
and Qwen3.5-4B-UD-Q4_K_XL read UNCOVERED, for cards that bind our pinned bytes.

Three fixes, all in the matcher, none in the verdicts:
- QUANTS also matches UD[-_]?Q\d+_K_[A-Z]+ and Q\d+_K_[A-Z]+ (XL/XS/XXS suffixes).
- canon_quant() gives one spelling, so the row's UD_Q4_K_XL (from a file name) compares equal to the
  card's UD-Q4_K_XL (from its lock).
- _quant_token() drops the standalone xl/xs/xxs/ud tokens, which qualify the quant and must not
  separate a card from its row.

Self-test unchanged (11 ok, 0 failed).
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit ebfecd8)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3156 - Partially compliant

Compliant requirements:

  • Update loom_coverage_check.py to correctly identify Unsloth Dynamic quant tags like UD-Q4_K_XL
  • Ensure that rows with UD quant formats are correctly matched to cards that bind the same pinned bytes
  • Fix false negatives in coverage checks where models with UD quant formats are not recognized as covered
  • Ensure quant tags from file names (e.g., UD_Q4_K_XL) and card locks (e.g., UD-Q4_K_XL) are normalized for comparison

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Quant Matching Issue

The QUANTS regex pattern was updated to include UD[-_]?Q\d+_K_[A-Z]+ and Q\d+_K_[A-Z]+ to match Unsloth Dynamic quant tags. This ensures that quant tags like UD-Q4_K_XL are correctly identified, preventing false negatives in coverage checks.

QUANTS = re.compile(r"UD[-_]?Q\d+_K_[A-Z]+|Q\d+_K_[A-Z]+|Q\d+_\d|IQ\d+_[A-Z]+|BF16|F16|MXFP4|AWQ", re.I)
Token Filtering Issue

The _quant_token() function was updated to filter out standalone tokens like xl, xs, xxs, and ud which are qualifiers for quant tags. This prevents mismatches between model names in rows and card identifiers, ensuring that quant qualifiers do not interfere with model name matching.

return bool(re.fullmatch(r"i?q\d+([_-][a-z0-9]+)*|f16|bf16|mxfp4|awq|xl|xs|xxs|ud", t))
Quant Normalization Issue

The canon_quant() function was added to normalize quant tags for comparison, ensuring that formats like UD_Q4_K_XL from file names and UD-Q4_K_XL from cards are treated as equivalent. This prevents mismatches due to different naming conventions in the tool's matching logic.

def canon_quant(q):
    """One spelling for a quant tag: `UD_Q4_K_XL` from a file name and `UD-Q4_K_XL` from a card must compare
    equal, and the UD (Unsloth Dynamic) prefix is part of the quant, not a model-name token."""
    return q.upper().replace("_", "-") if q else q

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit ebfecd8

@bong-water-water-bong
bong-water-water-bong merged commit d965a61 into main Nov 25, 2026
15 of 16 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the loom-coverage-ud-quants branch November 25, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant