The branch took f07b81e from main but not 121d23a, so a build of the branch
answered 500 "prompt (N tokens) + max_new (M) exceeds the context" to every
request without max_tokens, and to any with max_tokens at or above
context - prompt - 7, on Flash-Next and on Qwen3.6 alike. The hunk in
frontend/main.cpp is main's, unchanged.
tests/python/serve_max_tokens_check.py (make test-serve PORT=...) sends five
such requests to a running server: 0 of 5 before, 5 of 5 after, on
Flash-Next at 196,608 and on Qwen3.6 Q4_K_XL at 262,144 (RTX 4090).
REGINA-112.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Every verify window with an expert miss computed on the CPU decoded to
token 0 ("!!!!") on both Qwen3.6 files: the first serve of the Q4_K_XL
pack at 262,144 context (9,980 of 10,240 experts resident) and IQ3_XXS
under any --vram-cap. Found by elimination on the 4090: all-resident runs
were correct at every context and KV format, --pcie-frac 1.0 (misses by
DMA, computed on the GPU) was correct, --pcie-frac 0 (misses on the CPU)
was wrong with ggml's plain dot products, with one pool worker and on the
IQ3 file alike.
ExpertPool::run_split_multi_native split its gate/up and down phases over
FF (640) and H (2560) rows per expert, the canonical Q2_0 pack's widths
compiled into expert.hpp, while a native layer's NativeFmt carries its own
n_ff / n_embd (512 / 2048 here): the down phase wrote 512 rows past every
output row into the next token's, the gate/up phase read 128 rows past
each expert's block. The phases now take the layer's widths; native_fmt
refuses a layer wider than the pool's SplitBufMulti buffers (H x FF).
tests/core/pool_native_widths_test: three Q8_0 experts at 2048 x 512, four
tokens, the pool's rows against the kernels called directly, bitwise
equal, and a guard after every output row. It fails on the old row
counts (the guard) and passes now. After the fix on VM 221: Q4 at 8K with
forced CPU misses 328 tok/s correct, Q4 at 262,144 by default 322 tok/s
correct, IQ3 at 262,144 under --vram-cap 11264 (5,762 slots, 56%) correct
at 169 tok/s; the Qwen3.6 and native-expert ctest subset 32 of 32.
The front end reported every model as "qwen3.8-flash-next-iq3_xxs"; the
id is now the GGUF's base name without a shard suffix.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The first request through the HTTP front end on the 4090 generated 220
tokens and then failed with "saving a conversation checkpoint failed":
conversation_state.cpp rejected Qwen3.6's geometry key (idx_q_heads,
idx_key_dim and hc_lr are 0 without an indexer and without
hyper-connections), demanded the indexer's tail, dead-row, block-position
and pooled buffers per attention layer, and sized a block position per
layer; conversation_snapshot.cpp's K/V layout refused idx_key_dim 0. Those
zeros are now the geometry: the key check allows them where has_indexer()
is false (hc_lr where hc is 1), the running-state targets keep only the
cell bound for dense attention, the block position and pooled rows are 0
without an indexer. Verified on VM 221 at 262,144 context with the IQ3
pack: a two-turn conversation saves 1 then 2 checkpoints and the second
prompt reuses its prefix (27 of 278 tokens; the reuse granularity is a
step-5 measurement), 319 and 359 tok/s decode.
The front end required draft_vocab.bin in the --mtp directory; a Qwen3.6
draft pack built with the full head has none and the engine already treats
the file as optional, so the front end does too.
qwen36_verify_test: the 40-position argmax gate skips near ties, both where
the F32 and Q8 oracles disagree and where the Q8 oracle's top-two margin
is below the engine row's own rel L2 error (position 4 of the fixture
flips between runs on the 4090 with a 0.4% margin under a 1.4% row error).
35 of 35 discriminating positions agree; the ties are reported with their
margins.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The step-2 line (the draft block's weights + 16 MiB "ring KV and logits")
undercounted Qwen3.6's drafter (step4-drafter.md section 7): its K/V is the
whole context, not a ring (dense attention has no --kv-resident), in the --kv
format over its one attention layer (512 MiB fp16 / 144 MiB q4_0 at 262,144
cells); the draft head is the pack's vocabulary subset at the head's row bytes
(221 MiB on the Q8_0 head) plus 8 x n_vocab logits; the identity ids are T x
cells x 4. The planner takes them as inputs (the per-token ones lower with the
context), prints the breakdown, and counts no drafter without --mtp, which the
plan says. generate.cpp fills them from the file's census and the draft pack's
draft_vocab.bin; vram_plan_test checks the share, the derivation, the lowering
and the no-drafter line.
Co-Authored-By: Claude Fable 5.1 <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
qwen36_runner_fixture.py writes the synthetic model at the real per-layer
geometry (the prefill harness's full4) as a file a native pack is built from,
builds the pack with iq_pack.py and a 4 x 16 profile, and dumps the oracle for
the 8/11/40-token cases, faithfully and with --act-quant q8.
qwen36_verify_test.cpp drives Verifier on that pack as generate does (the load
order, check_all, the decode config layer_verify_compatible requires, the cache
holding every expert) - the step-3 review's HIGH finding that no test drove the
window on qwen35moe. The 8-token window's residual after every layer and its
head logits per row against the oracle; the same rows from one-token windows bit
for bit; 8 + 3 with a commit; 40 one per window (base_ar). The reference is the
Q8 oracle, the engine rounding activations as ggml does.
qwen36_runner_check.py drives the strata binary end to end: the 40-token
sequence teacher-forced in three chunkings (base_c7, one chunk, base_ar), the
logits dumped per position, and the 4 KB mutation-sensitivity gate.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The fixture is the prompt-path trunk plus the nextn block (Q8_0 projections, experts, head and embedding) on 76
tokens, with the pack cut from it. Every seam at every position against the Q8 oracle, the router's picks identical,
the argmax identical but near ties; the negatives (the hidden state first in the concat, hnorm skipped, the pairing
with position k) more than 5 % away; the captured round graph against the uncaptured forward; the prompt-side pass
for 64 cells and the forward after it. --real: the real file against llama.cpp's own MTP arm.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The step-2 gate fires before the arena, the native projections, the head and the embedding load, so a run to the
gate proves nothing about the pack; this binary does those loads in generate.cpp's order with its skip set, then
check_all (which generate.cpp never calls), the expert profile, and prints every weight the step-3 sites read with
its engine form or native type. CTest: skipped (77) without STRATA_QWEN36_GGUF / STRATA_QWEN36_PACK or a card.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The fixture script writes <out>/SKIP with the reason and exits 0 on the
ImportError (as the other fixture scripts do); prefill_qwen36_test exits 77 on
seeing it. 4090: the simulated missing numpy gives SKIP and 77; the real
fixtures still pass.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
A chunked run's error is the relative L1 of the sums over its chunks (the worst
7-row chunk said more about one token than about the kernel); the forcing copy
waits for its DMA (the prompt stream is non-blocking); a router rank swap is
allowed only where the oracle's own softmax puts the two experts within 2e-3
(the prompt path's router multiplies BF16-rounded activations: every swap seen
is a near tie of 2e-5 to 1.3e-3); the post-attention norm's gate is the
mixer's error passing through (2e-3); the Q8 oracle's numbers are reported
beside the F32 oracle's. The fixture's router runs at half the toy's gain so
the renormalisation rival is visible (5.7 %, was 1.3 %). The attention
branch's kernels are in the tree, so the pending-attention skip is gone.
4090: gdn3 and full4 pass, one chunk of 40 and chunks of 7.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The attention layer of a model without an indexer takes the cherry-picked
kernels as the attention branch defines them: the shapes zero the three indexer
widths (qsa_dense), the capacity is qsa_selection_cap (every cell), no ids are
carved or passed (a null is the identity), the group G comes from the geometry
and any other ratio is refused by name before a launch. The own dense_ids
kernel goes (qsa_identity_ids is the explicit form). A model with no attention
layer at all (the harness's gdn3 fixture) has no primary attention state: the
reads of it are guarded. STRATA_PREFILL_ALLOC_TRACE=1 names the allocation
that did not fit.
tests/python/qwen36_prefill_fixture.py writes the synthetic model at the real
per-layer widths (gdn3: three DeltaNet layers; full4: plus the attention layer;
Q8_0 projections and experts, BF16-exact routers) and the oracle's dumps for 40
tokens, faithful, --act-quant q8, and the rival readings.
tests/cuda/prefill_qwen36_test.cpp runs the prompt path on them as one chunk
and in chunks of 7 with every layer's input teacher-forced to the oracle's
l_out, holds each seam to the dumps, checks the router's top-k, the negative
controls and the geometry refusals; CTest: prefill_qwen36_fixtures,
prefill_qwen36_test, prefill_qwen36_attn_test.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The widths become variables set per pass (Flash-Next's 2560 / 640 top-10, then
Qwen3.6's); the timing part keeps the pack it was measured on. 4090: every
pair within 1.5e-2 rel RMS of the FP32 reference at both geometries.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The screen memsets its 0xff sentinel on the legacy default stream and launches on a non-blocking stream, so the
memset could land after the product's writes: every row of the second product at 2048 x 512 read as unwritten on
the RTX 4090 (and passed under CUDA_LAUNCH_BLOCKING=1). A cudaDeviceSynchronize after the inputs orders it. The
failure message now says which rows were unwritten or non-finite. Arguments TYPE,OUT_ROWS,COLS[,TRIAL] run single
products in one context (the probe that found the race), and ggml_quantize_init precedes the reference quantizer
(IQ3_XXS's lookup tables; a probe of it faulted without).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
llama.cpp's MMQ has a Q6_K tile (mmq-instance-q6_k.cu); it joins the K-quant list beside Q4_K, Q5_K and Q5_1 so a
prompt through the Q4_K_XL file's three Q6_K layers takes the int8 tiles rather than the fp16 GEMM over
dequantized weights. The screen test adds Q5_K and Q6_K down products at the model's 2048 x 512; its "not covered"
negative moves from Q6_K to Q3_K. Type tables only; the prefill geometry is the prefill agent's.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Maya's layer composition shape on the synthetic fixture: a pack the test writes (the F32 norms, the BF16
router and shexp gate) loaded by WeightTable, then block_layer_pre stage 0 / half 2, the residual add,
block_layer_post and lm_head_mix held to attn_norm-N, attn_residual-N, attn_post_norm-N, ffn_moe_topk-N,
ffn_moe_weights_norm-N, ffn_out-N, l_out-N, result_norm and result_output per layer and token, with the
mixer and expert outputs teacher-forced from the dumps (the fixture's projections are F32, which the engine
has no kernel for: the mixer seams are reported with the engine's own error until the sibling branches and
the step-4 pack). The window's row arithmetic: the T-row helpers and native_moe_combine_multi bitwise the
one-row calls, and the 8-token sequence carried through the four layers against l_out-N per position.
Negative cases: the GR read at hc = 1 with identity bottleneck weights, the post-attention norm skipped and
unweighted, top-10 on the 8-expert file, a missing norm, the Flash-Next compatibility still demanding the
fused read. cmake/qwen36_block_fixtures.cmake runs ref/qwen36.py on 8 tokens; the CTest entries depend on
step 2's qwen36_synth_data fixture.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
read_model_geometry left n_vocab at Flash-Next's 248,320 on every file while generate.cpp samples over
output.weight's rows and loads the native embedding with g.n_vocab (the synthetic fixture has 128). The reader
now takes the vocabulary from whichever of output.weight's ne1, token_embd.weight's ne1 and
tokenizer.ggml.tokens' length the metadata shard carries (the array's `count`: the reader caps `items` at 64),
refuses when two disagree naming both ("output.weight says 100 tokens but token_embd.weight says 128"), and
keeps the default only when none is present (the metadata-only fixtures). model_geometry_text prints it.
model_geometry_test: toy.gguf reads 128; the real IQ3_XXS file 248,320 (so the default was right for the shipped
files; the Mac's Flash-Next Q2 file also 248,320); the disagreeing fixture is refused and output.weight alone sets it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The qwen4exp reader's optional reads (ssm.*, key_length, the interval, the expert widths, rope dims / sections
/ base, the epsilon) and its four refusals ran only on the six-key fixture, so the one path that could refuse the
working model was untested (review finding 5). The fixture writer gains f32 and u32-array values for it.
model_geometry_test --real on the Mac's Qwen3.8-Flash-Next-Q2.gguf reads it (48 trunk layers, 1 draft block,
every field the default).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The same 524,288 B that expert_layout_test carried: tests/data/native_experts/qwen36-q4_k_xl.txt's header and
the sum of its 40 blobs x 256 experts are 19,635,634,176 (exactly 18,726 MiB, the study's figure); the
constant and the header comment were 19,636,158,464. The mean blob and every ladder check are unchanged at
this rounding; all checks pass.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The test's Qwen3.6 section had never been built (expert_layout_test is CUDA-gated; the Mac has no binary). On
the 1080 Ti build it failed three checks:
qwen36-iq3_xxs.txt: at Flash-Next's 2560 x 640 refused by its numbers: native experts: expert geometry is not whole blocks FAIL
qwen36-q4_k_xl.txt: per-layer formats and blobs (down 14 on 34/38/39, 2301952 B at layer 39, total 19636158464 B) FAIL
qwen36-q4_k_xl.txt: at Flash-Next's 2560 x 640 refused by its numbers: native experts: expert geometry is not whole blocks FAIL
The total: tests/data/native_experts/qwen36-q4_k_xl.txt's header (and the sum of its 40 blobs x 256) is
19,635,634,176 B; the constant 19,636,158,464 was 524,288 B high. The refusal: n_ff 640 is not whole
256-value blocks for Q4_K / IQ2_S rows, so native_fmt refuses before the blob comparison the test looked for;
the check now accepts either message, both a refusal. All checks pass on the VM.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
strata/plan/vram_plan.hpp: the 4.2 rule with no GPU in it - the fixed set at the requested context
(weights, drafter, KV per token, session, CUDA context, reserve, prompt buffers unless prefill
borrows), the context lowered toward 131,072 in steps of 4,096 when it does not fit, a refusal with
every number and the smaller file's name below the floor, the remainder as expert slots at the mean
blob, the RAM tier from the available RAM minus a headroom, the rest mapped from the file.
tests/core/vram_plan_test.cpp reproduces table 4.3 of docs/QWEN36-35B-A3B.md for 6, 8, 11 (decimal
and the 1080 Ti's 11,264 MiB), 12, 16, 24 and 32 GB at Q4 and IQ3, with and without borrowing: every
row equals floor((budget - fixed) / blob) exactly and is within the table's rounding of the printed
figure; the 24 GB spare (~1,090 MiB), the RAM tier at 9.5 GB (~4,950 / ~8,760), the disk tier on the
1080 Ti (~1,740 / ~2,780), the lowering branch, the refusal at 6 GB Q4 without borrowing.
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
ModelGeometry gains the architecture, the draft block count, n_rot / rope sections / base / eps, the
shared-expert width, the router k and has_ple; derive() computes the conv channels and the value dim
from the head counts instead of storing Flash-Next's. strata/core/model_geometry.hpp reads every
field from the <arch>.* keys (hc = 1, no PLE, no indexer for qwen35moe), checks the derived quantities
against the file's own (ssm.inner_size), refuses the fused ffn_gate_up_exps and attention attn_qkv
forms by tensor name, and carries the step 2 gate message. check_architecture accepts qwen35moe with
the key set llama.cpp's loader requires (presence only; the file is the authority on sizes).
tests/core/model_geometry_test.cpp: every field of the toy geometry from tools/qwen36_synth_gguf.py,
the nextn block subtracted, both fused forms refused by name, a qwen4exp file keeping hc 4 and PLE,
'llama' refused by name, a contradictory ssm.inner_size refused; --real FILE asserts the real
Qwen3.6-35B-A3B values (checked on the IQ3_XXS and Q4_K_XL files).
Co-Authored-By: Claude Fable 5.1 <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>