docs/DEEPSEEK41.md records the engine-only benchmarks (the CPU lane is the
critical path on a Ryzen 1700; the opt-in zero-copy store moves two thirds
of it onto the card: 2.0 -> 3.3 tok/s alone, 4.5 to 6.9 through the front
end) and the template finding: the ISTA GGUF's template spells the DSML
tags the pre-1017 way, the official and Unsloth templates need a dict()
the pinned minja lacks, so data/dsv41/chat_template-ista-1017.jinja is
the GGUF's template with the five tags written out. README run line
updated to match.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
UPSTREAM.md gets the two new source rows and a section on what was taken
from Strata v0.2.4 and what was not; docs/DEEPSEEK41.md is rewritten for
this fork (files, pack recipe, run line, what is and is not there) in
place of upstream's installer-centred text; the README lists the third
engine and its run line.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
third_party/llama.cpp -> branch deepseek41-parser, one commit on 385445f. See UPSTREAM.md (to follow).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
From Niko1221/Strata tag v0.2.4 (commit 96ca4383, 2026-10-24), unmodified: src/dsv41/ (the engine and its vendored
EXL3 / sampler / window kernels), include/strata/dsv41/, tests/dsv41/, tools/dsv41/{pack_gguf,smoke,tune}.py,
data/dsv41/ (the shipped hot-expert profiles), tools/trellis/tqenc.{cpp,hpp} (the tests' encoder),
third_party/project-maya/ (the MIT notice: the engine is a port of Project Maya's maya-ds4),
third_party/ggml/ggml-common-tq.h, docs/DEEPSEEK41.md (upstream's text, to be rewritten for this fork).
src/kernels/cpu: upstream's iq_avx2.{cpp,hpp}, iq_avx2_rows.inl, iq_avx512.{cpp,hpp} replace this fork's
(v0.1.45-poly.1) copies - they add the engine's CPU lane rows iq256x_rows / iq512x_rows and leave the main engine's
iq256_* / iq512_* as they were (upstream's statement; iq_avx2_parity is the check) - and the trellis CPU lane
tq_cpu.{hpp,cpp}, tq_avx2.cpp, tq_avx512.cpp, tq_states.hpp, tq_computed.hpp is new. expert_layout.hpp stays at
layout version 4 (upstream's 5 adds Hadamard-folded packs this fork has no use for yet).
CMakeLists.txt: upstream's strata-dsv41 block, with ggml.h / ggml-cpu.h coming through strata_kernels_cpu's ggml-cpu
link from the submodule (no FetchContent), the tq sources and flags in strata_kernels_cpu, and iq_avx512.cpp built
with -mavx512vpopcntdq -mbmi2 as upstream does (iq512x_rows uses them). Makefile: STRATA_BUILD_DSV41=ON and
strata-dsv41 among the targets `make build` produces.
Target: ISTA-DASLab/DeepSeek-V4.1-Flash-1017-GSQ-RCO-GGUF (IQ1_M / IQ2_XXS + the IQ4_NL Engram) on the A6000 VM.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* frontend: llama.cpp parser-hold-delta (no 500 on a shrinking partial tool-call parse; raw text logged), issue #17
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* frontend: skip a stuttered </parameter> in Qwen3-Coder calls; never 500 on a shrinking partial parse (issue #17)
llama.cpp submodule parser-hold-delta 638a7e2 (two commits on a6de9af); UPSTREAM.md lists them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* frontend: skip blank lines before </function>; the final parse keeps streamed tool calls (issue #17)
llama.cpp submodule 4174b21: the Coder IQ1_M shard also leaves a blank line between the last
</parameter> and </function>; the hold-delta guard kept that stream alive but the final parse
threw in the diff check and the request still ended in a 500 (memcached-bisect-deep, 2026-10-21).
The grammar skips blank lines before the close tags, and a final parse that loses a streamed
call keeps the streamed calls instead of throwing. UPSTREAM.md lists it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* frontend: skip any stray close tag between Qwen3-Coder arguments (issue #17)
llama.cpp submodule: the third shape of the Coder IQ1_M slip (prime-frontend, 2026-10-21) wrote
</content> and </invoke> after the real </parameter>. One rule now covers the stutter, the blank
line and foreign close tags. UPSTREAM.md lists it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Measured 2026-10-20 on a 16 GB VRAM frame (Coder IQ1_M, RTX 3090; IQ2_XS, RTX 4090 in a 32 GiB VM):
arena vs --resident-experts vs --mmap-experts, --ple-io direct vs mmap, and why a RAM number read as
RSS alone lies when the n-gram table is mapped. README links the page and the pre-built MTP directory
at huggingface.co/robertkarl/UnbiasedStrataPacks.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Closes#15. tools/vm/serve-{glm,qfn}-a6000.sh were the launch lines of one machine (its NVMe paths, ports, tmux
habits); they go. The bench/correctness runners (parity-run.sh, check-batch.sh, make-inputs.py, strata-run.py)
stay, since they are the procedure CORRECTNESS-PLAN.md describes, but read US2_MODELS (required), US2_BUILD
(default: this repository) and US2_RESULTS (default ~/us2-results/correctness) instead of /mnt/ds4 and ~/us2-build.
docs/MODEL-FILES.md names no machine's paths any more; the REAP50 row gives the serve command itself.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A chat client resends the whole conversation every turn, pictures included, and the vision encoder is the slow part
of a request: 6 s a screenshot on 16 CPU threads, 18 s on 6, every turn, while the engine reuses the prompt's KV
prefix in a fraction of a second. Upstream's Python server kept the encoder's output per picture in an LRU of 64
files keyed by the SHA-256 of the picture's bytes (serve/server.py, class Vision); this is that cache for the C++
front end, in memory.
frontend/picture_cache.hpp (header-only, no llama.cpp): PictureCache keeps PictureRows (the projector's output,
n_tok rows of the embedding width) under mtmd's chunk id, which is the SHA-256 of the bitmap's bytes. Shared
pointers, so a request keeps the rows it is writing when the cache lets go of them; two limits, entries and bytes,
the newest entry always kept. engine_key() turns the id into the 64-bit key the engine's conversation cache takes
(img_keys= on the GENI line, #2228), so a picture encoded again with other bits still matches its KV prefix.
encode_pictures is now six short functions: open the file, fill it, find the chunk, its id, its rows (cache or
encoder), its grid, write the record. --picture-cache N (default 64, 1 GiB) sets the size; 0 turns it off.
frontend/tests/picture_cache_test.cpp: hit/miss and counters, LRU order and the entry limit, the byte limit and the
oversize newest entry, a held entry outliving its eviction and a key replaced, off and an empty key, the engine
keys, eight threads at once. In make test.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An ordinary one-token text such as "<th" is not split by the server (its attribute is not CONTROL or USER_DEFINED);
the oracle split it and was one token off against the Flash-Next vocabulary.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The rendered prompt was tokenized whole with specials parsed, so "<|image_pad|>" in a
document an agent read became the image pad token and the engine refused the request
("the prompt has more images than the embeddings file"); "<|im_end|>" in a tool
result ended a turn. Upstream's Python server marked these literals before the template
rendered (#537, #554); the C++ front end lost that with the server's removal.
frontend/literals.hpp: the texts of the vocabulary's control tokens and marker-like
added tokens (<think>, <tool_call>, [gMASK]) are swapped for private-use marks in the
messages and tools before oaicompat_chat_params_parse renders the template, swapped
back after, and the spans they covered are tokenized as text: parse_special off, and an
added token the tokenizer matches regardless is split until none is left. Media parts
are not scanned. An assistant message keeps a leading whole <think>...</think> block
as the model's markers (clients that send reasoning inline), as upstream did. A mark
that a template's tojson(ensure_ascii=True) escaped as a surrogate pair is read too.
A request without literals renders and tokenizes exactly as before.
mtmd's logger wrote every level to stderr, its debug line add_text() among them: the
whole rendered prompt once per request into the journal. It now goes through the
common log, where debug lines need the server's verbosity raised.
Tests: frontend/tests/literals_test.cpp (no model; nlohmann json, the interface
common_json copies) in make test; e2e.sh runs a third fake-engine server with upstream's
Qwen3 template (frontend/tests/data/qwen3-chat-template.jinja) and checks
usage.prompt_tokens against the prompt tokenized by hand with the literals as text, for
user content, a tool description and an assistant history message.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Upstream's bench/results/ (23 MB, one directory per community machine) and the fork's bench/unbiased/ run
directories (57 MB: step 6 to 9, 13, the 4090 run, the correctness record) are removed. A result from one machine
is a record, not source; the numbers that matter are in README.md "Measured", and the directories stay in history
at 7551f138 (git checkout 7551f138 -- bench/unbiased bench/results). bench/ keeps bench_vs_llama.py with its
corpus, the kernel probes, and bench/correctness/, the step-12 teacher-forced harness moved from
bench/unbiased/correctness/scripts/ without its per-campaign chain-*.sh glue (it writes under ~/us2-results/, not
in the tree). README, UPSTREAM.md, PLAN.md, docs/MODEL-FILES.md and docs/CORRECTNESS-PLAN.md point at the history
commit where they cited the directories.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The two tool-call parser changes that CMake applied to the submodule's working tree at every configure are now
commits 9547d8d and a6de9af on the fork's branch, and the submodule pins that branch's tip. The pinned commit alone
names the sources compiled, the submodule is clean after a build, and a bump of the pin that breaks the parser
changes fails in git, not in configure. patches/ and the CMake loop are removed; README, UPSTREAM.md, PLAN.md and
docs/CORRECTNESS-PLAN.md say where the changes live now. make test passes on the CUDA-free front-end build.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Fork only, built fresh on the box at a0443466 (make build CUDA_ARCHS=89), upstream's strata_bench.py --runs 3 --long
plus the sustained supplement, the record layout of bench/unbiased/2026-10-17-3090pod-step9/. 54 requests, all
successful. Two start-only probes chose --kv-resident 131072 (every q4_0 cell in VRAM, 10,162 expert slots) over 32768
(10,545 slots). Chat decode 98.5 tok/s, sustained 123.0, agent turns 120.0; prefill 1547 / 2992 / 3075 tok/s at 4K /
16K / 32K; draft acceptance 65.2 %. Open finding: short-prompt reading is 25-45 % below the 3090 pod while 16K and 32K
reading is 18 % above it; a --pool-workers 8 arm is the first test. The server, probe and driver logs are added with -f
(the *.log ignore is for build trees; the README cites these).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A fresh clone on the VM (2026-10-19) built in 20.6 min with the README's commands as written, but `make test` failed with
'build-frontend/engine_test: No such file or directory': the frontend target sets CMAKE_RUNTIME_OUTPUT_DIRECTORY to
build-frontend/bin and the test target looked one level up. It passed on the Mac only because a stale build-frontend/
there still had the old binary at the root.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Record section 8: T2 holds on every set and arm (DeepSeek 0.69-1.06x, GLM 0.89-1.13x the CPU-vs-GPU floor); T1 flips at
3 and 5 margin positions where both llama.cpp runs agree (USTRAT-10); the GLM draft arm is not bitwise the base arm
because the draft block's VRAM moves 52 experts to the CPU (USTRAT-9); llama.cpp master's CPU run drifts from the
pinned reference by as much as the engine does (USTRAT-11). GLM reference = master 99db719b (pinned lacks glm5-next).
Inputs, top-20 reference extracts, engine outputs, scores, logs and the pod scripts as run; MODEL-FILES rows filled;
PLAN step 12 addendum; README sentence.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The 2x B200 pod was terminated mid-run with the chain scripts living only on its disk; they now sit in
bench/unbiased/correctness/pod/ and target the replacement 2x RTX PRO 6000 box.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- src/poly/main.cpp: --tokens/--eos-ids/--follow take @FILE (a 31K-id list is over Linux's 128 KiB argument limit);
tools/qwen35/q36_llama_dump.cpp: the same for --tokens/--force. Test-only; documented in UPSTREAM.md.
- bench/unbiased/correctness/scripts: US2_CORR_ROOT / US2_DUMP / US2_POLY / US2_VOCAB overrides so the step-12 scripts
run for another model, tokenizer and reference build; ids passed as @FILE; stderr decoded with errors='replace'
(DeepSeek's vocabulary pieces are not all UTF-8); make-inputs-model.py (inputs through the fork front end's
/apply-template + /tokenize); pull-record-2026-10-19.sh.
- README: pi's compaction defaults need a window well above 32K (USTRAT-8).
Runs on the 2x B200 pod in progress; record follows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bench/unbiased/2026-10-19-step13-acceptance/: results (per-run table, tally, reading of the non-passes), API-only
acceptance on five served models (A6000 Qwen3.6 IQ4_XS; RTX 3090 Flash-Next IQ3_XXS at 24 and 15 pool workers and
Qwen3.6 Q3_K_M; B200 DeepSeek V4 Flash and GLM 5.3 Flash), findings 1-8, server lines and engine info.
Outcome: every model completes md-toc, kvstore, bugfix and Minesweeper (and Minesweeper at temperature 1.0, except the
A6000 IQ4_XS page with a ReferenceError of its own) through the fork's server; DeepSeek and GLM after this step's two
fixes. API checks within 15 % of step 9 on the 3090 (Flash-Next only at --pool-workers 15, now the pod's start line);
first B200 figures recorded.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
patches/llama.cpp-any-argument-order.patch (common/chat-auto-parser-generator.cpp, common/parsers/deepseek.cpp):
the generated tool-call grammars accept required arguments in any order. Upstream takes them in schema order,
which holds when its own sampler is grammar-constrained; this engine samples unconstrained, and DeepSeek V4
Flash and GLM 5.3 Flash both wrote content before path for pi's write tool, so finished calls came back as
parse errors (USTRAT-7). Same fix the fork already carries for the Qwen3-Coder parser. GLM's md-toc run passes
with it; DeepSeek rerun in progress.
tools/acceptance: 300 s per-tool-call watchdog inside the container; the minesweeper judge serves the work tree
over HTTP (the headless browser refuses file: URLs) and counts errors correctly; rejudge.sh, summarize.py;
pi max output 24576 tokens. tools/pod/bringup.sh copies data/expert-profile.bin into the Flash-Next pack (the
engine exits without it). docs/MODEL-FILES.md: DeepSeek V4 Flash UD-IQ2_XXS and GLM 5.3 Flash 3.0bit rows
with hashes and first-start results on the 2x B200 pod. bench/unbiased/2026-10-19-step13-acceptance/: record
in progress (server lines, engine info, findings; result tables to follow).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
tools/acceptance/: Dockerfile (pi 0.85.1 image), run-task.sh / run-all.sh / judge.sh / pretty.py, tasks md-toc,
kvstore, bugfix (seeded), minesweeper with hidden tests / black-box judges, models.tsv, README. Runs go to
runs/ (ignored); curated results land under bench/unbiased/ when the campaign closes.
frontend/tests/acceptance-real-engine.sh: PLAN.md step 13 (c): sampled checks, seeded repeat, tool call, decode and
prompt-reading speed against an expected figure with a 15 % band.
frontend/strata_context.cpp: the vocabulary-only load is retried with general.architecture overridden to "llama"
when llama.cpp does not know the file's architecture; GLM 5.3 Flash's file says glm5-next (neurall's fork) and
the front end refused to start (USTRAT-6). Verified on the 2x B200 pod: GLM starts, template renders, answers.
tools/pod/README.md: pod-to-pod tree copy (90 s against hours from the laptop), bringup must wait for the tree.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Configuration A on the A6000 VM: llama.cpp 3cf03257 reference as a partial offload (28 of 48 layers) and a CPU run;
strata arms fp16, t4 (4-token windows), int8, int8str (streamed KV), pf512 (512-token prompt chunks), pin (every
expert on the card), cpu (fixed smaller cache, every miss on the CPU pool), pcie, and T0 repeats. T2 passes every set
in every arm (0.67-0.94x the reference's own CPU-vs-GPU spread); T1 fails at 0-4 of ~2,880 margin positions per arm,
six near-tie positions, none in every arm. check-batch 4 passes on both Qwen3.6 files.
Findings 4-6: strata's bits depend on the free VRAM at start (--expert-cache auto; CPU-computed misses round
differently) unless the expert cache is pinned, under which repeats, window sizes, KV streaming and the CPU tier are
bitwise reproducible; six Flash-Next T1 flips; the PCIe-fetched expert differs from the cached one on 18 rows of one
sequence. Tickets USTRAT-1 to 5.
Also: scripts as run (two-request scheme for long sequences, realign, the pinned and CPU-tier arms, check-batch,
chains), logs, scores, reference top-20 and sha256; STRATA_DUMP_THREADS in the dump tool (thread count moves no
bits, probes/cpu-threads); docs/MODEL-FILES.md gets the correctness column and the LFS-pointer note; README.md and
UPSTREAM.md state the results and the two upstream claims that did not hold; PLAN.md row 12 done.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
38 component parities pass; poly_expert_parity fails its 0.05 bound on one Q3_K_M
expert in the CPU path (finding 1). Teacher-forced scoring of 16 sequences per
model, 4 arms (Q3_K_M) and 2 arms (IQ4_XS): T2 (KL within 1.5x the GPU-vs-CPU
floor) passes every set; top-1 agreement at the floor; T1 at 0.5 nats fails at
a handful of positions, three of which the reference fails against itself.
Finding 2: the draft block's bitwise claim fails for windows of five or more
tokens (probes). Finding 3: one engine-only T1 failure on the thinking answer.
Scorer gates T2 against the like-for-like bucketed floor. Flash-Next pending.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bench/unbiased/correctness/scripts/: inputs (make-inputs.py), the llama.cpp reference runs
(ref-run.py), the strata-poly and strata arms (poly-run.py, strata-run.py), the
component parities (parity-run.sh), the scorer (score.py, score-all.py) and the
VM chains. tools/qwen35/q36_llama_dump.cpp: STRATA_DUMP_UBATCH, default
min(ctx, 4096): a 32K prompt as one micro-batch wanted a 35 GB compute buffer.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Written by a planning agent (session c2843167); the user read it and approved
the checks as proposed. Step 12 runs them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bench/unbiased/2026-10-18-a6000-qwen36-iq4xs-images-step8/: four runs (API uncapped
2040 rows 146 s, API with --mmproj-gpu which ran on the CPU, API at the 300-row
default 15 s, and through pi 0.85.1 with @facts.png), six of six facts each time;
projector width checked at start. docs/MODEL-FILES.md gains the mmproj-F16 row.
README: run line with --mmproj, the limits (CPU encoder, quadratic in rows).
UPSTREAM.md: the --mmproj bullet replaced by what the front end does. PLAN row 8.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
An uncapped 1920x1080 screenshot is 2040 rows and took 146 s on the A6000 VM's
Ryzen 7 1700. Upstream's setup.py gave strata-vision --max-tokens 300 on the CPU
and 1024 on the GPU; the same defaults here, --image-max-tokens overrides. The
front end's ggml has no GPU backend (the engines bring their own CUDA), so
--mmproj-gpu now fails at start instead of running on the CPU under a GPU label.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The first picture on the A6000 VM (Ryzen 7 1700, 12 vCPUs, AVX2) took 146 s to
encode a 1920x1080 screenshot (2040 rows) on the CPU against 0.85 s of engine
time. The card had 29 GB free beside the engine. --mmproj-gpu (a front-end
option, not llama-server's, whose default is the GPU) puts the encoder there with
mtmd's warm-up so the work buffers exist before the first request.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
server-common replaces an image_url part by a marker that is random per process;
mtmd was left at its default marker, so the first picture request on the A6000
failed with 'number of media markers in text (0) does not match number of bitmaps
(1)'. Set mtmd's marker to get_media_marker(), as llama-server does.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
--mmproj FILE loads the model's vision projector with llama.cpp's mtmd in the server
process (CPU, --threads or half the cores; the card is the engine's), after checking
that the projector's output width (clip.vision.projection_dim) equals the model's
embedding width from the GGUF metadata and that the vocabulary has <|image_pad|>.
A request's image_url parts come through llama.cpp's own parser as media chunks;
launch() encodes each chunk, writes strata-vision records ('SVE1', rows, nx, ny,
width, float32 rows) to a per-request temp file removed with the slot, replaces the
chunk's placeholders by image_pad ids, and sends GENI <max_new> ... image_pad=<id>
<file> <ids>, which strata-poly (take_pictures) and strata read. Without --mmproj
the parser refuses images with llama.cpp's message; e2e.sh checks that.
Reference: upstream tools/vision/strata_vision.cpp (same records, a child process)
and UnbiasedStrata 1's frontend/vision.hpp. Qwen family only (the pad token);
tiled encoders (MiniCPM-V canvases) are refused. Gate on a real engine follows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>