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 router harness runs its five fixtures at both 512/10 and 256/8 (random, all-equal,
12-way tie wider than k, a tie of exactly k scattered through the range, dominant expert)
and asserts the 2^-14 clamp unreachable at both (8/256 is 512x the clamp).
The shared-expert harness adds Qwen3.6's shape: 2048 x 512, Q8_0 projections through
native_mmvq with Q8_1 activations and the native BF16 scalar gate, against a host reference
written from the block layouts (9.6e-8 relative); the silu-on-up reading and the skipped
gate as negatives (83%, 272%); shared_expert_multi bitwise the per-token call; and the
output moved by rounding the F32 gate weight to BF16 reported (2.5e-4), not asserted.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
cmake/qwen36_oracle_dumps.cmake writes k.gguf (2 k-heads / 4 v-heads of 128, 256 experts
top-8, shared expert 512 in Q8_0, BF16-exact gate weights) and runs ref/qwen36.py on the
11-token "hello world" sequence in F32 and --act-quant q8 modes; qwen36_seam_parity reads the
fixture and the dumps and holds, by llama.cpp's cb() names:
- conv_output_silu-0, new_state-0, final_output-0 through the legacy, pinned native and
fused decode paths token by token with the state carried, and through the verify window's
multi-token kernels over two windows (8 + 3) with commits; the fused path also at
q/k_conv_predelta-0, gate-0, beta_sigmoid-0. Worst 2.3e-7 against 8e-5 (gdn_out class).
- ffn_moe_topk-0 identical and ffn_moe_weights_norm-0 at 6e-8 from the oracle's logits.
- ffn_shexp_gated-0 on the native Q8_0 path with the 1-D BF16 scalar gate at 3.5e-7 against
the Q8 oracle (1.2e-2 against the F32 oracle: the activation rounding); shared_expert_multi
bitwise the per-token call.
Negatives through the kernels: the sigmoid gate (126% at final_output-0), the un-normalised
router weights (24%), the shared gate skipped (52%). Exits 77 without the fixture.
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
`ModelGeometry::gdn_gate()` is SiLU for qwen35moe and sigmoid for qwen4exp, decided by the
architecture like `hc` and the indexer. layer.cpp's three output-norm calls and verify.cpp's
four `gdn_step_norm_multi` calls pass it; nothing else in either file changes. The
parameter is required (no default) so a call site the block agent rewrites cannot silently
keep sigmoid for Qwen3.6.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
Qwen3.6 closes the GDN layer with rms_norm(o) * ssm_norm * SiLU(z) where Flash-Next uses
sigmoid(z) (study 3.2, inventory row 39; the oracle's negative control puts the two 1.07
relative L1 apart). `kernels::GdnGate` names the choice and every decode output kernel
takes it as an argument: `gdn_out_norm` (legacy), `fused_gdn_step_norm` (the default native
decode), `native_gdn_out_norm` (pinned unfused), and the verify window's
`gdn_step_norm_multi`, which must stay bitwise the fused kernel. The sigmoid arithmetic is
unchanged; SiLU is ggml's op_silu form z / (1 + exp(-z)). No global: the layer passes
`ModelGeometry::gdn_gate()` (next commit).
gdn_parity now runs the recurrence at both geometries, 16/48 (VPK 3, sigmoid) and 16/32
(VPK 2, SiLU), through all four implementations, checks the verify kernel bitwise against
the fused one (verify, commit and split-commit paths), and makes the wrong gate a negative
case through each kernel itself (86-125% apart), beside the existing four traps. The
harness uses a blocking stream: its first version raced its own pageable memcpy resets on
a non-blocking stream and reported the native kernels 7.5x off at one geometry.
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
Verifier::record_window branches on g.hc == 1 in pre (plain_norm_rows for attn_norm, the residual add then
plain_norm_rows for post_attention_norm over the group's rows), post (R += ffn out in place, then the control
vector) and the head (output_norm over the T rows; the canonical head goes through lm_head, which branches the
same way). The hc_* tensors are resolved only at hc > 1, no pending write is folded, STRATA_FUSE_HEAD_GR
applies only there, and a wired PLE is refused. The init refusal `ss.k == 10 && fused_gr_supported && ...`
becomes verify_geometry_supported(g, k, why): the fused GR shape only at hc > 1, k == expert_used_count from
the file (8 for Qwen3.6, 10 for Flash-Next), state 128 / conv 4; a free function so the negative case
(top-10 on an 8-expert file) is a unit test and the message names both numbers. Rows 141, 142.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
check_one demanded the eight hyper-connection tensors on every layer (row 22); a qwen35moe pack has none and
carries the two plain norms instead, which the block reads as const float* and so must be engine form F32.
At hc > 1 the two plain names are skipped. The indexer rows are left to the attention branch.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
`ModelGeometry::hc == 1` (qwen35moe) selects llama.cpp's pre-norm residual block in block_layer_pre /
block_layer_post / lm_head_mix: rms_norm(R) * attn_norm -> mixer -> R += out -> rms_norm(R) *
post_attention_norm -> MoE -> R += out, head rms_norm(R) * output_norm. Two row-count helpers
(plain_norm_rows, plain_residual_rows) carry it, so the verify window's T-row calls are the single-token
kernels per row by construction. No pending write: the add is applied where the reference adds it. The
GR kernels are never entered at hc = 1 (one stream through gr_read is not a plain norm: the harness shows
it). layer_verify_compatible gains a geometry overload that drops the fused-GR and indexer requirements
where the model has neither; the no-argument form keeps its Flash-Next meaning.
docs/QWEN36-35B-A3B.md section 3.5; geometry-inventory.md rows 4, 22, 23.
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
pascal-build.md section 4 quotes the gate as it stands after 30e3add (the geometry, the plan, the missing
gate-up/down kernel pairs per layer, the qwen35moe_not_yet message; exit 2 in 0.36 s) for the IQ3_XXS and the
Q4_K_XL files, and the --vram-cap lines at 5722 / 7629 / 8192 / 10490 / 12288 after 2b4fcf1 (free = cap - 164
MiB within 1 MiB). Section 3 answers what expert_multi_test's AVX-512 kernel is for and how the RAM tier is read
in the native-pack path (the CPU lane computes from it on AVX-2 / ggml-cpu, the staging path copies from it).
step2-notes.md section 5 gains the planner's figures at those caps beside the study's table 4.3, the table of the
review's fixes with their commits, the Flash-Next real-file result (the reader reads the Mac's MTP Q2 file; the
guard refuses it with block_count 49), and the rsync excludes the VM tree needs.
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
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
On the 1080 Ti both real files never reached the step 2 gate: generate.cpp checked native_expert_supported()
per layer right after the layout load, and the grouped kernels' down types (STRATA_D_FMTS: IQ4_NL, IQ4_XS,
Q5_0, Q5_1, Q8_0) do not include IQ3_XXS (the IQ3_XXS file, 37 layers), Q5_K or Q6_K (the Q4_K_XL file):
strata generate: layer 0's experts are IQ2_S/IQ3_XXS (ggml types 22/18), which this engine has no GPU kernels for
The gate now comes first for a qwen35moe file: the geometry, the VRAM plan, then one line per gate-up/down pair
without a kernel with its layers ("step 3 also needs GPU expert kernels for ..."), then qwen35moe_not_yet. The
whitelist loop is unchanged and still runs before anything is allocated for every other file.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
generate.cpp's two trace sites kept the literal 48 (outside 0..47) from Flash-Next; Drive carries the trunk
layer count from ModelGeometry now (review finding 6). tools/make_profile.py's N_LAYER = 48 is step 4's
(docs/qwen36-port/step2-notes.md).
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
last_stats was written under engine.mu and read without it on the busy branch; httplib serves /health from
several threads (review finding 4). A dedicated mutex guards it and every reader takes a copy under it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
With --ram-cap and the automatic --resident-experts the line set resident_budget = cap, which flipped
pin_cache_complement into explicit-budget mode (lending off, the file tier unbuffered, the budget warning on
every run; review finding 3). The automatic path is bounded by set_host_ram_cap's clamp of
host_available_memory already; only a budget the user gave above the cap is lowered to it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
in.budget_bytes is cudaMemGetInfo's free figure, read after this process's context exists, and the engine
subtracted a 300 MiB context on top of it: ~290 (IQ3) / ~160 (Q4) expert slots under table 4.3 (review
finding 2). The engine passes 0; vram_plan_test keeps the study's 300 MiB because its budgets are the cards'
sizes. Said in vram_plan.hpp's field comment.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
vram_info computed used = total - free after the blocker of total - cap had been allocated, so the blocker
was in `used` AND already out of `free`: room = cap - used = 2*cap - total - used_other, negative at
--vram-cap 5722 on the 1080 Ti and ~4,800 instead of ~7,900 MiB at 8192 (review finding 1). The blocker's
bytes are remembered and taken out of `used`. The cap line now also prints what a card of the cap would show
free (cap - used_before), and the start refuses if the clamped figure is above it or more than 64 MiB below
(the driver rounds the blocker up by a few MiB).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
The sm_61 build needed no guard: configure 4 s, the engine 173 s, every other target 43 s more, 0 errors,
cuobjdump shows sm_61 only; `make build CUDA_ARCHS=61` works end to end in 181 s. ctest on the 1080 Ti: 69
pass, 4 fail (one Pascal-specific: kv_hybrid_parity's [5/5], the cc < 70 refusal of qsa_prompt_attn_batch
counted as a failure), 2 skip. The gate is not reached: both real files are refused by the native expert
kernels' down-type whitelist (IQ3_XXS, Q5_K, Q6_K down projections have no grouped kernel) before the VRAM plan
and the qwen35moe_not_yet message. The Q4_K_XL expert total corrected to 19,635,634,176 B.
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
On VM 211 (cmake 3.31.6) the fixture test failed before the generator ran, so model_geometry_test was
"Not Run":
CMake Error at cmake/qwen36_synth_fixtures.cmake:11 (list):
list index: 1 out of range (-1, 0)
With CMP0007 unset, list(GET) drops the empty element of "toy.gguf;" and index 1 does not exist. cmake 4.x
(the Mac) treats the policy as NEW. With the policy set, qwen36_synth_fixtures writes its 4 files on the VM
(the vendored gguf-py, numpy 2.2.4) and model_geometry_test passes there.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
generate.cpp: every cudaMemGetInfo the planners read goes through vram_info, which clamps the free
figure to cap - used under --vram-cap MIB; a blocker of total - cap is allocated before the weight
arena. --ram-cap GIB bounds the RAM tier (host_available_memory is clamped, the resident budget
too) and the pinned arena. A model whose architecture has no per-layer token embedding starts
without --ple-gguf (no PLE kernels selected, and session.cpp carves no PLE history for it). For a
qwen35moe file the start reads the geometry, checks the pack's layout against it, makes the 4.2
plan from this card's free VRAM and the file's own census (non-expert weights, the draft block,
KV per token in the chosen format, the session, the reserve, the prompt buffers unless prefill
borrows), prints the three tiers, and stops at the step 2 gate naming the steps not done. The
serve loop answers STATS with one JSON line: experts, VRAM slots and how many hold an expert, RAM
copies, mapped experts, tokens served, VRAM hits of lookups, RAM-copy and file reads, warm hints,
and the major page faults since start (the disk-read proxy); the same line is logged at start.
frontend: /health carries that line as "tiers" (the last reading, marked stale, during a request);
--vram-cap and --ram-cap pass through; a one-file model needs no second shard. Makefile: any
CUDA_ARCHS entry below 75 switches STRATA_EXPERIMENTAL_SM60 on (make build CUDA_ARCHS=61).
Not compiled yet: the CUDA translation units need the VM (its sweep is running); this commit is
checked on the VM in the Pascal build commit that follows.
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
Measured on the real UD-IQ3_XXS file, 12 tokens, expert choices and layer inputs forced from llama.cpp: the F32 oracle is
1.4e-2..4e-2 off per layer on quantized-weight seams, the Q8-activation oracle 7e-7..5e-3; dequantization is bit-identical to ggml.
Co-Authored-By: Claude Sonnet 5.5 <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