chat template (prompt bytes): ChatTemplate.render (#843) drops completed empty assistant turns
(no text after strip, no picture, no tool calls; the final message is kept; STRATA_KEEP_EMPTY_TURNS=1
keeps them) before the template runs. prompt.rs now does the same in Renderer::render and in the typed
render_with_images path. diff_chat_template: 136/3000 -> 0 (also 2 x 12000). chat_template_oracle.json
regenerated from the Original; one responses.rs test asserted the old behaviour.
gguf: block_geometry knows the APR trellis types 143-146 (PTQ1_0, TQ2_T, TQK6, TQK7); gguf_headers.json
regenerated. diff_gguf_header: 188/400 -> 0.
native pack: NATIVE_PLE_KEY gained IQ3_XXS/IQ4_XS (#381); NVFP4 expert tails and prism.hadamard experts
are refused (not ported, the runtime reads neither). diff_native_pack f16_nan uses a quiet NaN (numpy's
widening of a signaling NaN differs between builds). The live differential still needs one run on Linux.
smoke-mtp-pack.py reads the Q8_0 names from required[]/wq(); Dockerfile.systemd-smoke drops its apt
version pins. docs/ci-audit.md findings 14, 15, 16, 18 updated in place.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* scripts/test-cuda-fixed-ptx.sh asserted the CUDA 13.0 toolkit pins; deploy/cuda-toolkit.lock.json moved to 13.2.2 on 2026-10-14. Pins updated
to nvcc/ptxas 13.2.86 and nvdisasm 13.2.86 (sha256 and sizes from the official manifest, verified against the lock's manifest_sha256);
the SASS dataflow assertions hold for the new ptxas.
* crates/model-format/src/huge_pages.rs: libc 0.2.190 has no MADV_COLLAPSE for musl targets, so the static CLI (linux-static-cli,
release-cli, Dockerfile.static-cli) did not compile since the hugepages work (2026-11-01). The constant (25, the same value glibc's libc
exports) is spelled out locally; nothing else changes.
* deploy/Dockerfile.static-cli: `rustup target add` ran before rust-toolchain.toml was copied; the floating rust:1.99 tag is 1.99.1 while the
pin is 1.99.0, so the musl std was installed for the wrong toolchain ("can't find crate for core"). The target is added after the COPY.
* crates/cuda-driver/tests/mock_cuda.c: load-only cuStreamSynchronize (Driver::load resolves it eagerly); the fake-libcuda mock gates pass again.
port.yml runs them (`run.sh --mocks`) after the harness.
* scripts/cuda-stubs: glibc/libstdc++ already declare the libm names the stub redefines (clash on every file), so those stubs are skipped under
__GLIBC__; check-cu.py finds s26_tsum.cuh in the Original kernels; check-local.sh runs the C++-only pass (--plain) off macOS (101/104 files).
* check-local.sh --full: test-cuda-driver-bootstrap.sh reported as debt (stale: it builds a synthetic workspace of the crate alone, which no
longer resolves its path dependencies).
No engine numerics or kernels are changed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* docs/experiments/2026-10-14-experimental-modes-port.md: "Re-sync" section (what drifted per program, what was done, verification,
the stale-PTX gate, the server-side reseal list and steps, open items found on the way: remote experts host code, K8V4 streaming,
multi-token append entries).
* scripts/check-local.sh: --fast no longer skips `_bodies_are_literal` and no longer carries literal_port as debt.
* docs/ci-audit.md (findings 4, 5 and the "what changed" note) and docs/windows.md: literal_port closed, minimal edits.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The 2026-10-25 upstream sync moved the Original kernels and the four experimental CUDA ports were not re-synced
(literal_port failed 4 of 6: 1, 5, 20 and 197 Original kernel-body lines missing).
* kv_stream: guarded shared atomicAdd; kv_q4: step_stride / planes; kv_q8: template <bool MULTI>; qsa_attn: attn_chunk_body with
reduce12_gfx906 / reduce12_head_of_lane. Bodies are copied verbatim; the entries keep their ABI and instantiate the Original's
single-token launch, so the sealed entry tables and the Rust facade are unchanged. The thread-emulation harness gives bitwise
identical results on the previous and the re-synced sources (fwht, q4, q8, route, cvec, attention m2/m3/m4).
* tests/literal_port.rs: per-function bodies; a device function of the Original that the port does not carry (SM60-only gather,
pre75 / merge_v2 / v3 / slot / row variants of the same arithmetic) is listed with its reason; the list is checked both ways, an
unlisted new function or a stale entry fails; self-test of the guard.
* experimental.rs: the PTX is not rebuilt (no nvcc on this host), so PINS[..].source_sha256 of the four programs still names the
previous source. admit() gains a source-seal gate (source_is_sealed) and PENDING_RESEAL lists the four programs: they refuse to
open until the server reseals them, and a unit test keeps the list exact. The sealed PTX and their PTX digests are untouched.
* docs/cuda-seal-plan-additions-experimental.json: new cu_pin of the four sources. reseal_own.py: --plan, refreshes seal_sha256 /
seal_length when the plan entry has them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
7f896a8bb changed 100755 to 100644 on 16 scripts that the workflows or check-local.sh execute by path, among them
scripts/install-pinned-rustup.sh (the first step of every job), scripts/test-cuda-fixed-ptx.sh, scripts/test-cuda-driver-bootstrap.sh,
scripts/build-cpu.sh and the GPU gate scripts. A Linux checkout keeps git's mode, so `scripts/install-pinned-rustup.sh ...` failed with
"Permission denied" before any build. Found by running the steps from a `git archive` in a Linux container; the Windows and WSL-on-/mnt/c
runs of the first audit show every file as executable and could not see it. Only modes change; engine/strata is not touched.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
show | install | remove | status, --dry-run; optional --disable-powersave (+ --install-iw), --disable-aspm, --reboot-after-min.
Tested read-only on the server (show, install/remove --dry-run, run --dry-run --simulate-fail); install was not run.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The existing workflows never built the `leleka` binary (crates/deploy) or ran the tests of leleka-deploy, leleka-memory,
leleka-runtime-client, leleka-runtime or leleka-cuda-driver (docs/ci-audit.md). New: scripts/check-local.sh --product and
.github/workflows/product.yml (default-member build, release build of the six shipped binaries, cargo check of the CUDA-feature
crates, tests, rustfmt/Clippy), scripts/check-ci-coverage.py + scripts/ci-coverage.json (fail when a workspace member has no CI
coverage entry), scripts/ci/nvidia-smi (hermetic stand-in for the deploy end-to-end tests).
Repairs found by running every step: check-local --fast failed on rustfmt in leleka-backend-api/leleka-context and on Clippy
type_complexity in leleka-tokenizer (formatting and a local type alias only); `cargo test -p leleka-cuda-driver` does not compile without
its cuda-driver feature (script now passes it); the desktop.yml hardware smoke step had no --bin (six binaries, no default-run);
the stale 8192 context assertion in crates/deploy/tests/e2e.rs (the laptop profile is 262144 since 621d35276); five trivial Clippy
lints in leleka-memory and leleka-deploy; the literal_port drift guard (red since the 2026-10-25 upstream sync) is reported as debt;
control-plane Clippy no longer lints its path dependencies; the sampler host-shim script works under Git Bash; worktree.sh creates
worktrees with core.autocrlf=false and .gitattributes marks the sealed PTX -text (a CRLF checkout makes the binary refuse to start).
No kernel, engine numeric or runtime behaviour is changed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Identity gate (legacy vs new bank read, 256k replay): 2057/2057 rows, 1036/1036 draft traces identical. Soak not yet run.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The owner asked to ship the 196,632-byte table instead of depending on a download.
* crates/deploy/data/expert-profile.bin: Strata data/expert-profile.bin unchanged (MIT, sha256 8f59b4aa...388975baf), the one
*.bin exception in .gitignore (every other *.bin stays ignored); .gitattributes pins it `-text binary` so no platform can
alter the bytes. crates/deploy/data/expert-profile.NOTICE carries the Strata MIT notice and provenance.
* expert_profile.rs: `include_bytes!` of the table; provisioning order is --expert-profile-file, the embedded bytes, then the
https download as fallback. The embedded bytes are digest-checked before the atomic install like any other source, and only
offered to a profile that pins the same digest. The plan shows "install the ... table embedded in this binary (no network
needed)" even with --no-fetch and without curl/wget.
* digest verification, status/verify/summary ON/OFF reporting and --no-expert-tier are unchanged.
* attribution: docs/release licence audit (Strata row), docs/deploy.md, docs/windows.md, docs/upstream.md, and the 5090
packager ships the NOTICE as licenses/strata-expert-profile-NOTICE.txt.
* tests: embedded == pinned file, offline install before any download, explicit file wins, a corrupted embedded copy falls
back to the download, plan states, e2e first start with no network tool.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
scripts/soak/soak.py (stdlib Python, offline tooling): a never-ending agent session (streamed /v1/responses, a shell tool, grown from the frozen
782-file corpus, digest checked) with faults injected while a request is in flight: engine kill -9, engine hang (SIGSTOP), API kill, gateway kill /
SIGTERM, supervisor kill (the holder), client abort mid-stream, log flood, parallel burst. Judges eight criteria (recovery within bounds, no hang and
no silent truncation of any request, identical greedy probe before/after every fault, log directory bounded, no secret in logs, bounded descriptors,
progress, ready at the end), writes soak-result.json and a capped events.jsonl, exits 0 only if all hold.
scripts/soak/test_soak.py: the harness against a fake service (fake API, a supervisor that respawns a dummy engine, log rotation) - no GPU.
scripts/soak/soak-job.sh: the holder job for the real model (guards, gpu.lock, seal-probe on real files, `leleka up --mode none` from nothing,
cold-load A/B new vs LELEKA_LOAD_READ=legacy with shards evicted by posix_fadvise, then the soak under a restart loop that plays systemd).
scripts/soak/identity-job.sh: the replay identity gate for the fast cold load (adapted from draftround-id.sh: legacy bank read vs the new read,
one test binary, top-16 logprob rows and the draft trace must be identical).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
scripts/ops/install-leleka-service.sh (owner runs it with sudo; nothing here was run by an agent):
--install [--no-start] [--force] copies scripts/ops/leleka.service to /etc/systemd/system, daemon-reload, enable, start; refuses when the
state is not prepared, a binary is missing, the user para does not exist, or the lab KAR holder runs
--remove stop, disable, remove the unit (state, logs, models untouched)
--status unprivileged: systemd state, lab mode, the supervisor's status.json (phase, uptime, restarts and reason, health), log tail
--lab on|off STATE/lab-mode: the unit (ConditionPathExists=!) stays down while the GPU belongs to the lab queue
docs/unattended.md: what runs, the exact owner steps (prepare with `leleka up --mode none`, install, use, look, update), lab mode, the fast cold
load (problem, change, measurements), the supervision table (what happens for every failure), logs and disk, security defaults, the soak test
(harness, criteria, the multi-day command), open items. docs/deploy.md section 6 follows the new restart, log and status behaviour.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`leleka run` restarted a crashed engine twice after a fixed 5 s and then ended the service; a hung engine, a growing log and a client
waiting on a dead engine had no answer. All of it is now in the supervisor and in what `leleka up` writes:
* Restart with backoff (config.rs RestartPolicy backoff_initial_s 5 / backoff_max_s 300, max_engine_restarts 6 in a row, reset after 600 s
of ready): recover_engine() waits 5, 10, 20 ... s, counts a restart that fails (load refused, port taken) as an attempt and retries it
instead of ending the service; only after the last attempt does the supervisor exit 1 and let systemd start everything afresh.
* Hang detector (watchdog.rs, pure and tested; HealthPolicy in leleka.json: interval 10 s, fail 120 s, max_request 3900 s): every 10 s the
supervisor reads GET /metrics of the API (the control plane's own view; the engine's telemetry is not used, the API refreshes it only
between requests). API unreachable 120 s: restart the API. Worker not ready 120 s (the API lost the engine): SIGKILL and restart the
engine. A request active longer than 3900 s (generation_timeout 3600 + 300): the same. A stopped (SIGSTOP) or deadlocked engine ends this way.
* Requests get an error, not a hang: strata.json now carries runtime.stall_timeout_s 600 (no engine event for 10 min during a request cancels
it with an error to the client) and generation_timeout_s 3600 (RequestLimits in leleka.json).
* Bounded logs (logs.rs): every 10 s the supervisor copy-truncates any STATE/logs/*.log past 16 MiB, keeps 3 generations (children keep
their O_APPEND descriptors, nothing is told); <= 16 x 4 x 6 files; one 16 MiB copy per rotation. tail_of reads only the last 256 KiB.
* Status file: started_unix, restarts_total, last_restart_unix/reason, health, log_bytes; rewritten every 30 s as a heartbeat.
* units.rs (and scripts/ops/leleka.service, a test pins the file to the generator for the server layout): StartLimitIntervalSec=0 with
RestartSteps/RestartMaxDelaySec (30 s growing to 10 min), LimitCORE=0 (a 100 GB core dump must not hit the root NVMe), LimitNOFILE,
TasksMax, OOMScoreAdjust=-500 (system scope), journal rate limit, RequiresMountsFor, TimeoutStopSec 180, and ConditionPathExists=!STATE/lab-mode
so the unit stays down while the GPU belongs to the lab queue.
* Tests (fake runtime, no GPU): a reported hang kills and replaces the engine; restarts back off, a start that fails twice and then works is
just a slower restart, three failures in a row end the service with a message; an oversize log is rotated while the service runs; the
existing lifecycle tests (SIGKILL of the engine, SIGTERM drain) still pass. 134 unit tests.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- AdaptiveConfig::set_option and the LELEKA_SPEC_ARMS suffix ~key=value (adaptive@0~step=0.3): policy variants inside one replay process on the same forced text
- options rowq / smooth / measured for the draft floor rule (defaults reproduce the earlier rule exactly, unit test against the kept reference)
- windowpolicy-replay.sh, -ab.sh (three arms), -analyze.py, -id.sh, -install.sh
- run-e2e.sh: LELEKA_SM120_ATTN_DAILY_MTP defaults to 1 like the rtx5090-32g profile
- deploy: the profile's engine_env reaches engine_environment() through the saved config (test)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The accepted-prefix commit graph replayed each of the 36 GDN layers (conv history commit + recurrence replay through the accepted tokens) and each of the 12 QSA layers (tail restore +
8 row appends) as its own kernels. Two sealed kernels do all layers in one launch each: draft_commit_gdn_layers (precise math like original_verify.cu; the replay's output path,
which nothing reads, is not computed; the state-independent loads of all tokens are issued first) and draft_commit_qsa_layers (fast math like the resealed original_verify_qsa.cu;
one block per layer, rows in order). Model-free probe tools/draft-round/commit_probe.cpp: every state byte identical to the Original's kernels on 36 GDN and 60 QSA random
cases (n_keep 0..8, three RoPE settings, positions around block edges, holes); in a graph the GDN part is 346 -> 156 us, the QSA part 72 -> 4.5 us. Replay gate: draft-round-id1
(fused alone, DAILY alone and both): 2057/2057 top-16 logprob rows and 1036/1036 draft traces bit-identical, A/A exact.
Sealed with scripts/gpu-bringup (extra-seal-plan.json group draft-round, nvcc 13.2.86); ptx-sm86/MANIFEST.json records them as not built for sm_86 (record_commit fuses only on cc 12).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
draftround-ab.sh: ours-vs-ours paired blocks (alternating order) and the CUPTI profile run at ~245k context; draftround-kernels.py: per-kernel table of the commit graph, MTP round graph and
chain steps; draftround-id.sh/-idcmp.py: teacher-forced replay gate (top-16 logprob rows and the IEEE bits of every draft probability); LELEKA_TRACE_DRAFT=1 prints one DRAFT line per draft.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>