25 Commits
Author SHA1 Message Date
Robert KarlandClaude Fable 5.1 979e16ba64 DeepSeek-V4.1: UPSTREAM.md, docs/DEEPSEEK41.md and README for the imported engine
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>
2026-10-23 20:39:03 -07:00
Robert KarlandClaude Fable 5.1 325594d806 tool call healing (#17) (#18)
* 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>
2026-10-21 09:47:23 -07:00
Robert KarlandClaude Fable 5.1 20bb8f79fa bench: per-machine results and logs out of the tree; keep the reusable tools
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>
2026-10-19 18:54:57 -07:00
Robert KarlandClaude Fable 5.1 7551f13877 llama.cpp as a fork: submodule -> robertkarl/llama.cpp branch UnbiasedStrata (3cf03257 + the two parser commits); no configure-time patching
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>
2026-10-19 18:46:04 -07:00
Robert Karl 2a29acb411 Revert "gitmodules: ignore = dirty for third_party/llama.cpp, whose working tree carries patches/ after every configure"
This reverts commit a69013a97c.
2026-10-19 18:40:21 -07:00
Robert KarlandClaude Fable 5.1 a69013a97c gitmodules: ignore = dirty for third_party/llama.cpp, whose working tree carries patches/ after every configure
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-19 18:38:45 -07:00
Robert KarlandClaude Fable 5.1 f499b8cf37 correctness tooling for DeepSeek V4 Flash and GLM 5.3 Flash: @FILE id lists, per-model script roots, pi context note
- 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>
2026-10-19 00:00:49 -07:00
Robert KarlandClaude Fable 5.1 3a37ac6315 step 13: tool-call arguments in any order (llama.cpp patch), harness watchdog and HTTP-served judge, DeepSeek/GLM rows, record draft
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>
2026-10-18 19:46:54 -07:00
Robert KarlandClaude Fable 5.1 1df145a215 step 12: correctness checks done; configuration A (Flash-Next) results, findings 4-6, the per-file column
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>
2026-10-18 18:26:27 -07:00
Robert KarlandClaude Fable 5.1 02875ab078 step 8 done: a screenshot through pi to Qwen3.6 on the A6000 VM; mmproj row; README, UPSTREAM, PLAN
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>
2026-10-18 00:54:42 -07:00
Robert KarlandClaude Fable 5.1 f5b9d32f8e Step 10: README rewritten for the fork; UPSTREAM.md records the front end's behaviour
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>
2026-10-18 00:02:28 -07:00
Robert KarlandClaude Fable 5.1 4c25aa6f6a Front end: llama.cpp's server files with the Strata engine behind them (design C), with fake-engine tests
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>
2026-10-17 21:31:05 -07:00
Robert Karl 822babeeb6 Remove the tool scripts that imported setup or serve (decided 2026-10-17)
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.
2026-10-17 21:04:48 -07:00
Robert Karl b7e32bea6e Remove the installer docs, chat.py and calibrate.py (decided 2026-10-17)
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).
2026-10-17 20:39:04 -07:00
Robert Karl 94df4aec73 Remove translations, media and project templates (rule 4: marketing)
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).
2026-10-17 20:39:03 -07:00
Robert Karl 3e4ad96410 Remove the Python server (rule 2: Python between a request and a token)
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.
2026-10-17 20:39:03 -07:00
Robert Karl ec59208d87 Remove the installers and downloaders (rule 1: network at setup, build or start)
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.
2026-10-17 20:38:18 -07:00
Robert Karl 7e683af1bb Build: llama.cpp as a shallow submodule at 3cf03257; patches at configure; Makefile
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.
2026-10-17 20:37:04 -07:00
Robert Karl d1022a66f0 Empty the tree: UnbiasedStrata 2 starts over from PolyStrata
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.
2026-10-17 19:34:05 -07:00
Robert KarlandClaude Opus 5.5 f3e0787320 README: the Qwen3.6 ladder on both cards against llama.cpp; the plain Q4_K_XL file's SHA-256
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-13 02:10:38 -07:00
Robert KarlandClaude Fable 5.1 69c2f05c8d README, UPSTREAM: Qwen3.6-35B-A3B as the second supported model; the sizing rule; the fat binary default
The README names both models and their hardware, the build's new
CUDA_ARCHS default, the Qwen3.6 serve command and engine flags, the files
with sizes and checksums (the plain Q4_K_XL file's hash is still to be
taken: QWEN36_Q4_PLAIN_SHA), the sizing rule in words with the planner's
figures per budget, what was checked on the 4090 and on the 1080 Ti, and
the known problems.  UPSTREAM.md gets the pack and draft-pack commands
and every prepared file's SHA-256; the patch note says it is applied at
configure time.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
2026-10-12 19:56:55 -07:00
Robert KarlandClaude Fable 5.1 8df8936dee Tool calls: accept arguments in any order; log a call the parser dropped
llama.cpp's Qwen3-Coder grammar takes a tool call's required arguments first and
the optional ones after. Qwen3.8 Flash-Next often writes the optional ones first
(limit, offset, path), and because the grammar's tool-call group is optional and
has no end anchor, such a call parsed as no call at all: no error, finish_reason
"stop", an empty answer. A coding agent sees its turn end after it announced the
call.

The grammar now accepts the arguments in any order; whether a required one is
missing is for the tool to report. The change is kept as a patch under patches/
that `make build` applies to the submodule. The front end logs the raw output
when it contains <tool_call> but no call was parsed, so the next case of this is
visible in the journal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-08 15:54:15 -07:00
Robert KarlandClaude Fable 5.1 66e03ed875 README and UPSTREAM: measured speeds against upstream, loader changes, artifact checksums
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-05 21:17:37 -07:00
Robert KarlandClaude Fable 5.1 d0a44ea7e7 README and UPSTREAM: current status, known volume problem, artifact commands
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-04 15:14:53 -07:00
Robert KarlandClaude Fable 5.1 1b59e5e106 Build from a pinned llama.cpp submodule; add Makefile and README
ggml now comes from third_party/llama.cpp (commit 3cf03257, the one upstream
pins) instead of a clone made during the build. 'make build' configures and
builds the engine for RTX 30/40/50 cards with an AVX2 CPU baseline.

Not yet verified on a CUDA machine.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-04 12:57:44 -07:00