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>
12 KiB
Relationship to upstream
Sources
| What | Where | Version |
|---|---|---|
Engines (strata, strata-poly), tools, docs |
https://github.com/VecSzn/PolyStrata | tag v0.1.45-poly.1, commit d0cd84dc6bd009d1d9e2191e4e28cc76b80f1ee3 |
| ggml, llama, common, mtmd, cpp-httplib | https://github.com/ggml-org/llama.cpp, as the submodule third_party/llama.cpp |
commit 3cf03257f219afbe7334045ff7c6a06ac68c627d, the one upstream pins |
Commit 0197ae86 ("Import PolyStrata v0.1.45-poly.1 (d0cd84dc) unmodified") is the upstream tree, every tracked
file, with the same tree hash as upstream's commit. git diff 0197ae86 HEAD is the whole story of this fork;
git diff 0197ae86 HEAD -- src include is every change to the engines.
The history before that commit is UnbiasedStrata 1, a fork of Niko1221/Strata 0.1.39, ended at the tags
unbiasedstrata-1 and unbiasedstrata-1-muse-spark-native.
Rules
A thing is removed only when it (1) reaches the network during setup, build or start-up, (2) puts Python between a request and a token, (3) breaks or complicates the one-command build, or (4) is marketing. Everything else stays, built or not. Engine changes are bug fixes for the target (Linux x86-64, one NVIDIA GPU, Pascal or newer, CUDA 12.x), each recorded below with the file, the reason and the measurement.
Build (CMakeLists.txt, Makefile, .gitmodules, .gitignore, patches/)
- ggml from the submodule, not a fetch.
STRATA_GGML_DIRdefaults tothird_party/llama.cppand the configure stops with thegit submodule update --initline ifggml/CMakeLists.txtis missing. Upstream'sFetchContentof llama.cpp (the only network access of its build) is deleted. The three laterif(STRATA_GGML_DIR)blocks are unchanged; theirelse()branches are now dead..gitignoreno longer ignores/third_party/llama.cpp*. patches/*.patchapplied at configure time. Each patch is checked in reverse first, so configuring twice applies it once. The submodule's working tree is therefore modified after a configure;git -C third_party/llama.cpp diffshows exactly the patches. UnbiasedStrata 1 applied its patch inmakeand in CMake both; here it is CMake only, so a tree configured directly gets it too.- llama.cpp's libraries for the front end. A second
add_subdirectoryof the submodule withLLAMA_BUILD_COMMONandLLAMA_BUILD_MTMDon and tests, tools, examples, server, app, UI, prebuilt UI, OpenSSL and llguidance off. It reuses the ggml targets configured above. Gated bySTRATA_FRONTEND(default on), not by CUDA, so the front end also builds on a machine without a GPU. - The front end,
unbiased-strata. Seven of llama.cpp'stools/serverfiles are compiled unmodified from the submodule into a static library (server-http,server-queue,server-task,server-common,server-chat,server-schema,server-stream): the HTTP layer, the task queue, the OpenAI request and result types, SSE framing, the request schema. The eighth,server-context.cpp, is bound tollama_contextand is replaced byfrontend/strata_context.cpp, which runs the engine as a child process over its line protocol (docs/BACKENDS.md) and uses a vocab-onlyllama_modelfor tokenizing, the chat template and the output parsers.server-http.cppreferences the web UI's asset table (ui.h, generated bytools/uiat build time, which downloads);frontend/ ui_stub/provides an empty one. No patch to llama.cpp was needed for this; the undocumented internal API oftools/serveris used as it is at the pinned commit. Makefile.make buildconfigures once and buildsstrata,strata-poly,strata_kqandunbiased-strataintobuild/bin/, not upstream'sall, which also builds about 70 parity and bench programs.make frontendbuilds the front end alone without CUDA intobuild-frontend/;make testbuilds and runs the front end's tests there against a fake engine (frontend/tests/): the adapter's cases and the HTTP surface a coding agent touches. The nvcc check applies only to thebuildandconfiguregoals.CUDA_ARCHSdefaults to61;75;86;89; an arch below 75 adds upstream'sSTRATA_EXPERIMENTAL_SM60(upstream's default is120, which needs CUDA 13).PORTABLE=1gives the AVX2 baseline instead of-march=native. One GCC for the C, C++ and nvcc host sides: the Makefile probesg++-15,g++-14, ... withnvcc -ccbinand passes the newest accepted one asCMAKE_C_COMPILER,CMAKE_CXX_COMPILERandCMAKE_CUDA_HOST_COMPILER. Without that, on a box whose defaultg++is newer than nvcc accepts (Debian 13 with CUDA 12.4: GCC 14 against a GCC 13 limit), the C++ files were compiled by GCC 14 and the CUDA files by GCC 13, andstratafailed to link on__cxa_call_terminate(upstream's installer handles the same case, its #1645).HOSTCXX=/usr/bin/g++-13overrides the probe.
Front end behaviour (frontend/), where it differs from llama-server or from upstream's server
Recorded here because a client written for one of the two may notice.
/healthreturns llama.cpp's{"status": "ok", "busy": ...}plus upstream's"service": "strata","loaded": true,"model","max_context"(commit453d3015). Upstream'stools/strata_bench.pyrefuses a server without the first two; the first step-9 fork arm was lost to that (bench/unbiased/2026-10-17-3090pod-step9/README.md).- Streams always end with a usage chunk (empty
choices,usage,timings), as upstream's server does, whether or not the client sentstream_options.include_usage; llama-server sends it only on request (96f4ef1f). Same reason: the bench client readsprompt_tokensfrom it. - One slot. Requests are served one at a time in arrival order, as upstream's server does with one engine.
- No constrained decoding.
response_formatand tool schemas are parsed and used for output parsing, not enforced at the sampler, because the engine samples; logged once per such request. - Pictures are encoded in the front end (
--mmproj FILE, commit71886db0and after): llama.cpp's mtmd runs the projector and the front end writes upstream'sSVE1record file and sendsGENI … image_pad=<id> <file>, the protocol upstream's Python server spoke tostrata-vision. Projector width is checked against the model's embedding width at start. The default row budget is upstream's installer's (300 on the CPU, 1024 on the GPU;--image-max-tokensoverrides). The encoder runs on the CPU: the front end's ggml is built without CUDA, and--mmproj-gpuis refused when ggml has no GPU device (17e27213). Measured inbench/unbiased/2026-10-18-a6000-qwen36-iq4xs-images-step8/. --sse-ping-intervalis llama-server's (default 30 s); the measured Flash-Next runs used 10.- SIGTERM exits 1, not 0, after stopping the engine: the engine child dies with the process group and the front end reports it as an engine death with an empty message. Open; matters only to a service manager.
- Default
min_pis llama-server's 0.05 when a request omits it; upstream's server sends none. pi sends 0.
Patches to llama.cpp (patches/)
llama.cpp-qwen3-coder-any-argument-order.patch(common/parsers/qwen3-coder.cpp): the Qwen3-Coder tool-call grammar accepts a call's arguments in any order. Upstream takes the required ones 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 was dropped silently: the client gotfinish_reason=stopand an empty answer (UnbiasedStrata 1, 2026-10-08, REGINA-104). Qwen3.6's template routes to the same parser. Carried over unchanged; it applies cleanly at this pin.
Engine source (src/, include/)
No changes: git diff 0197ae86 HEAD -- src include is empty (checked 2026-10-18). The engines measured in step 9 are
these sources built in this tree; their binaries differ from upstream's build of the same sources, and the step-9
record says so where it matters.
Step 12 (bench/unbiased/correctness/, 2026-10-18) checked these builds against llama.cpp 3cf03257: upstream's
parity programs that cover the kernels in use (38 pass, poly_expert_parity fails its own bound on one UD-Q3_K_M expert),
and teacher-forced per-step distributions on 16 sequences per model (within llama.cpp's own CPU-vs-GPU spread on every set
and arm). Two upstream claims did not hold and are not repeated here: the draft block is not bitwise inert above 4-token
windows, and strata's output is not reproducible across starts unless the expert cache is pinned. Tickets USTRAT-1 to 5.
Removed
Each entry names the rule above that it satisfies.
- Rule 1, installers and downloaders:
setup.py(8,223 lines: hardware detection, pip, CUDA, llama.cpp zips, prebuilt engines from GitHub releases, model files from Hugging Face or ModelScope, pack and MTP orchestration, run-config JSON, start),setup.sh,SETUP.bat,START-HERE.bat,UPDATE.bat,update.sh,Dockerfile,docker-entrypoint.sh,.dockerignore,flake.nix,flake.lock,requirements.txt(replaced bytools/requirements.txt: numpy and regex, for the offline tools only),conftest.py(pytest root forsetup.py's tests),tools/strata_mcp.py(an installer driven over MCP),tools/image/(stable-diffusion.cpp, Vulkan SDK and model downloads),tools/hip/package_windows.py(AMD nightly wheels), and their tests (tools/test_setup_*.pywith two golden JSONs,test_strata_mcp.py,test_qimage.py,test_docker_entrypoint.py,test_poly_prebuilt.py). The jobs ofsetup.pythat were not downloads (choosing engine flags per card, RAM and context) become documented flags inREADME.md. - Rule 2, Python in the serving path:
serve/(92 files, 33.9k lines: the HTTP server with the OpenAI, Anthropic and Responses dialects, the jinja2 chat templating, the Python tokenizer path, the per-family reasoning and tool-call parsers, MCP, structured output, replicas, Prometheus, the hardware monitor, the web UI and 58 test files) andpolystrata.py(the terminal front end, which importsserve/). Replaced by the C++ front end infrontend/, built from the pinned llama.cpp'scommon,mtmd,cpp-httpliband the engine-agnostic files oftools/server. The engines' stdin/stdout protocol is unchanged. - Rule 4, marketing: the six translated READMEs (383 KB),
docs/media/(12 MB: a 9.6 MB demo video still, a 1.8 MB GIF, the figure SVGs and their generator),.github/(issue and PR templates),SECURITY.md(the upstream project's advisory process) andAGENTS.md(contributor notes for upstream's tests and installers).README.mdis rewritten for this fork (PLAN.md step 10); the fork's model-file record isdocs/MODEL-FILES.md, its measurements are underbench/unbiased/. - Documents only removed components (decided 2026-10-17):
docs/INSTALL.md,AI_SETUP.md,MCP_SERVER.md,IMAGES.md,LLAMA_SWAP.md,COMMUNITY_BENCHMARKS.md,FAQ.md;chat.py(a terminal client) andtools/calibrate.py(importssetupandserve.server), with their tests. - Scripts that imported removed modules (decided 2026-10-17): the engine gate scripts that drove the engine
through the Python server's
StrataEngineclass (tools/batch_groups_cache_test.py,cancel_park_test.py,conversation_cache_*.py,conversation_restore_speed.py,logit_bias_english_example.py,logit_bias_http_probe.py,session_pressure_test.py),tools/strata_bench.pywithbench.shandBENCH.bat(one helper fromsetup),tools/make_poly_release.py, and the tests that importedsetuporserve(test_mtp_fetch.py,test_shards.py,test_strata_tokenizer.py,test_effort_end_args.py,test_research_run.py,test_benchmark_prompt.py,test_dll_closure.py,test_windows_amd_gpu.py, thetest_conversation_cache_*andtest_strata_bench.py). The benchmark scripts underbench/results/*/stay as the record they are. Upstream's copies run against upstream.