Files
leleka/docs/build-validation.md
T

48 KiB
Raw Blame History

Build validation

2026-10-02 — source-only build

  • Strata upstream commit: d9ab8435f654c368c586340d490915f6addf56a3.
  • Host: macOS arm64; AppleClang 21.0.0; CMake 3.31.10; Ninja 1.13.2.
  • Command: PATH="$PWD/artifacts/tool-venv/bin:$PATH" scripts/build-cpu.sh.
  • CMake flags: CUDA off, HIP off, upstream broad test suite off, conversation tests on.
  • Built: strata-gguf, strata-dequant, strata-plan, and five CPU test executables.
  • Result: 5/5 CTest tests passed.
  • Scope: source compilation and CPU tests only. No CUDA build, model inference, or performance measurement was performed.

The test toolchain was installed into ignored artifacts/tool-venv/ for this run; it is not a production dependency.

2026-10-02 — Rust control-plane smoke test

  • cargo fmt --check and cargo check --locked passed with Rust 1.95.0.
  • With no worker configured: /health returned 200 and /ready returned 503.
  • With an ignored local fake engine that emitted READY 262144 stop: /ready returned 200 with max_context: 262144; Ctrl-C shut down both processes.
  • With a fake engine that exited after READY: /ready returned 503 with worker: failed.
  • /v1/responses is not implemented and returned 404. No model inference was tested.

2026-10-02 — local worker contract checks

  • Added JSON file configuration with environment overrides and a bounded startup timeout.
  • Four local tests pass against a fake engine process: valid READY handshake, graceful QUIT, worker exit, and startup timeout.
  • The tests require neither the RTX 5090 nor model files.

2026-10-02 — Responses contract and Rust 1.99

  • Pinned Rust 1.99.0 with rust-toolchain.toml and rust-version = "1.99".
  • scripts/check-local.sh passed: rustfmt, Clippy with warnings denied, 12 Rust tests, synthetic Responses SSE replay, and 5 CPU CTest tests.
  • The replay checks the local response builder and Strata pipe parser only. /v1/responses still returns an explicit 501 when the worker is ready because the inference adapter is not connected.
  • No CUDA build, model inference, real Codex replay, or performance measurement was performed.

2026-10-02 — internal worker generation exchange

  • A fake resident worker accepted a GEN command and returned PP, T, and DONE through the Rust supervisor.
  • Context admission rejected a request exceeding the worker's READY 262144 limit without failing the worker.
  • Rust 1.99 Clippy with warnings denied and all 13 Rust tests passed. This is a pipe test only; the HTTP inference adapter is still absent.

2026-10-02 — model CLI and Linux delivery preparation

  • Added an embedded, commit-pinned IQ3_S manifest, resumable model fetch, full-size/SHA-256 model verify, and bounded GGUF v3 model inspect.
  • scripts/check-local.sh passed on macOS arm64 with pinned Rust 1.99.0: rustfmt, Clippy with warnings denied, 18 Rust tests, synthetic Responses SSE replay, and 5 CPU CTest tests.
  • The interrupted-transfer test resumes a local HTTP fixture and rejects a corrupted final file. The GGUF test parses a synthetic v3 header and rejects truncation.
  • The real 83.6 GB model was not downloaded or inspected. The Hub-provided LFS ETags are recorded as expected SHA-256 values but have not been measured locally.
  • The Linux/arm64 Docker musl CLI image built and its --version command ran inside a scratch container. The current source was also cross-compiled locally for aarch64-unknown-linux-musl; file reported a statically linked ELF, and readelf found no interpreter or dynamic section.
  • Mounted the current binary into that scratch image. It fetched Rust 1.99.0's pinned README over HTTPS (3,304 bytes), verified the manifest SHA-256 (b3f6ef2fef88b98cb9ec013a5c86213095e53e40eb228679574e4d06517f33c8), and matched the host reference byte for byte. This verifies embedded TLS roots and the small-file acquisition path, not the 83.6 GB model transfer.
  • The Strata Next GitHub repository does not exist yet. This local checkout has only the strata-upstream remote, so the workflow has not run on GitHub Actions. No GPU node was used.

2026-10-02 — worker cancellation contract

  • A dropped generation receiver now causes STOP, drains the worker's terminal DONE, and leaves the resident worker ready for a second request.
  • Shutdown during an active generation sends STOP before QUIT and closes the pending result receiver.
  • The two focused fake-worker tests pass, along with Rust 1.99 Clippy with warnings denied. No GPU inference was used.

2026-10-02 — native tokenizer asset extraction

  • Added model extract-tokenizer for validated GGUF v3 gpt2/qwen35 metadata. It writes five tokenizer files into a staging directory and publishes the directory on completion.
  • A synthetic GGUF with vocabulary, merges, token types, special ID, and chat template produced the same parsed JSON and exact text files as the pinned upstream tools/strata_tokenizer.py (5/5 files). The upstream comparison used Python regex only as an offline test dependency under ignored artifacts/tool-venv/.
  • Rust 1.99 formatting, Clippy with warnings denied, and 21 Rust tests passed at this stage. The real model tokenizer and packed weights were not validated.

2026-10-02 — native BPE parity

  • Added qwen35 byte-level BPE encoding and decoding in Rust, including rank-ordered merges, a heap path for long pieces, control and user-defined literal handling, and a CLI path for text on standard input.
  • Compared 20 corpus strings in both special-token modes against the pinned upstream Python tokenizer with a synthetic complete byte vocabulary: 40/40 token-ID sequences and decoded strings matched. Cases included multilingual text, emoji, combining marks, C0 bytes, long repeated text, and near-miss literals.
  • Added fixed oracle ID cases to Rust tests. The real IQ3_S tokenizer and end-to-end generation remain untested.
  • scripts/check-local.sh passed after this change: rustfmt, Clippy with warnings denied, 24 Rust tests, synthetic SSE replay, and 5 CPU CTest tests.
  • Rebuilt the current source as a statically linked Linux/arm64 musl CLI. Mounted it into the scratch image and confirmed model tokenize returned the oracle IDs for Hello, world!. The actual model weights and GPU were not used.

2026-10-02 — text inference preview and KAR-2 verification

  • Qwen text-only prompt assembly matches eight pinned upstream golden cases byte for byte. A synthetic in-process worker receives the expected native token IDs through the HTTP Responses route and returns a completed non-streaming text response. Live streaming, reasoning output, tools, and real-model inference remain unverified.
  • Added bounded KAR-2 metadata inspection, streaming CRC-32 verification of every tensor section, and optional source-manifest verification. The latter checks each shard's size and SHA-256, then hashes the shards in ascending byte-wise filename order against the archive's source digest and byte count.
  • Independently generated a 1,280-byte two-tensor RAW/NESTED archive with koference r08/code/kar_container.py at commit 806d2398ae1daaceb2917242911e5680cbfb3608. Its Python reader and the Rust model verify-kar both accepted the archive and both tensor CRCs. A two-file synthetic source manifest passed the Rust source-identity check. The temporary archive and source bytes were kept out of Git.
  • Rust 1.99 formatting, Clippy with warnings denied, and 31 Rust tests pass after adding a disk-space preflight that rejects an impossible model transfer before networking. The full scripts/check-local.sh cannot reach CPU engine tests on this machine because CMake ≥3.24 is absent; the local GitHub Actions workflow installs CMake, but it cannot run on a hosted runner until the Strata Next GitHub repository exists.
  • Rebuilt the current CLI as a Linux/arm64 musl executable in a scratch image. --version, KAR-2 payload verification, and the optional two-shard source-identity check all ran successfully inside the image against the synthetic koference archive. This proves the current static CLI starts without a user-space loader, not that a GPU engine or real model runs. No model weights or GPU node were used.
  • Ported the koference KAR-2 container writer for already encoded RAW/NESTED tensor slices to Rust. A native two-tensor archive has the same SHA-256, 013d3daa3f8ee70feb7045eee29390cb51e16d2a8558444cc8d6cbb91918f4f2, as the independently generated reference archive at koference commit 806d2398ae1daaceb2917242911e5680cbfb3608. The writer's temporary output passes native payload verification before publication. This fixture is synthetic and does not establish model quality or a bounded-memory full-model conversion.
  • Rust 1.99 formatting, Clippy with warnings denied, and all 32 Rust tests pass with the native writer.
  • Added a GGUF tensor index that checks exact source block lengths and can hash one tensor with a fixed 1 MiB buffer. A synthetic mixed F32/IQ3_S fixture verifies offsets, lengths, and rejection of overlapping sections, a misaligned quantized row, and an unsupported type. All 33 Rust tests and Clippy with warnings denied pass; this is a source-layout check, not a KAR encoder or model conversion.
  • The model index /tmp/strata-next-index-smoke.gguf --hash CLI emitted the expected two JSON records: F32 at absolute offset 128 with 16 bytes, and IQ3_S at 160 with 110 bytes; both SHA-256 values matched the synthetic zero payloads. cargo check --locked --target aarch64-unknown-linux-musl passed with this source.
  • The KAR writer's file-backed RAW path generated the same complete archive bytes as its in-memory path, rejected a changed source digest without publishing a destination, and passed a separate 1,048,580-byte input crossing the 1 MiB copy boundary. Rust 1.99 formatting, Clippy with warnings denied, all 34 tests, and Linux/arm64 musl cross-check pass. NESTED encoded data is still in-memory, so full-model conversion is not bounded yet.
  • Added a file-backed NESTED path for already coded KAR sections. A synthetic file-backed section produces the same complete archive bytes as the in-memory writer; corrupted scale, nonzero padding, and wrong section digest each fail before publication. The path streams through 1 MiB and retains no full encoded tensor in RAM. All 35 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. The source-to-NESTED encoder is still missing, so this does not complete model conversion.
  • Added an experimental native f32-to-KAR bit-plane encoder with supplied thresholds. A synthetic four-cell pattern produced the koference word layout (0xcccccccc, 0xaaaaaaaa), then passed through the KAR writer and verifier. IEEE f16 scale conversion tests include the smallest subnormal and ties-to-even. All 37 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. Calibration fitting, IQ3_S decoding, bounded source conversion, and full-model quality remain open.
  • Added bounded CPU prefix decoding for the synthetic tensor: a five-value slice reconstructed at levels 1 and 2 exactly as the supplied f16 books specify, and an out-of-range slice was rejected. This oracle has not yet been compared with the koference GPU decoder on hardware.
  • Ported top-down nested boundary and book fitting for a supplied normalized sample. Two pinned koference Python fixtures match the Rust f32 boundary bits and f16 book values; a degenerate sample is rejected. The f64-to-f16 path avoids double rounding of fitted means. All 38 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. This only establishes synthetic calibration parity, not representative model sampling or a quality result.
  • Connected a small synthetic F32 GGUF to model prepare-f32-preview: it produced a verified KAR-2 archive with source SHA-256 f2bff437d5a53e8ddf7f43ee41acf3baebb7fb5f27eefb079f5bc1634def6f2c and archive SHA-256 fe049ca40305d5380caaa278f34a9149ae2d5761ea9544b58a0eb73775cd6810. The separate model verify-kar command passed. A valid synthetic IQ3_S GGUF was rejected by the F32 preview, without creating an archive. All 40 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. This is a bounded experimental integration path, not full-model preparation.
  • Refactored the F32 preview to write each tensor's canonical NESTED section to a private staging directory, then assemble the KAR archive from file-backed sections. The native section bytes match the in-memory writer. A two-tensor fixture succeeds and leaves no staging directory; corrupting the second tensor to NaN fails after the first section and also cleans staging without publishing an archive. The preview source-size and per-tensor limits remain; IQ3_S source decoding and full-model quality remain open.
  • Added a native IQ3_S CPU block decoder with the pinned ggml grid table (SHA-256 bd1af4945a1717c65610b0284e4628b9a1ba3b306fae3a06f6e5f597356e349f). A deterministic mixed 110-byte block produced 256 F32 values whose byte digest cfee2753d1b389fe4ee30994ff3387d4400745b8432aeb32cb4d7fced39949ec matches an independent Python calculation from the upstream layout; constant, sign, multi-block, and malformed-scale cases also pass. All 41 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. This has not been compared with a real tensor or GPU. The ggml MIT license is copied into the control binary and shown by --ggml-license.
  • Added model derive-iq3-identity for a single all-IQ3_S GGUF. It hashes the original GGUF and a virtual contiguous little-endian F32 stream, with per-tensor original/derived digests and offsets, using a 256-block input buffer; no expanded file is written. A two-tensor fixture with reversed physical and directory order matched an independently assembled F32 stream digest. All 42 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. Mixed tensor types, shard sets, real-model parity, and KAR publication remain unverified.
  • Added model prepare-iq3-preview for a small all-IQ3_S GGUF. A synthetic one-tensor input produced a KAR-2 archive with the virtual F32 source digest and a provenance sidecar binding the original GGUF, derived stream, and archive SHA-256 values. The archive passed payload verification. A preexisting sidecar blocked publication and the newly written archive was removed. All 43 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. The source decoder and compressed output have not passed a real-model quality gate or GPU test.
  • Added model verify-iq3-preview to recompute the original and virtual F32 identities, check KAR per-tensor source records and payload CRCs, and compare the provenance sidecar with the archive hash. The synthetic IQ3 preview verified; changing the sidecar's archive digest caused rejection, and restoring it passed again. A separate cargo build --locked CLI smoke generated and verified a temporary one-tensor archive: virtual F32 SHA-256 9d1f76b4ef22e4b0e1f7e8d13cd3ff91516c884e9b8aa8107c8932bfd64fed85, archive SHA-256 c4d4e843165aa2599206458f0550c24eaafe95c3dacffec5e736950e16d1769c. All 43 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check passed. This is identity/integrity verification, not an assessment of model quality or GPU behavior.
  • Added model derive-mixed-identity for one GGUF containing IQ3_S and F32/F16/BF16 tensors. A four-tensor fixture with directory order different from physical order matched the independently assembled F32 byte-stream SHA-256, including half and bfloat conversions, and the all-IQ3-only derivation rejected it. The command uses a fixed 28,160-byte source buffer and writes no expanded file. All 44 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. Mixed KAR preparation, real-model parity, and GPU quality remain open.
  • Added model prepare-mixed-preview and model verify-mixed-preview, with a separate versioned sidecar carrying each original tensor kind and digest. A four-type synthetic GGUF passed preparation and verification in Rust tests. A separate two-type CLI smoke produced a KAR archive whose virtual F32 SHA-256 was c407838a4718093d8f2699209c7cac8b998a47b937e5afe59e4c5a0af09033a7; the verifier matched the source, sidecar, KAR source records, and payload CRCs. All 45 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. The preview remains capped at 64 MiB input and is not approved for serving.
  • Added model derive-sharded-identity for manifest-pinned GGUF shards. A two-file fixture deliberately listed IQ3_S before F32 in its manifest; native derivation sorted filenames, checked both size/SHA-256 values, and assigned global F32 offsets 0 and 128. Replacing a manifest SHA-256 with the wrong value was rejected. A separate CLI smoke emitted the expected derived stream SHA-256 e529f5e2f7aac1aa5509fabe728d84ab876c64754635963825e265cd70cb8b05. All 46 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check pass. No sharded KAR archive or real-model conversion was attempted.
  • Extracted the shared one-tensor preview encoder and reconstruction check for future sharded preparation. Existing F32, IQ3_S, and mixed preview tests passed. Rebuilt the CLI and reran the pinned two-type mixed fixture: the derived F32 SHA-256 remained c407838a4718093d8f2699209c7cac8b998a47b937e5afe59e4c5a0af09033a7 and the full KAR archive SHA-256 remained 4053e787d46b2cf2bca3d67e38d06e1ee96a157e80e3155c8dbdbf36835df88c byte for byte. This is a non-lossy refactor of the preview implementation, not a quality result for the lossy format.
  • Added a CI-only synthetic mixed GGUF/KAR smoke script for the Linux musl release binary. The workflow is configured to reject an ELF interpreter or NEEDED dynamic library, run the CLI through derivation, preparation, and source/provenance/archive verification, and check the pinned derived/archive SHA-256 values before uploading. The script passed locally against the current macOS debug CLI. The hosted workflow cannot run until the Strata Next GitHub repository exists and this checkout is connected to it. Python is used only to create the CI fixture, not by production serving.
  • Added model prepare-sharded-preview and model verify-sharded-preview for two or more manifest-pinned GGUF files under the existing 64 MiB preview limit. A two-shard synthetic Rust test passed archive preparation, provenance verification, and source-record checks; changing a pinned manifest digest caused rejection. A separate CLI smoke built and verified an archive with derived F32 SHA-256 c407838a4718093d8f2699209c7cac8b998a47b937e5afe59e4c5a0af09033a7 and archive SHA-256 49206cc99935dad8ddc1cb342dfc263548285e04767237c2c377c23d33a88479. All 47 Rust tests, Clippy with warnings denied, and Linux/arm64 musl cross-check passed. No full-model conversion, CUDA decode, or throughput comparison was performed.
  • Added model prepare-sharded-streamed and model verify-sharded-streamed: the experimental path samples at most 65,536 normalized values per tensor, writes nested or exact RAW F32 sections from bounded GGUF chunks, checks per-tensor physical/virtual digests, rehashes each shard, assembles a KAR-2 archive, and binds a separate versioned sidecar. The two-shard F32/IQ3_S synthetic test verifies the archive, reconstructs a dense tensor on CPU, rejects a changed preparation level and pinned shard digest, and refuses to overwrite the archive. All 56 Rust tests and Clippy with warnings denied passed locally. The CLI reports actual archive bytes and accounted bits per weight. Real Qwen shards have not been converted, and no GPU quality or speed result exists.
  • Extended the existing static-CLI smoke script with two manifest-pinned synthetic shards. The local macOS CLI prepared and independently verified their streamed archive; its SHA-256 is pinned as 51688d265860172feca39e296f9142b1ed16800496bae4b06b4b8d8fa11d806e. This script is wired into the Linux musl workflow, but hosted GitHub Actions has not run because this checkout has no remote repository. The fixture is synthetic and says nothing about full-model size or quality.
  • Added opt-in model ensure-sharded-streamed: fetches pinned GGUF shards, verifies source bytes, creates and verifies the streamed archive, then rehashes and checks source/provenance/payload on reuse. A local CLI smoke created and reused the synthetic two-shard archive and rejected a rerun with a changed level without modifying the existing file. Full 83.6 GB model preparation has not run; the local checkout had about 121 GiB free at this step, insufficient for source plus staged and final archive. No full-model size is reported yet.
  • Began the pinned Qwen3.8 IQ3_S model download into a local model directory outside Git. Read only the header/directory bytes from the partially downloaded first shard and an HTTPS range of the second: 1,223 and 1 tensors respectively, 13 GGUF types, and 176,943,899,520 total elements. The second shard omits general.architecture. Summing the KAR-2 level-2 nested layout over these unverified directory entries gives 55,295,262,208 payload bytes (55.30 GB); this assumes every tensor uses nested encoding, excludes small container overhead, and is not an observed archive size or a quality result. The full shard hashes still need to match the manifest.
  • The KAR writer now has an internal consuming mode for private file-backed sections: after each verified copy into its temporary archive, it removes that staged section, reducing peak disk use. The normal non-consuming writer remains available. A dedicated test verifies staged RAW removal and a valid published archive; the two-shard test now also covers a shard with no architecture metadata. Local targeted tests and Clippy with warnings denied pass. Real mixed quantization types beyond F32/F16/BF16/IQ3_S still need native decoding before the full archive can be prepared.
  • Vendored the pinned llama.cpp/ggml C dequantizer source and required headers at Strata's upstream ggml commit 3cf03257f219afbe7334045ff7c6a06ac68c627d, recorded checksums and license, and linked it statically through Cargo for offline preparation. The bounded visitor now handles every quantized kind found in the two actual Qwen headers: 8, 12, 13, 14, 18, 20, 21, 22, 23, and 42, in addition to F32/F16/BF16. A synthetic IQ3_S block matched the independent Rust decoder exactly; Q8_0 and Q2_0 matched known values; one zero block of each actual kind decoded through the visitor. The streamed two-shard test exercises an IQ4_NL RAW fallback. All 60 Rust tests and Clippy with warnings denied passed locally. The static CLI smoke now includes an IQ4_NL shard, with pinned archive SHA-256 07751adc1f7115258b95613203c935f05cbe28a364f77717e8a1bc64cb79c8fa. Real model source SHA-256 remains unmeasured.
  • On a provisional real-data sample from the partially downloaded first Qwen shard, a 28,835,840-byte leading slice of blk.17.ffn_gate_exps.weight (IQ3_S, starting at absolute GGUF offset 19,192,385,920) and the 921,600-byte blk.0.ffn_down_shexp.weight (IQ4_NL, offset 1,385,570,304) were wrapped as two minimal GGUF shards outside Git. Their GGUF bytes total 29,757,760 and their level-2 KAR-2 archive is 21,485,056 bytes (72.1998% of this sample, 2.500179 accounted bits per weight), SHA-256 ebacd3cd488274a21bc94630c841d157b5633ce62721bb991c39b78dad8cef23. The dedicated verifier matched manifest source hashes, derived-F32 identity, provenance, KAR source records, and payload CRCs. The maximum tensor relative L2 error was 0.40491666, so this level is not approved for serving. The full source shard hash has not yet been checked; this sample is not representative of whole-model size or quality. scripts/measure-real-sample.py reproduces this measurement into an output directory outside Git; pass --index-gguf only while the source is a partial download, and --source-sha256 after its full hash is known. The chosen source GGUF offsets are absolute as printed by model index; no data-start offset is added.
  • Repeated the same sample through scripts/measure-real-sample.py: level 2 reproduced the same 21,485,056-byte archive and SHA-256. Level 3 gave a 30,078,464-byte archive (101.0777% of sampled GGUF input), SHA-256 3e6bc55254ba30bea5ed4f40c970ac9290ad4b1fd160e5c92e71caaaff0328e2, and maximum tensor relative L2 error 0.18060363. Both archives passed the dedicated manifest/provenance/payload verifier. These measurements show a sample rate/error tradeoff, not a whole-model compression or agent-quality result; neither rate is enabled for serving.
  • cargo run --locked --release --example compare-iq3-s -- <external-sample-gguf> 262144 compared every block in the sampled real IQ3_S slice: 262,144 blocks / 67,108,864 F32 values were bit-identical between the independent Rust decoder and the pinned ggml C decoder. This is a non-lossy decoder parity check on source bytes from the incomplete first shard; the complete shard still needs manifest SHA-256 verification.
  • Built the committed static-CLI Dockerfile on an arm64 Linux container with RUST_TARGET=aarch64-unknown-linux-musl. The resulting single strata-next ELF is 14 MiB (file reports statically linked), SHA-256 3faa76d410f08134cb39bc77009674ffba8e9a3190bfa7af0099028ed5282285. The scratch image ran --version successfully and independently verified the real-slice level-2 KAR archive through a read-only bind mount, including manifest source hashes, provenance, source records, and payload CRCs. This validates the Linux/arm64 static control-plane/CLI artifact, not the x86_64 release path or a CUDA-enabled inference runtime. Hosted GitHub Actions still has not run because this checkout has no GitHub repository or remote.
  • The same reproducible sampler has an --profile expert option using the same 28,835,840-byte IQ3_S slice plus a 28,800,000-byte leading slice of the much larger blk.0.ffn_down_exps.weight IQ4_NL tensor (absolute GGUF offset 913,711,104). The two minimal GGUF inputs total 57,636,160 bytes. Level 2 produced a verified 36,973,056-byte KAR-2 archive (64.1491% of sampled input), SHA-256 03a971fc1ff0a50c34a24fb5a29df76116f16fe9dec98ed61c3429a8f322af48, with maximum tensor relative L2 0.33925502. Level 3 produced a verified 51,761,664-byte archive (89.8076%), SHA-256 1f94757878575541d3a1568e7ba8d9e680ba6afed2c1199ae63d4c342a6203f8, with maximum tensor relative L2 0.16425464. These are rates for selected slices from an incomplete shard, not an estimate with validated uncertainty for the full model, and neither rate is approved for serving.
  • The first complete Qwen shard was fetched and matched its manifest SHA-256 4c1eb2ceb4915e1192f4f386021897bde56a97f40a0bb78bb86465e0f7d2aca3. Repeating scripts/measure-real-sample.py --profile expert --levels 2 --source-sha256 <digest> on this verified file reproduced the same two slice digests, 36,973,056-byte archive, archive SHA-256 03a971fc1ff0a50c34a24fb5a29df76116f16fe9dec98ed61c3429a8f322af48, and maximum relative L2 0.33925502. The second source shard is still downloading.
  • Added bounded CPU decode of an arbitrary nested KAR tensor range, reading only the relevant scales and bit-plane words after archive verification. A 96-element synthetic archive test covers ranges crossing group boundaries. On the verified-source level-2 expert sample, compare-kar-range independently decoded three one-million-value archive ranges and compared them with pinned ggml source decoding: IQ3_S at starts 0 and 33,000,013 had relative L2 0.32941509 and 0.32867352; IQ4_NL at start 25,000,017 had 0.34136948. The same IQ4_NL range from the level-3 archive had 0.16519821. This checks stored archive reconstruction on selected ranges, not GPU execution or model-level quality.
  • Corrected a dispatch error found by comparing the native C bridge with pinned ggml.h: GGUF kind 18 is IQ3_XXS (98 bytes/block) and kind 22 is IQ2_S (82 bytes/block); the initial bridge had these two decoders reversed. Dispatch now uses ggml enum names and decode_into rejects any mismatch between the C sizeof result and the Rust GGUF block geometry before C reads source bytes. Cargo explicitly watches the bridge C and vendored ggml sources, so a C edit rebuilds the native archive. The streamed builder, provenance schema, and virtual-F32 derivation were bumped to v3 to prevent reuse of v2 archives with potentially incorrect kind-18/22 values. The v3 synthetic streamed archive SHA-256 is c897a2b5016d5734925269b7dc223c33f944f10bc178a85db4b322cbaf058b5a; the v3 IQ4_NL fixture archive SHA-256 is 955b626c2c206b272b690b301168d01824563bb88dc9963698035c3acb619ba2. The old v2 hashes above are historical and cannot pass the current streamed verifier.
  • scan-quant-blocks decoded the first real block of each of the 13 GGUF kinds in the SHA-256-verified first shard and found only finite F32 values. Its kind-18 IQ3_XXS block F32 SHA-256 was aaf601ac40a43dc9af448936d6ab439a9837f01d13b835574d94af2eb62a2a1e; kind-22 IQ2_S was 4c4b80c73da67911a002589646c61aed4fe8e0139b3152cffd0b3e4ac4e540de. The source-verified expert-slice level-2 archive under v3 is still 36,973,056 bytes with maximum relative L2 0.33925502, but its new archive SHA-256 is 9c8d195c80cb4a04789d8f53847811214d5abc3f8c652185000f0055f435522f. All 62 Rust tests, Clippy with warnings denied, and the updated static CLI synthetic smoke passed locally. The Linux static image must be rebuilt for this v3 correction.
  • Extracted the first verified shard’s 248,320-token/247,587-merge tokenizer to an external directory. The native CLI and pinned upstream strata_tokenizer.py agreed on IDs and exact decode/encode roundtrips for 20 real-vocabulary cases spanning Cyrillic, CJK, emoji, combining marks, whitespace, C0 controls, long BPE runs, and control/user-defined special tokens, both with and without special parsing. scripts/compare-real-tokenizer.py reproduces this offline check; Python and regex are evaluation dependencies only, not serving dependencies.
  • The second complete Qwen shard was fetched outside Git and matched its manifest SHA-256 316b46f3a2dbd68c900f43136ab9449f9dcc3725dfd8c794847c204bc161e113; the first complete shard remains verified at 4c1eb2ceb4915e1192f4f386021897bde56a97f40a0bb78bb86465e0f7d2aca3. The total GGUF file size is 83,617,662,656 bytes. These are verified source bytes, not a KAR archive size.
  • Streamed KAR policy v4 partitions a tensor whose bit-plane stride would exceed KAR-2's u32 limit. The real 51,200,245,760-element per_layer_token_embd.weight is planned as adjacent 32,000,000,000- and 19,200,245,760-element records with checked GGUF block boundaries and contiguous virtual F32 offsets. The part planner checks physical and derived parent hashes; provenance records parent dimensions and each part's source/F32 hashes and offsets. A small forced split fixture passed end-to-end preparation, independent archive/provenance verification, and CPU reconstruction for both parts. Calibration sampling now seeks to at most 65,536 normalized groups for tensors over 1,048,576 elements; F32 and IQ3_S sparse samples matched the complete-stream sampler exactly in dedicated tests. All 65 Rust tests and Clippy with warnings denied passed locally, and the v4 synthetic static-CLI smoke passed against the macOS binary. The Linux/arm64 v4 static validation is recorded below.
  • Both SHA-256-verified source shards supplied a reproducible 57,636,160-byte two-tensor sample: a 28,835,840-byte IQ3_S expert slice plus 28,800,000 bytes from the giant per_layer_token_embd.weight IQ4_NL tensor. V4 level 2 produced a verified 36,973,056-byte KAR-2 archive (64.1491% of sampled GGUF size), SHA-256 b1630baa94d01b52916e2d3fbcf73042542a1d4e2f9108517333497cf677db8d, with maximum tensor relative L2 error 0.33378769. Level 3 produced 51,761,664 bytes (89.8076%), SHA-256 91ce9e0c5c804a293f3b03aea8644871ef2981ecb562c5417a3c74afa850caa5, with maximum tensor relative L2 error 0.16037559. Both archives passed source/provenance/payload verification. These are sampled size and reconstruction errors only; neither is a full-model size, model quality gate, or serving approval.
  • The optimized macOS release CLI recreated the same v4 level-2 per-layer sample byte for byte: 36,973,056 bytes, archive SHA-256 b1630baa94d01b52916e2d3fbcf73042542a1d4e2f9108517333497cf677db8d, and the same 0.33378769 maximum tensor relative L2 as the debug CLI. The release verifier independently matched source manifests, provenance, source records, and payload CRCs.
  • On the verified second-shard per_layer_token_embd.weight slice, compare-kar-range independently decoded one million archived F32 values starting at 25,000,017 and compared them with pinned ggml IQ4_NL source dequantization. L2 reconstruction had relative L2 0.33396194 and maximum absolute error 0.01647477; L3 had 0.15970538 and 0.00811461. This checks one real range of stored KAR output against source values on CPU, not model-level quality or GPU execution.
  • Rebuilt the v4 static CLI in the committed Dockerfile for aarch64-unknown-linux-musl. The executable is a 14 MiB statically linked Linux/arm64 ELF, SHA-256 656fefeb0cf8aa7c2b804a162f264e1d59689beadcdc6eb544dc4fe2fa92fc62. Its scratch image ran --version and independently verified the v4 real per-layer L2 sample through a read-only bind mount, including manifest source hashes, provenance, source records, and payload CRCs. This validates the current Linux/arm64 CLI path; Linux/x86_64 and CUDA inference remain untested.

2026-10-03 — complete two-shard KAR-2 size

  • Host: macOS arm64; release CLI at commit edf0617; KAR-2 experimental streamed policy v4, group 32, level 2. Both source GGUF shards matched the embedded manifest SHA-256 before conversion and were rehashed by the preparation command.
  • Command: strata-next model prepare-sharded-streamed qwen-iq3-s --source-dir /Users/para/.local/share/strata-next/qwen-iq3-s --output /Users/para/.local/share/strata-next/qwen-iq3-s-l2-v4.kar --levels 2.
  • The complete archive has 55,295,529,472 bytes (51.49797487 GiB) across 1,225 KAR records; the two GGUF shards have 83,617,662,656 bytes. Archive/source ratio is 0.66129006, saving 28,322,133,184 bytes (33.87099%). Accounted rate is 2.500025 bits per derived F32 weight. Archive SHA-256 is 536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5; derived F32 SHA-256 is c89bfcea7b1c979ad2e9e64c59fcc3c03fc414b345c5f47f027ce0ba99015479.
  • The writer's full payload CRC verification passed before atomic publication, and a versioned provenance sidecar was written. The maximum tensor relative L2 error measured during encoding was 0.68008092. This is not a model-level quality result or permission to serve with KAR-2. No Linux GPU inference, GPU decode, or paired end-to-end throughput result exists yet.
  • A separate model verify-sharded-streamed /Users/para/.local/share/strata-next/qwen-iq3-s-l2-v4.kar --manifest qwen-iq3-s --source-dir /Users/para/.local/share/strata-next/qwen-iq3-s --levels 2 run exited successfully. It recomputed the derived F32 source identity, checked both manifest shards, all 1,225 KAR source records and payload CRCs, the archive SHA-256, and the v4 provenance policy. The provenance sidecar SHA-256 is 3edceb512c386ea4552a3e5d3d49fbd841f7bd1b314aeba8b2a87ac811a8a6b5. Temporary section files, old real-data slices, local header fixtures, and superseded local Docker images were removed; both verified GGUF shards, the final KAR, and its provenance remain outside Git.

2026-10-03 — outer block codec and selective precision probes

  • Read 18 independent 1,536,036-byte KAR expert sections from the verified full archive (gate/up/down records at layers 0, 3, 14, 24, 37, and 45 for experts 0, 127, and 511). On the same 18 blocks, mean compressed/raw ratios were 0.988025 for LZ4 HC (lz4 -9, 1.10.0), 0.935372 for Deflate (zlib level 9), and 0.915421 for xz (xz -9e, XZ Utils 5.8.4). Median xz ratio was 0.914897, with a range of 0.904669–0.930424. One block per codec decompressed byte-identically. These are CPU encoding and size observations only, without a CUDA decoder, PCIe measurement, or end-to-end A/B result.
  • A separate sparse scan of 26 aligned 32 MiB windows spaced 2 GiB across the archive gave mean xz ratio 0.895215, median 1.000051, and range 0.418332–1.000051. The large spread shows that a full-archive size cannot be inferred reliably from a few windows; no complete outer-compressed archive was produced.
  • The streamed Rust preparer now retains relative L2, source kind, and section bytes per KAR record in its result and prints the worst 20 when creating a new archive. A forced-split fixture checked that all records are represented and their maximum equals the summary maximum. The existing full archive was created before this diagnostic and has no per-record report; reusing it will not fabricate one. All 65 Rust tests, Clippy with warnings denied, and git diff --check passed locally.

2026-10-03 — sampled distortion of the existing complete archive

  • Added model analyze-sharded-kar and a reusable verified CPU range decoder. The strict mode checks complete source derivation, archive payloads, and provenance. Its first full-model run was stopped after about 13 minutes because repeated derivation of the 707,775,598,080-byte virtual F32 stream made it unnecessarily expensive; it had produced no report or intermediate model files. A separate --assume-verified mode uses the earlier independent full verification of the immutable archive and source shards, checks current metadata and provenance mapping, and reads only sample windows. Synthetic compressed and RAW archives gave identical sampled relative L2 in strict and fast modes. The fast mode does not rehash source or archive payloads and says so in its output.
  • The fast real-model run produced /Users/para/.local/share/strata-next/qwen-iq3-s-l2-v4.sampled-distortion.json outside Git: 1,225 records, 12,276,608 sampled values, 546,787 JSON bytes, report SHA-256 1452b55705b9f723747df7dba47fd0484ae8b4140b0022cacceefb16970b5bbf, bound to the previously verified archive SHA-256 536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5. Each record uses up to three nonoverlapping GGUF-block-aligned windows of at most 4,096 values (beginning, middle, end). The median sampled relative L2 is 0.363209; 22 records are at least 0.5 and 207 at least 0.4. The largest sampled value is 0.77458222 in blk.0.ffn_gate_inp.weight; 0.74248190 and 0.73494266 occur in the same tensor family at blocks 30 and 14. A window's relative L2 can exceed the earlier full-record maximum of 0.68008092 because it measures a different subset, and it is not a full-record bound or model-quality result.
  • The 22 records at or above 0.5 contain 43,008,000 values. Adding one KAR bit plane only to these records would nominally add 5.13 MiB of plane bits before alignment and metadata; a serving loader and GPU path still need to apply this mixed-rate overlay. An external proposal list, /Users/para/.local/share/strata-next/qwen-iq3-s-l3-candidates.json, has SHA-256 6c82c80c8edfb7a8b0e83c8ebd690339843b83a9dce0020967e7146cbcb41120. It is a diagnostic proposal, not an approved precision policy or proof of improved model quality. The split per_layer_token_embd.weight sampled at 0.33714705 and 0.33125633; token_embd.weight at 0.33737772 and output.weight at 0.37104131.

2026-10-03 — selected L3 overlay and paired tensor comparison

  • model prepare-kar-overlay encoded the 22 proposed unsplit records from the original GGUF shards at KAR level 3. Each selected physical GGUF and virtual F32 digest matched the full base provenance during encoding; the KAR writer and an independent pass verified the overlay records and payloads. The overlay is /Users/para/.local/share/strata-next/qwen-iq3-s-l3-overlay.kar, 18,827,008 bytes (17.955 MiB), SHA-256 4f308e611e189b0fe8dde75287e55c65c4800bf7da8e6a5c2acef96d70c67471, with 22 records. The corresponding base archive sections occupy 13,445,632 bytes, so the standalone overlay file exceeds those sections by 5,381,376 bytes, including its own header/directory/alignment. The overlay provenance is 6,039 bytes, SHA-256 403eeca17d09bd51b3c5f6bae2587c62c483707e346577ab3df6feed2a2a7958. Private staging sections were removed.
  • model compare-kar-overlay decoded every value of the same 22 tensors from the base L2 and overlay L3 archives, compared both to pinned GGUF dequantization, and recomputed each selected source tensor's physical and F32 SHA-256. Its external report /Users/para/.local/share/strata-next/qwen-iq3-s-l2-vs-l3-overlay.json is 4,226 bytes, SHA-256 6413b353381749c5d0cc0eb91ed5bf93e6b8a9c36fd7f6db9942fd20a7478e97. All 22 full-record relative L2 errors decreased. The median across selected records was 0.50734744 at L2 and 0.22607999 at L3; the largest selected-record error decreased from 0.62459845 to 0.28435756. For blk.0.ffn_gate_inp.weight, the paired full-record values were 0.62459845 and 0.28435756. This is a numerical weight reconstruction result, not a model-quality result or a GPU/PCIe performance result. The large base archive's earlier full verification is assumed by this comparison, while the selected source tensors and small overlay were freshly checked.
  • All 67 Rust tests, Clippy with warnings denied, and git diff --check passed after the overlay work. A current macOS arm64 release CLI was saved outside Git at /Users/para/.local/share/strata-next/bin/strata-next-overlay-probe (13,691,888 bytes, SHA-256 df2ce4c26dbf000f5935fe79a31a8ef73aea64ee5e48a1f5a5888d3751c94817). cargo clean --profile dev and cargo clean --profile release removed their build outputs; the private overlay section staging directory is gone. Verified GGUF shards, the full base KAR, overlay, and reports remain for reproduction.

2026-10-03 — live text SSE preview

  • The restricted /v1/responses text path now forwards worker token events through bounded channels as live SSE deltas. It emits response.created, response.in_progress, output item/content part events, UTF-8-safe text deltas, and a response.completed terminal event with continuous sequence numbers. A worker failure emits response.failed; dropping the client stream closes its worker receiver so the supervisor sends STOP and drains the current generation.

  • A synthetic HTTP test received the first text delta before any DONE event, then checked the final text and event ordering. A resident mock worker accepted another request after its streaming receiver was dropped. A UTF-8 test checked tokens that split a multi-byte character. All 70 Rust tests, Clippy with warnings denied, and git diff --check passed on macOS arm64. This validates the local protocol path only; no real model, Linux GPU, Codex tool call, or end-to-end throughput was tested.

  • Follow-up terminal tests checked that worker errors produce response.failed and output-token exhaustion produces response.incomplete with incomplete_details.reason=max_output_tokens, in both the response trace and live SSE path. A length-limited response is no longer misreported as an HTTP gateway failure. All 73 Rust tests and Clippy with warnings denied passed locally.

  • A Rust parser now accepts complete Qwen <tool_call><function=...><parameter=...> output in the buffered Responses path. It preserves literal closing-tag examples inside string parameter values, converts declared non-string JSON values, rejects unfinished/undeclared calls, and validates finished argument objects against the request's local JSON Schema without remote references. Function declarations with duplicate or unsafe names are rejected before generation. A synthetic HTTP test returned a function_call with exact string and integer values. All 78 Rust tests and Clippy with warnings denied passed at that step. Streaming tool calls and real-model validation remain open; the tool prompt is an adaptation of the upstream template rather than an established byte-for-byte parity result.

  • The route now accepts a text-only input array for stateless continuation: earlier function_call items with JSON-object arguments must be paired with matching function_call_output text before a new generation. The Rust prompt includes the Qwen function and tool-response blocks; mismatched call IDs or incomplete pairs return a request error. A synthetic HTTP continuation reached the mock worker with the tool response intact and returned the next text answer. All 80 Rust tests, Clippy with warnings denied, and git diff --check passed. previous_response_id storage, multimodal items, reasoning replay, and real-model parity remain unimplemented.

  • The representative upstream tool call and response golden prompt now matches the Rust tool renderer byte for byte, including the tool schema JSON, function call block, and tool response turn. This checks one pinned case rather than arbitrary tool schemas or real-model behavior. All 81 Rust tests and Clippy with warnings denied passed after the formatting change.

  • The incremental Qwen tool parser now holds split <tool_call> markers, including literal closing-tag examples inside parameter values. The live SSE path emits text deltas and a completed, schema-validated function call before worker DONE; unfinished and schema-invalid calls end in response.failed without publishing arguments. Synthetic worker tests check sequence order and terminal events. This has not been exercised against a real model or Codex client yet.

  • After commit 122c5f0, cargo test --locked passed 85 Rust tests, Clippy with warnings denied passed, and the Linux/arm64 musl CLI cross-build succeeded. The 15 MiB ELF has no INTERP or DYNAMIC program header and ran --version from an arm64 scratch container. Its SHA-256 is 13e25f38445ada0b8f99e8a262580484342bdbfd28da39154957aaf29706054b. This validates the CLI/control plane, not the CUDA worker or compressed-model serving. The superseded local static CLI copy was removed.

  • The HTTP route now stores terminal responses by default in a bounded, process-local cache and can render a previous_response_id chain with a new function_call_output. A synthetic two-turn worker test checked that the earlier user request, function call, and tool result reach the second Qwen prompt; unknown IDs return 404. This does not establish compatibility with a real Codex session, and the cache does not survive restart.

  • Commit 5a96652 passed 87 Rust tests, Clippy with warnings denied, and git diff --check. The updated Linux/arm64 musl CLI ran --version in scratch, has no INTERP or DYNAMIC program header, and hashes to ffff43a30c75f2009a996079e4a8d45698658b3ba8a91a449a2cf87d9645d20c. It remains a CLI/control-plane artifact without the CUDA engine. The prior local CLI copy was removed after verifying this one.

  • The new model resolve-kar-overlay command recomputes full SHA-256 and payload CRCs for the base and overlay archives, validates their shared virtual-F32 source, and maps every tensor name to a base or replacement record. A synthetic fixture rejected a modified overlay provenance digest. The real release-build run on macOS arm64 completed in 407.7 seconds without staging a model copy: base SHA-256 536d612ca60eab460cb978f51748fc6fa4e9d611d4601e777884e8b51385afa5, overlay SHA-256 4f308e611e189b0fe8dde75287e55c65c4800bf7da8e6a5c2acef96d70c67471, 1,225 base records, and 22 selected replacements. The large per_layer_token_embd.weight parent correctly resolves through two adjacent KAR records. This validates archive identity and selection only; it does not test GPU residency, CUDA decode, model quality, or inference speed.

  • The CLI from commit d62c6ce cross-built for aarch64-unknown-linux-musl and ran --version in an arm64 scratch container. Its ELF has no interpreter or dynamic program header; SHA-256 is ae22b63d19c11e1de3c5d5279edbdef8042acee89a3fc1192baab25fa41efa7a. The superseded local static CLI copy was removed. This binary still excludes the CUDA inference engine.

  • cargo check --locked --target aarch64-unknown-linux-musl passed for the current Rust code. A first release link on macOS chose the host cc and failed on ELF flags; setting CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc made cargo build --locked --release --target aarch64-unknown-linux-musl --bin strata-next pass. The 15,141,536-byte Linux/arm64 ELF is statically linked, has no INTERP program header or dynamic section, and returned strata-next 0.1.0 inside the existing Linux/arm64 scratch container. External copy: /Users/para/.local/share/strata-next/bin/strata-next-linux-arm64-musl-8704ef3, SHA-256 78723399f292816e5f894ebf64b11ecf369eb68cef6478e363d71539d2b787ac. This is a control-plane/CLI artifact, not a CUDA inference runtime or x86_64 release validation.