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>
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>
- 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>
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>
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>
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).
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.
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.
STRATA_SERVE_LOGIT_TRACE=FILE writes, per emitted token, the head's five largest logits, the window's shape and
the experts it missed; STRATA_SERVE_LOGIT_DUMP=PREFIX the whole row per request. Off by default; with neither
set the final binary gives the tokens of the one before it on the same request sequence.
tools/qwen36_teacher_llama.cpp: --prompt-ids and --force-ids, so llama.cpp scores every position of a run the
engine made, with the path that run took.
--teacher-force with --mtp filled the window with the drafter's guesses and committed them as the oracle's
tokens (70 of 400 top-1 on a run that scores 394 without --mtp): refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
ref/qwen36.py --all-logits dumps result_output_all (the head at every position
of the last chunk), the reference a streaming runner is held to position by
position. qwen36_prefill_fixture.py's write() gains q8_embd (token_embd.weight
as Q8_0, a type a native pack's embedding kernel serves), reused by the runner
fixture.
qwen36_teacher_llama.cpp is llama.cpp's own greedy continuation of a prompt with
the head's logits per position and the routed experts at probed layers;
qwen36_compare_logits.py scores top-1 agreement, KL(ref || engine) per position,
the drift gate (one-sided: only a KL that rises with position is a leaking
state) and the routed-selection overlap.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
dense.txt/dense.bin with llama.cpp's names and the projections as stored (the ggml type as the kind), experts.bin as
256 native [gate | up | down] blobs with a one-line native_experts.txt, mtp.json with the geometry the block was cut
for, the draft vocabulary copied in. Refuses by name what the engine cannot serve (the IQ4_XS-MTP file's Q3_K/Q4_K
experts, fused tensors, a router that is not BF16-exact). Flash-Next's mtp_pack.py / mtp_rt.py stay.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
FORM_QWEN35MOE (routers, ssm_alpha, ssm_beta and the 1-D shexp gate BF16 under the exact rule; the norms, ssm_a,
ssm_dt.bias, ssm_conv1d F32) beside Flash-Next's FORM, byte-identical for qwen4exp (checked old against new on a
toy with every Flash-Next tensor kind). A projection, the head or the embedding of a type the engine's native
path has no kernel for is refused with the type and the list; an inexact F32 router is refused with the count of
values whose low 16 bits are set and what --compat-bf16 would do. A -MTP file's draft block (blk.40 and up) is
left out of index.txt and dense.bin as it already was of native_experts.txt. --expert-profile ships a ranking
whose header matches the trunk (default data/qwen36-expert-profile.bin for qwen35moe). Fixtures: a toy qwen35moe
with the shipped files' forms, with and without a nextn block.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
--n-layer (default 48) and the base profile's header decide the layers, and a disagreement is an error; --text-trace
reads llama.cpp eval-callback route traces (<layer> <e0> ... lines, # headers, .gz). data/qwen36-expert-profile.bin
is the 40 x 256 ranking from regina's E0 trace (routes.txt, 214,940 routed tokens over the 110-prompt corpus): all
10,240 pairs ranked from the trace, none filled.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The VMs' system python has numpy but no regex, and tools/iq_pack.py runs the export as a subprocess: the vocab,
merges, token types and the chat template need no pattern, so the import is optional and only encoding needs it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The engine's attention kernels are head_dim 256; the toy fixture is 32, so an engine-level parity test against the oracle's seams needs a fixture at 256. The largest-remainder section split moves into split_sections() for both paths.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Both shipped files store ffn_gate_inp, ffn_gate_inp_shexp, ssm_alpha, ssm_beta and
ssm_conv1d as F32 values whose low 16 bits are all zero, so the engine's BF16 reading is
lossless and the native-contract flip rate is zero by construction; the column makes the
table say so. Measured: 0 of 320 top-8 slots with F32 x BF16(W), 6 of 320 sets (0.23%) with
both operands rounded (the legacy contract), on the first 8 tokens of the IQ3_XXS file.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Takes an oracle dump of the real file (--act-quant q8) and the file's F32 ffn_gate_inp, forms
each layer's logits as llama.cpp does (F32 x F32), as the engine's native MMVF does (F32 x
BF16(W)) and as the legacy bf16_gemv does (BF16(x) x BF16(W)), and reports per layer the
top-8 positions and sets that differ, the tokens affected, and the smallest logit gap at the
top-8 boundary. Study 3.4: a number for the step-4 --compat-bf16 decision, no assertion.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The engine's CUDA GDN kernels are pinned to state 128 and the toy fixture has 16, so the
kernel parity tests need a fixture of their own: --gdn K,V,S sets the GDN heads and state,
--experts E,K the router shape (256,8), --shexp-ff the shared expert's width (512),
--quant-shexp q8_0 writes the three shared-expert projections through gguf-py's quantizer
(bit-identical to ggml), and --bf16-exact rounds ssm_alpha, ssm_beta, ffn_gate_inp and
ffn_gate_inp_shexp to BF16-representable F32 (what the engine reads them as, and what the
pack rounds without --compat-bf16). The default fixture is byte-identical to before.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Three tests for step 2's additions to iq_pack.py (review finding 7): the layout-only run writes
native_experts.txt alone with the v3 header and prints the census; a file with nextn_predict_layers 1 keeps
its last block out of the layout and says so; the fused form is refused by name before anything is written.
26 tests pass on the Mac.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
expert_layout_load(pack, n_layers, n_expert, n_embd, n_ff, err): each layer's NativeFmt is built with
the model file's widths instead of the compile-time 2560/640 (geometry-inventory.md row 108), and a
pack without native_experts.txt (the canonical Q2_0 form) is refused for any other geometry.
generate.cpp reads ModelGeometry from the --native file before the layout load, logs it for a
non-Flash-Next file, refuses the fused tensor forms by name, takes the router k and the embedding
dims from it, and reads the rope keys under the file's own architecture prefix.
tools/iq_pack.py: --layout-only writes native_experts.txt alone and prints the census; the draft
(nextn) block of an -MTP file is left out of the trunk layout; fused ffn_gate_up_exps refused;
FORM carries qwen35moe's attn_norm / post_attention_norm / output_norm (F32 as stored).
tests/data/native_experts/qwen36-{iq3_xxs,q4_k_xl}.txt from the real files (40 x 256; 10,594 and
18,726 MiB, mean blobs 1.035 and 1.829 MiB, as censused in docs/QWEN36-35B-A3B.md), and
expert_layout_test loads them at 2048 x 512 with every layer's types (IQ4_XS down on 34/38/39;
Q6_K down on 34/38/39, Q5_K gate/up on 39) and sees them refused at 2560 x 640.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
- synth --heads N,KV; cross-check case gqa4_2 (4 heads / 2 KV, seed 11): 211 seams and 50 nextn seams match; the
h % n_head_kv rival (opts gqa_map=interleaved) fails at kq-3 and is a negative test; with one KV head it is invisible.
- tools/qwen36_dequant_ggml.cpp + qwen36_check_dequant.py: ref/load.py (gguf-py) against ggml's own to_float on the real
file, bit-identical for Q6_K, IQ2_S, IQ3_XXS, IQ4_XS.
- ref/qwen36.py: --act-quant q8 (Q8_K / Q8_0 activation rounding as ggml's quantized matmul does), --force-topk,
--force-inputs (start each layer from a llama.cpp dump), tools/qwen36_spread.py to tabulate the spread per seam class.
- qwen36_crosscheck.sh: LLAMA_CPP_DIR override so it runs from a separate worktree.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
21 tests: full-attention layers are 3 mod 4 (and 30 GDN + 10 attention at the real geometry, the nextn block outside the
trunk), top-k weights renormalise and a stray expert_weights_scale is ignored, GDN state/conv shapes and
chunked == token-by-token, the output gate is SiLU(z) (negative test against sigmoid), the attention output gate is
applied to the second half of each head's q slice, seven rival readings each move their seam by more than 5 percent,
IMRoPE rotates 25 percent with text positions and an e-sector stays fixed, dump format, causality, the nextn block.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
docs/qwen36-port/oracle-crosscheck.md: 9 trunk cases and 5 nextn cases (one batch, 40 tokens one at a time, chunks of 7,
fused gate_up, fused qkv, a stray expert_weights_scale key, a --like-real fixture) match every cb()-named tensor of the
pinned llama.cpp graph, worst absolute error 1.1e-4; llama-eval-callback's printed stats agree on 209 named nodes;
seven rival readings (SiLU vs sigmoid gate, head pairing, decay order, conv direction, attention gate, top-k
renormalisation, rope pairing) each fail at the layer that makes them. The formulas are pinned to file:line.
qwen36_crosscheck.sh reruns all of it; the eval-callback checker tolerates the tool's truncated log tail.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
ref/qwen36.py is a teacher-forced forward pass written from the submodule's qwen35moe.cpp graph: embedding,
GDN layers (causal conv, L2-normed q/k, decay + delta-rule recurrence, SiLU-gated RMS norm), full-attention
layers (joint q+gate projection, IMRoPE on 25%, causal GQA, sigmoid output gate), softmax top-k MoE with
renormalised weights and the sigmoid-gated shared expert, output norm, lm head, and the nextn block of
graph_mtp. Every cb()-named tensor is dumped as <name>-<layer>.f32 plus manifest.txt. Each reading with a
plausible rival is a switch (Model.opts) so the fixture can be shown to tell them apart.
tools/qwen36_dump_llama.cpp dumps the same names, in full, from the real llama.cpp graph;
qwen36_compare_dumps.py, qwen36_check_eval_callback.py and qwen36_crosscheck.sh compare them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
tools/qwen36_synth_gguf.py writes a tiny F32 qwen35moe GGUF with the real tensor names and shape rules
(4 layers, one full-attention layer at index 3, 8 experts top-2, a nextn block), --like-real to take
rope/eps/interval/ratios and verify the tensor-name set against a real file, and options for the fused
gate_up / attn_qkv forms llama.cpp also accepts. docs/qwen36-port/gguf-metadata.md records every key and
tensor of the UD-IQ3_XXS file and the MTP build. ref/load.py gains the IQ2_S/IQ3_XXS/IQ3_S/... geometry the
real file uses.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
ref/load.py, the pack, profile, MTP, tokenizer and fixture tools with their tests, and the
tests/ sources the root CMakeLists already wires under STRATA_BUILD_TESTS. Development only:
the shipped binary still needs no Python. Taken unchanged from 12a7825 (Strata 6f32ec0); the
HIP tests, the installer tests and the conversation-cache tests stay out.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Removed: the Python installer and launchers (setup.py, *.bat, *.sh), the
Python server and web app (serve/), the Python tools (tools/), the Intel
SYCL port (sycl/), Docker files, benchmark results (bench/), the test suite
(tests/, which upstream's own published source also leaves out),
translations, and all docs except DETAILS.md and the paper, kept under
docs/upstream/ as reference.
The engine (src/, include/, CMakeLists.txt) is untouched.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Source: https://github.com/Niko1221/Strata, commit 6f32ec070f23ced9f50e704d854d775da52591ab
(engine 0.1.39, MIT). Every file is as upstream published it; later commits
show exactly what this fork changes.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>