Q4_K SMOKE TEST — CORRECTED
===========================

WHAT WAS WRONG
--------------
In the sidecar's PHASE2_VERIFIED.txt, section 4 (GGUF LOADER + DEQUANTIZATION),
every quant format is verified "exact" against known values — except one:

    - Q4_K superblock decode -> PASS (smoke)

A smoke test only confirms the decoder RAN without crashing. It does not check
that the reconstructed weights are correct. A wrong 6-bit scale/min unpack, a
swapped d/dmin, or an off-by-one in the superblock stride would all still
"PASS (smoke)" while silently producing garbage weights — the exact failure
mode that stays invisible until a real model gives nonsense tokens. Q4_K is the
most error-prone path (6-bit packed scales, min-subtraction, 256-elem
superblock), so it is precisely the one that needed exact verification, not the
weakest test.

THE ORACLE (from ollama-black-box1)
-----------------------------------
The black-box GGUF_V3_FORMAL_SPEC.md pins Q4_K down: type id 12, 256 elems per
block, 144 bytes per block. Its Q8_0 proof shows the correct methodology —
construct a block with known bytes, decode, assert exact float values. The
correction applies that same standard to Q4_K.

THE COMPILED DECODER IS ACTUALLY CORRECT
----------------------------------------
Disassembly of tb_infer_cpu_verified confirms tb_gguf.c's Q4_K machinery is the
canonical llama.cpp layout and math:
  - block stride 0x90 = 144 bytes                    (matches spec's 144)
  - d (f16) @ +0, dmin (f16) @ +2, scales[12] @ +4
  - q4k_unpack_scales == canonical get_scale_min_k4 6-bit unpack
  - decode: w = d*sc*q4 - dmin*m  (the vsubss after vmulss = min-subtraction)
So the bug was NOT in the decoder — it was in the TEST. The decoder was right;
the test was too weak to prove it. The fix upgrades the test to match.

THE CORRECTION
--------------
q4k_verify_test.c replaces the smoke test with 5 byte-exact assertions:
  [1] block size is exactly 144 bytes
  [2] f16 d/dmin decode exactly (0.5, 0.25 — f16-exact, no rounding excuse)
  [3] 6-bit get_scale_min unpack yields the expected sc/m for all 8 sub-blocks
  [4] decoded weights equal hand-computed reference across low- and high-nibble
      halves and multiple sub-blocks (w = 0.5 * q4)
  [5] the min-subtraction path (dmin*m) is exercised, not just the m=0 case

Build & run:
  gcc -O2 -std=c11 q4k_verify_test.c -lm -o q4k_verify_test && ./q4k_verify_test
Exit 0 = PASS, 1 = FAIL. All five currently PASS.

PHASE2_VERIFIED.txt line 47 should now read:
  - Q4_K superblock decode -> PASS (byte-exact: 144B block, 6-bit scale/min
    unpack, min-subtraction, decoded values vs reference)
