LELEKA_HUGEPAGES=on|thp (off by default; LELEKA_BANK_THP=on now selects thp) places each of the 144
resident bank copies in its own 2 MiB-aligned anonymous mapping instead of a heap Vec: MAP_HUGETLB when
HugePages_Free covers the bank (mode on only; nothing reserved), else MADV_HUGEPAGE + MADV_POPULATE_WRITE.
After the bank load and the shard page-cache drop, before cuMemHostRegister, huge_pages::settle() reports
the coverage from /proc/self/smaps and MADV_COLLAPSEs any 2 MiB range that fell back (best effort).
Pure placement: the bytes are the file's (read_tensor_into, same bounds and size fences). No system
setting is read-write.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MTP draft head projects over the rows listed in rt/draft_vocab.bin (106,299 ids). Upstream ships
draft_vocab_en.bin (40,525 ids, 65,774 head rows fewer: ~110 MiB of VRAM and a shorter draft GEMV, at the
price that CJK/Cyrillic tokens can never be proposed). LELEKA_DRAFT_VOCAB=en|cyrillic|fr|<path> picks one;
unset (or 0/off/default) keeps rt/draft_vocab.bin and reads, logs and changes nothing.
* a selected file must have the sha256 of a recorded upstream subset (a name: that name's digest);
another digest, a symlink, a wrong size or a too-large file is refused (the arm fails to load)
* a file that does not exist falls back to rt/draft_vocab.bin with one `FALLBACK` log line
* the startup VRAM reserve follows the selected file's size, so the freed VRAM reaches the expert slots
* one `leleka-serve draft-vocab: ... subset=en ids=40525 sha256=... file=...` line per bind when set
* sha2 becomes a dependency of leleka-cuda-driver (already in the workspace)
Unit tests (CPU only): setting parsing, table consistency, default reads/logs nothing, missing file
falls back, wrong digest refused for a name and a path, accepted digest reads the selected ids and the
reserve probe sees its size, malformed/oversized/symlink refused, subset index <-> full id round trip
and ids outside a subset. A real-file test runs when LELEKA_TEST_DRAFT_VOCAB_DIR names a directory
with the upstream draft_vocab*.bin (digests, counts, en ascending and inside the default list).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rust half of the CPU kernel A/B, part 1: crates/native-cpu-expert/examples/kernel_ab.rs
(verify, compare, internal run-tree) over the public API only; sha2 as a dev-dependency.
lib.rs untouched, unsafe_code stays deny. Timing fields of the records are explicit
NOT_MEASURED markers (STRA-318).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings the Rust/CUDA port of the Strata mode17 serve path together with the
CPU/iGPU/NPU gpt-oss runtime that main gained meanwhile.
Control plane: the Qwen tokenizer is the implementation behind the Qwen35
variant of codec::TextCodec (qwen(), encode_prompt() widen the trait; QwenCodec
derefs to the tokenizer), so control-token marks, images, chat template, the
runtime backend and vision keep their behavior, while the gpt-oss/Harmony path
and the worker pool keep main's. Config carries the union of fields; extra_workers
is rejected together with runtime, lazy_load, idle_unload_s and vision; the
gpt-oss family refuses top_k/min_p/penalties (its GEN line has no such keys).
leleka-kar-codec takes f16_bits_to_f32 from leleka-quant-core (identical code).
Workspace members and default-members are the union of both sides.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-free and CUDA-free. 64 unit tests (parsers, planner refusals with numbers, shed order and hysteresis, admission, sampler thread,
mlock/mincore/madvise over a descriptor, flatness check).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New crate leleka-deploy (binary leleka): idempotent one-command deployment with
preflight (driver, sm_120/sm_86, VRAM/RAM/disk, WSL2, cuBLAS 12, memfd), memory
profiles, plan/dry-run, stamped asset steps, systemd unit, and a native supervisor
that seals the KAR archive itself and hands it to the engine (no Python holder).
leleka-inference gains --kar-archive-file for the low-RAM read-only archive form.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leleka-gpu-npu-worker (crates/gpu-npu-worker) splits a long prompt: the NPU path takes the
first share of the tokens and the GPU path the rest, on two threads. They meet only in the
KV cache, through the new leleka_gptoss::LayerCache, which both prefill paths now use instead
of &mut State (same behaviour). The GPU part's cache waits for each layer the NPU part
stores, so the GPU runs layer l while the NPU runs l+1. The last-token distribution matches
the GPU alone (KL <= 1e-4).
Measured: 2048 tokens 0.89-1.13x against the GPU alone, depending on share; agent episode
(4 turns of ~2,060 new tokens, 6 alternating pairs) 0.81-1.16x per pair, a net loss. Both
paths stream all weights whatever their token share and share the 15 W budget, and the NPU
part's CPU attention over the growing context is the slow side. Not adopted; stays
experimental. Also: NpuPrefill::with_cpu_threads, and -ArmA/-ArmB/-LogDir in
Compare-PrefillWorkers.ps1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The KAR codec moves unchanged from control-plane/src/kar_codec.rs into crates/kar-codec
(re-exported there, so the control plane's KAR tests are unchanged and pass). Probes, off
unless set: LELEKA_EXPERIMENTAL_KAR_LEVELS / _KAR_TENSORS for attention and output weights,
and LELEKA_EXPERIMENTAL_KAR_EXPERT_LEVELS / _KAR_EXPERT_LAYERS for the MXFP4 experts
(level 0 is a storage-only control). Teacher-forced against llama.cpp, baseline KL 0.016:
attention+output at 6.5/5.5/4.5 bits give KL 0.063/0.095/0.213 (uniform rounding was
0.071/0.112/0.270), and every tensor group fails alone; experts of 6 of 24 layers at 3.5
bits give KL 0.081 (control 0.018). No KAR rate passes the gate on this model. Corrects the
earlier doc claim that a KAR layout is the same as uniform rounding.
iGPU and NPU prefill run at the same time give 93-98 tok/s in total against 73-77 for the
faster device alone (2048 tokens each, two rounds).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The serve stack's routed experts came only from `load_resident_expert_source`, a 50 GB RAM copy of the
144 shard-0 banks that `MappedExpertBank` then page-locks whole: impossible on a 32-48 GB PC.
* model-format: `ResidentTensor` storage is an owned copy or a read-only MAP_SHARED mapping of the verified
shard (`VerifiedGgufFile::map_resident_tensor`, same descriptor, bounds and size checks);
`Qwen4ExpArtifact::load_mapped_expert_source` builds the same bank catalog from mappings, no RAM
admission (generate.cpp `src.set_gguf` + `FileExpertSource::open`). The crate's lint is relaxed from
forbid to deny so exactly this mapping owner can allow its mmap/munmap/slice.
* cuda-driver: a lease of mapped banks makes `MappedExpertBank` pageable: no cuMemHostRegister; every
consumer the Original serve stack uses (`cache_source` for the prompt copy ring, VRAM tier fills/swaps,
PCIe staging) copies with cuMemcpyHtoDAsync from pageable memory; the zero-copy device aliases
(`retained_span_handle`, `copy_triplet`) are refused.
* runtime: `ModelBinding::load_mapped_expert_source`.
The bytes are the file's, so consumers see what the resident copy holds. Unit test
`mapped_tensor_is_the_files_bytes_and_a_retained_owner`; model-format --lib 128 passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
text.format becomes optional so a text object may carry only a verbosity. concise/detailed
summaries, max_tool_calls and other include values stay refused. New HTTP tests run a Codex-shaped
two-turn exchange with stateless replay and the tool_choice / parallel_tool_calls enforcement
through the runtime stack.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
runtime.{address,token_env,tokenizer_dir,model,mode,max_context} are validated at load
(loopback only, credential from the environment and never printed, exclusive with
engine/native_model/mtp_pack/vision/gpu). serve spawns backend_worker over GrpcBackend.
The worker carries the runtime's output-token cap in WorkerStatus; a default budget never
exceeds it, an explicit request above it is refused. Request ids are UUIDs, as the
runtime contract requires.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
proto/runtime.proto, the wire conversions and the validated RuntimeClient move out of
strata-desktop-core so strata-next can use them; strata-desktop-core re-exports them
unchanged. GrpcBackend implements the Backend contract by attaching to a runtime an
operator already loaded (no Load/Unload RPC), re-reading epoch and handle before every
generation, and ending a generation without a terminal event on any transport or frame
error. 9 loopback HTTP/2 tests with a scripted runtime server.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
backend_worker drives any leleka_backend_api::Backend through the GenerationCommand
channel strata-next already uses. It maps the rendered prompt to the engine contract
(verified round trip of the ids), re-tokenizes text deltas with a byte-equality check,
recognises the stop literals, maps finish reasons, cancels on client disconnect,
guarantees a terminal event when the engine dies, and re-attaches by itself. What the
text contract cannot carry is refused. 23 HTTP tests over a scripted engine cover
Responses (JSON/SSE), Chat, tools, text.format, cancellation and engine faults.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leleka-inference --kar-archive-fd needs a sealed memfd of the pinned length. The
bring-up used operator Python scripts outside the repo to make it; the production
path must not. leleka-seal-exec copies one regular file into a memfd with the
WRITE|GROW|SHRINK|SEAL seals (no close-on-exec, optional exact length pin),
substitutes {FD} in the command and execs it. Linux only; other hosts exit 2.
Tests: the copy has the properties open_sealed_archive_fd checks (regular,
unlinked, pinned size, all seals) and refuses writes, growth and shrinking; the
descriptor survives a real exec and is readable through /proc by the child.
rustix =1.1.5 is the version leleka-runtime already pins.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- service: BATCH n lets it see each product's successor and expand the next weights on a thread
while the device runs the current one; buckets up to 4096; OpenVINO CACHE_DIR compile cache
- client: batched expert products, layout sized by batch, default batch 2048
- cpu-sys/cpu-kernels: AVX2 F16C f16_to_f32 kernel, exact for every half bit pattern
- npu-worker: memory admission before an NPU prefill (falls back to the CPU when RAM is short)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- gptoss-npu: a prefill accelerator that sends the matrix products to the NPU service and keeps norms, RoPE,
attention, router, activation and combine on the CPU; debugging shadow device; examples for comparison, the
quality dump, a numerics probe and a paired A/B
- npu-worker: separate executable with the CPU worker's protocol, CPU-only fallback, --openvino-root/--npu-*
- the NPU flushes half-precision subnormals to zero, which erased every Q8_0 block with scale < 2^-14
(error 11% on attn_output); the service now boosts such rows' scales by a power of two and reports the
per-column shifts the client divides out (relative rms error back to 3e-4 on all shapes)
- Smoke-GptOssStack.ps1 takes -Worker leleka-npu-worker -OpenVinoRoot; passes through the control plane
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Decision (owner, 2026-10-15): the NPU is used through a separate service process so that the CPU runtime never
loads OpenVINO (STRA-199 v2 D1, E8).
- leleka-shm: read-only file mapping and a read-write region two processes map (recorded unsafe exception)
- leleka-openvino: OpenVINO C API loaded at run time (recorded unsafe exception, NPU runtime only)
- leleka-npu-service: reads the GGUF itself, expands Q8_0/MXFP4 blocks to int8 + half group scales, runs
y = x . W^T on the device with the weights as run-time inputs, activations through the shared region
- tested against an f64 reference with real weights on CPU and NPU devices: relative rms error 2e-4 to 3e-4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PrefillAccelerator::admit lets an accelerator refuse a prompt without being disabled. The GPU prefill
estimates its footprint (two layers of weights, scratch, hidden states, caches, 1 GiB headroom; 1.6 GiB
estimated vs 2.0 GiB peak private bytes measured for 1024 tokens before the headroom was raised) and
compares it with a probe; the worker's probe is the OS's available memory (sysinfo). admission_check
exercises both outcomes on the real model. 1024-token prefill with the vec4 attention: 15.9 s (64.5 tok/s),
single unpaired run.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- gptoss: PrefillAccelerator hook, Model::prefill_reuse_accelerated, layer/weight views, embed,
next_from_hidden (shared with the CPU forward pass), State KV export/import
- igpu: threaded weight repacking (131 s -> 6 s of upload for 24 layers), explicit half rounding of block
scales (the compiler folds the pack/unpack round trip away), matmul_rows, buffer reads/writes at offsets
- teacher-forced gate with GPU prefill: best token 97.1% vs llama.cpp, mean KL 0.0100, NLL +0.0148;
vs the CPU decoder KL 0.0067 (see docs/igpu-prefill.md). Experimental, not wired into the worker.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Buf, Recorder: device-resident arrays and batched kernel launches in one submission
- gemm epilogue: optional bias and accumulate into the existing output (residual add)
- rmsnorm_quant kernel: RMSNorm plus Q8_0 quantization per row; matches the CPU decoder's
rms_norm to 1e-5 relative and the CPU quantizer exactly on the tested shapes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New pure-Rust crate on wgpu 26 with generated WGSL kernels: C[m][n] = sum over 32-element blocks of the
exact int8 block sum (packed dot-product built-in) times the activation and weight block scales. Weights
are repacked at upload (ggml's unaligned 34- and 17-byte blocks become int8 or nibble words plus separate
half-float or E8M0 scale words); MXFP4 values are decoded in the shader from a nibble-packed magnitude table.
Every accumulator and operand is a named scalar (dynamically indexed private arrays spill on this GPU).
Checked against the CPU kernels: random Q8_0 and MXFP4 weights on awkward shapes (single block, ragged
tiles, 1 to 130 rows) and, with LELEKA_GPTOSS_GGUF set, real tensors of gpt-oss-20b (blk.3.attn_q Q8_0
4096 x 2880; blk.5 gate expert 11 and blk.23 down expert 31, MXFP4 2880 x 2880): all outputs within the
float32 accumulation bound, worst error 0.01-0.02 of it.
Speed (gemm_bench, reference iGPU, one run each): a 4x4-outputs-per-thread tile is best, about 0.7 TOPS
int8 including the block scales (MXFP4 2880x2880: 0.58 TOPS at 32 tokens, 0.68 at 64, 0.72 at 256;
Q8_0 4096x2880 at 256 tokens: 0.79); 8x8 spills registers (0.45). The CPU decoder's equivalent is about
0.25 TOPS. Small products use only ~45 workgroups; batching experts will fill the chip.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Setting engine.gptoss_gguf (or STRATA_GPTOSS_GGUF) selects the gpt-oss family and takes the tokenizer from
that GGUF. Prompts: a Responses request (instructions, input items with reasoning, function calls and
outputs, tools, tool_choice, parallel_tool_calls, text.format, reasoning effort) is rendered as the Harmony
conversation by leleka-harmony; the same replay validation as the Qwen path, one call per assistant message
with its output, no custom tools. Output: a stateful HarmonyDecoder turns the generated tokens into the
reasoning / answer / <tool_call> markup that the existing code parses, so tool-name and argument
validation, history and the streaming events are reused; gpt-oss always reasons, the end-of-generation
markers <|return|> and <|call|> are the terminal tokens, and an open tool call is closed when the
generation ends.
Safety: the renderer can write its special markers as private-use sentinel characters (and replaces those
characters in caller text); the codec turns exactly those into special tokens. Marker-looking text from a
client, in messages, tool descriptions or tool output, stays ordinary text.
Side effect, deliberate: serde_json preserve_order is now on workspace-wide (the renderer needs the client's
property order), so tool-call argument objects keep the model's key order instead of alphabetical; one test
expectation changed accordingly. 52 responses tests and the new family tests pass; the 13 other
control-plane test failures on Windows predate this change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New crate leleka-cpu-worker (executable leleka-cpu-worker --serve --model <gguf>): loads the GGUF through
the read-only mapping, runs the gpt-oss decoder on the AVX2 / AVX-VNNI kernels, and speaks the stdin/stdout
protocol of Strata's --serve mode (READY, GEN with temperature, top_p and seed, STOP, QUIT, PP, REUSED, T,
DONE, ERR). Prefix reuse across requests, cancellation between prefill chunks and between tokens, a stale
STOP while idle is ignored, the end-of-generation marker is emitted as the last token.
leleka-gptoss gains sampling (greedy, or temperature and top-p over the 1,024 best logits, with a seeded
generator) and prefill_reuse_with (progress and cancellation). A stray NUL byte left in a doc comment by an
earlier shell edit is removed.
Tests: protocol parsing, the request loop against a mock decoder (stop token, length, reuse, STOP, QUIT,
engine failure, broken pipe), and an end-to-end run on the real model (needs LELEKA_GPTOSS_GGUF) that gets
llama.cpp's 16 greedy tokens for "The capital of France is" and reuses the prefix of a longer prompt.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leleka-tokenizer gains gguf_bpe: a byte-level BPE tokenizer built from the vocabulary in the GGUF file
(gpt2 model, gpt-4o pre-tokenizer), with special-token parsing that is off by default so user text cannot
forge markers, and a UTF-8-safe streaming decoder. Checked against llama.cpp's /tokenize on 67 strings: same
ids except the two documented differences (llama.cpp forges some Harmony markers from text; it splits
words at combining marks, which the o200k expression keeps together).
New leleka-harmony crate: render() reproduces the gpt-oss chat template (including its whitespace) and is
byte-identical to llama.cpp's /apply-template on ten conversations with many tool-schema shapes;
HarmonyParser turns generated tokens into reasoning, answer and tool-call events.
The oracle fixtures are test strings, token ids and rendered prompts only. The tokenizer oracle test needs
LELEKA_GPTOSS_GGUF and reports "skipped" without it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leleka-gptoss reads the model hyper-parameters from the GGUF header and views
the weights in place in the memory-mapped file; only norms, biases, router and
sinks are copied. One-token forward pass: RMSNorm (f64 sum), attention with
grouped KV heads, learned sinks and alternating sliding/full layers, YaRN RoPE
in NeoX pairing, router with softmax over the selected logits, MXFP4 experts with
the clamped gated activation, Q8_0 attention and output head. Row-parallel
matrix-vector products; f32 KV cache. Greedy generation.
Tests: unit tests of each operation against f64 formulas, and an end-to-end test
on a tiny synthetic gpt-oss (ggml-quantized random weights) against an
independent f64 implementation: worst relative logit difference about 1e-7 over
three seeds, identical logits at every instruction-set level and thread count.
Whether the maths equals the real model's is NOT yet tested: that needs the
llama.cpp oracle (STRA-212 acceptance criteria).
leleka-cpu-sys gains a safe read-only file mapping (Windows and Linux). The
benchmark script now reproduces Bionic's server flags, supports concurrent
requests and reports aggregate speed. No speed claim is made.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leleka-gguf reads the header of a GGUF file with bounded allocation (limits plus
the file size), validates tensor shapes against block geometry from the pinned
ggml, offsets against alignment, overlap and the end of the file, and builds an
inventory of which bytes one decoded token reads in a mixture-of-experts model
(experts scaled by used/total, one embedding row, full attention, router, norms
and output head). No dependencies, no unsafe. 13 tests on synthetic files, including
hostile headers and truncation at every length.
benchmarks/tools adds Capture-MachineState.ps1 (drift fields of the reference
laptop record, quiet-machine gate) and Measure-LlamaServer.ps1 (rotating-round
measurement of llama.cpp-style servers with the machine state before and after).
Tested only against a fake local server; no real model has been measured yet.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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>
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>
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>
control-plane wire.rs builds GEN/GENI lines through RequestSampling::gen_keys plus
strata_tune and the per-request cvec switch (golden-tested against the real
StrataEngine.generate); Responses, Chat Completions and Messages accept and validate
top_k, min_p, repetition/frequency/presence penalties, penalty_last_n, seed and the
engine knobs with the Original's defaults and ranges; server-wide defaults (config
sampling block plus POST /settings shared values) merge under the request. The desktop
runtime gRPC contract carries the full sampling set and the gateway no longer refuses
temperature != 0. New crate leleka-serving-policy holds the pure Original policies
(shared settings, reasoning budget tracker, fixed-point sampling conversion) with
fixtures generated by running the Python handlers.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New pure crate with the arithmetic of f16_bits.hpp, kv_q4.cu and kv_q8.cu, the
cell layouts and byte sizes of fp16/INT8/rotated INT8/Q4_0/K8V4/keyless pools
(identical per-cell figures to the memory planner: 2048/1056/576/816/528), and
the generate.cpp format-selection rules. Golden fixtures are produced by the
Original's own host code extracted verbatim with awk (FWHT, Q4_0 quantizer
under separate and fused multiply-add, INT8 K, kv_pool_bytes, kv_block_bytes).
Experimental formats are explicit; nothing is enabled by default.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
leleka-cpu-sys holds the C kernels (one translation unit per ISA level, built
by build.rs with cc) behind a checked FFI; it is the only unsafe code of the CPU
runtime and opts out of the workspace unsafe_code lint with a recorded exception.
leleka-cpu-kernels does safe run-time dispatch with a LELEKA_CPU_ISA override
that fails rather than silently changing level.
Ports the int8xint8 and int4xint8 dot products from Colibri c/idot.h at scalar,
AVX2 and AVX-VNNI. Tests compare every level with the C scalar kernel and an
independent i64 oracle (13 tests; Windows MSVC and Linux GCC 14.2). Activations
must be in [-127, 127]: -128 is outside the contract and a test pins that. No
performance claim: nothing was timed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- serving_context: process-wide cell count + RoPE constants (default 262144 / identity, unchanged).
- qsa_prompt_kv/host/resolver/index/device/resident*: every 262144-linear literal (staging pools,
mapped host bytes, page tables, pooled rows, score stride, position guards, kernel max_cells)
now derives from leleka_context::geometry; identical at the default.
- .cu: the rotating-index kernels (qsa_append_first/blocks, qsa_decode_append, qsa_rope_rows,
qsa_decode_rope) take the five RoPE constants as trailing arguments instead of baking identity;
leleka_qsa_stream_reset takes n_blocks. Committed PTX is NOT regenerated: the launch code inspects
the embedded PTX (ptx_abi) and refuses scaled RoPE / pages > 65536 against the frozen entries.
- MTP drafter bank stays frozen at 262144 (documented, refused by validate_existing_int8_bank).
- dense layouts/rings accept positions below MAX_CONTEXT_CELLS (524288).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- SamplerParams moves to original_sampler_params.rs (pure) and is checked byte for
byte against the Original struct (size, alignment, offsets, padding) and defaults.
- validate() no longer rejects top_p == 0 (the Original accepts it).
- Draft cell -1 (draft_first at position 0, counter 0) is accepted by
coupled_draft_counter and OriginalSampler::sample_coupled.
- set_subset keeps the first index and ignores out-of-range ids like setup_coupled.
- Runtime penalty_rows / coupled helpers are compared with the Original header fixture;
run_port_host_tests.sh runs these pure tests on macOS.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>