Files
Pavlo Ratushnyi 056ab3d689 Retire the oracles, generators and scripts that only worked against the vendored Strata tree (STRA-406)
The vendored Strata tree engine/strata is removed for good (owner decision 2026-11-23): Leleka never builds or runs it, the vanilla
benchmark builds from its own checkout, the comparison measurements are finished and the CUDA ports are frozen. Everything below
compiled or read that tree, so it cannot run without it and is retired (the tree stays in git history, see third_party/strata/UPSTREAM.md).
Checked-in fixtures, golden JSON, sealed PTX, seal plans and MANIFEST hashes are untouched and keep being replayed by the cargo tests.

Drift guard
- crates/experimental-ref/tests/literal_port.rs: include_str! of the Original .cu files compared with the checked-in experimental ports.

Oracle generators and builders (they compile or extract from the Strata C++/Python sources; their outputs are the checked-in goldens)
- crates/experimental-ref/oracle/gen_{cvec,kv,remote,stream}_golden.{cpp,sh}, gen_seal_additions.py and the cuda_runtime stub they used
- crates/sampler-ref/oracle/build_oracle.sh, gen_fixtures.cpp, gen_sampling_keys.py, stub/ (run_port_host_tests.sh and the fixtures stay)
- crates/serving-policy/oracle/ (build_oracle.sh, gen_{host,cvec,vision}_fixtures.cpp)
- crates/context/tests/rope_plan_golden/gen_* (plan, rope, kv pool)
- crates/engine-core/src/conversation/golden/gen*.{sh,cpp} and stub/
- crates/cuda-driver/oracle/gen_prefill_ring_trace.py and drivers/prefill_ring_trace.cpp (extracted prefill.cpp), check_cu_syntax.sh
- crates/engine-qwen35-cuda/tests/stra161_reference/reference.py (fixtures.json and the Rust constants stay)
- control-plane/tests/golden/gen_goldens.py, scripts/offline/ (Python differentials and golden generators against the Strata Python tools)

Source-compiling CUDA oracles and builders
- scripts/build-cuda-{projection-family,q5,q6,qsa}-oracle.sh with scripts/cuda-{projection-family,q5,q6,qsa}-oracle/ (include the Original .cu; sha256 pins of them)
- scripts/build-original-verify-ptx.sh, scripts/q8/rebuild_quantizer_ptx.sh, scripts/decode-sm120/make_iq_prefix.py (needs engine/strata/include)
- scripts/cuda-stubs/ (check-cu.py and literal_diff.py need the strata headers and the Original sources; the stub headers served only them)
- tools/chain-probe/build.sh, tools/kernel-ab/{cpp,aa.sh,smoke.sh,time_smoke.sh} (the C++ comparator is built from the Strata CPU kernels; verify_manifest.py stays)
- scripts/e2e/codex/speed/verify-hc-down-kernel-microbench-vs-upstream/ (compiles the upstream kernel from the tree)

Engine builds and Python smokes that need the tree
- scripts/build-cpu.sh, scripts/build-static-cuda.sh, scripts/check-keyless-gpu.sh, scripts/test-static-cuda-profile.py (CMake of engine/strata)
- scripts/compare-real-tokenizer.py, scripts/smoke-mtp-pack.py (reads src/core/mtp.cpp and a bench manifest), scripts/prepare-keyless-routing.py and its test
- scripts/smoke-native-pack.py became scripts/native-pack-fixture.py: the synthetic GGUF fixtures the four other smokes import stay, the iq_pack.py oracle comparison goes

Gates and CI
- scripts/check-local.sh: no live Python oracle differentials, no literal_port note, no check-cu, no build-cpu, no retired test scripts
- .github/workflows/linux.yml: the keyless-cuda, static-cuda-package and hosted-cuda-package jobs (they built the engine from the tree) and their dispatch
  inputs, and the two oracle smoke steps; .github/workflows/port.yml: the Python oracle environment and the llama.cpp fetch of port-oracles
  (the sampler host shim still runs)
- limits.json and scripts/check_limits_test.py exclude third_party/strata/ instead of engine/strata/

Documentation and comments: README.md names third_party/strata and the pin; deploy/README.md marks the retired build and smoke commands; comments
in Rust, Python and Markdown that named engine/strata/... now name "Strata 41cf05a0, ..."; the gpu-bringup scratch-copy test no longer copies the
removed include directories. Stale engine/strata paths in sealed .cu, .ptx, seal-plan and MANIFEST files are left as they are (hashes may depend on the bytes).
2026-11-23 21:19:11 +01:00
..

Leleka model format foundation

leleka-model-format exposes the existing bounded GGUF v3 parser as an independent Rust crate. It depends directly on sha2 and the standard library; it has no build script, C/FFI shim, GGML, Strata process/source link, CUDA or Python dependency. The existing control plane reexports its gguf module, so preparation, inspection, tokenizer extraction and tensor-export consumers keep their public paths.

The original parser geometry and its three tests were moved unchanged from control-plane/src/gguf.rs. Tensor block geometry and the legacy Flash-Next metadata guard retain their upstream references; see the provenance record (third_party/strata/UPSTREAM.md). Those helpers inspect metadata and byte layout, not tensor values or inference. Recognizing a quantization block size is not support for decoding or serving it.

Contract and limits

  • inspect validates GGUF v3 header structure and reports metadata/layout.
  • tensor_index additionally requires known block geometry, checked dimensions, alignment, bounded nonoverlapping tensor spans and consistent file bounds.
  • tensor_sha256 hashes one indexed tensor through a fixed 1 MiB buffer.
  • tokenizer_metadata extracts the existing Qwen35 tokenizer fields after header inspection; the separate tokenizer crate implements tokenization.
  • check_flash_next_profile is the existing specialized metadata admission check. It does not validate a complete model, tokenizer or numerical output.

All preexisting bounds/rejections remain unchanged. Path-based functions reopen the source; callers must keep the verified file stable between inspection and reading. File length checks do not detect same-size replacement or mutation. VerifiedGgufFile::open is a separate owned-file API: it accepts a sha256:<64 hex digits> artifact digest, opens one regular file, hashes the full file with a buffer of at most 64 KiB, and parses the strict tensor index through that same handle. The private file/index pair is retained; index() offers only an immutable borrow. stream_tensor validates a requested tensor number and byte range before delivering at most 64 KiB per callback, and tensor_sha256 hashes the indexed payload through that stream. Neither tensor operation reopens the pathname or allocates the full tensor. A consumer may explicitly collect chunks or return an I/O error to abort. Empty ranges at the tensor end are valid.

Renaming or replacing the original pathname after opening does not redirect this handle to a different file. The preliminary path metadata check rejects ordinary nonregular paths; the opened-file metadata check determines whether the accepted handle is regular. This does not make pathname lookup atomic against a malicious concurrent substitution during opening. The caller must supply a stable regular source for opening and prevent in-place writes for the entire verification, indexing and read lifetime. Keeping a file descriptor does not make its bytes immutable: even same-size writes to the same file remain visible and are not caught by file length checks. The stored artifact digest records verification at open, not a later content attestation. Size changes are refused before/after streaming, and short reads propagate errors; callbacks already delivered before an I/O failure cannot be retracted.

The existing path APIs and tensor geometry remain unchanged. Descriptor, tensor and tokenizer semantics, memory admission, GPU allocation, readiness and real-model parity remain separate work. The current leleka-control-plane still has its legacy GGML/build dependencies; extracting this crate does not remove them from that package or its runtime.

Standalone checks

cargo test --locked -p leleka-model-format
cargo clippy --locked -p leleka-model-format --all-targets -- -D warnings
cargo tree --locked -p leleka-model-format

These are container/parser checks with sanitized synthetic bytes. They do not establish inference, model quality, GPU operation or performance.

Owned-file tests use generated synthetic GGUF bytes: full-digest and tensor-byte oracles, multi-chunk and partial streaming, malformed digest, nonregular source, tamper, truncate, unsupported version/type and overlapping geometry rejection, range/overflow checks before callbacks, callback abort/recovery, Unix pathname replacement retaining the original file, and an explicit same-size in-place mutation counterexample. These tests do not qualify an immutable artifact store or a complete model loader.