GRIT: A Grouped Reduced-precision Interchange Type with an O(1) Checkable Boundary Contract
Prateek Singh
Block-scaled reduced-precision arrays — the MXFP4 / Q4_K / NVFP4 / sparse-INT8 family — ship in files that record element counts and dtype tags but not the contract that gives the bytes meaning: the scale-derivation rule, the zero-point convention, the sub-byte packing order, the layout of the scale planes. Producers and consumers agree on these silently, in tool source code, and in 2026 that silence produced six documented incidents of silently wrong model output across vLLM and SGLang. GRIT (Grouped Reduced-precision Interchange Type) is a descriptor language and boundary-check protocol for this family: a GRIT array is a quadruple (Grade, Placement, Planes, Shape) serializing to a fixed-layout 64-byte POD descriptor, and a consumer verifies descriptor-vs-bytes agreement in O(1) — measured at 296 ns per call in C — at every load boundary, with a total check that terminates with exactly one status on any 64 bytes. A normative specification fixes decode() semantics through an explicit law set (NaN poison, sparse-wins-over-poison, slice honesty, group-axis transpose as requantization, fixed evaluation order, no FMA substitution, placement invariance). Five zero-dependency implementations — C11, C++20, Rust, pure-stdlib Python, strict TypeScript — reproduce a 68-vector SHA-256-pinned conformance suite and agree bit-for-bit on 96/96 cross-language descriptor fingerprints, re-proven by CI on every push. A read-only scanner audits existing GGUF and safetensors checkpoints with no adoption required; a two-run field study on four real checkpoints (12 findings as first shipped, 349 after closing three inference gaps on bit-identical bytes, with a known-clean control at zero) demonstrates that the mismatch classes exist in deployed artifacts, including GPTQ and AWQ zero-point planes that are byte-identical while carrying opposite conventions.