Commit Graph
220 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 b2d4573f69 docs: add module-by-module Rust port status table
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:35:08 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e7bb762b1b docs(roadmap): rewrite task queue and status for the Rust port; fix stale offline checkboxes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:31:45 +02:00
Pavlo Ratushnyi 7f9bf42a6e Merge branch 'claude/port-window-producers' into claude/port-main 2026-10-14 16:21:00 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 9c5ca2cf03 feat(verify): window GPU smokes, review fixes, seal plan for window assets
- QSA KV binding admits the serving index image size; kv addresses refuse until the resolver is reset
- GR shared-memory attributes only emitted for sm_70+
- docs/cuda-seal-plan-additions-window.json merges the new sources, bound pins and fast-math risk list
- ignored GPU smokes for asset load and shared opt-in

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:20:48 +02:00
Pavlo Ratushnyi 2d8d362d6b Merge branch 'claude/port-offline' into claude/port-main
# Conflicts:
#	Cargo.toml
#	control-plane/src/lib.rs
#	crates/context/Cargo.toml
#	crates/context/src/lib.rs
#	crates/model-format/src/qwen4exp_expert_source_bank.rs
2026-10-14 16:09:35 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 8832be7025 docs(offline): record the offline port status, divergences and open items; run the oracle diffs from check-local
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:07:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2d00e78706 feat(reasoning-budget): port Service.reasoning_budget and the run-loop wrap-up with a Service.run differential
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:07:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7e1d183313 test(verify): whole-window planner harness (every T, both splits, PLE) and mmvf block-size corrections
PlanOps drives the literal recorder through the pure planners with synthetic weights and
pins the launch order of GDN/QSA layers, post phase, split groups, head and PLE; fixes two
hand-derived expectations (mmvf block for 320 inputs is 160).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:05:50 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 d693e12366 feat(verify): bind every window producer to the planner and the sealed owners
OriginalVerifyWindowOps now records quantize/mmvq, hc read, final write, head mix +
captured head tail, PLE layer 1, the QSA K/V chain, router, shared expert, expert groups,
hit add and combine from the pure Planner; weight bindings per family, pre-capture asset
preload, fused-GR device decisions and dynamic-shared attributes; UNBOUND_PRODUCERS is
empty and unsealed assets are listed by name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:01:21 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 efa6909067 feat(verify): QSA attention-layer window launch plans and KV/index address bindings
K/V append, norm+RoPE, q/gate split, indexer paths, block scores+top-k, device-side KV
resolve, batched decode attention and the output gate (new fast-math source with a
placeholder PTX); pub(crate) address views on the mapped KV owner, resolver and QSA journal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:58:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5323645773 feat(verify): MoE / FFN window launch plans (router, shared expert, expert groups, hit add, combine)
Native grouped expert gate/up and down kernels are a new source with a placeholder
PTX (UNSEALED) and a seal-plan fragment; everything else binds the sealed assets.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:58:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 00271e4460 feat(verify): GR / head-mix / PLE layer-1 window launch plans over the sealed fused-GR, native post and PLE assets
hc_read (fused_gr_read_multi variants + down_chunk), final_write, per-token lm_head_mix
and the layer-1 PLE block, with the exact-size weight binding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:58:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 cda2c11426 feat(verify): window module loader keyed by PTX file with unioned entries and per-asset fail-closed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:58:20 +02:00
Pavlo Ratushnyi 49f22a8daf Merge branch 'claude/port-api' into claude/port-main
# Conflicts:
#	Cargo.toml
2026-10-14 15:53:19 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 250fd3e65d feat(prompt): render the pinned chat template with minijinja instead of a hand-written Qwen format
minijinja =2.24.0 (+ minijinja-contrib pycompat for str methods), configured like serve/frontend.py ChatTemplate:
trim/lstrip blocks, no autoescape, raise_exception, Python tojson (json.dumps ensure_ascii=False) and str.strip trim.
All 10 chat_golden.json cases render byte for byte straight through the template (tool_calls, tool messages, no
generation prompt included). Ordered Json keeps object key order. scripts/offline/diff_chat_template.py: 12000
generated conversations vs jinja2 (identical renders, identical raise_exception messages); committed golden + test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:53:16 +02:00
Pavlo Ratushnyi c16a050e52 Merge branch 'claude/port-experimental' into claude/port-main
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/cuda-driver/Cargo.toml
#	crates/leleka-runtime/src/backend.rs
#	crates/leleka-runtime/src/lib.rs
2026-10-14 15:51:28 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 76d57a549c feat(control): MCP hub (stdio + Streamable HTTP), config keys and GET /mcp
Port of serve/mcp.py: server config validation, background start, paged
tools/list, <server>__<tool> namespacing, error-as-text results with the
character cap, restart on demand, cancellation, GET /mcp. Tested against the
Original's fake MCP server. The server-side tool loop is intentionally not
ported (documented).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:51:13 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c0cd1d7f19 docs: wording
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:50:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 085512b4f3 docs+test: experimental modes status, literal-port drift guard
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:50:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 67071b5d30 feat(runtime): all-off experimental-mode config admitted at Load (selection rules, digest mixing, PTX probe, refusal until consumed)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:49:15 +02:00
Pavlo Ratushnyi 0648d296be Merge branch 'claude/port-forward-leaves' into claude/port-main
# Conflicts:
#	crates/model-format/src/lib.rs
2026-10-14 15:47:56 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2c90479b16 docs: seal-plan additions for the forward-leaves CUDA assets (pins, flags, entries)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:46:40 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 9852f7a776 build(cuda): seal-plan additions for the six experimental programs (precise flags per CMakeLists policy)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:46:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 e80a915a47 feat(cuda-driver): experimental closed programs (opt-in, fail-closed pins, typed facades) with CPU-oracle tests
Six literal .cu ports get a pure admission/geometry module (every entry signature is
cross-checked against the .cu text), a Linux-gated driver facade, #[ignore]d GPU smokes
and zero-pin placeholder PTX. All modes are off by default; KAR's closed-launch ABI is
widened to 24 arguments with a 64-bit scalar.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:45:57 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 18d712eed5 feat(context): reuse the port-rope leleka-context crate and port setup.py's RAM/VRAM sizing rules
crates/context is taken verbatim from claude/port-rope (rope scaling incl. setup_resolve_rope/derived_factor, memory
plan, context policy). New setup_policy module: ram_ctx, ctx_ram_need, resident_budget_gib, low_ram_*; a golden grid
from 'import setup' (resolve_rope/derived_factor too, which the branch had only transcribed) checked bit for bit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:45:55 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 08dbe0abe0 feat(mtp-fetch): port tools/mtp_fetch.py (inventory/fetch/verify) with a local-mirror differential
Pinned 31-entry SHA-256 table, 206 + exact Content-Range, retry-once on wrong bytes, inventory re-read on a revision
change, verified.json stamps. model::http_client is now shared. Tests port test_mtp_fetch.py onto a real local HTTP
mirror; scripts/offline/diff_mtp_fetch.py runs the unmodified Python against the same mirror (10 scenarios).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:43:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2c7fcf4af1 feat(serving): port control vectors, SVE1 embedding files and M-RoPE positions
leleka-serving-policy gains the Original's host-side vision and steering code: the SVE1
record reader and the (t,h,w) position table (compiled verbatim from generate.cpp for the
golden fixture), image sources, Python-compatible base64, the <|image_pad|> expansion of
Service.prepare, and the control-vector GGUF loader with its add/project tables (bit-exact
against the verbatim load_control_vectors). control-plane accepts engine.control_vector in
its config, preflights the files and passes the engine its arguments.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:43:23 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 ea64da89c3 feat(kernels): legacy S-form GEMVs (s_gemv, split, Q8_K/Q8_0, s2_*) as .cu with planner, summation-order models and host-executed oracle
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:43:17 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 ad284beeb9 feat(verify): pre-capture function-attribute and device-attribute helpers for window kernels
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:41:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3b6bd7bfe0 fix(control-plane): restore executable bit on mock_engine.sh test fixture
The port snapshot stored it as 100644, so worker supervision tests failed to spawn it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:41:09 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f6bd70d124 feat(verify): export the projection binding and build it from the dense weight cache
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:40:21 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3485221865 feat(offline-tools): port embd_bf16_pack, ple_fp8_pack, draft_vocab, make_profile, mtp_rt
New crate leleka-offline-tools wired as 'strata-next tools ...'. Every output is byte-identical to the unmodified
Python tool (scripts/offline/diff_tools.py: packs incl. refusal cases, 14 draft-vocab subsets x out/stats, make_profile
at 512/256/8 experts with ranked bases and traces, mtp_rt at the real H/FF geometry). Committed tiny goldens +
integration tests; mtp_rt's multi-MB input is regenerated from a shared splitmix64 rule.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:40:02 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7f8949996b feat(verify): bind the window quantize_q8_1 and mmvq producers to the sealed native MMVQ owners
Window-level plans (arena spans, per-layer output banks, q8_1 at the start of xq),
the GDN/QSA projection binding with byte-exact validation, pre-capture asset
preload and the MMVQ column-layout policy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:39:34 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3a9e2238e fix(model-format): clippy -D warnings clean on non-Linux hosts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:38:35 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7466426ed7 style: cargo fmt model-format and desktop-core
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:37:19 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7847306434 test(model-format): exercise multi-chunk stream safety via a test-only stream buffer seam
Production buffers GGUF spans in 16 MiB chunks (3c20d1a), so 128 KiB tiles
arrive as one chunk. Keep the abort/re-seek/size-mutation/retained-fd checks
by shrinking the stream buffer to 64 KiB per-thread in tests, and assert the
production single-chunk delivery explicitly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:36:55 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b219ad5d02 feat(experimental-ref): remote-experts tier planner, grouping, RemoteMeta and scatter with Original-extracted goldens
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:36:40 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 801a19992d Merge branch 'claude/port-serving' into claude/port-main (conversation cache + async PLE reader); model-format: autotests=false for #[path] test modules
Known: 4 model-format tests expect 64 KiB chunks but streaming uses 16 MiB buffers since 3c20d1a (stale tests, pre-existing).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:35:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 dd488e1512 chore(verify): declare the window producer family modules and journal arena map
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:35:32 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 392037d83e feat(serving): port the operational HTTP surface of the Python server
control-plane serves /props, /slots, /v1/status, /api/health, /settings, /load, /unload,
/v1/load, /v1/unload, model aliases, CORS with the preflight ahead of authentication and the
own-page guard; replayed scenario by scenario against the real Python handlers. The worker
supervisor gains load/unload, lazy start, idle unload, reload gates (before_load, min free VRAM),
an outside stall watchdog and the reasoning-budget wrap-up (budget tracker golden-tested against
the Python Detokenizer/OutputParser loop). leleka-serving-policy adds CORS, idle, stall watchdog,
logits stride (golden vs the C++ header), request timings and alias rules.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:35:08 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 910bd947a2 feat(model-format): pinned.cu host half (shared-file arena header, pin/slice registration plan, parallel expert load)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:34:29 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 ac81406a5c feat(verify): window kernel launch plans, sealed asset registry and projection primitives
AssetSpec/Launch/ArenaMap (pure plans over SHA-pinned PTX), lazy pre-capture module
loading in the verifier physical owner, by-value struct ABI args and function
attribute/device queries, and quantize_q8_1 / native MMVQ / bf16 MMVF launch plans
over the sealed head and bf16 assets.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:34:07 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b3bd6a0936 feat(runtime): read the 16 PLE rows of a token through the async reader
Issue the rows before the embedding read, collect before layer 1, decode
exactly as ple_row does. Reader opens lazily with the original defaults
(1M-row cache, 64 in flight, SSD keep-alive), an O_DIRECT handle on Linux
accepted only after an inode check and aligned probe read, and falls back
to the synchronous path when unavailable. Invalid LELEKA_PLE_* values are
refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:34:05 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f2ec56325c test(dequant): bit-exact parity of 23 block types vs pinned gguf-py and iq_fixture
scripts/offline/diff_dequant.py (live, 32 rows x 3 seeds through export-tensor-f32) and a committed golden
with an integration test over the production visitor.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:33:27 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 13638e294d feat(model-format): native_dense.cpp planning half (eligibility, shard/payload validation, upload plan, Q8_1 scratch)
Literal host port of NativeDense::served_names / keep_unquantized_ple_key and the validation half of NativeDense::load
with the Original's refusal messages; the device upload stays with the runtime.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:32:26 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 debfbd0941 test(tokenizer): committed oracle differential, per-codepoint pre-tokenizer check, batch CLI
- crates/tokenizer pre_tokenize + model pre-tokenize-batch/tokenize-batch/detokenize-batch (debug/differential)
- scripts/offline/diff_tokenizer.py: every Unicode scalar x 13 contexts vs Python regex (0 real mismatches;
  14k strings differ only where regex 2026.9.10 has Unicode 17 and regex-syntax/unicodedata 16), a synthetic
  GGUF with BPE-trained merges past the heap path, 5-file extraction compare, encode/decode fuzz
- golden crates/tokenizer/tests/fixtures/tokenizer_oracle.json + integration test
- stricter-by-design: duplicate merges, missing chat template, negative special ids

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:32:23 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7bd31abdb2 feat(experimental-ref): keyless routing, control vectors and attention references; emulated kernel scenarios
keyless.rs: SKLROUT1 artifact admission (layout cross-read against prepare-keyless-routing.py),
fmaf-order query routing, positional key reconstruction. cvec.rs: GGUF v3 parsing and the
load_control_vectors table builder (19 golden cases incl. the Original's error texts,
bit-exact, from the Original function extracted verbatim) and a reduction-tree twin of
cvec_kernel. attn.rs: scratch arithmetic and an f64 GQA reference. The emulated kernel
text reproduces routing and cvec bit for bit and attention modes 2/3/4 (incl. M-RoPE) to
1.6e-7 relative L2.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:31:44 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 44a851648e feat(model-format): expose a positional row-table source for verified shards
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:31:06 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7452a6d3b8 feat(attn): native_flash_attn.cu short-context FlashAttention kernel, admission model and host-executed oracle
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:30:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 195b0a99af feat(model-format): add async PLE row reader with page dedup and row cache
Port of ngram/ple_reader: issue/collect tickets, 4 KiB page dedup and
offset-sorted reads over positional reads and worker threads, 8-way
round-robin row cache, sticky errors, injected delay, keep-alive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 15:30:18 +02:00