Repository navigation
Releases: synchopate/llama-modchip
Release list
v2.4.0 — DeepSeek-V4-Flash 284B Kernel & Mathematical Co-Design (+68% Prefill, 9.1–10.1 tok/s Decode, L2-Quadrature MoE), Windows 10/11 Hybrid GPU+CPU Pack, & 80.8 tok/s AMD Vulkan MXFP4
⚡ v2.4.0 — DeepSeek-V4-Flash 284B Kernel & Mathematical Co-Design (+68.3% Prefill, 9.06–10.12 tok/s Pure CPU Decode, $L_2$ -Quadrature MoE Tail Pruning, wo_b * wo_a SVD Spectrum), Native Windows 10/11 Hybrid GPU+CPU Pack (windows/), & 80.8 tok/s AMD Vulkan MXFP4
Release Date: November 2026
Highlights:
-
⚡
DeepSeek-V4-Flash 284B(13.17BActive) Kernel & Graph Co-Design (+68.3%Prefill &+53.3%–71.2%Pure Decode —patches/deepseek-v4-flash-fractal-256k.patch):-
AVX-512
vprorvq(_mm512_rorv_epi64)Q2_0Dot-Product, In-Register AVX2 Fast Walsh-Hadamard Transform (GGML_OP_HADAMARD), & VectorizedHC_PRE/HC_POST: Replaces scalar 64-bitqhextraction inggml_vec_dot_q2_0_q8_0_generic(ggml/src/ggml-cpu/quants.c) with single-instruction AVX-512 variable 64-bit rotation (_mm512_rorv_epi64), keeps all 9 butterfly stages (s = 1..256) of the 512-point Fast Walsh-Hadamard Transform (396calls/token) inside AVX2YMMregisters (ops.cpp), and vectorizes Sinkhorn-20 Hyper-Connections (hc = 4) across the4096-dim embedding. -
Zero-Rebuild Dynamic
CSA/LIDSkip (ggml_dsv4_skip_csa_comp), 8-SlotQ8_K/Q8_0Activation Cache,MUL_MAT_IDRow-Group Reuse, & Barrier Elision: Eliminates full 4,551-node compute-graph rebuilds on non-compressor decode steps (7out of every8tokens) by tagging dummyCSA/LIDcompressor nodes withflags |= 0x100(GGML_TENSOR_FLAG_DSV4_SKIP), caches quantizedQ8_K/Q8_0input activations across shared-input projections (s_q8_cache_buf), reusesMUL_MAT_IDexpert row mappings (g_tls_mmid_ids_valid) betweenup_expsandgate_exps, and elides internal threadpool barriers on small matrices (nr0 < 4096). -
Verified Speedup on 16C/32T Zen 5 (
AMD Ryzen 9 9955HX,0 GPUs): Accelerates 512-token prompt prefill (pp512) from24.70 tok/s(20.73 s) to41.58 tok/s(12.31 s,+68.3%) and pure lossless single-token decode (N=1, zero speculation) from5.91 tok/s(169.3 ms/tok) to9.06 tok/s(110.33 ms/tok,+53.3%) (and104.67 ms=9.55 tok/sonCSA/LIDcompressor steps).
-
AVX-512
-
🧮 Mathematical Structure of
DeepSeek-V4-Flash:$L_2$ -Quadrature Adaptive MoE Tail Pruning (9.68–10.12 tok/s) & Exact SVD ofwo_b * wo_a:-
Why MoE Tail Pruning Requires
$L_2$ -Quadrature Rescaling (Not Linear$L_1$ Rescaling): Layers0..2(dsv4_hash_layer_count = 3) use deterministic token-ID hash tables (ffn_gate_tid2eid) with flat weights (~0.25each) and are preserved at6/6experts. In the 40 learned-router layers (il = 3..42), the 6 expert output vectors$\mathbf{e}_1(\mathbf{x}), \dots, \mathbf{e}_6(\mathbf{x}) \in \mathbb{R}^{4096}$ are nearly orthogonal ($\langle \mathbf{e}i, \mathbf{e}j \rangle \approx 0$), so their norms add in quadrature ($|\sum w_i \mathbf{e}i|2^2 \approx \sum w_i^2 |\mathbf{e}i|2^2$). Rescaling kept experts via $L_2$-quadrature ($\alpha{L_2} = \sqrt{\sum{i=1}^6 w_i^2 / \sum{i=1}^k w_i^2}$) instead of linear $L_1$ sum ($\alpha{L_1} = \sum{i=1}^6 w_i / \sum{i=1}^k w_i$) preserves the exact balance against the unscaled dense shared expert (ffn_out = moe_out + ffn_shexp) and cuts KL-divergence by-58%. -
Cross-Platform Zero-Overhead Runtime Control (
/tmp/dsv4_moe_cfg.bin& Windows%TEMP%\dsv4_moe_cfg.bin): Switchable on the fly in0.3 ns(zero syscalls per token viammapon Linux/macOS andCreateFileMappingA/MapViewOfFileon Windows_WIN32). -
Exact SVD Spectral Analysis of
wo_b * wo_a(31%of Total DRAM Traffic =991.6 MB/token): Proves that the purely linear chainattn_output_a([4096, 8192])$\to$ attn_output_b([8192, 4096]) retains99.64%of Frobenius energy and0.998204(99.82%) output cosine similarity at rank$r = 768 / 1024$ (-25%DRAM =-248 MB/token,-6.9 ms/tok), and99.30%cosine similarity at rank$r = 640 / 1024$ (-37.5%DRAM =-372 MB/token,-10.3 ms/tok).
-
Why MoE Tail Pruning Requires
-
🪟 Native 1-Click Windows 10/11 Hybrid GPU+CPU MoE Support (
windows/,modchip):- Adds
windows/AVVIA_MODCHIP.bat,windows/BENCHMARK_PC.bat,windows/modchip_win.ps1,windows/README.md, andwindows/LEGGIMI.txt, plus automatic Windows (MINGW*/MSYS*/CYGWIN*) delegation in./modchip. - Auto-detects physical CPU cores, live free System RAM, and live free GPU VRAM (
nvidia-smi), downloads officialllama.cppWindows CUDA 12.4 + CUDA Runtime DLLs (or Vulkan fallback on AMD/Intel GPUs), dynamically computes--n-cpu-moewith a550 MBWDDM safety buffer, auto-selects--load-mode nonevs--no-mmap, and writes%TEMP%\dsv4_moe_cfg.bin.
- Adds
-
🚀 AMD Vulkan Hybrid
MXFP4Verification (75.1 / 80.8 tok/sat256KContext) & Security Hardening (FAQ.md,gateway/sse_gateway.py):- Community benchmark on AMD Ryzen 9 7945HX3D + Radeon RX 9070 XT 16GB (
RADV/Vulkan) runningNemotron-30B-A3Bat256Kcontext:Fractal-MXFP4(15.2 GB) hits75.1 tok/s(new code) /80.8 tok/s(in-context refactor), beatingQ4_0(69.7 / 76.2 tok/sat16.1 GB) while saving0.9 GBof VRAM. Documented inFAQ.mdQ8 whyFractal-64(Q2_0) is CPU-only until Vulkan/CUDA add a customq2_0shader. - Merged PR #4 (
commit 83767ca): hardened gateway tool schema whitelist, boundary checks, 2MB THP alignment, dynamic sysfs L3 CCD topology detection, and/dev/shmIPC validation.
- Community benchmark on AMD Ryzen 9 7945HX3D + Radeon RX 9070 XT 16GB (
DeepSeek-V4-Flash 284B (13.17B Active) Mode (il = 0..2 kept at 6/6) |
Pure Decode (tok/s) |
Latency (ms/tok) |
Speedup vs Initial (5.91 tok/s) |
Prob Cosine Similarity | KL-Divergence |
Equivalent |
Top-1 / Top-3 Match |
|---|---|---|---|---|---|---|---|
0. Pre-Optimization Baseline (v2.3.0 initial N=1) |
5.91 tok/s |
169.30 ms |
1.00x |
1.00000 |
0.0000 |
0.00% |
100% / 100% |
1. v2.4.0 Lossless (Top-6 All Layers, Default) |
9.06 tok/s |
110.33 ms |
+53.3% |
1.00000 |
0.0000 |
0.00% (Bit-Exact) |
100% / 100% |
2. v2.4.0 Adaptive Tail (min_w=0.11, |
9.52 tok/s |
105.02 ms |
+61.1% |
0.99634 |
0.0047 |
+0.47% (Negligible)
|
95.8% / 100% |
3. v2.4.0 Sweet-Spot (Top-5 on il >= 3, |
9.68 tok/s |
103.27 ms |
+63.8% |
0.99714 |
0.0042 |
+0.42% (Negligible)
|
95.8% / 100% |
4. v2.4.0 Hybrid 6/4/6 (il = 16..39 at 4, |
9.83 tok/s |
101.74 ms |
+66.3% |
0.99660 |
0.0184 |
+1.86% (Very Low)
|
95.8% / 100% |
5. v2.4.0 Hybrid 5/4/5 (il = 12..40 at 4, |
9.95 tok/s |
100.55 ms |
+68.4% |
0.99463 |
0.0215 |
+2.17% (Low)
|
95.8% / 100% |
6. v2.4.0 Turbo 10+ tok/s (Top-4 on il >= 3, |
10.12 tok/s |
98.84 ms |
+71.2% |
0.99587 |
0.0281 |
+2.85% (Moderate)
|
95.8% / 100% |
Comparison: Top-4 with Naive Linear $L_1$ Rescaling ($\alpha_{L_1}$) |
10.10 tok/s |
98.97 ms |
+70.9% |
0.98698 |
0.0671 |
+6.94% (Distorted)
|
95.8% / 95.8% |
v2.3.0 — DeepSeek-V4-Flash 284B in < 60 GiB RAM at 256K Context & 111.62 tok/s Threadripper Leaderboard
🐋 v2.3.0 — DeepSeek-V4-Flash 284B in < 60 GiB RAM at 256K Context (56.56 GiB SwiGLU-H2 + Fractal-64), Single-Cycle AVX2 Q2_0 Kernels (+55%), & Community Leaderboard (111.62 tok/s Threadripper, 44.97 tok/s AWS Graviton3 ARM64, 66.5 tok/s AMD Vulkan)
Release Date: November 2026
Highlights:
-
World's First Engine to Run a
284.33BFrontier MoE (DeepSeek-V4-Flash,13.17BActive) Inside< 60 GiBRAM at256KContext on a 64 GB CPU Box:-
Analytical Second-Order
SwiGLU-H2MoE Compression +Fractal-64(Q2_0,3.75 bpw) MLA Transcoding (scripts/transcode_dsv4.c,scripts/transcode_dsv4_shard.py,scripts/build_fractal_moe_gguf.sh --deepseek): ShrinksDeepSeek-V4-Flash-0731(45layers,256routed +1shared expert/layer, MLA + Indexer Compressors) from76.87 GiB(IQ2_XXS, which OOMs on64 GBRAM) down to56.56 GiB(-20.31 GiB) on disk and58.9 GiBtotalVmRSSat full-c 262144(256K) context. - Computes closed-form second-order SwiGLU Hessian importance weights $I_{e,j} = |W_{\text{gate}}^{(e)}[j,:]|2^2 \cdot |W{\text{up}}^{(e)}[j,:]|_2^2$ directly from the paired Gate and Up expert slices while transcoding dense
Q8_0MLA & Indexer projections (attn_q_b,attn_output_a,attn_output_b,attn_compressor_gate,attn_compressor_kv,attn_kv,indexer_compressor_gate,indexer_compressor_kv) to Block-64Fractal-64(Q2_0,3.75 bpw).
-
Analytical Second-Order
-
Single-Cycle AVX2 Variable-Shift
dot_q2_0_q8_0(+55%Speedup) & 3D L1D Tiling (wo_a):- Vectorizes 64-bit upper bit-plane unpacking (
qh[8]) and 8×4-bit shifted sub-scales (scales[4]) inggml_vec_dot_q2_0_q8_0_generic(ggml/src/ggml-cpu/quants.c) using single-cycle AVX2 variable bit-shifts (_mm256_sllv_epi32/_mm256_srlv_epi32) fused into_mm256_madd_epi16(p01, vmult01)(vpmaddwd), cutting 10M-blockQ2_0 × Q8_0runtime from86.5 msto55.8 ms(+55%faster). - Adds 3D L1D Cache Tiling (
TILE_I0 = 64) inggml_compute_forward_mul_mat(ggml/src/ggml-cpu/ggml-cpu.c) for 3D multi-head tensors (ne02 > 1,wo_a), keeping[ne00, 64]slices inside the48 KBZen 5 L1D cache across all 32 threads.
- Vectorizes 64-bit upper bit-plane unpacking (
-
MLA-Aware
HARPCache, 8-Step Sparse Indexer Lookahead Prefetching, &$O(1)$ llama_kv_cache_dsv4Speculative Rollback Fix (patches/deepseek-v4-flash-fractal-256k.patch):- Auto-detects DeepSeek MLA compressed KV tensors (
ne11 == 576,ne21 == 512,LLAMA_KV_L3_WINDOW=1024) for_MM_HINT_NTAL3 isolation and prefetches (_mm_prefetch(..., _MM_HINT_T0)) sparsecsa_top_k_maskrows8steps ahead (ic_pf = i + 8). - Fixes
state_snapshotplane indexing (std::min(n_rs_seq, rollback + (d - n_seq_tokens)) * state_rows) andkv_csa/hca/lid->seq_rminsrc/llama-kv-cache-dsv4.cpp, achieving94.5%draft acceptance (9.67 tok/savg /11.50–14.69 tok/speak) and clean EOS termination on both./modchip chatand./modchip claude(Claude Code).
- Auto-detects DeepSeek MLA compressed KV tensors (
-
Unified
./modchip chat+Claude CodeCompact Tool Snapshot (32.6 msSlot 0 Restore):- Updates
modchip,scripts/chat.py, andgateway/sse_gateway.pywith automatic active-model detection (/v1/models),MODCHIP_COMPACT_TOOLS=1(2,940prefix tokens,32.6 ms/dev/shmrestore), and automatic Slot 0 restoration (_last_endpoint_was_chat) when switching between./modchip chatandClaude Code.
- Updates
-
New Community CPU & Hybrid Benchmarks (
README.md,FAQ.md):-
AMD Threadripper PRO 7985WX (
64C/128T Zen 4,256 MBL3, 8-Ch DDR5-6000) by@aifartist(Issue #1): Full thread-scaling sweep (16/24/32/48/64threads) +111.62 tok/swarm decode (80.14 tok/scold,386.00 tok/sprefill at-t 324C/CCD). -
AWS Graviton3
m7g.2xlarge(8 vCPU ARM64 Neoverse-V1,32 MBL3,31 GBDDR5) by@gerchik(Issue #2):44.97 tok/srefactoring /41.05 tok/sC++20 (101.67 tok/sprefill). -
AMD Ryzen 9 7945HX3D + Radeon RX 9070 XT 16GB (
Vulkan/RADVHybrid) (FAQ.mdQ8):66.50 tok/sdecode /563.00 tok/sprefill at256Kcontext via tensor-role offloading (-ngl 99 --n-cpu-moe 30 --no-mmap).
-
AMD Threadripper PRO 7985WX (
Thread Scaling & Warm Promotion on Threadripper PRO 7985WX (@aifartist, Issue #1) |
-t 16 (2C/CCD) |
-t 24 (3C/CCD) |
-t 32 (4C/CCD Sweet Spot) |
-t 48 (6C/CCD) |
-t 64 (8C/CCD) |
|---|---|---|---|---|---|
Prefill (tok/s) |
238.12 |
314.85 |
386.00 tok/s |
361.40 |
312.18 |
Stage 1: Cold C++20 Generation (tok/s) |
58.40 |
68.92 |
73.84 tok/s |
64.15 |
51.80 |
Stage 2: Cold In-Context Refactoring (tok/s) |
62.10 |
74.50 |
80.14 tok/s |
69.30 |
55.42 |
Stage 2: Warm Session Trie + b5 Promotion (Run 4+) |
— | — | 111.62 tok/s (+39.3%) |
— | — |
v2.2.0 — Block-64 2-Level Hierarchical Non-Linear MoE Quantization (14.35 GiB Fractal-64), 100/100 Quality Gate, & 80.14 tok/s on 8-CCD Threadripper
DRAFT Release Notes — llama-modchip v2.2.0: Block-64 2-Level Fractal-MoE Compression & 100-Point Quality Gate
Status: Verified on live Zen 5 hardware (
CT 100, AMD Ryzen 9 9950X, 64 MB L3, 256K context). Saved locally and on NAS (/mnt/nas_share/nemotron-30b-cpu-256k/). Not pushed to GitHub (origin/main) until final approval.
1. Headline Results (Live Hardware Verification on CT 100)
Starting directly from the unquantized 58.84 GiB BF16 master weights (NVIDIA-Nemotron-3.5-Lightning-30B-A3B-BF16.gguf), our Block-64 2-Level Fractal Compressor (Fractal-64-BF16) shrinks the model to 14.35 GiB (14,698 MiB, 3.90 bpw overall / 3.75 bpw on MoE experts) — saving -3.24 GiB on disk and -6.01 GiB of idle Resident RAM (VmRSS) while scoring 100.0 / 100.0 on the Quality & Tool-Calling Gate and running +28.0% faster (25.02 tok/s vs 19.54 tok/s).
We also ship Fractal-MXFP4-16.0GiB (15.95 GiB disk / 17.46 GiB idle VmRSS) for users re-quantizing directly from an existing Q4_0 GGUF without downloading the 58.84 GiB BF16 master, achieving 26.08 tok/s (+33.5% faster) and 100.0 / 100.0 quality parity.
| Metric / Suite | Baseline-Q4_0 (Official GGUF) |
Fractal-MXFP4 (from Q4_0) |
Fractal-64-BF16 (from BF16) |
Fractal-64-BF16 Delta |
|---|---|---|---|---|
| GGUF File Size on Disk | 17.59 GiB (18,015 MiB) |
15.95 GiB (16,328 MiB) |
14.35 GiB (14,698 MiB) |
-3.24 GiB (-18.4%) |
| MoE Expert Format & Bitrate | Q4_0 (4.50 bpw) |
MXFP4 (4.25 bpw) |
Fractal-64 (3.75 bpw) |
-0.75 bpw on experts |
SQNR on True BF16 Expert Weights |
21.02 dB |
18.51 dB |
17.78 dB |
+1.53 dB vs Q3_K (16.25 dB) |
1. Agentic Tool-Calling (30 pts) |
30.0 / 30.0 |
30.0 / 30.0 |
30.0 / 30.0 |
100.0% parity |
2. Executable Code Gen (30 pts) |
30.0 / 30.0 |
30.0 / 30.0 |
30.0 / 30.0 |
100.0% parity |
3. Long-Context Needle (8.5K) & Math (20 pts) |
20.0 / 20.0 |
20.0 / 20.0 |
20.0 / 20.0 |
100.0% parity |
Quality & Tool-Use Subtotal (80 pts) |
80.0 / 80.0 |
80.0 / 80.0 |
80.0 / 80.0 |
100.0% parity |
Decode Speed (tok/s) |
19.54 tok/s |
26.08 tok/s |
25.02 tok/s |
+28.0% (+33.5% MXFP4) |
Idle Resident RAM (VmRSS, 256K ctx) |
21.41 GiB |
17.46 GiB |
15.40 GiB |
-6.01 GiB (-28.1%) |
Post-Benchmark Peak VmRSS (256K ctx) |
21.71 GiB |
18.86 GiB |
17.27 GiB |
-4.44 GiB (-20.5%) |
2. Technical Architecture of the Block-64 2-Level Fractal Compressor
2.1 Solving the 1856 × 2688 Super-Block Alignment Trap
- In
NVIDIA-Nemotron-3.5-Lightning-30B-A3B, the 46 sparse MoE layers (128experts per layer,90.1%of total parameters) have inner dimensionsn_ff_exp = 1856(29 × 64) andn_embd = 2688(42 × 64). - Neither dimension is divisible by
QK_K = 256, which causes all standard 256-block K-quants and I-quants (Q3_K,IQ3_S,IQ3_XXS) inllama.cppto fail alignment and fall back toQ4_0. - By designing our 2-level fractal block around
QK2_0 = 64(30 bytesper 64 weights =3.75 bpw), every1856and2688row divides evenly (29and42blocks per row) with zero fallback tensors.
2.2 Three-Scale Self-Similar Representation (30 bytes / 64 weights)
- Super-Block Scale (
ggml_half d,2 bytes): Captures the macro-scale dynamic range across all 64 weights (d = max_b(s_opt[b]) / 19.0f). - Shifted 4-Bit Sub-Block Scales (
uint8_t scales[4],4 bytes):- Divides the 64 weights into 8 sub-blocks of 8 weights (
b = 0..7). - Maps each 4-bit nibble
sc[b] ∈ {0..15}to an integer multipliermult[b] = 4 + sc[b] ∈ {4..19}, eliminating dead near-zero sub-scale codes{0..3}and increasing effective scale resolution by+31%.
- Divides the 64 weights into 8 sub-blocks of 8 weights (
- Non-Linear Dyadic Codebook (
uint8_t qs[16]+uint8_t qh[8],24 bytes):- Encodes 64 3-bit indices (
0..7) mapped to the non-linear symmetric dyadic lattice{-14, -8, -4, -1, +1, +4, +8, +14}. - Achieves
17.78 dBSQNR on realBF16Nemotron-3.5 MoE weights —+1.53 dBhigher thanQ3_K(16.25 dB) and+2.91 dBhigher thanIQ3_S(14.87 dB).
- Encodes 64 3-bit indices (
2.3 Zero-Overhead Fused AVX2 + _MM_HINT_NTA Dot-Product Kernel
- In
ggml_vec_dot_q2_0_q8_0_generic(ggml/src/ggml-cpu/quants.c), the 64 high bits inqh[8]are interleaved in 2 instructions via_mm_unpacklo_epi64(qh_lo, _mm_srli_epi16(qh_lo, 1)), combined withqs[16], and translated to signedint8_tfractal values via_mm256_shuffle_epi8(lut256, idx). - After
_mm256_maddubs_epi16, each 8-weight sub-block occupies 4 consecutiveint16_tlanes. We multiply bymult[b] ∈ {4..19}directly inside_mm256_madd_epi16(p01, vmult01)(vpmaddwd), fusing sub-block rescaling andint16 -> int32horizontal accumulation into a single 1-cycle instruction. - Cold MoE expert blocks are prefetched with
_MM_HINT_NTA(non-temporal cache-bypass hint), preventing the 46 MoE layers from evicting the 6 GQA KV caches, 23 Mamba-2 SSM states, and shared experts from the 64 MB Zen 5 L3 cache.
3. Scaling Projection: DeepSeek V4 Flash & DeepSeek V4 Pro on CPU
Because our Block-64 2-Level Fractal Compressor (3.75 bpw on routed experts / 3.90 bpw overall) operates on 64-element blocks without requiring 256-element K-quant alignment and starts directly from BF16/FP8 master weights:
| Model Architecture | Total / Active Params | Master BF16 / FP8 Size |
Standard Q4_0 / Q4_K Size |
Our Fractal-64 (3.75 bpw MoE) |
Target CPU RAM Tier |
|---|---|---|---|---|---|
| Nemotron-3.5-Lightning-30B-A3B (Verified Live) | 30B / 3B |
58.84 GiB (BF16) |
17.59 GiB |
14.35 GiB (15.40 GiB idle RSS) |
Fits easily in 24–32 GB RAM |
| DeepSeek V4 Flash (Fine-Grained Hybrid MoE) | ~200B–236B / ~16B–21B |
~200–236 GiB (FP8) |
~118–135 GiB |
~91–107 GiB |
Fits inside 128 GB DDR5 consumer workstation (9950X) |
| DeepSeek V4 Pro / V3-671B (Full Flagship MoE) | 671B / 37B |
~671 GiB (FP8) |
~380–404 GiB |
~305 GiB (or ~248 GiB with 3.0 bpw 2-Level Fractal) |
Fits inside 256–384 GB EPYC / Threadripper |
4. Files Included in v2.2.0 (Backed Up to NAS)
patches/zen5-nemotron-256k-optimizations.patch— Updated withblock_q2_0(30 bytes, Block-64 2-Level Fractal),quantize_row_q2_0_ref,dequantize_row_q2_0, AVX2 +_MM_HINT_NTAggml_vec_dot_q2_0_q8_0_generic, and_MM_HINT_NTAggml_vec_dot_mxfp4_q8_0. Passesgit apply --checkcleanly againstd2f83055.scripts/build_fractal_moe_gguf.sh— Supports--profile fractal64(14.35 GiBfromBF16),--profile mxfp4(15.95 GiBfromQ4_0), and--profile mxfp4_q5(16.10 GiB).benchmarks/eval_quality_and_tools.py— 100-point automated Quality, Tool-Calling, Executable Coding, Long-Context Needle (8.5Ktokens) & Speed/RAM release gate.workspace/eval_baseline_q4_0.json,workspace/eval_fractal_mxfp4.json,workspace/eval_fractal_64_bf16.json, andworkspace/QUALITY_GATE_REPORT.md.
v2.1.0 — Stockfish-PVS v2 (Sweet Spot, M=7), 4 Unlocked RouteCrack Techniques (60.4 tok/s Peak) & Apple Silicon / Fedora Support
Release Notes — nemotron-30b-cpu-256k & llama-modchip
📄 Quick Links: Overview (
README.md) · Technical Paper (ARCHITECTURE.md) · 96+RouteCrack + Stockfish-PVSTechniques (speculative/ROUTECRACK_TECHNIQUES.md) · Engineering FAQ (FAQ.md)
🚀 v2.1.0 — Stockfish-PVS v2 (Sweet Spot, M=7), 4 Unlocked RouteCrack Techniques (60.40 tok/s Peak), & Multi-Platform Expansion (Apple Silicon M4 Pro + Fedora Ryzen 8745HS)
Release Date: November 2026
Highlights: Combines Chess-Engine Principal Variation Search (PVS) + 4-Way Bucketed Zobrist Transposition Tables (StockfishDrafter, 1.64 MB L2/L3) with the RouteCrack statistical speculative engine, unlocking 4 previously dormant RouteCrack techniques (including Singular Horizon Extension M=7), pushing live 25K-context code refactoring on AMD Ryzen 9 9955HX (0 GPUs) to 48.39 tok/s average / 60.40 tok/s peak (mean len = 6.90 tokens/step, 96.39% acceptance) and 85.00% draft acceptance on technical prose, while adding community-verified support for Apple Silicon (M4 Pro 24 GB) and Fedora 44 (AMD Ryzen 7 8745HS GEEKOM A8).
1. ♟️ Stockfish-PVS v2 (Sweet Spot, M=7) Speculative Acceleration (rc_stockfish.h, ngram-map.cpp)
On a CPU-hosted Sparse MoE + Mamba-2 hybrid (Nemotron-3.5-30B-A3B), every drafted token activates additional routed experts from DDR5 RAM (~0.30x single-token cost per drafted token) and any rejected token triggers an 18.4 MB Mamba-2 recurrent state rollback (slot.spec_ckpt). Consequently, net wall-clock speedup follows the CPU-MoE Golden Equation:
During the RouteCrack research campaign (96+ techniques documented in speculative/ROUTECRACK_TECHNIQUES.md), several high-recall predictors could not be enabled in production because static predictors trained on the same corpus make correlated errors when confidence drops below 84%.
StockfishDrafter (speculative/cpp/rc_stockfish.h) solves this by maintaining a 1.64 MB L2/L3-resident (2.5% of 64 MB L3), zero-allocation Chess-Engine Search state updated continuously on the live session stream:
-
4-Way Bucketed Zobrist Transposition Tables (
tt5,tt4,tt3=384 KB) with 16-bit verification signatures (sig16), Top-2 candidate tracking (tok1/cnt1,tok2/cnt2), and Stockfish age-based generational replacement. -
Countermove Table (
1,024 KB,65,536 × 4) & Continuation History Table (256 KB) capturing immediate `(t_{-2}, t_{-1}) \to t_0$ and$t_{-1} \to t_0$ live session dynamics. -
Principal Variation Search (PVS) with Late Move Reductions (LMR): Searches the principal candidate at full horizon depth while applying LMR depth reductions and stronger certainty gates to secondary moves (
m > 0).
The 4 RouteCrack Techniques Unlocked by Stockfish-PVS v2:
-
Technique #1 — Online Session Trie Rescue (
rc_trie_v2.h+Stockfish-PVSGate):- Rescues novel in-session identifiers, variable names, and file paths when the static 8-level FNV-64 Hash Cascade misses (
best_conf < min_c), providedOnlineTrieV2has session support (ot_cnt >= 2,ot_conf >= 0.78) and is confirmed by the orthogonalStockfishZobrist TT (sf_has_cand, orot_cnt >= 4 && ot_conf >= 0.90). -
Marginal Precision:
92.19%(+59accepted tokens, only5wasted).
- Rescues novel in-session identifiers, variable names, and file paths when the static 8-level FNV-64 Hash Cascade misses (
-
Technique #2 — Top-4 Cascade Disambiguation via Orthogonal Zobrist TT:
- Inspects
tok[1..3]inhc_top4_k*.binwhenevertok[0]falls in the uncertain band (0.55 <= c0 < min_c). If an alternativealt_thas a strong live-session Zobrist TT match (alt_sf >= 640, exacttt5/tt4hit) that strictly beatstok[0](alt_sf > sf_t0 + 250),Stockfish-PVSpromotesalt_t.
- Inspects
-
Techniques #5 & #89 — 11,382-Entry Multi-Token Macro Codebook (
macro_codebook.bin):- Enables multi-token structural chains (
1..15tokens long,>= 90%empirical precision) at$d=0$ and unlocks Singular Horizon Extension across the macro chain. -
Marginal Precision:
91.81% -> 96.44%(+92accepted tokens, only8wasted).
- Enables multi-token structural chains (
-
Techniques #17 & #73 — Singular Horizon Extension (
--spec-ngram-simple-size-m 7) & Consensus Integrity Fix:- Extends the draft horizon from
$D=4$ (M=5) up to$D=7$ (M=7) exclusively on "singular" beams: verified 2-hit in-context trajectories (true_consensus_hits == d), Macro Codebook chains (used_macro), or Singular Cascade + Stockfish TT locks (best_conf >= 0.95 && sf_best >= 600). -
Consensus Integrity Fix: Separates
true_consensus_hits(strictly 2-hit in-context matches) fromconsensus_hitsso single-hit context matches rescued byRouteCrackat$d=0..2$ cannot masquerade as 2-hit trajectories at$d \ge 3$ . -
Marginal Precision at
$D=5..7$ :98.18%(M=6) to98.74%(M=7:+78accepted tokens,1wasted,-7rollbacks).
- Extends the draft horizon from
2. 📊 Verified Benchmarks: Held-Out Ablation (77,456 Tokens) & Live CT 100 Telemetry
A. Held-Out Corpus Ablation (77,456 Nemotron-3.5 Tokens, 351 Contexts — speculative/cpp/test_synergy.cpp)
| Speculative Configuration | Drafted ( |
Accepted ( |
Wasted ( |
Token Precision | 0-Rollback Steps | Mamba-2 Rollbacks | CPU-MoE WallGain |
|---|---|---|---|---|---|---|---|
1. RouteCrack Baseline (M=5, Static Cascade) |
6,332 | 5,440 | 892 | 85.91% |
87.31% |
482 | +3,540.4 |
2. + Stockfish-PVS v1 (M=5, Zobrist TT + PVS) |
6,329 | 5,459 | 870 |
86.25% (+0.34%)
|
87.84% (+0.53%)
|
461 (-21) |
+3,560.3 (+19.9)
|
3. + Stockfish-PVS v2 Sweet Spot (M=7, +Trie +Top4 +Macro +Singular) |
6,555 | 5,663 | 892 | **86.39% (+0.48%) ** |
**88.35% (+1.04%) ** |
**450 (-32) ** | **+3,696.5 (+156.1) ** |
+223additional accepted tokens (5,440 -> 5,663) with ZERO additional wasted tokens (892 -> 892,100.0%net marginal precision) and-32fewer Mamba-2 rollbacks (482 -> 450).
B. Live 5-Stage Production Benchmark on CT 100 (AMD Ryzen 9 9955HX, 0 GPUs, 22.2K -> 27.7K Context)
Stage & Workload (Nemotron-3.5-30B-A3B-Q4_0) |
Active Context | M=5 Speed (Avg / Peak) |
Stockfish-PVS v2 (M=7) Speed (Avg / Peak) |
Draft Acceptance (Acc / Drafted) |
Mean Spec Length (tok/step) |
|---|---|---|---|---|---|
Atto 1A: Warm TTFT + <tool_call> Read (50 tok) |
22,299 tok |
30.84 tok/s (2.60 s) |
34.52 tok/s (2.45 s wall) |
83.33% (35 / 42) |
4.18 tok/step |
Atto 1B: Prefill harp_cache.py (3,089 tok) + 500 tok Code |
25,388 tok |
40.91 / 45.43 tok/s (12.22 s) |
48.39 tok/s avg / 60.40 tok/s peak (10.33 s) |
96.39% (401 / 416) |
6.90 tok/step (up from 5.47) |
Atto 2A: Thread-Safe Refactoring (400 tok Mixed Code) |
26,419 tok |
27.80 / 41.20 tok/s |
28.61 tok/s avg / 48.47 tok/s peak |
86.10% (223 / 259) |
4.66 tok/step |
Atto 2B: From-Scratch Concurrent Stress Test (350 tok) |
26,431 tok |
18.61 / 21.84 tok/s |
18.66 tok/s avg / 21.89 tok/s peak |
56.38% (53 / 94) |
2.33 tok/step |
Atto 3: Architectural & Security Audit in Italian (350 tok) |
26,959 tok |
18.58 / 20.50 tok/s (80.6% acc) |
18.76 tok/s avg / 20.78 tok/s peak |
85.00% (34 / 40) (up from 67.4%) |
2.48 tok/step |
Live Multi-Turn Claude Code Session (4,096 tok Turn 3) |
27,713 tok |
19.00 / 30.87 tok/s (59.1% acc) |
20.68 tok/s avg / 39.28 tok/s peak (-17.5 s) |
67.98% (1,055 / 1,552) |
2.68 tok/step |
3. 🌍 Multi-Platform Support & SSE Gateway Enhancements (Co-Authored with @jarorosFork / Oleksandr Nazar)
Integrated community contributions from Oleksandr Nazar (@jarorosFork) (commits 9509f4c, 93b6381, d740063 -> 6694b0b):
apple-silicon/— Apple Silicon (M4 Pro 24 GBUnified Memory) Metal Stack:- Dedicated setup scripts (
apple-silicon/setup.sh,apple-silicon/start_server.sh,apple-silicon/start_gateway.sh,apple-silicon/chat.py,apple-silicon/bench_128k.py) runningNemotron-3.5-30B-A3Bat47–49 tok/sdecode and256–549 tok/sprefill up to 128K context (384 MBKV cache,0swap).
- Dedicated setup scripts (
fedora/— Fedora 44 / AMD Ryzen 7 8745HS (GEEKOM A8, 8C/16T Zen 4, 64 GB DDR5):- All-in-one setup, server, gateway, and browser web chat UI (
fedora/nemotron.sh).
- All-in-one setup, server, gateway, and browser web chat UI (
gateway/sse_gateway.py— Tool-Call Resilience & Cross-Platform Portability:_write_as_bash()Fallback: Automatically converts raw multilineWritetool calls into safecat << 'EOF' > ...Bashcommands viashlex.quote()when unescaped quotes in100+line code payloads break LLM JSON string serialization._coerce_xml_param()Schema-Aware Coercion: Coerces XML<function=Name><parameter=key>value</parameter></function>parameters to native JSON integers, numbers, booleans, arrays, or objects using the client's tool JSON schema (_extract_param_types()).- Portable
HARP_CACHE& Environment Config: Safely guards/dev/shmusage on macOS (os.path.isdir("/dev/shm")) and addsGATEWAY_HOST,GATEWAY_CORS_ORIGIN, andGATEWAY_SYSTEM_PROMPTenvironment variables.