Define bit exact correction fallback and cost gate

This commit is contained in:
Pavlo Ratushnyi
2026-10-03 11:17:38 +02:00
parent 53aa45f75b
commit 7bf263b4bc
+12
View File
@@ -83,6 +83,18 @@ The streamed preparer tracks relative L2 and encoded bytes per KAR record and pr
An experimental KAR overlay now carries higher-precision replacement records for a selected subset without rebuilding the full archive. Its provenance binds the base archive and candidate policy digests; selected physical and virtual source digests are checked during encoding. The overlay is independently verified, and the CPU comparison command measures paired full-record error against both archives. A serving loader must still select overlay records by name, verify both artifacts together, and account for their VRAM residency and transfer before this can affect inference. An overlay is not an additive residual: it replaces the selected base record when enabled.
If selective higher precision does not pass the model-quality gate, an exact
correction tier can be evaluated separately. Its contract is bitwise equality
to a named GGUF dequantization baseline, including values such as signed zero;
ordinary floating-point addition of a residual is not sufficient to promise
that. One candidate is an XOR of the base F32 bit pattern with the reference
F32 bit pattern, packed in independently addressable blocks and decoded on
CUDA. Another is to retain exact original GGUF quantized blocks for selected
tensors. In both cases, record the bytes of the base plus correction, PCIe
traffic, CUDA decode cost, and full-model quality. If exact data removes the
size or transfer advantage, the exact tier is a correctness fallback rather
than a performance win.
`model resolve-kar-overlay --base BASE.kar --overlay OVERLAY.kar` now emits a verified tensor-to-archive mapping for a future loader. It recomputes both archive SHA-256 values, validates every payload CRC, checks the shared virtual-F32 source identity, and rejects a replacement with a different source digest, offset, or dimensions. The command does not load weights or enable overlay serving. Keep both archives immutable after resolution; a GPU loader must validate their identities again before using this mapping.
The isolated Linux CUDA smoke target accepts an optional overlay path and routes a requested tensor to the selected archive after payload, common source identity, name, shape, dtype, per-record source digest, and source-offset checks. `--row ROW_ID` selects one local row of a compressed record and decodes it into a one-row GPU output buffer after staging that record's complete compressed level prefix. Run the full Rust resolver first for complete archive hashes and provenance. This exercises compressed VRAM residency and CUDA decoding for one selected record when the GPU is available; it does not integrate with Strata's matrix multiplication, schedule a model, or pass the quality gate.