Skip to content

IQ1_S/IQ1_XXXS decode: three parameter defects pass the whole gate (self-referential reference decode) #1017

Description

@localai-bot

Found by an independent review of PR #946. The author self-reviewed and merged it; these were missed. Row ENG-EXPERT-STREAM, spec .agents/specs/expert-streaming.md.

F1 (HIGH): every decode parameter except the grid is pinned only by self-consistency

ReferenceDotF64 (tests/vt/test_ops_quant_dot.cpp:231-236), which the case comment calls "the INDEPENDENT reference", decodes the weight with vt::cpu::BlockToFloat(wtype) — the very function under test. The MatmulBTQuant NMSE reference does the same (:915). Both are independent only in the SUMMATION, never in the DECODE.

Three mutations, each applied and compiled, are UNCAUGHT by the entire gate with assertion counts unchanged:

Mutation Meaning
kIq1sDelta 0.125F -> 0.25F 2x error in the reconstruction offset, BOTH encodings
IQ1_S delta sign inverted (dequant + vec_dot) qh bit 15 means the opposite of upstream
IQ1_S scale from qh bits 13-15 instead of 12-14 off-by-one field position

The grid table IS sealed (FNV-1a digest + lane census) and that seal WORKS: corrupting a grid entry is caught. The seal simply stops one table short of the parameters around it.

Failure mode: silently wrong tokens from a 2.4 T model with every gate green.

F2 (MEDIUM-HIGH): the 2e-3 NMSE ceiling hides a real decode defect

tests/vt/test_ops_quant_dot.cpp:148,153. Measured: unmutated max 5.24e-4 (iq1_s, m=4, n=1); with delta=0.25 it is 6.97e-4.

Ceiling Unmutated + delta 0.25
6e-4 GREEN RED
2e-3 (as merged) GREEN GREEN

The measurement required 1.05x; the ceiling was set at 3.8x. Violates AGENTS.md: "Never make a red gate green by deleting an assertion or widening its scope." The figures quoted in the merged commit (3.8e-4 / 3.8e-5) do not reproduce against the tree.

F3 (MEDIUM): the loader expand path refuses 19 and 66 although vt decodes them

src/vllm/model_executor/model_loader/gguf_dequant.cpp:107-116 / :181 has no case 19 / case 66. RouteGgufTensor routes to kExpandBf16 whenever cpu_ref is set (the oracle switch), keep-quant is off, K is ragged, or the role is not verbatim, so the reference lane cannot load the target checkpoint. ggml 18 (IQ3_XXS) has the same pre-existing omission. Violates "Nothing lands dead" and the refuse-by-name rule.

Lower

  • F4: W9's declared gate slice says "CPU tests green against upstream-derived vectors"; no upstream-derived vectors for IQ1_S exist.
  • F5: cpu_quant_dot.cpp:591 claims this kernel reads bsums "and the others do not"; Q2_K, Q4_K and Q5_K already do.
  • F6: cpu_quant_iq_tables.h:1-5 still declares the file a 1:1 mirror of one repo while carrying a table from another, and indexes neither new table.
  • F7: the census tests claim TOTAL coverage of 1702 records but enumerate 6 of 7 encodings (F32 missing), summing to 864.

Remediation

Seal kIq1sDelta against upstream IQ1S_DELTA as the grid is sealed, and commit golden vectors for both encodings so at least one reference is not the tree's own decoder. Set the NMSE ceiling from the measurement or fix the unstable n=1 estimator instead of widening globally. Add the two missing dequant cases.

Owning row: ENG-EXPERT-STREAM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions