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>
With upstream's engine binaries behind the fork front end, prefill is equal within
1 % and decode within the run-to-run range on both models. Table and reading in the
step-9 README; PLAN section 11 updated.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Same files and flags as the step-9 arms. With upstream's engine behind the fork front end,
prefill matches upstream's arm (Flash-Next 1908/2329/2385 vs 1924/2342/2393; Qwen3.6
3873/3535 vs 3652/3570) and chat decode is at or above it (93.3 vs 87.1; 228.2 vs 220.8):
the Flash-Next speedup and the Qwen3.6 16K prefill gap of the fork arms come from the
engine build in the fork tree, not from the front end. Analysis to be written into the
README of this directory (next session).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
README.md: what the fork is, the two engines with measured versus present models,
the exact build lines and make variables, the run line per measured model with
every flag upstream's installer would have chosen for a 24 GB card and what each
flag does per upstream's docs, the Flash-Next pack chain, the measured table
(step 9 upstream-vs-fork and the step 6 short-prompt ranges, nothing without a
row), known limits, the removal rule, credits. 917 lines of upstream's README
become 180.
UPSTREAM.md: a section for the front end's behaviour where it differs from
llama-server or upstream's server (/health fields, usage chunk, one slot, no
constrained decoding, --mmproj refused, SIGTERM exit status, min_p default);
the engine-source section states the empty diff since import.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Three pi runs a side through an SSH tunnel; all six complete the task. Wall time
per generated token within noise (fork 76.6 vs upstream 72.1 tok/s median); raw
wall medians 44.7 vs 36.3 s follow the sampled trajectories' lengths. Records,
server logs, the runner and the per-run totals under row3/. PLAN section 11 and
the step table updated: step 9 measured, one Qwen3.6 prefill cell left to explain.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bench/unbiased/2026-10-17-3090pod-step9/: four arms (upstream and fork, Flash-Next
IQ3_XXS and Qwen3.6 UD-Q3_K_M), upstream's tools/strata_bench.py --runs 3 --long plus
the three-document sustained supplement, raw client output, server logs, provenance
(engine sha256, fork commit), the runner, the launch logs, and a README with the
comparison tables and the two client-compatibility gaps found on the way.
Flash-Next: fork faster on every workload (chat 103.1 vs 87.1 tok/s, sustained
119.1 vs 105.1, prefill 2065/2531/2616 vs 1924/2342/2393). Qwen3.6: decode within
the run-to-run range; 4K prefill 4.7 % faster; 16K prefill 2.3 % slower with
non-overlapping ranges, recorded as a finding to explain. Engines were built
separately in each tree, so a build difference is not excluded.
PLAN.md section 11 and the step table, docs/MODEL-FILES.md statuses updated.
Row 3 (pi wall time) pending.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Upstream PolyStrata's server reports usage on every streamed reply, and its
tools/strata_bench.py reads prompt_tokens from it without sending
stream_options.include_usage. llama.cpp only adds the usage chunk on request,
so the fork's step-9 Flash-Next arm recorded prompt_tokens = null. Set
include_usage on every task result: the last chunk has usage, timings and an
empty choices array (OpenAI's documented shape).
e2e.sh: the health check from 453d3015 compared the json boolean to 'True'
instead of 'true'; the stream checks now skip the empty-choices chunk and
assert usage on it.
Verified: make test under sandbox-exec (engine_test 7 cases, e2e all checks).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Upstream's tools/strata_bench.py (is_strata, wait_ready) only talks to a server
whose /health has service == "strata" and loaded; the fork answered llama.cpp's
{status, busy} only, so the step-9 fork arms never left the readiness wait
(fork-flash-next on the pod sat ready for 30 min, then was killed as 'failed
to start'). Add service, loaded, model, max_context; keep status and busy.
e2e.sh checks the two required fields.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The page the model writes is opened in a headless browser and must render without a console error with a clickable
grid; how much further the judging goes is an open question of the step.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
For every model file in docs/MODEL-FILES.md and every model upstream supports once its file is on a box that can hold
it: load through the front end, ask for a small program sampled at 0.6 and 1.0 and run it, compare decode and prompt
tok/s with an expected range per model and card. Open questions are listed in the step; it is a stub to be planned.
Noted as the minimum sanity bar beside step 12, which is the correctness check proper.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The parity programs and the teacher-forced greedy id comparison against llama.cpp that step 11 names and the user
signs off are run in step 12, with commands and raw outputs under bench/unbiased/correctness/. A divergence is a bug
to find before any README claim beyond equality with upstream PolyStrata; docs/MODEL-FILES.md records the result per
file. The notes copy in unbiasedstrata2/ is updated too.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Added to the steps table of section 9 and explained after it: an agent writes docs/CORRECTNESS-PLAN.md naming the
checks (upstream's parity programs, a teacher-forced greedy id comparison against llama.cpp at the pinned commit for
Flash-Next and Qwen3.6), what each compares against, its pass criterion and its cost; nothing runs and no code changes
in that step. Recorded because the plan so far inherits the engines' correctness from upstream, and the step-6 gate as
run compared text and completion-token counts rather than ids. The notes copy in unbiasedstrata2/ is updated too.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
frontend/tests/shapes-real-engine.sh runs seven request shapes against a live server (PLAN.md section 9, step 7): no
max_tokens; max_tokens 32768; a prior assistant message with reasoning_content and tool_calls followed by a tool
result; two tool calls asked for in one turn; a call with its optional arguments before the required one; a client
that disconnects two seconds into a stream, then a clean request; an 18k-token prompt streamed, timing the first byte
and counting SSE pings. Records: bench/unbiased/2026-10-17-{a6000-qwen36-ud-iq4xs-mtp,3090pod-flash-next-iq3xxs}-step7-
shapes/ and -step7-pi/, plus the A6000's Qwen3.6 UD-Q3_K_M smoke (…-a6000-qwen36-ud-q3km-mtp-step6/). docs/MODEL-FILES.md
describes the checks and the SSE ping default.
Verified 2026-10-17:
- Qwen3.6 UD-IQ4_XS on the A6000 and Flash-Next IQ3_XXS on the 3090 pod answer all seven shapes. Without max_tokens the
front end fills the context (n_predict 32,747); max_tokens 32,768 beyond the context is clamped, not refused; the
reasoning_content history is accepted and answered from the tool result; the optional-arguments-first call parses
("limit", "offset", then "path"); the disconnected stream is cancelled at the engine (finish=cancel after 387 and 172
tokens) and the next request answers in 0.09 s and 0.24 s; the 18,589-token prompt streams its first byte after 5.2 s
(Qwen3.6, A6000) and 8.0 s (Flash-Next, pod). Qwen3.6 issued the two parallel calls asked for; Flash-Next chose one
bash call instead, which is the model's choice, not a parsing fault. No ping was seen because the pinned server pings
after 30 s of silence (--sse-ping-interval); the run lines will set it lower for long prompts.
- pi 0.85.1 against Flash-Next on the pod completed the same multi-step task as against Qwen3.6: read, --json flag, 7
unittest tests, all passing, one commit (it also noticed and untracked __pycache__). 17 requests, 16 finish=stop and
the one cancel from the shapes run, prompts up to 4,644 tokens, max_tokens 32,768 passed through, no parse failure.
- Qwen3.6 UD-Q3_K_M (8966dd0c...) on the A6000: all six smoke checks, 214 to 235 tokens/s decode on short prompts.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bench/unbiased/2026-10-17-3090pod-qwen36-ud-{q3km,iq4xs}-mtp-step6/: launch scripts (strata-poly with upstream
setup.py's flags for the qwen36 family), the model files' SHA-256 (8966dd0c... and df27a780..., both from
unsloth/Qwen3.6-35B-A3B-MTP-GGUF at 5bc3e238, equal to the Hugging Face LFS object ids), the engine's info lines and
the raw smoke responses. bench/unbiased/2026-10-17-a6000-qwen36-ud-iq4xs-mtp-step7-pi/: pi's transcript, the diff it
committed in the scratch project, the provider entry it ran with, and the server-side summary of the session.
Verified 2026-10-17 on the RTX 3090 pod, through the front end: both files serve all six smoke checks. UD-Q3_K_M:
211 to 227 tokens/s decode on short prompts, 105 of 120 drafts accepted on the thinking request; UD-IQ4_XS: 205 to
245 tokens/s, 273 of 295. The greedy answer is the same as Flash-Next's and the A6000's. The pi session on the A6000
(13 requests, prompts growing from 453 to 5,520 tokens, max_tokens 23,181 to 28,229, no min_p) had 13 DONE lines, 12
finish=stop and 1 finish=length, no tool-call parse failure and no error or warning other than the expected
"a grammar was requested; this engine does not constrain sampling, parsing only".
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Records under bench/unbiased/, one directory per box and model: the exact launch script, the fork commit, the engine's
info lines and the raw responses of frontend/tests/smoke-real-engine.sh (health, /v1/models, a greedy chat without
thinking, a sampled chat with thinking, a stream, a tool call). docs/MODEL-FILES.md tracks every model file tried, by
source repository, size and SHA-256, with its status; the same quantization from two Unsloth repositories is two rows,
because only the Qwen3.6-35B-A3B-MTP-GGUF files carry the draft block. Upstream's docs/MODELS.md is unchanged.
Verified 2026-10-17:
- Flash-Next GSQ-RCO IQ3_XXS on `strata`, with the pack, the expert profile, spec 4 and MTP exactly as upstream
PolyStrata v0.1.45-poly.1 ran it on the RTX 3090 pod on 2026-10-17: the front end serves all six checks on the pod
and on the A6000 VM. The greedy answer ("101\n103\n107", 12 completion tokens) is the same on both boxes and the same
as upstream PolyStrata's Python server on the same engine binary and files on the pod (upstream-compare/), which is
the step-6 gate of PLAN.md section 9.
- Qwen3.6-35B-A3B UD-IQ4_XS (MTP repository, SHA-256 df27a780...) on `strata-poly` with upstream setup.py's flags for
the family: all six checks on the A6000, 207 to 215 tokens/s decode on short prompts, 83% of drafts accepted. The
stream check ended by max_tokens with thinking on, as expected for a 200-token cap.
- Through an SSH tunnel, pi 0.85.1 with an openai-completions provider pointed at the Qwen3.6 server completed a
multi-step task in one run: read two files, added a --json flag, wrote 11 unittest tests, ran them, fixed nothing,
committed. pi sent no max_tokens cap below 28,229 and no min_p; the front end passed both through.
- The pod's /workspace is a geesefs FUSE volume that stalls to a few MB/s when the engine fills its expert cache from
it while anything writes; the engine then never becomes ready. bench/unbiased/*3090pod*/stage.sh stages the files
on the container disk (hashes of pack and MTP checked against the pod's artifacts.sha256, shard sizes equal).
Not yet: a speed comparison (the pod's fork decode on the two short smoke prompts was 64 tok/s against upstream's
112 tok/s sustained benchmark; step 9 measures both the same way), Qwen3.6 UD-Q3_K_M (downloaded and hashed, not run).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
frontend/strata_context.cpp replaces tools/server/server-context.cpp. The other seven server files
(server-http, -queue, -task, -common, -chat, -schema, -stream) compile unmodified from the submodule into
the static library strata_llama_server; frontend/ui_stub/ supplies the empty web-UI asset table that
server-http.cpp references. The context runs one slot: the engine is a child process spoken to over its
line protocol (docs/BACKENDS.md), a vocab-only llama_model provides tokenizing, the chat template and the
reasoning and tool-call parsers, and the server's own task and result types carry the OpenAI JSON, SSE
framing and client-disconnect cancel. Routes kept: /health, /v1/models, /v1/chat/completions, /tokenize,
/detokenize. The strata engine's 8-token reserve is kept out of max_new. A supervisor thread ends the
process with exit code 1 when the engine dies, for a unit with Restart=on-failure.
frontend/engine.hpp is the child adapter: fork+exec, READY/INFO, GEN/GENI, T/PP/RESUME/DONE/ERR/FATAL,
STOP with drain to DONE, non-blocking reap. quit() and the supervisor's reap_exit() share the pid through
an atomic that quit() takes over by exchange, and only a positive local copy ever reaches kill(). The
first draft kept a plain pid_t and the supervisor set it to -1 on reaping, so a SIGTERM during shutdown
raced into kill(-1, SIGKILL), which killed every process of the user; it did so twice on 2026-10-17.
Build: STRATA_FRONTEND (default on) gates the llama.cpp libraries and the front end, not CUDA, so they
build on a machine without a GPU. Makefile: unbiased-strata joins `make build`; `make frontend` builds it
alone without CUDA into build-frontend/; `make test` builds engine_test there and runs it and
frontend/tests/e2e.sh against a fake engine (frontend/tests/fake-engine.py). The nvcc probes run only
when there is an nvcc and only the build and configure goals demand one. UPSTREAM.md records all of it.
Verified on macOS arm64 without CUDA: `make frontend` and `make test` pass. engine_test, 7 cases: READY,
a request, STOP mid-request with drain and a clean next request, a 100k-token burst the caller abandons,
ERR leaves the adapter usable, the engine dying mid-request is diagnosed, a DONE with the wrong prompt
size is visible. e2e.sh, 12 checks: /health, /v1/models, a non-streaming chat with content, finish and
usage, a stream whose deltas join to the content and end with finish_reason and [DONE], a client that
disconnects mid-stream (the server logs the cancel and the next request completes), an oversize prompt
refused with 400, a tokenize/detokenize round trip. Zero new patch lines to llama.cpp, so the step-4
gate of PLAN.md section 5 passes and design C stands. Not yet run against a real engine.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Engine gate scripts driven through the Python server's StrataEngine class, the
strata_bench benchmark and its launchers (bench.sh, BENCH.bat), make_poly_release,
and the tests that imported the removed modules. Nothing left under tools/
imports setup, serve, polystrata or chat. bench/results/*/ keeps upstream's
recorded scripts; metal/ and sycl/ keep their own installers as inert platform
code, per the brief. UPSTREAM.md lists the removals.
Verified: grep for importers of the removed modules outside bench/results,
metal, sycl and third_party finds none.
Seven docs pages that describe only removed components, the stdlib terminal
client, and the calibration tool that imports setup and serve.server, with
their tests. UPSTREAM.md records the cut and lists the tool scripts that stay
in the tree although they import removed modules.
Verified: nothing in the build references the removed files (grep).
Six README translations, docs/media, .github templates, SECURITY.md and
AGENTS.md. README.md stays until it is rewritten for the fork; its image links
are broken meanwhile. UPSTREAM.md records the cut.
Verified: nothing in the build references docs/media or .github (grep).
serve/ and polystrata.py. The Python server tokenized, rendered the chat
template, parsed reasoning and tool calls, and streamed SSE per token; the C++
front end in frontend/ will do that from llama.cpp's own code. The engines and
their line protocol are untouched. UPSTREAM.md records the cut.
Verified: no file under CMakeLists.txt, cmake/, tools/vision or the engine
sources references serve/ (grep); the only remaining importers are offline
tool scripts under tools/, listed in UPSTREAM.md as not runnable.
setup.py and its launchers, the Docker and Nix files, requirements.txt, the MCP
installer, the image-generation installer, the AMD Windows packager and their
tests. Nothing the engines read or the build uses lived in these files; the
engine's runtime data (data/, tools/hip/*.txt) stays. tools/requirements.txt
lists the two packages the offline pack tools need. UPSTREAM.md records the cut.
Verified: no file under CMakeLists.txt, cmake/, tools/vision or the engine
sources references a removed path (grep); git status clean after the commit.
ggml now comes from third_party/llama.cpp, the commit upstream pins, instead of
a FetchContent clone at configure time; the configure stops with the submodule
command if the checkout is missing. patches/*.patch are applied to the submodule
at configure time, idempotently (checked in reverse first); the one patch is the
Qwen3-Coder any-argument-order parser fix carried from UnbiasedStrata 1. A second
add_subdirectory builds llama.cpp's llama, common, cpp-httplib and mtmd for the
coming C++ front end with every download switch off. Makefile: make build
configures once and builds strata, strata-poly, strata_kq, llama-common and
mtmd into build/bin for CUDA archs 61;75;86;89 (SM60 flag added for 61), finds
nvcc on PATH or in /usr/local/cuda/bin, and probes for the newest GCC nvcc
accepts, passing it as the C, C++ and CUDA host compiler so one libstdc++ is
linked (a GCC 14 / GCC 13 mix failed to link strata on __cxa_call_terminate).
PLAN.md and UPSTREAM.md added.
Verified: a fresh clone and 'git submodule update --init' on a networked box
checks out the shallow pin in 37 s. On VM 220 (Debian 13, GCC 13/14, CUDA 12.4,
no outbound internet) 'unshare -rn make build JOBS=6' inside a network namespace
with no interfaces built strata, strata-poly and libstrata_kq.so for 61;75;86;89
in 24 min with zero network errors in the log; strata --version prints 0.1.45.
The upstream release tree, every tracked file byte for byte, from
https://github.com/VecSzn/PolyStrata at tag v0.1.45-poly.1, commit
d0cd84dc6bd009d1d9e2191e4e28cc76b80f1ee3. Nothing added, removed or edited;
git diff against this commit is the whole story of the fork.
Verified: the commit's tree hash equals the upstream commit's tree hash.
Every tracked file, .gitignore, .gitmodules and both submodules (llama.cpp at
3cf03257, llama-muse at 335916a) are removed so the next commit can import
PolyStrata v0.1.45-poly.1 unmodified and be the diff baseline of the fork.
UnbiasedStrata 1 remains at tags unbiasedstrata-1 (main, b124b59) and
unbiasedstrata-1-muse-spark-native (4c824e6).
Verified: git ls-files is empty; the working directory holds only .git.
The engine reports progress (PP) and tokens (T) over its stdout, but the
front end logged only the start and end of a request. A 154k-token prompt
is minutes of silence that reads as a hung request. Now a line every
STRATA_PROGRESS seconds (default 5, 0 = off): prompt processing from the
engine's own PP lines, and decoding from the token count.
cudaGraphInstantiate allocates device memory for each window size's exec and the
exec is never freed (measured ~22-26 MiB per size on a GTX 1070 Ti, 2026-10-15).
serve captured each size lazily, on the first request that used it, so that
memory came out of - and could outrun - the reserve the auto-cache had been sized
against. A serve planned down to its last ~150 MiB therefore captured the sizes
its first requests asked for and then failed the next
strata serve: verify: instantiate: out of memory
mid-request, which took the engine and the front end down with it (the container
restarted). This is not the sampler or the Qwen3.6 port: the DRY work adds ~4 KB
of device arrays and a 128 KB history row, and the lazy capture predates both.
Every size 1..max_t the serve path can ask for is now captured right after the
verifier is bound (after set_split / set_pcie_mode, which the recorded graph
depends on). That makes the cost part of what the serve free-VRAM check sees and
bounds it before any request runs: a size that does not fit is reported at
startup, naming the knobs that make room, instead of killing a request.
Seen on kontron.local: a GTX 1070 Ti (sm_61) serving Flash-Next Coder IQ1_M with
--ctx 131072 --vram-cap 7680. There the window graphs need ~135 MiB and the plan
left 135 MiB free; --vram-reserve-mib 700 (which skips #496's lowering to 300)
leaves ~630 MiB and all six fit. The cap itself is honoured: the blocker held
back the 424 MiB it should.
The sampler chain gains llama.cpp's dry stage (penalties -> DRY -> top_k -> ...): a token that would extend a
repeat longer than dry_allowed_length over the last dry_penalty_last_n history tokens loses
dry_multiplier * dry_base^(repeat - allowed_length), with tokenized restart sequences capping the scan.
- kernels/cuda/sampler.cu: dry_window/dry_build/apply_dry in the greedy, old, one-block, split and coupled
penalize kernels; the DRY window is the same history row the penalties count, clamped to kDryWindowCap=512;
the membership bitmap spans the wider of the two windows and gates both. Off (the default) the neutral path
is unchanged: shmem 0, the cluster argmax still runs, the parity fixtures pin every path against a host
reference (sampler_parity, 19 fixtures).
- include/strata/kernels/sampler.hpp: the dry_* fields, DryBreakers (device flat/off), dry_enabled.
- verify / mtp: Verifier::set_breakers and MtpDrafter::set_draft_breakers thread the tokenized breakers to the
head sampling and the captured coupled-draft graph (stable device arrays).
- generate.cpp (engine): dry_multiplier / dry_base / dry_allowed_length / dry_penalty_last_n / dry_breakers GEN
keys; the breaker arrays are allocated once at the cap on the head device, the request refills them; a
DRY-only request still stages history (the wider of the two windows).
- front end: --dry-multiplier / --dry-base / --dry-allowed-length / --dry-penalty-last-n / --dry-breakers
defaults and dry_* / dry_sequence_breakers request fields; the front end tokenizes the restart sequences
(the engine has no tokenizer) and sends them as ids. The defaults are llama.cpp's: multiplier 0.8, base
1.75, allowed length 2, window 256, breakers newline, colon, quote, asterisk when unset.
Port upstream Strata's reasoning_budget_tokens to this fork's front end: when the thinking reaches the budget it is closed with a configurable message and the template's end-of-thinking tag, and the engine is asked again with prompt + generated + wrap-up, continuing from the prefix it already holds. Off unless thinking is on and a budget is set (a request's own value wins over the command line). The wrap-up tokens are charged to the response so the context fit is unchanged; usage reports completion_tokens_details.reasoning_tokens. --reasoning-budget-message sets the wrap-up wording (default: upstream's own line).
Brings in 139 upstream commits: the Qwen3.6-35B-A3B model (ModelGeometry from the file's own metadata, native experts IQ3_XXS/Q5_K/Q6_K, dense split-K attention, the GDN gate per model, the MTP drafter, native packs through the verify window), the VRAM/RAM planner with --vram-cap/--ram-cap, the fat-binary CUDA build, and the front-end fixes (content streaming, preserve_thinking, the engine's actual context, /health tiers).
Conflicts resolved:
- Makefile: kept upstream's CUDA_ARCHS default and the drop-unsupported-arch logic (fixes the compute_120 build on this toolkit) and kept the local PASCAL=1 override.
- README.md: kept both the local --fit-max-tokens row and upstream's engine-flag row.
- frontend/main.cpp: kept the local --fit-max-tokens option beside upstream's --vram-cap/--ram-cap.