Keep the Strata files Rust and the product read in third_party/strata (STRA-406)

Owner decision 2026-11-23: the vendored Strata tree engine/strata is removed for good. This first step moves what is still read
at build, test or ship time into one small directory, byte for byte:

- third_party/strata/LICENSE (MIT; `leleka engine license` embeds it, the packagers ship it)
- third_party/strata/ggml/LICENSE, project-maya/LICENSE, project-maya/NOTICE.md (licence texts the release packager ships)
- third_party/strata/serve/chat_template.jinja (one copy, embedded by control-plane server_api.rs and gateway-text prompt.rs)
- third_party/strata/serve/chat_golden.json (gateway-text prompt tests)
- third_party/strata/tests/data/native_experts/*.txt (control-plane native_pack tests)
- control-plane/tests/mcp_hub/mcp_fake_server.py next to its test harness
- third_party/strata/UPSTREAM.md replaces engine/upstream.md: pin 41cf05a0, URL, the 25 locally patched files, where the removed tree is in history

include_str! paths, deploy/build.rs (the `leleka version` Strata pin now reads third_party/strata/UPSTREAM.md), Dockerfile.static-cli,
.dockerignore, .gitattributes, the release packagers (package-5090.sh, package-release.py: the subtree facts of the removed tree are
dropped from PROVENANCE) and the evidence capture scripts follow the move. The tree itself is deleted in a later commit.
This commit is contained in:
Pavlo Ratushnyi
2026-11-23 21:11:53 +01:00
parent 81039bb407
commit b4db01728c
42 changed files with 138 additions and 103 deletions
+8 -8
View File
@@ -4,14 +4,14 @@ models/
captures/ captures/
logs/ logs/
control-plane/target/ control-plane/target/
engine/* third_party/*
!engine/strata/ !third_party/strata/
engine/strata/* third_party/strata/*
!engine/strata/LICENSE !third_party/strata/LICENSE
# prompt.rs embeds the pinned chat template at compile time # prompt.rs and server_api.rs embed the pinned chat template at compile time
!engine/strata/serve/ !third_party/strata/serve/
engine/strata/serve/* third_party/strata/serve/*
!engine/strata/serve/chat_template.jinja !third_party/strata/serve/chat_template.jinja
benchmarks/ benchmarks/
target/ target/
dist/ dist/
+3
View File
@@ -27,3 +27,6 @@ scripts/check-ci-coverage.py text eol=lf
scripts/install-pinned-rustup.sh text eol=lf scripts/install-pinned-rustup.sh text eol=lf
scripts/test-cuda-fixed-ptx.sh text eol=lf scripts/test-cuda-fixed-ptx.sh text eol=lf
.github/workflows/*.yml text eol=lf .github/workflows/*.yml text eol=lf
# Strata files kept for the shipped product and the Rust tests (third_party/strata/UPSTREAM.md): embedded and hashed byte for byte, never converted.
third_party/strata/** -text
+1 -1
View File
@@ -3,7 +3,7 @@
Leleka is a Rust/CUDA inference runtime for coding agents. Release **0.1** serves one model, **Qwen3.8-Flash-Next IQ3_S** (KAR level-2 PLE, MTP speculative Leleka is a Rust/CUDA inference runtime for coding agents. Release **0.1** serves one model, **Qwen3.8-Flash-Next IQ3_S** (KAR level-2 PLE, MTP speculative
decode), on **one RTX 5090 (32 GB)** at **262,144 tokens of context**, to Codex CLI and other clients over the Responses, Chat Completions and Messages APIs. decode), on **one RTX 5090 (32 GB)** at **262,144 tokens of context**, to Codex CLI and other clients over the Responses, Chat Completions and Messages APIs.
It is a Rust/CUDA port of the Original mode17 serve path of [Strata](https://github.com/Niko1221/Strata) (reference copy in `engine/strata/`, pinned at It is a Rust/CUDA port of the Original mode17 serve path of [Strata](https://github.com/Niko1221/Strata) (reference copy in `engine/strata/`, pinned at
upstream `41cf05a0`, see `engine/upstream.md`). Serving needs no Python and no CUDA toolkit on the host. upstream `41cf05a0`, see `third_party/strata/UPSTREAM.md`). Serving needs no Python and no CUDA toolkit on the host.
**Status of 0.1.** It runs real Codex sessions to completion and decodes about 155 tok/s on the 245k-token benchmark of the 5090 server (section "Numbers"). **Status of 0.1.** It runs real Codex sessions to completion and decodes about 155 tok/s on the 245k-token benchmark of the 5090 server (section "Numbers").
It is **not a formally quality-gated profile**, only the RTX 5090 is supported, and the limits below are real. Release notes: `spec node release/RELEASE-NOTES-5090-v0.1.md`; It is **not a formally quality-gated profile**, only the RTX 5090 is supported, and the limits below are real. Release notes: `spec node release/RELEASE-NOTES-5090-v0.1.md`;
+1 -1
View File
@@ -201,7 +201,7 @@ fn engine_info() -> Result<(), BoxError> {
} }
fn engine_license() -> Result<(), BoxError> { fn engine_license() -> Result<(), BoxError> {
print!("{}", include_str!("../../../engine/strata/LICENSE")); print!("{}", include_str!("../../../third_party/strata/LICENSE"));
Ok(()) Ok(())
} }
+6 -6
View File
@@ -236,12 +236,12 @@ fn shards_for(golden: &Golden) -> Vec<Shard> {
#[test] #[test]
fn real_golden_expert_tables_are_reproduced() { fn real_golden_expert_tables_are_reproduced() {
let goldens = [ let goldens = [
include_str!("../../../engine/strata/tests/data/native_experts/iq3_s.txt"), include_str!("../../../third_party/strata/tests/data/native_experts/iq3_s.txt"),
include_str!("../../../engine/strata/tests/data/native_experts/iq3_xxs.txt"), include_str!("../../../third_party/strata/tests/data/native_experts/iq3_xxs.txt"),
include_str!("../../../engine/strata/tests/data/native_experts/iq2_xs.txt"), include_str!("../../../third_party/strata/tests/data/native_experts/iq2_xs.txt"),
include_str!("../../../engine/strata/tests/data/native_experts/q2_0.txt"), include_str!("../../../third_party/strata/tests/data/native_experts/q2_0.txt"),
include_str!("../../../engine/strata/tests/data/native_experts/coder-iq1_m.txt"), include_str!("../../../third_party/strata/tests/data/native_experts/coder-iq1_m.txt"),
include_str!("../../../engine/strata/tests/data/native_experts/swift-iq2_xs.txt"), include_str!("../../../third_party/strata/tests/data/native_experts/swift-iq2_xs.txt"),
]; ];
for text in goldens { for text in goldens {
let golden = parse_golden(text); let golden = parse_golden(text);
+1 -1
View File
@@ -32,7 +32,7 @@ use crate::{
}; };
/// The chat template the Original serves in `/props` when the model ships none. /// The chat template the Original serves in `/props` when the model ships none.
pub const DEFAULT_CHAT_TEMPLATE: &str = include_str!("../../engine/strata/serve/chat_template.jinja"); pub const DEFAULT_CHAT_TEMPLATE: &str = include_str!("../../third_party/strata/serve/chat_template.jinja");
mod engine_lifecycle; mod engine_lifecycle;
pub use engine_lifecycle::*; pub use engine_lifecycle::*;
+1 -1
View File
@@ -7,7 +7,7 @@ use std::path::PathBuf;
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
pub(super) fn fake_path() -> PathBuf { pub(super) fn fake_path() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../engine/strata/serve/mcp_fake_server.py") PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/mcp_hub/mcp_fake_server.py")
} }
pub(super) fn python() -> Option<&'static str> { pub(super) fn python() -> Option<&'static str> {
+1 -1
View File
@@ -2,7 +2,7 @@
These unmodified source and header files come from `ggml-org/llama.cpp` commit These unmodified source and header files come from `ggml-org/llama.cpp` commit
`3cf03257f219afbe7334045ff7c6a06ac68c627d`, the same commit pinned by `3cf03257f219afbe7334045ff7c6a06ac68c627d`, the same commit pinned by
the imported Strata engine in `engine/strata/third_party/ggml/VERSION.txt`. the Strata engine pinned in `third_party/strata/UPSTREAM.md` (its `third_party/ggml/VERSION.txt`).
Their original repository paths are under `ggml/src/` or `ggml/include/`; Their original repository paths are under `ggml/src/` or `ggml/include/`;
`ggml-cpu-impl.h` came from `ggml/src/ggml-cpu/`. `SHA256SUMS` records every `ggml-cpu-impl.h` came from `ggml/src/ggml-cpu/`. `SHA256SUMS` records every
vendored file. The upstream MIT license is in `LICENSE`. vendored file. The upstream MIT license is in `LICENSE`.
+3 -3
View File
@@ -1,7 +1,7 @@
//! Build identity for `leleka version`. //! Build identity for `leleka version`.
//! //!
//! Embeds the git commit of the tree the binary was built from, whether that tree had uncommitted changes, and the //! Embeds the git commit of the tree the binary was built from, whether that tree had uncommitted changes, and the
//! Strata upstream pin recorded in `engine/upstream.md`. The release packager (`scripts/release/package-5090.sh`) //! Strata upstream pin recorded in `third_party/strata/UPSTREAM.md`. The release packager (`scripts/release/package-5090.sh`)
//! exports `LELEKA_GIT_COMMIT` and `LELEKA_GIT_DIRTY` so the values do not depend on `git` being callable from the //! exports `LELEKA_GIT_COMMIT` and `LELEKA_GIT_DIRTY` so the values do not depend on `git` being callable from the
//! build script; an ordinary developer build asks git itself and falls back to `unknown` (an exported tree has //! build script; an ordinary developer build asks git itself and falls back to `unknown` (an exported tree has
//! no `.git`). //! no `.git`).
@@ -22,7 +22,7 @@ fn git(repo: &Path, args: &[&str]) -> Option<String> {
Some(String::from_utf8_lossy(&output.stdout).trim().to_owned()) Some(String::from_utf8_lossy(&output.stdout).trim().to_owned())
} }
/// The 40-hex commit on the `Upstream commit SHA` row of the pin table in `engine/upstream.md`. /// The 40-hex commit on the `Upstream commit SHA` row of the pin table in `third_party/strata/UPSTREAM.md`.
fn upstream_pin(doc: &Path) -> Option<String> { fn upstream_pin(doc: &Path) -> Option<String> {
let text = std::fs::read_to_string(doc).ok()?; let text = std::fs::read_to_string(doc).ok()?;
let line = text let line = text
@@ -40,7 +40,7 @@ fn main() {
std::env::var_os("CARGO_MANIFEST_DIR").expect("cargo sets CARGO_MANIFEST_DIR"), std::env::var_os("CARGO_MANIFEST_DIR").expect("cargo sets CARGO_MANIFEST_DIR"),
); );
let repo = manifest.join("..").join(".."); let repo = manifest.join("..").join("..");
let doc = repo.join("engine").join("upstream.md"); let doc = repo.join("third_party").join("strata").join("UPSTREAM.md");
emit_reruns(&repo, &doc); emit_reruns(&repo, &doc);
let commit = std::env::var("LELEKA_GIT_COMMIT") let commit = std::env::var("LELEKA_GIT_COMMIT")
.ok() .ok()
+1 -1
View File
@@ -11,7 +11,7 @@ pub fn version_text() -> String {
format!( format!(
"leleka {} "leleka {}
commit {} ({}) commit {} ({})
strata pin {} (upstream commit of engine/upstream.md at build time) strata pin {} (upstream commit of third_party/strata/UPSTREAM.md at build time)
built for {}, {} profile", built for {}, {} profile",
env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_VERSION"),
env!("LELEKA_BUILD_COMMIT"), env!("LELEKA_BUILD_COMMIT"),
+1 -1
View File
@@ -11,7 +11,7 @@ fn the_version_names_the_commit_and_the_strata_pin_and_keeps_the_first_line() {
Some(concat!("leleka ", env!("CARGO_PKG_VERSION"))) Some(concat!("leleka ", env!("CARGO_PKG_VERSION")))
); );
let pin = env!("LELEKA_BUILD_STRATA_PIN"); let pin = env!("LELEKA_BUILD_STRATA_PIN");
// engine/upstream.md is in the repository this crate is built from; an exported tree without it reports `unknown`. // third_party/strata/UPSTREAM.md is in the repository this crate is built from; an exported tree without it reports `unknown`.
assert!( assert!(
pin == "unknown" || (pin.len() == 40 && pin.bytes().all(|b| b.is_ascii_hexdigit())), pin == "unknown" || (pin.len() == 40 && pin.bytes().all(|b| b.is_ascii_hexdigit())),
"{pin}" "{pin}"
+4 -4
View File
@@ -6,7 +6,7 @@
//! It is Strata's `STRP` v1 table: all 48 x 512 = 24,576 (layer, expert) pairs of the Qwen3.8-Flash-Next model, ranked //! It is Strata's `STRP` v1 table: all 48 x 512 = 24,576 (layer, expert) pairs of the Qwen3.8-Flash-Next model, ranked
//! by how often a calibration workload routed to them, plus the inverse slot table (24 + 4 x 24,576 + 4 x 48 x 512 = //! by how often a calibration workload routed to them, plus the inverse slot table (24 + 4 x 24,576 + 4 x 48 x 512 =
//! 196,632 bytes). `--expert-cache auto` fills the VRAM expert slots in that order //! 196,632 bytes). `--expert-cache auto` fills the VRAM expert slots in that order
//! (`engine/strata/tools/make_profile.py`, header comment). //! (Strata 41cf05a0, `tools/make_profile.py`, header comment).
//! //!
//! * It cannot be derived from the model weights: it is a routing statistic. Producing one means running the model on //! * It cannot be derived from the model weights: it is a routing statistic. Producing one means running the model on
//! calibration prompts with `--dump-routing` and ranking the routed experts (`make_profile.py`, Python, offline). The //! calibration prompts with `--dump-routing` and ranking the routed experts (`make_profile.py`, Python, offline). The
@@ -16,8 +16,8 @@
//! 43 argmax flips in 1,660 rows (2.59 %), VRAM share 48 % against 90 %. Any other table needs its own quality //! 43 argmax flips in 1,660 rows (2.59 %), VRAM share 48 % against 90 %. Any other table needs its own quality
//! gate; none exists, so the product pins the upstream bytes. //! gate; none exists, so the product pins the upstream bytes.
//! * Upstream publishes it at `data/expert-profile.bin` in https://github.com/Niko1221/Strata (MIT, //! * Upstream publishes it at `data/expert-profile.bin` in https://github.com/Niko1221/Strata (MIT,
//! `engine/strata/LICENSE`), byte-identical at the pin `41cf05a0` and at the older pin `d9ab8435` //! `third_party/strata/LICENSE`), byte-identical at the pin `41cf05a0` and at the older pin `d9ab8435`
//! (`engine/upstream.md` lists it as left out of the import because `*.bin` is git-ignored). Commit-pinned raw //! (the removed vendored tree left it out because `*.bin` is git-ignored). Commit-pinned raw
//! URLs are immutable content; the SHA-256 is what is trusted, not the URL. //! URLs are immutable content; the SHA-256 is what is trusted, not the URL.
//! //!
//! * The 192 KiB file is small, so the exact upstream bytes are committed (`crates/deploy/data/expert-profile.bin`, the //! * The 192 KiB file is small, so the exact upstream bytes are committed (`crates/deploy/data/expert-profile.bin`, the
@@ -47,7 +47,7 @@ pub static EMBEDDED: &[u8] = include_bytes!("../data/expert-profile.bin");
/// Nothing larger is hashed or accepted (the pinned file is 192 KiB). /// Nothing larger is hashed or accepted (the pinned file is 192 KiB).
pub const MAX_BYTES: u64 = 1 << 20; pub const MAX_BYTES: u64 = 1 << 20;
/// The Strata commit the sources below are pinned to (`engine/upstream.md`). /// The Strata commit the sources below are pinned to (`third_party/strata/UPSTREAM.md`).
pub const UPSTREAM_COMMIT: &str = "41cf05a06a25dd29103b7b27a2279a3f60c21876"; pub const UPSTREAM_COMMIT: &str = "41cf05a06a25dd29103b7b27a2279a3f60c21876";
/// Download sources, tried in order. All serve the same bytes; each result is checked against [`PINNED_SHA256`]. /// Download sources, tried in order. All serve the same bytes; each result is checked against [`PINNED_SHA256`].
pub const SOURCES: [&str; 3] = [ pub const SOURCES: [&str; 3] = [
+2 -2
View File
@@ -1,6 +1,6 @@
//! Chat prompt rendering: the model's real Jinja chat template, executed natively. //! Chat prompt rendering: the model's real Jinja chat template, executed natively.
//! //!
//! The pinned Strata template (`engine/strata/serve/chat_template.jinja`, the Qwen3.8-Flash-Next template with //! The pinned Strata template (`third_party/strata/serve/chat_template.jinja`, the Qwen3.8-Flash-Next template with
//! Unsloth's developer-role and tool fixes) is rendered with `minijinja`, configured like the Python server's //! Unsloth's developer-role and tool fixes) is rendered with `minijinja`, configured like the Python server's
//! `ChatTemplate` (`serve/frontend.py`): `trim_blocks` and `lstrip_blocks`, no autoescape, Python-style string //! `ChatTemplate` (`serve/frontend.py`): `trim_blocks` and `lstrip_blocks`, no autoescape, Python-style string
//! methods, a `raise_exception` global, and Python-compatible `tojson` and `trim` filters. All ten cases of //! methods, a `raise_exception` global, and Python-compatible `tojson` and `trim` filters. All ten cases of
@@ -32,7 +32,7 @@ use serde::{
use serde_json::Value as Plain; use serde_json::Value as Plain;
/// The pinned chat template, embedded at build time. /// The pinned chat template, embedded at build time.
pub const PINNED_TEMPLATE: &str = include_str!("../../../engine/strata/serve/chat_template.jinja"); pub const PINNED_TEMPLATE: &str = include_str!("../../../third_party/strata/serve/chat_template.jinja");
// --------------------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------------------
// ordered JSON // ordered JSON
+1 -1
View File
@@ -21,7 +21,7 @@ struct Case {
} }
fn golden() -> Vec<Case> { fn golden() -> Vec<Case> {
serde_json::from_str(include_str!("../../../../engine/strata/serve/chat_golden.json")).unwrap() serde_json::from_str(include_str!("../../../../third_party/strata/serve/chat_golden.json")).unwrap()
} }
/// All ten cases of `serve/chat_golden.json`, straight through the Jinja template: system merging, tool /// All ten cases of `serve/chat_golden.json`, straight through the Jinja template: system merging, tool
+1 -1
View File
@@ -9,7 +9,7 @@ their public paths.
The original parser geometry and its three tests were moved unchanged from `control-plane/src/gguf.rs`. 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 Tensor block geometry and the legacy Flash-Next metadata guard retain their
upstream references; see the provenance record (`engine/upstream.md`). upstream references; see the provenance record (`third_party/strata/UPSTREAM.md`).
Those helpers inspect metadata and byte layout, not tensor values or inference. 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. Recognizing a quantization block size is not support for decoding or serving it.
@@ -16,7 +16,7 @@ pub(super) fn read_index_file(file: &mut File, size: u64, strict: bool) -> Resul
/// (values per block, bytes per block) of each tensor kind. /// (values per block, bytes per block) of each tensor kind.
/// ///
/// Mirrors engine/strata/include/strata/artifact/gguf_reader.hpp at the /// Mirrors engine/strata/include/strata/artifact/gguf_reader.hpp at the
/// upstream commit recorded in engine/upstream.md, plus the kinds /// upstream commit recorded in third_party/strata/UPSTREAM.md, plus the kinds
/// engine/strata/tools/gguf_reader.py BLOCK_GEOMETRY knows beyond it (Q8_K 15, /// engine/strata/tools/gguf_reader.py BLOCK_GEOMETRY knows beyond it (Q8_K 15,
/// IQ1_S 19, F64 28, MXFP4 39, NVFP4 40). Geometry is only a byte count: a /// IQ1_S 19, F64 28, MXFP4 39, NVFP4 40). Geometry is only a byte count: a
/// consumer that cannot decode a kind still refuses it at use. Differential: /// consumer that cannot decode a kind still refuses it at use. Differential:
+2 -2
View File
@@ -14,8 +14,8 @@ COPY crates/ ./crates/
COPY manifests/ ./manifests/ COPY manifests/ ./manifests/
COPY desktop-core/ ./desktop-core/ COPY desktop-core/ ./desktop-core/
COPY control-plane/ ./control-plane/ COPY control-plane/ ./control-plane/
COPY engine/strata/LICENSE ./engine/strata/LICENSE COPY third_party/strata/LICENSE ./third_party/strata/LICENSE
COPY engine/strata/serve/chat_template.jinja ./engine/strata/serve/chat_template.jinja COPY third_party/strata/serve/chat_template.jinja ./third_party/strata/serve/chat_template.jinja
RUN cargo build --manifest-path control-plane/Cargo.toml --locked --release \ RUN cargo build --manifest-path control-plane/Cargo.toml --locked --release \
--target "${RUST_TARGET}" --bin leleka-api --target "${RUST_TARGET}" --bin leleka-api
+1 -1
View File
@@ -515,7 +515,7 @@ full payload and require memory and disk space proportional to its size.
`leleka-api engine-help` materializes the embedded worker and runs its `--help` `leleka-api engine-help` materializes the embedded worker and runs its `--help`
with no GPU visible; this checks loading and help output, not model readiness. with no GPU visible; this checks loading and help output, not model readiness.
`leleka-api --engine-license` prints the imported Strata MIT license. The `leleka-api --engine-license` prints the imported Strata MIT license. The
upstream record in `engine/upstream.md` remains authoritative and unchanged. upstream record in `third_party/strata/UPSTREAM.md` remains authoritative and unchanged.
Select the embedded worker explicitly in the usual configuration: Select the embedded worker explicitly in the usual configuration:
```json ```json
+1 -1
View File
@@ -479,7 +479,7 @@ on interactive performance.
\begin{description} \begin{description}
\item[Source history.] The source revisions and weight digests are \item[Source history.] The source revisions and weight digests are
listed in Table~\ref{tab:revisions}. The local Strata import and patch listed in Table~\ref{tab:revisions}. The local Strata import and patch
set are documented in \path{engine/upstream.md}. set are documented in \path{third_party/strata/UPSTREAM.md}.
\item[Weights.] The model-pair SHA-256 is the identity recorded by the \item[Weights.] The model-pair SHA-256 is the identity recorded by the
KAR/GGUF PLE comparison. The records and aggregate results are listed in KAR/GGUF PLE comparison. The records and aggregate results are listed in
\path{spec node build-validation.md}, \path{spec node kar-sparse-memfd.md} \path{spec node build-validation.md}, \path{spec node kar-sparse-memfd.md}
+1 -1
View File
@@ -16,7 +16,7 @@
# PH = PG and QQ = QP: A/A twins (same engine environment under another name) for the A/A control of a group A/B / a CUPTI window pair # PH = PG and QQ = QP: A/A twins (same engine environment under another name) for the A/A control of a group A/B / a CUPTI window pair
# S as E, and the replay is repeated once per entry of SPD_TUNES (default "none 0.35 0.30 none 0.35 0.30"): `strata_tune.pcie_frac` per request, files replay-<i>-<tune>.jsonl; the engine log is cut by request count # S as E, and the replay is repeated once per entry of SPD_TUNES (default "none 0.35 0.30 none 0.35 0.30"): `strata_tune.pcie_frac` per request, files replay-<i>-<tune>.jsonl; the engine log is cut by request count
# T<NN>[b] as E with LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.<NN> (T45 = the shipped 0.45, no override); a trailing b only names a repeat (T45b) # T<NN>[b] as E with LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.<NN> (T45 = the shipped 0.45, no override); a trailing b only names a repeat (T45b)
# K[b] as T45 (E) with the sm_120 kernel sets on (LELEKA_SM120_ATTN_DAILY, _GU_SWIGLU, _SIDE_MIXER = 1): the vanilla 0.1.50 defaults (engine/upstream.md); a trailing b names a repeat # K[b] as T45 (E) with the sm_120 kernel sets on (LELEKA_SM120_ATTN_DAILY, _GU_SWIGLU, _SIDE_MIXER = 1): the vanilla 0.1.50 defaults (third_party/strata/UPSTREAM.md); a trailing b names a repeat
# KA[x] as K without SIDE_MIXER (ATTN_DAILY + GU_SWIGLU: byte-identical in the model-free probe and the 243-row replay of 2026-10-29); KS[x] as K with SIDE_MIXER only # KA[x] as K without SIDE_MIXER (ATTN_DAILY + GU_SWIGLU: byte-identical in the model-free probe and the 243-row replay of 2026-10-29); KS[x] as K with SIDE_MIXER only
# L shipped (lossless, tail skip OFF) + sm_120 ATTN_DAILY + GU_SWIGLU (lever 1: byte-identical expected, gate = every out_sha equal to A) # L shipped (lossless, tail skip OFF) + sm_120 ATTN_DAILY + GU_SWIGLU (lever 1: byte-identical expected, gate = every out_sha equal to A)
# FA frozen placement: tier swaps off (LELEKA_ORIGINAL_SERVE_ADAPT_EVERY=0) and the fixed Original window (LELEKA_SPEC_ADAPTIVE=off LELEKA_SPEC=4, floor 0), nothing else; the identity-gate base # FA frozen placement: tier swaps off (LELEKA_ORIGINAL_SERVE_ADAPT_EVERY=0) and the fixed Original window (LELEKA_SPEC_ADAPTIVE=off LELEKA_SPEC=4, floor 0), nothing else; the identity-gate base
+1 -1
View File
@@ -24,5 +24,5 @@ ENG=$(ls -d /home/para/.local/share/strata/components/engine/*/strata | head -1)
} >"$BP/MANIFEST.sha256.new" } >"$BP/MANIFEST.sha256.new"
mv "$BP/MANIFEST.sha256.new" "$BP/MANIFEST.sha256" mv "$BP/MANIFEST.sha256.new" "$BP/MANIFEST.sha256"
cat "$D/bin-footprint3b/COMMIT.txt" "$D/bin-cpuservice/COMMIT.txt" >"$BP/PROVENANCE.txt" cat "$D/bin-footprint3b/COMMIT.txt" "$D/bin-cpuservice/COMMIT.txt" >"$BP/PROVENANCE.txt"
{ echo "vanilla engine component: $ENG"; echo "vanilla launcher: $HOME/work/vanilla-strata/control/bin/strata (Strata 0.2.6 per engine/upstream.md)"; date -u +%FT%TZ; } >>"$BP/PROVENANCE.txt" { echo "vanilla engine component: $ENG"; echo "vanilla launcher: $HOME/work/vanilla-strata/control/bin/strata (Strata 0.2.6 per third_party/strata/UPSTREAM.md)"; date -u +%FT%TZ; } >>"$BP/PROVENANCE.txt"
echo "installed; $(wc -l <"$BP/MANIFEST.sha256") inputs in $BP/MANIFEST.sha256" echo "installed; $(wc -l <"$BP/MANIFEST.sha256") inputs in $BP/MANIFEST.sha256"
+4 -4
View File
@@ -78,7 +78,7 @@ import tempfile
HERE = os.path.dirname(os.path.abspath(__file__)) HERE = os.path.dirname(os.path.abspath(__file__))
DEFAULT_ANALYZE = os.path.normpath(os.path.join(HERE, "..", "analyze_session.py")) DEFAULT_ANALYZE = os.path.normpath(os.path.join(HERE, "..", "analyze_session.py"))
DEFAULT_UPSTREAM_DOC = os.path.normpath(os.path.join(HERE, "..", "..", "..", "engine", "upstream.md")) DEFAULT_UPSTREAM_DOC = os.path.normpath(os.path.join(HERE, "..", "..", "..", "third_party", "strata", "UPSTREAM.md"))
EXIT_OK, EXIT_NO_CPU, EXIT_INPUT, EXIT_POWER_NA, EXIT_ANALYZE, EXIT_USAGE = 0, 2, 3, 4, 5, 64 EXIT_OK, EXIT_NO_CPU, EXIT_INPUT, EXIT_POWER_NA, EXIT_ANALYZE, EXIT_USAGE = 0, 2, 3, 4, 5, 64
GAP_S = 10.0 # a sample gap above this is counted (scripts/laptop/monitor.sh uses 10 s) GAP_S = 10.0 # a sample gap above this is counted (scripts/laptop/monitor.sh uses 10 s)
@@ -492,10 +492,10 @@ def upstream_commit(doc_path):
with open(doc_path, encoding="utf-8") as f: with open(doc_path, encoding="utf-8") as f:
text = f.read() text = f.read()
except OSError as exc: except OSError as exc:
raise fail_input("engine/upstream.md not readable (%s): %s" % (doc_path, exc.strerror or exc)) raise fail_input("third_party/strata/UPSTREAM.md not readable (%s): %s" % (doc_path, exc.strerror or exc))
m = re.search(r"\|\s*Upstream commit SHA\s*\|\s*`([0-9a-f]{40})`", text) m = re.search(r"\|\s*Upstream commit SHA\s*\|\s*`([0-9a-f]{40})`", text)
if not m: if not m:
raise fail_input("engine/upstream.md: no `Upstream commit SHA` row with a 40-hex commit") raise fail_input("third_party/strata/UPSTREAM.md: no `Upstream commit SHA` row with a 40-hex commit")
return m.group(1) return m.group(1)
@@ -655,7 +655,7 @@ def main(argv=None):
ap.add_argument("--power-series", required=True) ap.add_argument("--power-series", required=True)
ap.add_argument("--out", required=True) ap.add_argument("--out", required=True)
ap.add_argument("--analyze-session", default=DEFAULT_ANALYZE, help="path of analyze_session.py (default: the sibling in scripts/e2e)") ap.add_argument("--analyze-session", default=DEFAULT_ANALYZE, help="path of analyze_session.py (default: the sibling in scripts/e2e)")
ap.add_argument("--upstream-doc", default=DEFAULT_UPSTREAM_DOC, help="engine/upstream.md (default: this checkout's)") ap.add_argument("--upstream-doc", default=DEFAULT_UPSTREAM_DOC, help="third_party/strata/UPSTREAM.md (default: this checkout's)")
args = ap.parse_args(argv) args = ap.parse_args(argv)
try: try:
return run(args) return run(args)
+3 -3
View File
@@ -34,7 +34,7 @@ fit the S0.1 turn object (additionalProperties false): it is parsed and written
synthetic, long_session_argv, source_snapshot_sha256, owner_attestation, foreign_load) PLUS the facts a vanilla log cannot carry: synthetic, long_session_argv, source_snapshot_sha256, owner_attestation, foreign_load) PLUS the facts a vanilla log cannot carry:
model {digest, digest_mapping}, configuration {context_tokens, kv, slots, batch, speculation}, cache {state, metric, value, unit}, model {digest, digest_mapping}, configuration {context_tokens, kv, slots, batch, speculation}, cache {state, metric, value, unit},
hardware {cpu_model, gpu_name (optional: sampler or nvidia-smi), os (optional: this machine)}, software {cuda_version, driver_version (optional), hardware {cpu_model, gpu_name (optional: sampler or nvidia-smi), os (optional: this machine)}, software {cuda_version, driver_version (optional),
strata_upstream_commit (optional: engine/upstream.md)}, vanilla_noskip_environment [NAME=VALUE, ...] (vanilla_noskip only: the environment the engine strata_upstream_commit (optional: third_party/strata/UPSTREAM.md)}, vanilla_noskip_environment [NAME=VALUE, ...] (vanilla_noskip only: the environment the engine
was started with), vanilla_family {control_printed [lines], predicate {tool, output} | "unavailable: <blocker>", binary_identity {engine_version, sha256}} was started with), vanilla_family {control_printed [lines], predicate {tool, output} | "unavailable: <blocker>", binary_identity {engine_version, sha256}}
(the fallback of --family-dir). (the fallback of --family-dir).
--family-dir: control.log (the engine log of the start-up with STRATA_FORCE_AVX2=1), predicate.json ({tool, output}; absent and not in --meta = --family-dir: control.log (the engine log of the start-up with STRATA_FORCE_AVX2=1), predicate.json ({tool, output}; absent and not in --meta =
@@ -611,8 +611,8 @@ def main(argv=None):
ap.add_argument("--out", required=True) ap.add_argument("--out", required=True)
ap.add_argument("--family-dir", default=None, help="control.log, predicate.json, binary_identity.json") ap.add_argument("--family-dir", default=None, help="control.log, predicate.json, binary_identity.json")
ap.add_argument("--parsed-out", default=None, help="write the parsed per-turn engine values and per-round timing here (not part of the record)") ap.add_argument("--parsed-out", default=None, help="write the parsed per-turn engine values and per-round timing here (not part of the record)")
ap.add_argument("--upstream-doc", default=os.path.normpath(os.path.join(HERE, "..", "..", "..", "engine", "upstream.md")), ap.add_argument("--upstream-doc", default=os.path.normpath(os.path.join(HERE, "..", "..", "..", "third_party", "strata", "UPSTREAM.md")),
help="engine/upstream.md (default: this checkout's)") help="third_party/strata/UPSTREAM.md (default: this checkout's)")
return run_capture(ap.parse_args(argv)) return run_capture(ap.parse_args(argv))
except Fail as exc: except Fail as exc:
sys.stderr.write("capture_vanilla: %s\n" % exc.message) sys.stderr.write("capture_vanilla: %s\n" % exc.message)
+6 -34
View File
@@ -8,7 +8,7 @@ repository tree (for templates, sealed PTX and docs) and a provenance record. Ou
leleka-VERSION-COMMIT12-linux-x86_64.tar.xz.sha256 leleka-VERSION-COMMIT12-linux-x86_64.tar.xz.sha256
The provenance record names the git commit, whether the tree was clean, and the local changes to the imported The provenance record names the git commit, whether the tree was clean, and the local changes to the imported
Strata source relative to the upstream commit in engine/upstream.md. Builds happen in WSL/Linux from an exported tree Strata source relative to the upstream commit in third_party/strata/UPSTREAM.md. Builds happen in WSL/Linux from an exported tree
(no .git there), so the record is produced where git exists: (no .git there), so the record is produced where git exists:
python3 scripts/package-release.py provenance --repo . --out provenance.json python3 scripts/package-release.py provenance --repo . --out provenance.json
@@ -36,8 +36,7 @@ TEMPLATES = [
'deploy/rust-runtime/leleka-inference.service', 'deploy/rust-runtime/leleka-inference.service',
'deploy/rust-runtime/runtime.env.example', 'deploy/rust-runtime/runtime.env.example',
] ]
UPSTREAM_DOC = 'engine/upstream.md' UPSTREAM_DOC = 'third_party/strata/UPSTREAM.md'
SUBTREE = 'engine/strata'
def run(args, cwd=None, check=True): def run(args, cwd=None, check=True):
@@ -65,7 +64,7 @@ def upstream_record(repo):
def provenance(repo, allow_dirty=False): def provenance(repo, allow_dirty=False):
"""Git commit, cleanliness, and the local changes to engine/strata relative to the recorded upstream commit.""" """Git commit, cleanliness and the recorded Strata upstream commit."""
url, upstream_sha = upstream_record(repo) url, upstream_sha = upstream_record(repo)
commit = run(['git', '-C', repo, 'rev-parse', 'HEAD']) commit = run(['git', '-C', repo, 'rev-parse', 'HEAD'])
status = run(['git', '-C', repo, 'status', '--porcelain', '--untracked-files=normal']) status = run(['git', '-C', repo, 'status', '--porcelain', '--untracked-files=normal'])
@@ -74,10 +73,6 @@ def provenance(repo, allow_dirty=False):
diff_digest = hashlib.sha256(run(['git', '-C', repo, 'diff', 'HEAD', '--binary'], check=False).encode()).hexdigest() if dirty_files else None diff_digest = hashlib.sha256(run(['git', '-C', repo, 'diff', 'HEAD', '--binary'], check=False).encode()).hexdigest() if dirty_files else None
if dirty_files and not allow_dirty: if dirty_files and not allow_dirty:
raise RuntimeError(f'the tree has {len(dirty_files)} uncommitted change(s); commit them or pass --allow-dirty (the release is then marked dirty)') raise RuntimeError(f'the tree has {len(dirty_files)} uncommitted change(s); commit them or pass --allow-dirty (the release is then marked dirty)')
# Import commit(s): the first commit that touched the subtree.
history = run(['git', '-C', repo, 'log', '--format=%H %s', '--reverse', '--', SUBTREE]).splitlines()
import_commit = history[0].split(' ', 1)[0] if history else None
subtree_tree = run(['git', '-C', repo, 'rev-parse', f'HEAD:{SUBTREE}'])
record = { record = {
'schema_version': 1, 'schema_version': 1,
'git_commit': commit, 'git_commit': commit,
@@ -90,33 +85,10 @@ def provenance(repo, allow_dirty=False):
'strata': { 'strata': {
'upstream_url': url, 'upstream_url': url,
'upstream_commit': upstream_sha, 'upstream_commit': upstream_sha,
'subtree_path': SUBTREE, 'record': UPSTREAM_DOC,
'subtree_tree_at_head': subtree_tree, 'vendored_tree': 'removed (STRA-406); the full tree is in git history before the removal commit, see the record',
'import_commit': import_commit,
'commits_touching_subtree': len(history),
'local_patch_commits': [line.split(' ', 1) for line in history[1:]][:200],
}, },
} }
# Local changes since the import (the committed ones), and against the upstream tree when it is present.
if import_commit:
stat = run(['git', '-C', repo, 'diff', '--shortstat', f'{import_commit}', 'HEAD', '--', SUBTREE], check=False)
diff = run(['git', '-C', repo, 'diff', '--binary', f'{import_commit}', 'HEAD', '--', SUBTREE], check=False)
record['strata']['diff_since_import'] = {
'shortstat': stat or 'no change',
'diff_sha256': hashlib.sha256(diff.encode()).hexdigest(),
}
have_upstream = subprocess.run(['git', '-C', str(repo), 'cat-file', '-e', f'{upstream_sha}^{{commit}}'], capture_output=True).returncode == 0
if have_upstream:
upstream_tree = run(['git', '-C', repo, 'rev-parse', f'{upstream_sha}^{{tree}}'])
record['strata']['diff_vs_upstream'] = {
'upstream_tree': upstream_tree,
'shortstat': run(['git', '-C', repo, 'diff', '--shortstat', upstream_tree, f'HEAD:{SUBTREE}'], check=False) or 'identical',
}
else:
record['strata']['diff_vs_upstream'] = {
'available': False,
'why': f'the upstream commit {upstream_sha} is not in this repository (fetch the strata-upstream remote to compare)',
}
return record return record
@@ -176,7 +148,7 @@ def package(args):
members[f'share/leleka/templates/{Path(template).name}'] = ((repo / template).read_bytes(), False) members[f'share/leleka/templates/{Path(template).name}'] = ((repo / template).read_bytes(), False)
for profile in sorted((repo / 'deploy/rust-runtime/profiles').glob('*.json')): for profile in sorted((repo / 'deploy/rust-runtime/profiles').glob('*.json')):
members[f'share/leleka/profiles/{profile.name}'] = (profile.read_bytes(), False) members[f'share/leleka/profiles/{profile.name}'] = (profile.read_bytes(), False)
for doc in ['engine/upstream.md']: for doc in ['third_party/strata/UPSTREAM.md']:
if (repo / doc).is_file(): if (repo / doc).is_file():
members[f'share/leleka/docs/{Path(doc).name}'] = ((repo / doc).read_bytes(), False) members[f'share/leleka/docs/{Path(doc).name}'] = ((repo / doc).read_bytes(), False)
members['install.sh'] = ((repo / 'deploy/rust-runtime/install.sh').read_bytes(), True) members['install.sh'] = ((repo / 'deploy/rust-runtime/install.sh').read_bytes(), True)
+17 -19
View File
@@ -36,9 +36,9 @@ set -eu
# --- the release identity: change these only with the checklist ------------------------------------------------------------------ # --- the release identity: change these only with the checklist ------------------------------------------------------------------
RELEASE_TAG=leleka-5090-v0.1 RELEASE_TAG=leleka-5090-v0.1
RELEASE_STRATA_PIN=41cf05a06a25dd29103b7b27a2279a3f60c21876 # engine/upstream.md; upstream 0.2.8 exists, the pin is NOT moved for this release RELEASE_STRATA_PIN=41cf05a06a25dd29103b7b27a2279a3f60c21876 # third_party/strata/UPSTREAM.md; upstream 0.2.8 exists, the pin is NOT moved for this release
BINARIES="leleka leleka-api leleka-inference leleka-daemon leleka-cli leleka-seal-exec" BINARIES="leleka leleka-api leleka-inference leleka-daemon leleka-cli leleka-seal-exec"
DOCS="engine/upstream.md" DOCS="third_party/strata/UPSTREAM.md"
UNATTENDED_DEFAULTS="scripts/ops/README.md scripts/ops/install-leleka-service.sh scripts/ops/leleka.service scripts/ops/owner-wifi-stability.sh" UNATTENDED_DEFAULTS="scripts/ops/README.md scripts/ops/install-leleka-service.sh scripts/ops/leleka.service scripts/ops/owner-wifi-stability.sh"
MAX_TRACKED_BYTES=20000000 MAX_TRACKED_BYTES=20000000
SECRET_RE='-----BEGIN [A-Z ]*PRIVATE KEY-----|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{30,}|hf_[A-Za-z0-9]{30,}|sk-[A-Za-z0-9]{32,}|xox[abp]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{35}|eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.' SECRET_RE='-----BEGIN [A-Z ]*PRIVATE KEY-----|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{30,}|hf_[A-Za-z0-9]{30,}|sk-[A-Za-z0-9]{32,}|xox[abp]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{35}|eyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.'
@@ -111,14 +111,12 @@ else
P_BRANCH=$(git rev-parse --abbrev-ref HEAD) P_BRANCH=$(git rev-parse --abbrev-ref HEAD)
P_DESCRIBE=$(git describe --always --abbrev=12 2>/dev/null || echo unknown) P_DESCRIBE=$(git describe --always --abbrev=12 2>/dev/null || echo unknown)
P_EPOCH=$(git log -1 --format=%ct HEAD) P_EPOCH=$(git log -1 --format=%ct HEAD)
P_SUBTREE=$(git rev-parse HEAD:engine/strata)
P_TOUCHING=$(git log --format=%h -- engine/strata | wc -l | tr -d ' ')
P_TREE=$(git rev-parse 'HEAD^{tree}') P_TREE=$(git rev-parse 'HEAD^{tree}')
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then P_DIRTY=true; else P_DIRTY=false; fi if [ -n "$(git status --porcelain --untracked-files=no)" ]; then P_DIRTY=true; else P_DIRTY=false; fi
fi fi
release_version() { field version <crates/deploy/Cargo.toml; } release_version() { field version <crates/deploy/Cargo.toml; }
upstream_pin() { grep 'Upstream commit SHA' engine/upstream.md | head -1 | sed -n 's/.*`\([0-9a-f]\{40\}\)`.*/\1/p'; } upstream_pin() { grep 'Upstream commit SHA' third_party/strata/UPSTREAM.md | head -1 | sed -n 's/.*`\([0-9a-f]\{40\}\)`.*/\1/p'; }
upstream_url() { grep 'Upstream repository URL' engine/upstream.md | head -1 | sed -n 's/.*| *\(https[^ |]*\) *|.*/\1/p'; } upstream_url() { grep 'Upstream repository URL' third_party/strata/UPSTREAM.md | head -1 | sed -n 's/.*| *\(https[^ |]*\) *|.*/\1/p'; }
ptx_sm120_list() { find crates/cuda-driver -name '*.ptx' -not -path '*/ptx-sm86/*' | LC_ALL=C sort; } ptx_sm120_list() { find crates/cuda-driver -name '*.ptx' -not -path '*/ptx-sm86/*' | LC_ALL=C sort; }
ptx_all_list() { find crates -name '*.ptx' | LC_ALL=C sort; } ptx_all_list() { find crates -name '*.ptx' | LC_ALL=C sort; }
@@ -164,7 +162,7 @@ gate_toolchain() {
gate_pin() { gate_pin() {
pin=$(upstream_pin) pin=$(upstream_pin)
if [ "$pin" = "$RELEASE_STRATA_PIN" ]; then ok "Strata pin is $RELEASE_STRATA_PIN (engine/upstream.md)"; else bad "engine/upstream.md pins '${pin:-nothing}', this release is defined for $RELEASE_STRATA_PIN: moving the pin needs the checklist section 3"; fi if [ "$pin" = "$RELEASE_STRATA_PIN" ]; then ok "Strata pin is $RELEASE_STRATA_PIN (third_party/strata/UPSTREAM.md)"; else bad "third_party/strata/UPSTREAM.md pins '${pin:-nothing}', this release is defined for $RELEASE_STRATA_PIN: moving the pin needs the checklist section 3"; fi
} }
gate_ptx() { gate_ptx() {
@@ -191,12 +189,12 @@ gate_lf() {
if ! no_cr "$f"; then crlf=$((crlf + 1)); printf ' CRLF: %s\n' "$f"; fi if ! no_cr "$f"; then crlf=$((crlf + 1)); printf ' CRLF: %s\n' "$f"; fi
done done
if [ "$mode" = repo ]; then if [ "$mode" = repo ]; then
all=$(git ls-files --eol | grep -v 'engine/strata/' | awk '$2 ~ /w\/crlf/' | wc -l | tr -d ' ') all=$(git ls-files --eol | awk '$2 ~ /w\/crlf/' | wc -l | tr -d ' ')
fi fi
if [ "$crlf" = 0 ]; then if [ "$crlf" = 0 ]; then
ok "the files copied into the archive or compiled in as text are LF" ok "the files copied into the archive or compiled in as text are LF"
elif [ "$command" = check ] || [ "$command" = stage-source ]; then elif [ "$command" = check ] || [ "$command" = stage-source ]; then
note "$crlf of those files, and $all tracked files outside engine/strata in all, are CRLF in this working tree (core.autocrlf); build only from the LF export made by stage-source" note "$crlf of those files, and $all tracked files in all, are CRLF in this working tree (core.autocrlf); build only from the LF export made by stage-source"
else else
bad "$crlf files that are copied or compiled in are CRLF" bad "$crlf files that are copied or compiled in are CRLF"
fi fi
@@ -204,8 +202,8 @@ gate_lf() {
gate_tracked_files() { gate_tracked_files() {
[ "$mode" = repo ] || { note "tracked-file and secret gates ran at staging time (PROVENANCE.env)"; return 0; } [ "$mode" = repo ] || { note "tracked-file and secret gates ran at staging time (PROVENANCE.env)"; return 0; }
hits=$(git ls-files | grep -E "$FORBIDDEN_NAME_RE" | grep -vE '^(benchmarks/(results|quality)/|engine/strata/bench/results/)' || true) hits=$(git ls-files | grep -E "$FORBIDDEN_NAME_RE" | grep -vE '^(benchmarks/(results|quality)/)' || true)
if [ -z "$hits" ]; then ok "no weights, keys, credentials, logs or capture-type files are tracked (benchmarks/ result tables and upstream bench/results excluded; see the audit)"; else bad "forbidden file types are tracked:"; printf '%s\n' "$hits" | head -20; fi if [ -z "$hits" ]; then ok "no weights, keys, credentials, logs or capture-type files are tracked (benchmarks/ result tables and excluded; see the audit)"; else bad "forbidden file types are tracked:"; printf '%s\n' "$hits" | head -20; fi
big=$(git ls-tree -r -l HEAD | awk -v m="$MAX_TRACKED_BYTES" '$4 > m { print $4, $5 }') big=$(git ls-tree -r -l HEAD | awk -v m="$MAX_TRACKED_BYTES" '$4 > m { print $4, $5 }')
if [ -z "$big" ]; then ok "no tracked file is larger than $MAX_TRACKED_BYTES bytes"; else bad "tracked files over $MAX_TRACKED_BYTES bytes:"; printf '%s\n' "$big"; fi if [ -z "$big" ]; then ok "no tracked file is larger than $MAX_TRACKED_BYTES bytes"; else bad "tracked files over $MAX_TRACKED_BYTES bytes:"; printf '%s\n' "$big"; fi
} }
@@ -224,7 +222,7 @@ gate_licence() {
if ! grep -qE '^license(\.workspace)? *=' "$manifest"; then unlicensed="$unlicensed $(field name <"$manifest")"; fi if ! grep -qE '^license(\.workspace)? *=' "$manifest"; then unlicensed="$unlicensed $(field name <"$manifest")"; fi
done done
if [ -z "$unlicensed" ]; then ok "every workspace crate declares a licence"; else bad "workspace crates without a licence field:$unlicensed (these build the shipped binaries leleka-api, leleka-inference, leleka-daemon, leleka-cli, leleka-seal-exec)"; fi if [ -z "$unlicensed" ]; then ok "every workspace crate declares a licence"; else bad "workspace crates without a licence field:$unlicensed (these build the shipped binaries leleka-api, leleka-inference, leleka-daemon, leleka-cli, leleka-seal-exec)"; fi
for f in engine/strata/LICENSE engine/strata/third_party/ggml/LICENSE engine/strata/third_party/project-maya/LICENSE engine/strata/third_party/project-maya/NOTICE.md control-plane/third_party/ggml/LICENSE crates/native-cpu-expert/LICENSE.ggml crates/native-cpu-expert/LICENSE.strata crates/quant-core/LICENSE-GGML crates/cpu-sys/NOTICE.colibri; do for f in third_party/strata/LICENSE third_party/strata/ggml/LICENSE third_party/strata/project-maya/LICENSE third_party/strata/project-maya/NOTICE.md control-plane/third_party/ggml/LICENSE crates/native-cpu-expert/LICENSE.ggml crates/native-cpu-expert/LICENSE.strata crates/quant-core/LICENSE-GGML crates/cpu-sys/NOTICE.colibri; do
[ -f "$f" ] || bad "third-party licence text missing: $f" [ -f "$f" ] || bad "third-party licence text missing: $f"
done done
} }
@@ -257,7 +255,7 @@ run_stage() {
mkdir -p "$dest" mkdir -p "$dest"
git -c core.autocrlf=false -c core.eol=lf archive --format=tar HEAD | tar -x -C "$dest" git -c core.autocrlf=false -c core.eol=lf archive --format=tar HEAD | tar -x -C "$dest"
{ {
printf "P_COMMIT='%s'\nP_SHORT='%s'\nP_BRANCH='%s'\nP_DESCRIBE='%s'\nP_EPOCH='%s'\nP_SUBTREE='%s'\nP_TOUCHING='%s'\nP_TREE='%s'\n" "$P_COMMIT" "$P_SHORT" "$P_BRANCH" "$P_DESCRIBE" "$P_EPOCH" "$P_SUBTREE" "$P_TOUCHING" "$P_TREE" printf "P_COMMIT='%s'\nP_SHORT='%s'\nP_BRANCH='%s'\nP_DESCRIBE='%s'\nP_EPOCH='%s'\nP_TREE='%s'\n" "$P_COMMIT" "$P_SHORT" "$P_BRANCH" "$P_DESCRIBE" "$P_EPOCH" "$P_TREE"
printf "P_CHECK_FAILURES='%s'\nP_STAGED_UTC='%s'\n" "$failures" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" printf "P_CHECK_FAILURES='%s'\nP_STAGED_UTC='%s'\n" "$failures" "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
} >"$dest/PROVENANCE.env" } >"$dest/PROVENANCE.env"
crlf_after=$(cd "$dest" && for f in $(ptx_all_list); do no_cr "$f" || echo "$f"; done | wc -l | tr -d ' ') crlf_after=$(cd "$dest" && for f in $(ptx_all_list); do no_cr "$f" || echo "$f"; done | wc -l | tr -d ' ')
@@ -315,15 +313,15 @@ run_package() {
( cd "$stage/share/leleka/ptx/sm_120" && LC_ALL=C ls | grep -v '^SHA256SUMS$' | xargs sha256sum >SHA256SUMS ) ( cd "$stage/share/leleka/ptx/sm_120" && LC_ALL=C ls | grep -v '^SHA256SUMS$' | xargs sha256sum >SHA256SUMS )
for d in $DOCS; do for d in $DOCS; do
[ -f "$d" ] || die "$d is missing" [ -f "$d" ] || die "$d is missing"
rel=${d#engine/}; mkdir -p "$stage/share/leleka/docs/$(dirname "$rel")"; cp "$d" "$stage/share/leleka/docs/$rel" rel=${d#third_party/strata/}; mkdir -p "$stage/share/leleka/docs/$(dirname "$rel")"; cp "$d" "$stage/share/leleka/docs/$rel"
done done
[ ! -f LICENSE ] || cp LICENSE "$stage/LICENSE" [ ! -f LICENSE ] || cp LICENSE "$stage/LICENSE"
cp engine/strata/LICENSE "$stage/share/leleka/licenses/strata-MIT.txt" cp third_party/strata/LICENSE "$stage/share/leleka/licenses/strata-MIT.txt"
cp crates/deploy/data/expert-profile.NOTICE "$stage/share/leleka/licenses/expert-profile-NOTICE.txt" cp crates/deploy/data/expert-profile.NOTICE "$stage/share/leleka/licenses/expert-profile-NOTICE.txt"
cp crates/deploy/data/expert-profile.NOTICE "$stage/share/leleka/licenses/strata-expert-profile-NOTICE.txt" cp crates/deploy/data/expert-profile.NOTICE "$stage/share/leleka/licenses/strata-expert-profile-NOTICE.txt"
cp engine/strata/third_party/ggml/LICENSE "$stage/share/leleka/licenses/ggml-MIT.txt" cp third_party/strata/ggml/LICENSE "$stage/share/leleka/licenses/ggml-MIT.txt"
cp engine/strata/third_party/project-maya/LICENSE "$stage/share/leleka/licenses/project-maya-MIT.txt" cp third_party/strata/project-maya/LICENSE "$stage/share/leleka/licenses/project-maya-MIT.txt"
cp engine/strata/third_party/project-maya/NOTICE.md "$stage/share/leleka/licenses/project-maya-NOTICE.md" cp third_party/strata/project-maya/NOTICE.md "$stage/share/leleka/licenses/project-maya-NOTICE.md"
cp crates/cpu-sys/NOTICE.colibri "$stage/share/leleka/licenses/colibri-NOTICE.txt" cp crates/cpu-sys/NOTICE.colibri "$stage/share/leleka/licenses/colibri-NOTICE.txt"
[ ! -f deploy/release/third-party-crates-5090-v0.1.tsv ] || cp deploy/release/third-party-crates-5090-v0.1.tsv "$stage/share/leleka/licenses/rust-crates.tsv" [ ! -f deploy/release/third-party-crates-5090-v0.1.tsv ] || cp deploy/release/third-party-crates-5090-v0.1.tsv "$stage/share/leleka/licenses/rust-crates.tsv"
found_unattended= found_unattended=
@@ -355,7 +353,7 @@ run_package() {
{ {
printf '{\n "schema_version": 1,\n "release": "%s",\n "git_commit": "%s",\n "git_branch": "%s",\n "git_describe": "%s",\n "git_tree": "%s",\n "dirty": %s,\n' "$RELEASE_TAG" "$P_COMMIT" "$P_BRANCH" "$P_DESCRIBE" "$P_TREE" "$dirty" printf '{\n "schema_version": 1,\n "release": "%s",\n "git_commit": "%s",\n "git_branch": "%s",\n "git_describe": "%s",\n "git_tree": "%s",\n "dirty": %s,\n' "$RELEASE_TAG" "$P_COMMIT" "$P_BRANCH" "$P_DESCRIBE" "$P_TREE" "$dirty"
printf ' "cargo_lock_sha256": "%s",\n "rust_toolchain": "%s",\n "built_in_mode": "%s",\n' "$cargo_lock" "$(field channel <rust-toolchain.toml)" "$mode" printf ' "cargo_lock_sha256": "%s",\n "rust_toolchain": "%s",\n "built_in_mode": "%s",\n' "$cargo_lock" "$(field channel <rust-toolchain.toml)" "$mode"
printf ' "strata": {"upstream_url": "%s", "upstream_commit": "%s", "subtree_path": "engine/strata", "subtree_tree_at_head": "%s", "commits_touching_subtree": %s, "note": "engine/strata is the reference and is not modified by this release; see engine/upstream.md (local patches are listed there)"}\n}\n' "$(upstream_url)" "$(upstream_pin)" "$P_SUBTREE" "$P_TOUCHING" printf ' "strata": {"upstream_url": "%s", "upstream_commit": "%s", "note": "the vendored Strata tree is not part of this release and was removed from the repository; see third_party/strata/UPSTREAM.md (pin, local patches, where the tree is in history)"}\n}\n' "$(upstream_url)" "$(upstream_pin)"
} >"$stage/PROVENANCE.json" } >"$stage/PROVENANCE.json"
printf '%s\n' "$RELEASE_TAG" >"$stage/RELEASE" printf '%s\n' "$RELEASE_TAG" >"$stage/RELEASE"
+1 -1
View File
@@ -51,7 +51,7 @@ def main(image):
assert version.startswith('leleka-api '), version assert version.startswith('leleka-api '), version
license_text = docker('run', '--rm', *common, '--network', 'none', image, license_text = docker('run', '--rm', *common, '--network', 'none', image,
'--engine-license').stdout '--engine-license').stdout
assert license_text == (root / 'engine/strata/LICENSE').read_text() assert license_text == (root / 'third_party/strata/LICENSE').read_text()
info = json.loads(docker('run', '--rm', *common, '--network', 'none', image, info = json.loads(docker('run', '--rm', *common, '--network', 'none', image,
'engine-info').stdout) 'engine-info').stdout)
assert info['embedded'] is False and info['model_bundled'] is False, info assert info['embedded'] is False and info['model_bundled'] is False, info
+62
View File
@@ -0,0 +1,62 @@
# Strata upstream record
Leleka is a Rust/CUDA port of the Original mode17 serve path of Strata. The Strata source tree that was vendored under
`engine/strata/` is removed; this directory keeps the few files that Rust code and the shipped product still read, and this record.
## Pin
| Field | Value |
| --- | --- |
| Upstream repository URL | https://github.com/Niko1221/Strata.git |
| Upstream commit SHA | `41cf05a06a25dd29103b7b27a2279a3f60c21876` |
| Upstream commit date | 2026-10-25 11:35 +0100 |
| Upstream version at the pin | engine and Control 0.1.50, Terminal and app 0.2.5 |
| Licence | MIT, `LICENSE` in this directory (shipped by `leleka engine license` and by the release packager) |
`leleka version` prints the `Upstream commit SHA` above (`crates/deploy/build.rs` reads the row of this table), and the release packager
records it. Do not advance the pin silently: choose a commit, review the diff from the pin, and change this row in the same commit.
The old pin was `d9ab8435f654c368c586340d490915f6addf56a3` (engine 0.1.35, upstream tree `487c4cc0`, identical to upstream commit
`5b734e42`; upstream rewrote its history, so `d9ab8435` is not an ancestor of upstream `main`).
## What is kept here, and who reads it
All of these are byte-identical to upstream at the pin (`.gitattributes` keeps them out of line-ending conversion).
| File | Read by |
| --- | --- |
| `LICENSE` | `leleka engine license` (`control-plane/src/cli/operations.rs`), `deploy/Dockerfile.static-cli`, the release packagers |
| `ggml/LICENSE`, `project-maya/LICENSE`, `project-maya/NOTICE.md` | release packagers (licence texts shipped in `share/leleka/licenses/`) |
| `serve/chat_template.jinja` | `leleka-gateway-text` (`prompt.rs`) and `leleka-control-plane` (`server_api.rs`), both with `include_str!` |
| `serve/chat_golden.json` | `leleka-gateway-text` prompt tests |
| `tests/data/native_experts/*.txt` | `leleka-control-plane` `native_pack` tests |
`control-plane/tests/mcp_hub/mcp_fake_server.py` is the upstream `serve/mcp_fake_server.py`, kept next to the test that runs it.
## Local patches that the removed tree carried
The tree at `engine/strata/` was upstream `41cf05a0` plus 25 locally patched files (21 modified, 4 new), all default-off or build-profile only:
- `CMakeLists.txt` (`STRATA_CUDA_STATIC` profile, KAR and PLE targets, keyless sources)
- `include/strata/core/expert_source.hpp`, `include/strata/core/keyless.hpp` (new), `include/strata/core/layer.hpp`,
`include/strata/core/verify.hpp`, `include/strata/kernels/kv_stream.hpp`, `include/strata/kernels/ngram.hpp`,
`include/strata/kernels/qsa_decode_attn.hpp`
- `src/core/conversation_snapshot.cpp`, `src/core/conversation_snapshot_test.cpp`, `src/core/expert_source.cpp`,
`src/core/keyless.cpp` (new), `src/core/layer.cpp`, `src/core/mtp.cpp`, `src/core/verify.cpp`
- `src/kernels/cuda/keyless.cu` (new), `src/kernels/cuda/kv_q8.cu`, `src/kernels/cuda/kv_stream.cu`,
`src/kernels/cuda/qsa_decode_attn.cu`, `src/kernels/keyless_parity.cpp` (new), `src/kernels/kv_stream_parity.cpp`,
`src/kernels/ngram.cpp`
- `src/prefill/kernels.cu`, `src/prefill/prefill.cpp`, `src/program/generate.cpp`
## Where the removed tree is
The full tree is in git history before the removal commit: `87e2633af` ("bring the Strata subtree to upstream 41cf05a0 (engine 0.1.50)
with the local patches re-applied") is the last commit that changed `engine/strata/`, and `git show <removal commit>^:engine/strata`
(or `git archive <removal commit>^ engine/strata`) restores it. The removal commit is REMOVAL_COMMIT.
The local patches as a diff (old pin to old subtree, and new pin to new subtree) were `engine/upstream/local-patches-on-0.1.35.patch`
and `engine/upstream/local-patches-on-0.1.50.patch`; they are in the same history. The upstream remote is
`git remote add strata-upstream https://github.com/Niko1221/Strata.git`; the pin commit is fetched from there.
Why it was removed (owner decision, 2026-11-23): Leleka never builds or runs it (no `Cargo.toml` or `build.rs` depends on it), the vanilla
reference build for benchmarks is made from its own checkout on the benchmark server, the comparison measurements are finished and the
CUDA ports are frozen. Oracles and checks that compiled or read the removed sources were retired with it (see the removal commit message).
+2 -2
View File
@@ -37,8 +37,8 @@ Recorded in `manifest.json` (`provenance`) and printed by the build: compiler id
strings (`strata_cxx_flags`, `strata_per_file_flags`, `ggml_c_flags`, `ggml_cxx_flags`, `ggml_cpu_arch_flags`), strings (`strata_cxx_flags`, `strata_per_file_flags`, `ggml_c_flags`, `ggml_cxx_flags`, `ggml_cpu_arch_flags`),
`GGML_NATIVE=ON` (ggml-cpu is built with `-march=native` for the **build host**, so build and run on the same machine), `GGML_NATIVE=ON` (ggml-cpu is built with `-march=native` for the **build host**, so build and run on the same machine),
`STRATA_PORTABLE=OFF`, `STRATA_ISA_FLOOR` empty, `STRATA_ENABLE_CUDA=OFF`, the ggml commit (pin + the checkout's actual HEAD), `STRATA_PORTABLE=OFF`, `STRATA_ISA_FLOOR` empty, `STRATA_ENABLE_CUDA=OFF`, the ggml commit (pin + the checkout's actual HEAD),
the `engine/strata` pin from `engine/upstream.md`, and the tools commit. The comparator flags are the **pin's CMake flags**, not the `engine/strata` pin from `third_party/strata/UPSTREAM.md`, and the tools commit. The comparator flags are the **pin's CMake flags**, not
those of upstream's release packaging (`engine/upstream.md`: the packaging recipes were not run here). those of upstream's release packaging (`third_party/strata/UPSTREAM.md`: the packaging recipes were not run here).
The Makefile's `STRATA_AVXVNNI` define comes from running the engine's own probe (`cpp/avxvnni_probe.cpp`); ggml's own The Makefile's `STRATA_AVXVNNI` define comes from running the engine's own probe (`cpp/avxvnni_probe.cpp`); ggml's own
generated header `ggml-version.h` is regenerated from `ggml/CMakeLists.txt` and the pin. generated header `ggml-version.h` is regenerated from `ggml/CMakeLists.txt` and the pin.
+1 -1
View File
@@ -157,7 +157,7 @@ $(BUILD)/build-info.txt: $(BUILD)/kab Makefile
printf 'ggml_pin\t%s\n' '$(GGML_PIN)'; \ printf 'ggml_pin\t%s\n' '$(GGML_PIN)'; \
printf 'ggml_source\t%s\n' '$(GGML_URL)'; \ printf 'ggml_source\t%s\n' '$(GGML_URL)'; \
printf 'strata_version\t%s\n' '$(STRATA_VERSION)'; \ printf 'strata_version\t%s\n' '$(STRATA_VERSION)'; \
printf 'engine_strata_pin\t%s\n' "$$(grep -o 'Upstream commit SHA | `[0-9a-f]*`' $(REPO)/engine/upstream.md | head -1 | grep -o '[0-9a-f]\{40\}')"; \ printf 'engine_strata_pin\t%s\n' "$$(grep -o 'Upstream commit SHA | `[0-9a-f]*`' $(REPO)/third_party/strata/UPSTREAM.md | head -1 | grep -o '[0-9a-f]\{40\}')"; \
c=$$(git -C '$(REPO)' rev-parse HEAD 2>/dev/null || cat '$(REPO)/.source-commit' 2>/dev/null || echo unknown); \ c=$$(git -C '$(REPO)' rev-parse HEAD 2>/dev/null || cat '$(REPO)/.source-commit' 2>/dev/null || echo unknown); \
printf 'tools_commit\t%s\n' "$$c"; \ printf 'tools_commit\t%s\n' "$$c"; \
d=unknown; if git -C '$(REPO)' rev-parse HEAD >/dev/null 2>&1; then d=$$(git -C '$(REPO)' status --porcelain -- tools/kernel-ab | wc -l); fi; \ d=unknown; if git -C '$(REPO)' rev-parse HEAD >/dev/null 2>&1; then d=$$(git -C '$(REPO)' status --porcelain -- tools/kernel-ab | wc -l); fi; \