Files
leleka/docs/roadmap.md
T
Pavlo Ratushnyi 4013e0c9bd
Desktop foundation / core (ubuntu-latest) (push) Failing after 28s
Desktop foundation / core (macos-latest) (push) Canceled after 0s
Desktop foundation / core (windows-latest) (push) Canceled after 0s
Linux / verify (push) Canceled after 0s
Linux / keyless-cuda (push) Canceled after 0s
Linux / static-cuda-package (push) Canceled after 0s
Linux / hosted-cuda-package (push) Canceled after 0s
Linux / linux-static-cli (push) Canceled after 0s
Linux / linux-cli-container (push) Canceled after 0s
Linux / release-cli (push) Canceled after 0s
Import tracked Strata Next source snapshot
2026-10-05 18:15:08 +02:00

15 KiB
Raw Blame History

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

  1. Complete P0 and P1 locally. Keep model bytes out of Git and verify every finished file by SHA-256.
  2. Port P2 with differential fixtures from upstream. Do not infer tensor correctness from a file extension alone.
  3. Connect the existing Rust worker pipe to P3. Use the real model only when the GPU node is free; use synthetic protocol tests meanwhile.
  4. 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.
  5. 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.
  • Write the local GitHub Actions workflow for Linux checks, a musl build, ELF dependency checks, artifact upload, and tag prerelease.
  • Create the Strata Next GitHub repository, add its project remote, and run the workflow on a hosted Linux runner.
  • Run a CUDA engine build and loader smoke test on Linux GPU hardware.
  • Build the isolated KAR CUDA decoder for RTX 5090 and match synthetic full/row plus two real overlay-record checksums with the CPU oracle.

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.
  • Report per-shard byte and percentage progress while downloading, including resumed offsets.
  • Verify both complete real IQ3_S shards on an external volume and record measured digests.
  • Retry transient model transfer failures with bounded backoff and verified partial-file resume.
  • Accept an optional process-local HF_TOKEN for exact HTTPS Hugging Face URLs; reject URL-embedded credentials and keep redirects from forwarding the header across origins.

P2 — native model preparation

  • Inventory iq_pack.py, pack_index.py, and strata_tokenizer.py outputs 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.
  • Extract the SHA-256-verified first real shard’s tokenizer and compare native IDs and roundtrips with the pinned upstream oracle on Unicode and special-token cases.
  • 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 prepare with 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.
  • Decode a bounded arbitrary range of a large nested KAR tensor from stored archive bytes and compare selected real GGUF ranges with pinned ggml values.
  • 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.
  • Define and compute a versioned virtual F32 stream identity for a bounded-memory, all-IQ3_S GGUF, retaining original GGUF and tensor digests separately.
  • Convert a small all-IQ3_S GGUF to an experimental KAR preview with virtual F32 source identity and an original-source provenance sidecar.
  • Recompute the IQ3-derived source against the original GGUF and verify each KAR source record, archive payload CRC, and provenance sidecar.
  • Define and compute a versioned virtual F32 source for a single GGUF mixing IQ3_S with F32, F16, and BF16 tensors.
  • Prepare and independently verify a small KAR preview from a mixed IQ3_S/F32/F16/BF16 virtual source.
  • Compute a versioned virtual F32 identity across manifest-verified GGUF shards in filename order, with global tensor offsets.
  • Encode and independently verify a small, manifest-pinned sharded KAR preview with provenance.
  • Add an experimental sharded preparation command with bounded calibration and encoding and no preview size cap; verify its archive and provenance on synthetic F32/IQ3_S shards.
  • Add an opt-in full-size fetch → verify → prepare → verify CLI path that reuses only a reverified streamed archive.
  • Inspect both target GGUF directories and statically link pinned ggml CPU dequantizers for every type found there; exercise them on bounded synthetic blocks.
  • Check native ggml block size against GGUF geometry and decode a real block of every first-shard type; version the streamed derivation after correcting the kind-18/22 dispatch.
  • Measure a provisional, reproducible IQ3_S/IQ4_NL real-data slice with the streamed KAR path; record archive size, source identity, and reconstruction error without treating the slice as a model-quality gate.
  • Run full streamed preparation and independent verification; both target shards matched their manifest SHA-256 values and representative real blocks/ranges matched the CPU oracle. Model-level quality and GPU execution remain separate gates.
  • Resolve a fully verified base KAR archive plus precision overlay into a per-record selection map; both real archive hashes, all payload CRCs, and 22 replacements passed. GPU loader use remains open.
  • Verify IQ3_S values against upstream CPU dequantization on representative tensors.
  • Promote the bounded GGUF/KAR path to model prepare after real-shard validation, per-class rate policy, and quality checks.
  • Make one-command serve fetch, 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/DONE through a resident fake worker.
  • Add native tokenization and Qwen prompt formatting; connect a restricted non-streaming text path to the worker command queue.
  • Stream text deltas directly from the worker with bounded channels, UTF-8 assembly, terminal SSE events, and client cancellation in synthetic tests.
  • Parse complete Qwen function calls in Rust for buffered Responses output, preserving nested delimiter text and checking argument schemas; synthetic HTTP test passes.
  • Render stateless text input arrays with paired function calls and outputs into the next Qwen prompt; synthetic HTTP continuation passes.
  • Store completed responses in a bounded, process-local cache by default and replay previous_response_id with new input; synthetic tool-result continuation passes.
  • Stream live output with cancellation, backpressure, tool calls, reasoning, and terminal events. Text and completed function calls are connected; reasoning remains open.
  • 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 libkar reserve/decode, PLE row decode, expert miss scheduling, and measured transfer/decode/multiply overlap.
  • Verify base plus precision overlay and account for selected compressed residency and F32 scratch without double-counting replaced records; the real v4 pair was measured as archive metadata, not GPU execution.
  • Expose with-key and experimental without-key KV 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 has local CI assets; Linux/arm64 and Linux/x86_64 musl control-plane/CLI artifacts ran successfully, with the x86_64 artifact checked on the RTX 5090 host. Hosted Actions still needs a GitHub repository and runner. P1 has model fetch and model verify; both real shards passed their manifest SHA-256 values on the Linux NTFS volume. P2 has bounded GGUF indexing, real-tokenizer parity against upstream, pinned ggml CPU decoding with checked block geometry, and an experimental bounded-memory sharded GGUF-to-KAR path. Streamed policy v4 partitions the giant per-layer tensor so its bit-plane stride fits KAR-2. The complete level-2 archive was produced from both verified shards: 55,295,529,472 bytes from 83,617,662,656 source bytes (66.13%); an independent verifier passed source identity, KAR records, payload CRCs, archive hash, and provenance. Its maximum tensor relative L2 error was 0.68008092. A separate 18,827,008-byte level-3 overlay for 22 high-distortion records reduced paired full-record relative L2 for every selected tensor, but no serving loader applies it yet. These numerical results do not pass the model-level quality gate. Sampled IQ3_S values matched pinned ggml bit for bit, and selected archived ranges were independently decoded and compared with GGUF values. An isolated Linux CUDA smoke matched CPU output checksums for two real overlay records. An opt-in PLE-only GPU row cache now decodes compressed rows inside the serving engine; a 4,097-token cross-part gather matched CPU KAR byte for byte, and short paired 128-token runs produced identical output. Its small measured throughput differences are not an accepted end-to-end gain, and expert weights still use the native pack. A separate custom V→K regression screen reported 0.3023 attention-output relative L2 error on a limited held-out proxy. It did not implement the cited Keyless Attention query-routing method and cannot establish whether that method preserves quality. The physical V-only cache, query-routing CUDA kernels, frozen-routing calibration and console agent experiments are now implemented and tested on RTX 5090. Technical gates passed, while both pretrained Qwen V-only agent variants failed model quality and remain opt-in; see docs/experiments/2026-10-04-keyless-runtime.md. No V-only production trial or speed improvement is qualified; see the methodology correction in docs/experiments/2026-10-03-v-only-screen.md. The Responses route has a restricted preview backed by the worker queue, including live text SSE deltas, cancellation, completed streaming function calls with schema checks, stateless tool-result replay, and bounded process-local previous_response_id continuation, tested with a mock worker. Live reasoning, full-model quality, native-versus-GPU agent throughput, and a complete single-file GPU runtime remain pending.

References: NVIDIA CUDA 13.0 release notes, NVIDIA driver components, and Rust musl target support.