9.5 KiB
Strata Next implementation plan
Product shape
The target interface is one Linux command, strata-next, with serve, model fetch, model verify, model prepare, doctor, and benchmark operations. A model remains on an external volume. The command must keep production serving independent of Python. The user-facing executable may eventually contain a statically linked Strata engine, but CUDA still needs the installed NVIDIA driver and its libcuda.so. The CLI checks the existing driver; it does not install or bundle one. For the current CUDA 13.0 GA baseline, the minimum Linux driver is 580.65.06 per NVIDIA's release notes. Until engine integration is proven, the Rust executable and C++ engine remain separate build artifacts and the CLI reports that limitation clearly.
LAYERED_EXTENDED is retained as an exact user-provided term; no runtime semantics have been assigned to it yet.
Work packages
| ID | Package | Deliverable | Acceptance |
|---|---|---|---|
| P0 | Linux foundation and CI | Pinned Rust, Linux lint/tests, musl CLI artifact, release workflow | CI builds a runnable Linux artifact and rejects format/lint/test failures |
| P1 | Artifact acquisition | Manifest-pinned model downloads, size/hash verification, safe resume, external volume | Interrupted local HTTP fixture resumes; wrong hash never becomes a completed model |
| P2 | Model preparation | Inspect GGUF and tokenizer; port pack/index; create and verify provenance-pinned KAR-2 archives | Prepared output matches upstream, with source and archive digests and separate KAR quality gate |
| P3 | Native API | Tokenization, prompt template, /v1/responses, tool calls, schema, live SSE, cancellation |
Sanitized Codex replay has no protocol errors or missing terminal events |
| P4 | Single executable | Link/embed engine and CUDA KAR decoder where viable, check preinstalled NVIDIA driver, one-command startup | Linux node with a compatible driver loads compressed weights and decodes on GPU without Python or manual engine installation |
| P5 | Reliability and telemetry | Restart, timeouts, backpressure, metrics, graceful drain | Soak and failure injection pass without orphaned slots or incomplete streams |
| P6 | Performance and scale | Controlled baseline, KAR GPU path, 2×256K, 1×512K, scheduler, with-key and without-key cache profiles | Charter quality/performance gates and reproducible reports pass |
Sequence and dependencies
- Complete P0 and P1 locally. Keep model bytes out of Git and verify every finished file by SHA-256.
- Port P2 with differential fixtures from upstream. Do not infer tensor correctness from a file extension alone.
- Connect the existing Rust worker pipe to P3. Use the real model only when the GPU node is free; use synthetic protocol tests meanwhile.
- Package P4 after the ABI and CUDA link strategy are measured on Linux. Do not label a control-plane-only musl artifact as the complete GPU runtime.
- Add P5 before production deployment, then run the baseline and P6 experiments with the charter's gates.
Task queue
P0 — Linux delivery
- Pin the Rust toolchain and enforce format, Clippy, Rust tests, and CPU tests.
- Add Linux CI, a musl build, ELF interpreter check, artifact upload, and tag prerelease path.
- Run the workflow on a hosted Linux runner after this repository has its own remote.
- Run a CUDA engine build and loader smoke test on Linux GPU hardware.
P1 — model acquisition
- Embed a commit-pinned IQ3_S manifest with size and SHA-256 for both GGUF shards.
- Implement resumable downloads, integrity checks, and a local interrupted-transfer test.
- Check free disk space for all outstanding shard bytes and again after each resume/restart response.
- Verify a complete real IQ3_S download on an external volume and record measured digests.
- Add multi-shard progress, retry policy, and authenticated Hub access where needed.
P2 — native model preparation
- Inventory
iq_pack.py,pack_index.py, andstrata_tokenizer.pyoutputs and formats. - Port bounded GGUF v3 header and tensor-directory inspection into native code.
- Validate the native inspector against representative upstream GGUF fixtures and both real IQ3_S shards.
- Port tokenizer asset extraction without a Python runtime and compare it with upstream on a synthetic GGUF.
- Port tokenizer encode/decode and compare token IDs with upstream on a synthetic full-byte vocabulary.
- Port the IQ3_S pack/index path without a Python runtime and verify the real tokenizer.
- Differentially compare metadata, tensor bytes, and tokenizer behavior against upstream output.
- Add
model preparewith source digest, KAR-2 archive validation, atomic completion, and no model data in Git. - Add bounded native KAR-2 metadata inspection, streaming payload CRC verification, and optional source-manifest identity check (decode still pending).
- Emit a byte-identical synthetic KAR-2 RAW/NESTED archive from native Rust tensor slices; publish after verification without overwriting an existing file.
- Index supported GGUF tensor payloads with exact block geometry and bounded per-tensor hashing; reject overlapping, truncated, or malformed source layouts.
- Stream RAW tensor bytes into KAR-2 with a fixed 1 MiB buffer and per-tensor digest verification.
- Stream pre-encoded NESTED sections into KAR-2 with checked section geometry, finite f16 values, zero padding, and digest verification.
- Encode a synthetic f32 tensor to native KAR scales and bit planes using supplied calibration; keep the lossy path experimental.
- Decode a selected KAR bit-plane prefix into a caller-sized CPU buffer for numerical tests.
- Fit experimental top-down nested boundaries and f16 books from a supplied normalized sample; match pinned koference synthetic oracles.
- Wire a small F32 GGUF through native calibration, encoding, reconstruction check, and verified KAR publication under an explicit preview command.
- Spool each preview tensor as a canonical NESTED section and assemble the archive from file-backed sections; clean staging after success or failure.
- Decode synthetic GGUF IQ3_S source blocks in native Rust with a pinned ggml grid and bounded output.
- Verify IQ3_S values against upstream CPU dequantization on representative tensors, then define a provenance-safe IQ3_S → KAR source identity contract (derived F32 source or a versioned format extension).
- Feed the native writer from a bounded-memory GGUF tensor iterator and a native KAR encoder; implement
model prepareon real shards. - Make one-command
servefetch, verify, and prepare missing model assets, then reuse the verified compressed archive. - Compare KAR reconstruction with its CPU oracle; run full-model quality before making the compressed path a default.
P3 — API and worker
- Validate a Responses request subset and build synthetic JSON/SSE traces.
- Exercise
GEN/T/DONEthrough a resident fake worker. - Add native tokenization and Qwen prompt formatting; connect a restricted non-streaming text path to the worker command queue.
- Stream live output with cancellation, backpressure, tool calls, reasoning, and terminal events.
- Replay sanitized real Codex sessions and compare against the upstream server.
P4–P6 — production and optimization
- Package the C++/CUDA engine with the Rust CLI into one user-facing Linux executable where the link strategy permits.
- Keep the KAR archive compressed through GPU residency; integrate
libkarreserve/decode, PLE row decode, expert miss scheduling, and measured transfer/decode/multiply overlap. - Expose
with-keyand experimentalwithout-keyKV modes; keep QSA indexer keys and pass the separate Keyless quality gate before default use. - Add process restart, metrics, auth, failure injection, and soak tests.
- Stop and drain an abandoned internal generation; interrupt an active generation during shutdown.
- Capture the 1×256K baseline, then implement and validate 2×256K and 1×512K.
- Evaluate speculation, KAR, and Value-Only only under the charter's separate quality gates.
CI/CD policy
Pull requests and main commits run Rust format, Clippy, tests, synthetic replay, and CPU engine tests on Linux. CI builds a static musl CLI/control-plane artifact and checks that it has no ELF interpreter. Version tags can publish this artifact with a SHA-256 checksum; a full GPU release waits for a Linux CUDA build, runtime smoke test, and signed-off model quality gate. No model weights or tokens enter CI artifacts.
Current status
P0 is in progress. P1 has model fetch and model verify; P2 has a bounded GGUF tensor index with exact byte spans and per-tensor hashes, bounded KAR-2 metadata/payload CRC verification with optional source-manifest identity, an experimental F32-only preparation preview, tokenizer asset extraction, and native BPE encode/decode. The Responses route has a narrow non-streaming text preview backed by the worker queue and synthetic test; streaming, tools, reasoning output, and live model quality remain pending. Real IQ3_S KAR encoding, decode accuracy validation, and GPU decode are targets, not completed integration. No GPU baseline or complete single-file GPU runtime has been verified.
References: NVIDIA CUDA 13.0 release notes, NVIDIA driver components, and Rust musl target support.