Files
leleka/docs/experiments/codex-compare-speed-gap.md
T

54 KiB

Codex compare: why Leleka decodes slower than vanilla Strata, and the ranked levers (RTX 5090, 2026-11-07)

Branch claude/speed-vs-strata-08143a. Phase 1 = analysis of existing logs, no new GPU run, no performance claim. Phase 2 (measurements) is in section 6 once it has data. Sources (server /data/leleka-e2e/): codex-compare/runs/main/{LEL,VAN,VANL}/stack-r{1,2,3}/engine.log (LEL: JSON request events of the engine; VAN/VANL: strata serve: prompt ... generated ... drafts accepted a of b lines), spd-gap/runs/main/{A,B,E,K*,KA*,KS*,P,T*,VANLP,VANL-noprof} (replay of the recorded VANL nestng-crm-r2 prompts), docs/ledger.md, docs/roofline.md, docs/experiments/codex-compare-5090-results.md (branch claude/codex-compare). Arms: LEL = release package leleka-0.1.0-17e372944279, VANL = vanilla 0.2.6 with route tail skip and CPU prefill share off (reference), VAN = vanilla shipped defaults (both on). Analysis scripts are not kept in Git (run over ssh from stdin; formulas below).

1. Where the time goes (all requests with prompt > 200 tokens of the 9 stack logs per arm, ttt + nestng-crm together)

Rounds of vanilla are estimated as generated - drafts accepted (one bonus token per window); LEL logs rounds itself.

metric LEL VANL (reference) VAN LEL vs VANL
requests (3 stacks) 531 246 271
decode tok/s (sum output / sum decode ms) 177.5 217 238 -18 %
tokens per round 3.22-3.34 2.92-3.00 2.91-3.02 +12 % (adaptive window)
ms per round 18.1-18.8 13.5-13.9 12.3-12.5 +36 %
prefill tok/s over uncached tokens 930-1050 1460-1560 1320-1660 -35 %
prefill share of request time 9.5 % 7.1 % 7.3 % +2.4 points
request time per output token, prefill + decode (ms) 0.59 + 5.63 = 6.22 0.36 + 4.61 = 4.97 0.33 + 4.20 = 4.53 gap 1.25 ms: decode 82 %, prefill 18 %

Reading: Leleka gets more tokens per round than vanilla (+12 %), but a round costs +5 ms. With vanilla's round time Leleka would be ~10 % faster than VANL. The whole gap is the time per round, plus a smaller prefill share.

Prefill latency by size of the uncached part (median ms): the fixed cost per request is about +200-300 ms, and large reads are 2x slower.

uncached tokens LEL VANL VAN share of LEL requests
< 64 430 268 210 19 %
64-256 530 292 251 31 %
256-1024 722 435 397 35 %
1024-4096 1002 715 695 11 %
>= 4096 4405 2184 2044 4 % (19 % of LEL prefill time)

2. Same prompts replayed (spd-gap; nestng-crm-r2 of VANL, first 30 requests, requests are identical across variants; dec_tps = output tokens / decode ms)

variant what dec tok/s tok/round ms/round VRAM / PCIe / CPU % of routed
VANL (vanilla, lossless) --spec 4 --spec-min-p 0.5 208.3 (2 runs equal) 2.95 14.2 hit 92.8 / 2.0 / 5.2
A ours shipped (adaptive window, floor 0) 183.8 3.55 19.3 90.2 / 3.0 / 6.7
B ours with vanilla's window (fixed 4, floor 0.5) 178.8 2.90 16.2 90.8 / 2.7 / 6.6
E A + our lossy tail skip 206.7 3.58 17.3 93.7 / 1.7 / 4.6
T45 E, repeat 205.8 3.59 17.4 94.0 / 1.6 / 4.4
KAa E + sm_120 ATTN_DAILY + GU_SWIGLU 209.7 3.51 16.7 93.6 / 1.7 / 4.7

Over requests 4-30 only (whole runs of 27 requests, n = 1-4 per variant, not a paired design): T45 family 207.8 / 210.1 / 213.3 / 209.0 (mean 210.1), K (all three sm_120 sets) 214.0 / 215.8 / 218.3 (216.0), KA 212.0 / 217.6 (214.8), KS (side mixer only) 208.3 / 210.5 (209.4), T30/T35/T40 (PCIe fraction) 204.0 / 206.8 / 207.2. So: ATTN_DAILY + GU_SWIGLU ~ +2.3 %; the side mixer adds nothing; the PCIe fraction 0.45 is not worse than 0.30-0.40. Run-to-run spread inside one variant is +-1.5 %: these are indications, not A/B results.

Step profile (P = ours with LELEKA_SERVE_PROFILE=1, vanilla STRATA_DECODE_TIMING=1; ms per window, GDN layers + QSA layers, 30 profile lines each):

step (ms/window) ours, miss-heavy (lines 1, 2, 7, 8, 26) vanilla, miss-heavy (lines 8, 9, 12, 22, 27) ours, quiet (16, 17) vanilla, quiet (17, 18)
total per window 21-26 16-17 12.0 10.7
waitB (GDN + QSA) 4.3-5.9 3.9-4.6 0.45 0.5
waitCPU (GDN + QSA) 3.1-4.0 0.4-1.3 0.8 0.2
PCIe group 0.6-0.9 0.3 0.4 0.1
VRAM hits 1.7-2.8 1.4-1.9 1.5 1.4

The windows differ by 5-9 ms only in states with misses, and almost all of it is waitCPU + PCIe group (+2.5 ms of 21 in a miss-heavy window, +0.6 ms in a quiet one) and a hit rate that is lower in ours (90.2 % against 92.8 % of the routed experts). Cache size: ours 12,192 expert slots (23.24 GiB), vanilla 12,575 (23.87 GiB, +3.1 %), vanilla leaves 389 MiB VRAM free (and warns); vanilla draft head over 106,299 tokens (212.9 MiB), ours the full 248,320-row head (ledger section 5). Draft + commit outside the window: ours about 2.5 ms/round (draft.finish 1.7, apply_pending 0.6, commit 0.4), vanilla 1.2 (draft 1.17 in its timing line); ledger section 5 measured +1.5 ms/round. The vanilla server drifts with uptime: 13.5-16 ms/round at 11-13 h, 10.1-11.7 after a fresh boot (codex-lossy-delta.md); every A/B must alternate inside one boot.

3. Ranked levers

Gain = estimated change of end-to-end tok/s on the Codex workload (contexts 30-120k), E = estimate from the numbers above, not measured as an A/B. Lossy = changes output; "placement-class" = changes which experts run on the GPU (GPU and CPU round differently), so output differs slightly without being a bug.

# lever expected gain risk class evidence
1 sm_120 sets ATTN_DAILY + GU_SWIGLU default on (the vanilla 0.1.50 defaults) +2-3 % (E from KA vs T45: 214.8 vs 210.1) low non-lossy: byte-identical in the probe and 243-row replay section 2
2 Remove the CPU/PCIe wait of the miss leg (waitCPU + PCIe group: why is the CPU-expert result late: pool wake/hand-off, per-layer dispatch, split rule with pcie_frac, CPU kernel speed per expert) +4-10 % (E: 1.0-3.1 ms of 19 ms/round; the quiet-state excess is already 0.6 ms) medium (host threading) non-lossy if the numerics of each expert stay (same device decides the rounding) step profile
3 Fewer misses: slots 12,192 -> 12,575 (headroom policy), adaptive tier timing, draft-head VRAM +2-6 % (E: miss rate 9.8 % -> 7.2 % removes up to a quarter of the miss leg) medium: VRAM headroom (vanilla warns at 389 MiB), OOM/paging risk placement-class (quality gate against control placement) slots, hit rates
4 Per-round draft + commit overhead (merge small graphs, fewer launches, cheaper chain step: 0.68 vs 0.42 ms, mtp_original_finite guards) +3-6 % (E: -1.3 ms of 19) medium non-lossy, bitwise (same kernels; draft vocabulary subset is a separate sub-lever, ledger: prompt-dependent -4 %..+19 %) ledger 5, profile
5 Prefill fixed latency per request (+200-300 ms per small tail; vanilla reads <= 64 tokens through verify windows) and 2x slower large reads +2-3 % (E: prefill share 9.5 % -> 7.1 %) medium tail through windows is a different kernel path: placement-class numerics; faster large chunks are bitwise section 1
6 Adaptive window policy: A vs B is +2.8 % net (+0.65 tokens per round for +3.1 ms); tune floor / ceiling (variants C, D of spd_replay_job never ran) +1-3 % (E) low non-lossy (exact speculative decoding) section 2
7 Route tail skip (lossy): E vs A +12.5 % (206.7 vs 183.8), vanilla VAN vs VANL +9.7 % real +10-12 %, shrinks lever 2 and 3 quality: rounds growth unknown (codex-compare rounds CV 20-30 %) lossy, experimental, stays off until the owner gate section 2
8 CPU prefill share (vanilla default, KL ~0.004) ~0 (VAN prefill share 7.3 % vs VANL 7.1 %) lossy section 1 - do not pursue

Total of the non-lossy levers 1, 2, 4, 5, 6 if additive: about +12-25 %; the gap to VANL is +22 % (217 / 177.5), to VAN +34 %. Lever 3 and 7 are the way past parity with vanilla's shipped defaults. The levers interact: tail skip removes most of the miss leg, so lever 2 and 3 are measured with tail skip off (the default).

4. Gates, per lever (AGENTS.md; nothing changes a default before its gate)

lever A/B quality / identity gate
1 switch on/off, same boot byte-identical outputs and R hashes on a full replay of a Codex session (all 56 requests of nestng-crm-r2, plus the earlier 243-row replay); then default on
2 switch on/off per-step output identical on a frozen tier (--adapt-every 0 and a frozen placement, because the adaptive tier is not reproducible run to run); a distribution comparison of the adaptive runs
3 slots / headroom / profile variants placement-class gate: deviation against the control placement not worse than between two control placements (>= 1000 rows), zero OOM/paging in the 256k run, VRAM free >= the policy floor
4 switch on/off greedy output and tensor identity (the kernels are the same); chain graph timing in the model-free probe first
5 switch on/off, tails of 1-64 / 64-256 tokens R hash identity for the unchanged path; the window-tail path under the placement-class gate
6 variants of floor/ceiling on the same replay identical greedy output (speculation is exact); tokens/round and ms/round reported
7 E against A on the replay + real Codex sessions the owner criterion: rounds growth <= speed gain in %, game playable, CRM 56/56; stays experimental until it passes

5. Measurement protocol for phase 2

  • Workload: the recorded VANL nestng-crm-r2 requests (proxy/rounds/NNNN.fwd.json.gz) through scripts/e2e/codex/compare/spd_replay_job.sh (server copy spd-gap/tools/spd_replay_job7.sh), whole cell (56 requests); requests 1-3 are warm-up and dropped.
  • Design: blocks of leleka up per variant, order A B B A A B ..., n >= 10 blocks per variant in one boot (uptime drift above), GPU lock and holder queue as for all jobs; the metric per block: dec tok/s, tok/round, ms/round, end-to-end tok/s (otok / (pf + dec)), tier %; paired difference per adjacent block pair with a 95 % CI.
  • Record per run: GPU, driver, CUDA, host, model digest (8f59b4aa... profile, model files), binary sha256 and commit, the switches, cache state (prefix cache and expert tier start state: engine restarted per block, prefix cache empty at start), token counts and the distributions (per-request dec tok/s).
  • Binary: lever 1 is a pure switch (LELEKA_SM120_ATTN_DAILY, LELEKA_SM120_GU_SWIGLU), so its paired A/B runs the same codex-compare release package on and off (sha256 in the job log); the default flip itself is a commit on the hexagonal head e4993d151 and needs one confirmation block pair on that head. Levers that change code (2, 4, 5) are measured as head build against head build with the same switch off.
  • Tools (this branch, scripts/e2e/codex/speed/): spd_ab_job.sh (holder job; variant names NAME.BLOCK, new variant L), replay_hash.py (adds out_sha per request), ab_report.py RUN_DIR BASE VAR (paired differences with 95 % t intervals and the identity count). Copies live in /data/leleka-e2e/spd-gap/tools/.

6. Phase 2 results

Not run yet: the GPU queue holds the hexagonal identity/A-B jobs (hx-abg1 running, hx-abc3..5, hx-id6, hx-abd1..5 behind it, ~30 min each) ahead of this program. Queued at the end of PRIORITY (2026-11-07 18:30 UTC): spd-l1a (blocks 1-5) and spd-l1b (blocks 6-10) = lever 1, A (shipped lossless) against L (A + ATTN_DAILY + GU_SWIGLU), 10 blocks per arm, 30 requests of the recorded cell per block, ~12 min per block. Read the result with python3 -I - RUN_DIR A L < scripts/e2e/codex/speed/ab_report.py on /data/leleka-e2e/spd-gap/runs/ab-l1. Smoke test of the report on three old block pairs (tail skip on, no hashes): L +1.9 % decode tok/s, CI -2.1..+6.0 % (n = 3, which is why n >= 10). Entries are added below, one per lever, as each paired A/B finishes.

Lever 1, interim (blocks 1-5 of 10, spd-l1a; spd-l1b was running, so no final numbers yet)

metric A L L - A (95 % CI)
decode tok/s 187.10 190.05 +1.6 % (-0.3..+3.4 %)
end-to-end tok/s 170.18 169.67 -0.3 % (-3.2..+2.6 %)
ms/round 19.60 19.21 -2.0 % (-6.6..+2.6 %)

n = 5 pairs: not significant, gain below the +2-3 % of the estimate. Identity gate cannot use two boots: out_sha is equal for only 2 of 30 requests even between two runs of the same arm (A.1 vs A.2, A.2 vs A.3; L.1 vs L.2: 3 of 30), because the adaptive tier / placement is not reproducible run to run (as codex-lossy-delta.md noted). So the byte-identity of lever 1 must be shown on a frozen placement (--adapt-every 0, static tier, one boot, switch toggled per request or two boots with the same frozen tier), not by this A/B; the A/B above is the speed record only. Queue order (orchestrator request 2026-11-07): hx-abg2..5 (cumulative refactor A/B) are on top of PRIORITY; the running spd-l1b was left to finish.

Lever 1, final speed result (10 pairs, spd-l1a + spd-l1b, 2026-11-08)

Release package leleka-0.1.0-17e372944279-5090, RTX 5090, VANL nestng-crm-r2, 30 requests per block (27 after the 3-request warm-up skip), engine restarted per block, order alternated, only the switch differs.

metric A (shipped lossless) L (+ ATTN_DAILY + GU_SWIGLU) L - A (95 % CI)
decode tok/s 186.58 190.03 +1.85 % (+0.97..+2.73 %)
end-to-end tok/s 168.87 170.07 +0.71 % (-1.01..+2.44 %)
tokens/round 3.66 3.63 -0.66 % (-3.13..+1.82 %)
ms/round 19.61 19.13 -2.46 % (-4.47..-0.46 %)
VRAM % of routed 90.37 90.34 -0.03 % (-0.27..+0.21 %)

Decode gain is real and small (+1.85 %, CI excludes zero), inside the +2-3 % estimate's lower end; it does not reach the end-to-end number (prefill is untouched; CI crosses zero). The cross-boot out_sha identity is 22 of 300 and is not the gate (A against A is as low, adaptive tier and window). Default stays off until the frozen-placement gate passes: spd-l1id (variants FA/FL = tier swaps off + fixed window 4, with and without the two sets; FA.1 vs FA.2 is the A/A floor, then FA.n vs FL.n must be byte-identical), output /data/leleka-e2e/spd-gap/runs/id-l1, queued on top of PRIORITY.

Lever 1, identity gate: HTTP replay cannot decide, teacher-forced harness used (2026-11-08)

spd-l1id (release package, leleka up, tier swaps off, fixed window 4, 30 requests, 4 boots FA.1 FL.1 FA.2 FL.2): out_sha equal for 10/30 (FA.1 vs FA.2), 10/30 (FL.1 vs FL.2), 11/30 (FA.1 vs FL.1), 9/30 (FA.2 vs FL.2). The A/A floor is as low as the A-vs-L pairs, so the live HTTP replay is not a deterministic probe even on a frozen tier and window (the remaining sources are not isolated: host-thread timing of the CPU/PCIe split, the persisted prefix-cache state between boots; the frozen tier also runs at 63 % VRAM hits, ~104 tok/s, so these four boots say nothing about speed). The gate is therefore the repository's teacher-forced harness (scripts/e2e/decode/draftround-id.sh, the 256k-class capture night5-long-256k, top-16 logprob rows, A/A floor inside each process): spd-l1id2, P1 = release kernels, P2 = P1 + ATTN_DAILY + GU_SWIGLU, test binary rt-dr2, output /data/leleka-e2e/spd-gap/runs/id-l1-tf.

Lever 1, verdict: default ON for the 5090 profiles (2026-11-08)

spd-l1id2 (teacher-forced, rt-dr2, five requests of night5-long-256k up to 243k prompt, 240 forced tokens each, ADAPT=4): reference process A/A floor 2057 of 2057 top-16 rows identical; P2 (ATTN_DAILY + GU_SWIGLU) against the reference, both arms: 2057 of 2057 identical, 0 argmax flips; draft trace 1036 of 1036 lines identical (IDENTICAL); q_tail_gate PASS in both processes. So the two sets are bitwise identical to the shipped kernels on this gate and the paired decode gain is +1.85 % (CI +0.97..+2.73 %), end-to-end +0.71 % (not significant). Caveats: the gate binary rt-dr2 (draft-round 28d74a2ef) is older than the release package 17e372944279, and the live HTTP replay cannot serve as an identity probe (floor 10/30). The three 5090 profiles (rtx5090-32g, -file, -gguf-ple) now set LELEKA_SM120_ATTN_DAILY=1 and LELEKA_SM120_GU_SWIGLU=1; the laptop profile (sm_86) does not; an operator's engine_env still wins. Rollback: set both to 0 in engine_env.

Confirmation on the product tree (2026-11-08, jobs spd-l1id4-c9, spd-l1id4-main): the same teacher-forced gate on the hexagonal test binaries rt-c9 (refactored product tree) and rt-main (its base). Both: A/A floor 2057 of 2057 top-16 rows identical, P2 (ATTN_DAILY + GU_SWIGLU) against the reference 2057 of 2057 in both arms, 0 argmax flips, draft trace 1036 of 1036 identical, q_tail_gate PASS. The release package itself cannot run the replay smoke (it is a lib test), and a test binary of exactly 17e372944279 does not exist on the server (not built: 41 GiB free on /data); the kernels are the same PTX. The server copy of draftround-id.sh hardcodes the binary directory, so these two jobs use the repository version (D override) installed as spd-gap/tools/draftround-id.sh. The decision to keep the sets on stands; the paired A/B of the release package (10 pairs above) is the switch these profiles now set, so no further A/B was run.

Levers 2 and 4: what the existing evidence says before any code (2026-11-08, no GPU run)

  • Vanilla and ours run the same CPU leg shape: 15 workers on logical processors 1-15, host on 0 (vanilla engine.log, ours cpu_workers=15), LELEKA_POOL_TASKS_PER_THREAD 2/4/6 within +-2 us per expert (docs/experiments/cpu-service2-5090.md), PCIe fraction 0.30-0.40 not better than 0.45 (section 2 above).
  • The step-profile columns are not comparable one to one: vanilla books the CPU wait inside waitB (GDN layers waitB 4.87, waitCPU 0.22, PCIe group 0.36 = 5.45 ms/window) where ours splits it (waitB 3.74, waitCPU 2.36, PCIe group 0.57 = 6.67 ms/window). The wait group of the GDN layers is ~1.2 ms/window longer in ours, the QSA layers ~0.2 ms/window shorter in ours: a net ~1.0 ms of ~19 ms/window (~5 %), and it moves with the miss count (hit rate 90.2 % against 92.8 %, 12,192 against 12,575 slots), so lever 2 and lever 3 are one effect until a per-miss cost is measured.
  • The fused verifier commit graph (LELEKA_DRAFT_FUSED_COMMIT=on, bitwise, docs/experiments/draft-round-5090.md) measured -0.024 +- 0.046 ms per round: neutral, not worth an A/B here.
  • Consequence: a code change for lever 2 needs a per-miss timing (CPU compute against late start) from an instrumented build before it is worth an A/B; the cheap config knobs are already flat. Not started; the next measured lever is 7 (tail skip, experimental, lossy): spd-l7a/spd-l7b queued, 10 paired blocks A against E, speed and rounds growth only (the owner gate also needs real Codex sessions and CRM 56/56), output /data/leleka-e2e/spd-gap/runs/ab-l7.

Lever 7 (route tail skip, EXPERIMENTAL, lossy), interim: blocks 1-5 of 10 (spd-l7a; spd-l7b running), 2026-11-08

Release package 17e372944279, same replay as lever 1, A (shipped) against E (LELEKA_ROUTE_TAIL_SKIP=7, ..._MAX_CACHED=100), 27 requests per block after warm-up, order alternated.

metric A E E - A (95 % CI)
decode tok/s 185.84 210.30 +13.16 % (+11.80..+14.53 %)
end-to-end tok/s 168.49 186.95 +10.95 % (+8.47..+13.44 %)
tokens/round 3.59 3.79 +5.45 % (+0.07..+10.83 %)
ms/round 19.31 18.00 -6.81 % (-10.67..-2.96 %)
VRAM % of routed 90.42 93.89 +3.48 % (+3.09..+4.59 %)

The gain is large and the CI is far from zero; rounds per token did not grow in this replay (tokens/round +5.5 %), but the replay sends recorded prompts, so the replies differ from E's own (the task trajectory is not followed) and this says nothing about the owner criterion on real sessions. The output is not identical (lossy by definition). Stays off by default. The owner gate (rounds growth <= speed gain in %, game playable, CRM 56/56) runs on real Codex sessions: spd-g1..3 (the codex-compare ours arm with the two tail-skip variables exported, tasks ttt + nestng-crm, repetitions 1-3, output /data/leleka-e2e/spd-gap/runs/codex-tail), queued behind spd-l7b; compare with the shipped LEL and VANL runs of codex-compare/runs/main.

Lever 7, final speed result (10 pairs, spd-l7a + spd-l7b, 2026-11-08)

Same replay and arms as the interim table (27 requests per block after warm-up, 10 block pairs, order alternated): decode tok/s A 186.40, E 209.81, +12.56 % (95 % CI +11.50..+13.62 %); end-to-end +11.00 % (+9.75..+12.25 %); tokens/round 3.65 against 3.77 (+3.30 %, CI -0.21..+6.80 %, includes zero); ms/round 19.57 against 17.96 (-8.24 %, -10.71..-5.77 %); VRAM share of routed 90.32 -> 93.76 %. out_sha identical in 4 of 300 requests: it is a lossy mode, and the HTTP replay floor is about 10 of 30 anyway, so this number decides nothing.

Lever 7, owner gate on real Codex sessions (jobs spd-g1..3, 2026-11-08) - the table below used the OLD accept.py, see the correction after it

Release package 17e372944279, LELEKA_ROUTE_TAIL_SKIP=7, LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100, real Codex CLI 0.163.0, temperature 0, three repetitions of ttt and nestng-crm, run by cmp_codex_job.sh on the 5090 (/data/leleka-e2e/spd-gap/runs/codex-tail, report _compare/compare.md). Baseline is the shipped LEL of codex-compare/runs/main (same tools, same Codex, same tasks).

task arm accepted rounds (mean +- sd) wall s decode tok/s
nestng-crm LEL shipped 3/3 (56/56 each) 54.0 +- 7.5 488.4 163.1
nestng-crm LEL + tail skip 0/3 (55/56, 55/56, 54/56) 55.0 +- 17.4 468.3 183.2
ttt LEL shipped 3/3 (14/14) 17.7 (15, 22, 16) 177.9 164.3
ttt LEL + tail skip 3/3 (14/14) 18.0 +- 7.0 155.5 184.6
  • Speed: decode tok/s +12.3 % (crm) and +12.4 % (ttt); the engine's own per-round view over the CRM requests is 17.4 ms/round against 19.4 (-10 %) at an equal 3.47 tokens/round.
  • Rounds: CRM +1.9 % and ttt +1.7 % (both far inside the sd): the growth of rounds is below the speed gain (+12 %) in both tasks (greedy sessions are not reproducible run to run, n = 3).
  • Game: ttt accepted 3/3.
  • CRM 56/56 is not met in any of the three runs. The failing check is frontend src: a board with one column per stage (all five stages and a loop) in r1, r2 and r3 (no file with all five stages and a loop), plus one backend e2e test in r3 (deals.e2e-spec.ts, passed=41 failed=1). All nine baseline sessions (LEL, VAN, VANL, three each) passed 56/56. Three of three against zero of nine is not noise at this size; the lossy skip changes what the model writes on this task, and the gate in AGENTS.md ("do not enable lossy optimizations by default until their separate quality gate passes") is not passed.

Verdict: the route tail skip stays experimental and off by default; no default or profile was changed for it. The logit gate (q_tail_gate, teacher-forced night5-long-256k, rt-c10) is queued as spd-l7id for the record; it cannot overturn the CRM failure above.

Lever 2 (waitCPU / PCIe), decision after re-reading cpu-service2-5090.md (2026-11-08, no new GPU run)

The CPU leg already costs what vanilla's costs per expert: the server bench of the dispatch gives 41-51 us per CPU expert (15 workers, 54-57 GB/s of expert bytes, near this host's DRAM bandwidth) and vanilla's PcieAuto line reports 44 us; the host-callback stages are 0.06-1.08 ms/round each and already trimmed (eager admission +4.24 %, AVX2 q8_k); pool tasks per thread, PCIe share 0.45-0.65 and the fused commit graph are flat or neutral. What remains of the waitCPU + PCIe group excess (about 1 ms of ~19 ms per window) scales with the number of misses per window, i.e. it is lever 3 (hit rate 90.2 % against 92.8 %), not a separate host-side defect. A per-miss instrumented build would only re-split a quantity that the miss count already explains, so none is built. Lever 2 is closed with no change; the remaining miss-leg work moves to lever 3 (placement-class gate) and, lossy, lever 7.

Queued next: lever 6 (spd-l6a, spd-l6b: D = adaptive window at floor 0.5 against shipped A, 10 block pairs, exact speculative decoding) and the lever 7 logit gate spd-l7id.

Correction: the spd-g1..3 cells were accepted by the pre-fix accept.py (2026-11-08)

cmp_codex_job.sh ran the frozen codex-compare/tasks/nestng-crm/accept.py (sha256 db1b7095...), whose check "a board with one column per stage" needs the five stages and the loop in ONE file and failed in all nine baseline cells too (codex-compare-5090-results.md, Deviations 4); the baseline 56/56 come from the fixed reaccept-1/tasks/nestng-crm/accept.py (sha256 b2e6c690...). The 0/3 above therefore compared unlike checkers. Re-accepted offline with the fixed script (copy at /data/leleka-e2e/spd-gap/runs/codex-tail-reaccept/accept-task, logs r1.log r2.log r3.log, original cell logs untouched):

cell fixed accept.py detail
nestng-crm r1 56/56 board: @for (stage of stages ...) in deals.component.html
nestng-crm r2 56/56 board: @for (stage of stages ...) in deals-page.html
nestng-crm r3 55/56 (reproduced 3 of 3 runs) backend tests: npm run test:e2e passes: 41 of 42 pass
  • The board is present in all three (a column per stage over the five stages, read in the sources), so the static failure was the checker artifact, not a model defect.
  • r3: the failing test is the agent's OWN deals.e2e-spec.ts:176 ("searches deals by title ... combines with stage"): it expects one deal for ?stage=won&q=software, but its own fixture creates two won deals with "software" in the title ("Alpha software" and "Beta software"), so the API correctly returns two. Deterministic (3 of 3 reruns), a wrong assertion written by the model, not environment noise, and not a defect of the service. It still fails the acceptance rule "the agent's tests pass". The baselines have 0 such cases in 9 sessions; 1 in 3 with tail skip is a small-n signal, not proof (an own-test slip of this kind can occur without tail skip, and greedy sessions are not reproducible).
  • Gate re-assessed: rounds growth below the speed gain (yes, +1.9 % / +1.7 % against +12 %); game playable (ttt 3/3, 14/14); CRM 56/56: 2 of 3 (r3 55/56 through its own wrong test). Not passed in full; with n = 3 per arm I do not call it a quality regression either. Tail skip stays experimental and off. To settle it, run 3 more repetitions of nestng-crm with the fixed accept.py (and the first three re-run under it); needs the owner's go on the cost (about 8 GPU-min each).

Lever 7, owner gate on n = 7 CRM and 5 ttt (spd-g1..3 re-accepted + spd-g4..g9, fixed accept.py b2e6c690, 2026-11-08): NOT passed on rounds

Real Codex CLI 0.163.0, release package 17e372944279 with LELEKA_ROUTE_TAIL_SKIP=7, ..._MAX_CACHED=100. Baseline = shipped LEL of codex-compare/runs/main (n = 3, same fixed accept.py). New cells in /data/leleka-e2e/spd-gap/runs/codex-tail2 (job copy tools/cmp_codex_job_fixed.sh: TASKS_ROOT=reaccept-1/tasks, manifest-checked).

nestng-crm tail skip n = 7 shipped LEL n = 3 difference
accepted (fixed accept.py) 6 of 7 (r3: own e2e test wrong) 3 of 3
rounds (requests), each 75, 43, 47, 98, 94, 87, 52 47, 62, 53
rounds mean +- sd 70.9 +- 23.3 54.0 +- 7.5 +31 % (Welch t = 1.7, df 7.9: not significant)
wall s mean +- sd 539.0 +- 118.5 488.4 +- 59.4 +10 % (t = 0.9)
decode tok/s 179.4 +- 5.1 163.1 +- 1.3 +10.0 % (t = 7.8)

Against the pooled nine shipped baselines of the three arms (LEL, VAN, VANL: rounds 62.4 +- 15.7, wall 461 s) the tail-skip rounds are +13.5 % and wall +16.8 %. The four new cells are the long ones (98, 94, 87 requests at 1.9-2.2 requests per tool call, against about 1.0 before); the early sessions (r1-r3) were short, so the order of runs, not only the mode, differs between the groups.

ttt (static 14/14; the six-click browser check is not available on the server or in this work folder, so it is NOT done): 5 of 5 accepted, rounds 17.6 against 17.7 (-0.4 %), wall 161.5 s against 177.9 s, decode 178.5 against 164.3 tok/s (+8.6 %).

Owner criterion "rounds growth must not exceed the speed gain in %": the point estimate fails on CRM (+31 % rounds, and wall time +10 % longer, against +10 % decode speed); the difference is within the noise of n = 3 against n = 7 (t = 1.7), so it is neither proven nor refuted. Game playable: statically yes, in a browser unchecked. CRM works: 6 of 7. Verdict: not passed, tail skip stays experimental and off.

Teacher-forced logit check (spd-l7id, rt-c10, 5 requests of night5-long-256k, 240 forced tokens each): the A/A floor in the reference process is bit-identical (2057 of 2057 rows). Tail skip against the reference: 1687 common top-16 rows, 0 identical, 60 argmax flips = 3.6 % (the Original's envelope in q_tail_gate is flips <= 2.8 %), and the draft traces differ in every line (1036 compared, 0 identical). q_tail_gate itself prints PASS only for the in-process arm pair (A/A), not for this cross-process comparison.

Lever 6 (adaptive window floor), result: no gain (spd-l6a, spd-l6b, 10 pairs, 2026-11-08)

D (adaptive window with spec_min_p floor 0.5, leleka reconfigure) against shipped A (floor 0), same replay, 27 requests per block after warm-up: decode tok/s A 185.77, D 185.25, -0.28 % (95 % CI -1.13..+0.57 %); end-to-end -0.13 % (-0.96..+0.70 %); tokens/round +2.72 % (-0.74..+6.19 %); ms/round 19.48 against 20.07 (+3.0 %, CI +0.18..+5.86 %). The extra tokens per round cost as much in round time. No default change; the shipped adaptive policy stays.

Lever 3 (fewer misses), plan (2026-11-08)

docs/experiments/vram-footprint-5090.md already holds the footprint work (dense slab default on; decode reserve 130 MiB and the prompt-embedding alias are opt-in, about +250 slots together, against vanilla's 12,575; our 12,192 now). Free VRAM at idle after load is about 1,040 MiB. The paired test queued here (spd-l3a, spd-l3b, variant G = leleka up --gpu-budget-gib 31, +0.43 GiB, about +190 slots, free VRAM after load about 600 MiB against vanilla's 389) measures the upper bound of what ~+200 slots are worth without any code change. If the gain is under 1 % the slot route is closed except for the larger prompt-buffer carve-out (+250..450 slots, needs code).

Where the real-session gap goes, per request (existing cells only, no new run; scripts/e2e/codex/speed/session_split.py, 2026-11-08)

Source: codex-compare/runs/main/{LEL,VANL,VAN}/{nestng-crm,ttt}-r1..3. Proxy time per request (proxy/rounds.jsonl, t_end - t_start) joined by order with the engine's own prefill and decode milliseconds (the cell's engine_log_start_offset slice of the stack engine.log; join checked: request counts equal in all 6 cells per arm, 3 per task). Proxy "tok/s" = output tokens / proxy time = the decode tok/s of compare.md.

nestng-crm (3 cells per arm) LEL VANL VAN LEL - VANL
requests 162 186 214
output tokens per request 1,351 1,217 1,114
uncached prompt tokens per request 583 609 441
proxy time per request, ms 8,297 6,055 5,064
of it engine prefill, ms 726 431 354 +295
of it engine decode, ms 7,549 5,592 4,674
of it rest (gateway, tokenizer, HTTP, SSE, prefix-cache work), ms 22 32 36 -10
pause between requests (tool run + Codex), ms 713 1,405 1,013 trajectory, not engine
ms per output token, proxy 6.14 4.97 4.54 +1.17
... prefill / decode / rest 0.54 / 5.59 / 0.02 0.35 / 4.59 / 0.03 0.32 / 4.19 / 0.03 +0.19 / +1.00 / -0.01
proxy tok/s (the 163 vs 201 of compare.md) 162.8 201.0 220.1 -19.0 %
engine decode tok/s 178.9 217.7 238.4 -17.8 %

At LEL's own 1,351 output tokens per request the 1.17 ms/token gap is about 1,580 ms per request: decode 1,350 ms (85 %), prefill 257 ms (16 %), gateway and the rest -13 ms (0 %). ttt is the same: 6.10 against 4.96 ms/token (+1.14 = prefill +0.13, decode +1.01, rest 0). The wall-clock of a cell also contains the pauses (LEL 38 s, VANL 86 s per CRM cell: the vanilla sessions ran heavier tool commands), which differ with the trajectory and are not the engine.

So the 19 % (proxy) against the replay's 11-12 % (dec tok/s 183.8 against 208.3) is not a gateway, proxy, prefix-cache, tokenizer or serialization cost: the "rest" is 22 ms per request against 32 for vanilla. Two things make the gap look smaller in the replay: it counts decode only (the real-session proxy number adds the prefill gap, 0.19 of 1.17 ms/token, about 3 points), and the replay's two arms differ from the sessions by +-4 % each (LEL 186 in the replay against 178.9 in the sessions; VANL 208 against 217.7), i.e. a different text and a vanilla that ran at a different uptime. The decode gap itself is flat over the context: engine decode tok/s by prompt size (LEL / VANL): 0-20k 178.4 / 218.3 (-18.3 %), 20-40k 183.3 / 221.1 (-17.1 %), 40-70k 177.8 / 214.1 (-17.0 %), 70-100k 173.5 / 215.0 (-19.3 %), > 100k 155.8 / 206.7 (-24.6 %, 9 requests).

Where the decode time goes (ms per round, phase 1): LEL 18.1-18.8, VANL 13.5-13.9: +4.7 ms. Our adaptive window pays +3.1 ms for +0.65 tokens per round (net +2.8 %, kept); the step-profile excess is waitCPU + PCIe group (+2.5 ms in miss-heavy windows, +0.6 in quiet ones, tied to the hit rate 90.2 % against 92.8 %), draft + commit outside the window +1.3 ms (full 248,320-row draft head against vanilla's 106,299-token subset), and +1.3 ms in quiet windows (12.0 against 10.7: kernels; the sm_120 sets of lever 1 took a part of it, +1.85 %).

Prefill: +295 ms per request at equal uncached tokens (726 against 431); by size: < 64 tokens 430 against 268 ms, 64-256 530 against 292, >= 4096 4,405 against 2,184 (4 % of requests, 19 % of the prefill time). The known cause is old code work, not a switch: docs/prefill-throughput.md "Remaining gap" (8192-token chunks 2,830-2,930 tok/s against the Original's 5,400-5,900; tails of <= 64 tokens read through verify windows in the Original).

What is available without lossy (E, none measured as an A/B yet beyond lever 1): lever 1 done (+1.85 % decode); lever 3 upper bound queued (spd-l3a/b: +190 slots); lever 4 (draft + commit, up to -1.3 ms of 18 = up to +7 % decode if all of it went, but the fused-commit graph measured neutral and the draft-vocabulary route is prompt-dependent and not bitwise); lever 5 (prefill: up to 16 % of the gap, code-level, placement-class numerics for the window tails). Nothing identified so far closes the 18 % without the lossy tail skip (+12.6 % decode, gate not passed).

Levers 4 and 5 after the base moved to hexagonal-finish (b686f6ab7), 2026-11-08

Lever 4, draft head 248k against 106k: the premise was wrong for the shipped product

  • What the Original does: a static subset file, not a prompt-dependent or frequency-ranked choice at run time. rt/draft_vocab.bin (106,299 int32 ids, 425,196 bytes, sha256 b1e1d3a7…cb91) is copied by setup from data/draft_vocab*.bin, built offline by tools/draft_vocab.py (base list + whole scripts --add han,kana,hangul,cjk_punct,cyrillic or a language corpus by token frequency --corpus --coverage 0.99). The engine computes draft logits over those rows only (MtpDrafter::bind, src/core/mtp.cpp).
  • What the product does: leleka-deploy always passes --mtp-rt-dir <mtp pack> (crates/deploy/src/config/engine_launch.rs), so the engine drafts over the same file. Checked on the running 5090 engine: argv has --mtp-rt-dir /data/leleka-e2e/codex-compare/ours-assets/data/mtp-rt, and that directory's draft_vocab.bin has sha256 b1e1d3a7a9e4bf862dcd5923ce661fb59bbd07907e594df5cf86a62ac235cb91, the Original's default. The "248,320-row head" in section 2 and in the ledger (section 5) described the model-free smokes and the daemon without --mtp-rt-dir, not the release package that the A/B and the Codex cells ran. There is no subset sub-lever to take: ours already equals vanilla there. (The opt-in LELEKA_DRAFT_VOCAB=en|cyrillic|fr exists, is not bitwise and is prompt-dependent: unchanged, see 2026-10-30-draft-vocab-en.md.)
  • What is left of "draft + commit +1.3 ms/round": draft.finish 1.7 against vanilla's draft 1.17, apply_pending 0.6 and commit 0.4. The ledger's own split of the chain step with the subset bound is 0.466 ms against 0.421 (about 0.2 ms per round over 3.9 chain steps) plus launch calls of 100-200 us against 55-125 us. That is at most about 0.5 ms of 18.5 (2.7 %), spread over many small items; no single switch, nothing started.

Lever 5, prefill: the fixed cost per request, from the product's own profile lines (runs/main/P/engine.log, 30 replayed requests, LELEKA_SERVE_PROFILE=1)

Per request, ms: prefill.read (the batched read of the uncached tokens), prefill.refill (the lent expert slots refilled after the read: 2,226 copy spans, constant), decode.assemble (host assembly and re-recording the window graphs: capture 54-62, instantiate 27-30, charged to the decode time).

uncached tokens prefill.read prefill.refill decode.assemble
239 485 139 109
266 486 136 106
536 582 140 104
1223 668 140 105
2453 1013 140 101
5440 1229 136 108

A least-squares line through the 29 post-warm-up requests gives 581 ms plus 0.134 ms per token for the read; the smallest tails (239-266 tokens) read in 485 ms, where vanilla's whole prefill for the same size class is 292 ms. Fixed per request: about 490 (read of a small tail) + 139 (refill) + 105 (assemble, inside decode) = about 730 ms, 9 % of a 8.3 s request. Two of the three have a known non-lossy handle:

  • prefill.refill (139 ms): LELEKA_REFILL_DEFER=on (opt-in, never measured: "no GPU result yet (job 904)") queues the same copies inside the decode assembly, after its uploads and before the graph capture. Same bytes, other time; spd-l5a/b run it as variant R against A, 10 pairs.
  • the read's ~490 ms fixed part: no per-stage split of a small tail exists for the 5090 (docs/prefill-throughput.md only has 8192-token chunks and an 80-token laptop run: GDN 1.3 s). spd-l5q is a single profiled replay (variant Q: LELEKA_BRINGUP_TRACE=1, LELEKA_PREFILL_PROFILE_SYNC=1) to get PREFILL-PROFILE lines per chunk; its sync drains make it a diagnosis run, never an A/B arm.

Lever 3, first attempt (variant G, --gpu-budget-gib 31): invalid, the arm opened the same cache

ab-l3, 10 pairs, G against A: decode +0.58 % (CI -0.15..+1.31 %), end-to-end +0.07 %, tokens/round +1.71 %, ms/round +1.10 %, VRAM share 90.33 -> 90.28 %. Both arms logged expert cache 12192 slots: the cache is sized against min(card free, context budget - allocated) (usable_room, original_cache_startup.rs); on the 32 GiB card the card binds, so a larger declared budget adds no slot (the engine saw +177 MiB available for the prefix cache only). The result is a null experiment, not evidence about slots.

Second attempt (ab-l3h, jobs spd-l3c/d): variant H = LELEKA_ORIGINAL_SERVE_DECODE_RESERVE_MIB=130 (opt-in of vram-footprint-5090.md, bitwise: it moves only the cache size) and LELEKA_ORIGINAL_SERVE_VRAM_RESERVE_MIB=500 (from 700): 370 MiB less reserve = about +190 slots, placement class, an upper bound of what ~+200 slots are worth. The slot count has to be read from the H log before the pairs are used.

Lever 5 first A/B (R = LELEKA_REFILL_DEFER=on) and lever 3 H: both invalid, the job script leaked their variables

ab-l5 (10 pairs): decode -0.65 % (CI -1.60..+0.30 %), end-to-end -0.26 % (-1.52..+0.99 %), pf_ms per request 866 -> 870 (mean paired difference +6.9 ms, sd 17.6): no change in the prefill time at all. Cause found afterwards: spd_ab_job.sh unset a fixed list of variables between blocks and the list did not contain LELEKA_REFILL_DEFER, so every A block after the first R block ran with the deferral on (the pair order A R R A A R R A makes half of the A blocks contaminated). The same hole applied to the lever 3 variable pair of H (DECODE_RESERVE_MIB, VRAM_RESERVE_MIB) and to Q. Levers 1, 3-G, 6 and 7 were not affected (their variables, FLOOR and UPX were reset per block). The script now unsets all of them (commit of this section); the contaminated outputs are kept as runs/ab-l5-contaminated and runs/ab-l3h-contaminated and are not evidence. spd-l3e/f (H against A) and spd-l5c/d (R against A) rerun the pairs into runs/ab-l3v2 and runs/ab-l5v2.

Lever 5, where a small tail's prefill goes (prof-l5/Q.1, PREFILL-PROFILE per chunk, PREFILL_PROFILE_SYNC=1, 31 chunks; ms)

tokens in chunk total moe moe.ring gdn qsa input
238 492 374 355 52 46 3
278 558 424 404 66 42 8
541 696 546 522 74 46 7
1,242 738 516 475 108 56 18
1,416 861 601 565 120 83 14

For a tail under about 1,500 tokens 72-80 % of the chunk is moe.ring: the per-layer expert copy ring (48 layers, about 7.4 ms per layer even for 238 tokens, 355 ms in all). It barely grows with the tokens (238 -> 1,416 tokens: +210 ms), which is the fixed cost found in the product's profile lines (about 490 ms of read). GDN, QSA and the input stage together are under 120 ms. The prompt stream (STRATA_PREFILL_STREAM_MIN, 4096 rows) is off for these chunks. Whether the ring is bandwidth-bound (bytes of the non-resident routed experts at 36-47 GB/s) or latency-bound (48 synchronous per-layer round trips) is not known from the existing counters: PREFILL-COPY is only printed for streamed chunks. Code proposal (needs the orchestrator's word): see the report of 2026-11-08.

Graph re-recording per request (decode.assemble, 2026-11-08): what it would take

Per request (product profile lines, 30 replayed requests): decode.assemble 98-109 ms, of which assemble.record_all 83 ms (capture 54-62, instantiate 27-30; nine graphs: windows T = 1..8 and the commit graph, about 6 ms capture + 3 ms instantiate each); assemble.prepare 12, assemble.verifier_new 2, assemble.aggregates 0.75. The decode phase uses every width up to 8 in a long request (T_hist of a 2,444-round request: 187/681/635/523/235/85/56/42 for T = 1..8), so recording only the widths used saves little.

Why the graphs are not kept: a recorded graph holds device pointers, and four things behind them are made per request in AssembleInputs::assemble (original_serve_verifier.rs): the canonical GDN image (original_verify_canonical_gdn(states, histories) allocates and seeds from the session's priors), the verifier bank and its GDN journal (OriginalVerifier::new, bank().gdn_journal), the per-width head/embedding row views and window resources, and the QSA journal that takes the twelve resident index and mapped K/V owners by value from the prompt executor (take_qsa_owners) and gives them back in disassemble. Keeping the verifier between requests therefore needs (1) a persistent, re-seedable canonical GDN image and bank (seed = upload, no allocation), (2) the QSA owners staying with the journal while the prompt path appends to the same buffers, (3) the 'a borrows of DecodeResources (dense and MoE weight caches) to outlive a request, which is a self-referential shape in the present OriginalServeStack, and (4) invalidation when any pointer changes (prefix-cache switch, window-cap fallback, tier reconfigure). Expected gain at best -60..-80 ms per request of about 8,300 (under 1 % end to end); it is a cross-crate ownership change (cuda-driver verifier/bank and engine-qwen35-cuda stack), not a switch.

Decode miss leg, draft + commit, quiet windows: what the P profile lines say (2026-11-08, no new GPU run)

Per round and per group (48 groups per round), from runs/main/P/engine.log (30 profile lines):

window kind rounds' T window.verifier doorbell wait (GPU mixers) pool.cpu (CPU leg on the critical path) cpu.compute per group draft.finish
miss-heavy (lines 2, 7, 26) 4.5-7.0 23.3-26.0 ms 8.8-10.4 ms 12.0-14.1 ms 233-272 us 1.5-2.6 ms
quiet (lines 16, 17) 3.0-3.2 12.1-12.2 ms 8.7-8.9 ms 2.5-2.6 ms 45-47 us 0.93-0.97 ms
  • The CPU leg is serial with the GPU mixers of the next layer (the layer output needs every expert): window time = doorbell wait + pool time + 0.5-0.7 ms sync. It is DRAM-bound (about 39 us per 2 MB expert = 52 GB/s, equal to vanilla's 44 us), so the miss leg is proportional to the number of CPU-computed experts; nothing in the host path adds to it: the fixed host work around a group (split 3, spans 2, publish plan 6, open + zero 5 us) is about 16 us x 48 = 0.8 ms per round and is already small.
  • draft.finish follows the window width (0.93 ms at T 3.0, 2.5 ms at T 6.2): the chain has more steps in a wider window. It is not a per-round defect; the "+1.3 ms" is the width of the adaptive window, the same cost as the "+3.1 ms for +0.65 tokens" of the window price.
  • Same speculation, ours against vanilla (B 178.8 against VANL 208.3 tok/s at 2.90 against 2.95 tokens/round): +2.0 ms per round (+14 %). The largest identified part is the miss count: hit rate 90.8 % against 92.8 % (28 % more misses, about +1.4 ms of CPU leg). Per request, vanilla's hit rate is higher in nearly every request, by up to 7 points in short ones (request 12: 93.2 against 86.4 at 276 tokens; request 26: 87.6 against 78.4), i.e. mostly at the start of a request.
  • The tier policy is the same as the Original's (decay 0.7, margin 1.5, min count 2.0, adapt_every 4, 96 swaps, candidates and victims paired per layer; counts survive across requests; the lent slots are refilled with their own previous experts, so the prefill borrow does not lose learned placement). The differences left are +3 % slots (12,575 against 12,192), the window width and whatever the first rounds of a request see. spd-w1..5 (tier knobs) and spd-l3e/f (slots) measure how much each of them moves the hit rate.

Real-session weighting of the hit-rate gap and the gap by context (owner rule 2026-11-08: weigh by time in the real session, ignore short-request-only gains)

Tools: scripts/e2e/codex/speed/session_hit.py and session_ctx_gap.py (run on the server with python3 -I; read the engine-slice.log of the runs/main/{LEL,VANL} cells, three repetitions each).

  • VRAM hit share weighted by decode time: nestng-crm LEL 91.38 % against VANL 92.41 % (-1.03 points), ttt 92.68 % against 93.38 % (-0.70). By output length of the request (share of decode time in brackets), nestng-crm LEL/VANL: < 600 tokens (10 %/12 %) 86.9/89.9, 600-2000 (33 %/34 %) 90.5/91.6, >= 2000 (58 %/54 %) 92.7/93.5 (-0.9). The 3-8 point gaps of the replay are in the short requests, which carry 10 % of the decode time; in the long ones the gap is about 0.9 point.
  • Price of a point: lever 7 raised the VRAM share by 3.5 points and took 2.0 ms off a round (19.3 -> 17.3) at equal tokens per round, so at most 0.57 ms per round per point (that figure also contains the skipped entries). One point of hit share is therefore at most 0.57 / 3.55 = 0.16 ms per output token: 2.6 % of nestng-crm's 6.14 ms request time per token (1.0 point), 1.8 % of ttt's (0.7 point). That is the ceiling for everything done about the hit rate together (tie order, tier knobs, slots).
  • Gap by context (decode tok/s LEL against VANL, same cells): nestng-crm 0-30k -18.2 %, 30-60k -16.6 %, 60-100k -18.7 %, 100-160k -24.6 % (3 % of the time); ttt 0-30k -16.8 %, 30-60k -20.0 %. The sessions never pass 160k; the gap is flat in context, so there is no long-context hot spot in these two tasks (a 245k session is not in the cells).

Kernel level: what vanilla has on by default and the release does not (2026-11-08; the measured per-kernel table is queued)

Vanilla sm120_series.hpp turns five bitwise switches on for a 12.0 card (SIDE_MIXER=2, ATTN_DAILY, GR_UP75, GR_DOWN_TG=1, GU_SWIGLU) and its tables add the interleaved MMVQ (MMVQ_IL, 2-4 columns, 5-8 on sm_120). Upstream's own number for the set is 13.70 -> 12.23 ms per 4-token round on an RTX PRO 5000 (other hardware). Status in the release: ATTN_DAILY and GU_SWIGLU on since lever 1 (+1.85 % decode paired, bitwise); SIDE_MIXER exists (LELEKA_SM120_SIDE_MIXER), off, measured no gain (KS variants 209.4 against 209.1 tok/s); GR_DOWN_TG we have and better (chain_gr_down_t2w8_nb4 9.7 us against 18.4 us); GR_UP75 partial; the rest below is missing. The remaining estimates are those of docs/upstream-port-plan.md rows 2.1/2.2 (estimates from our microseconds, not measurements), ms per round of about 18:

item estimate ms/round effort numerics
COMMIT_BATCH + state-only GDN commit (commit graph 158 kernels, 0.463 ms) 0.25-0.35 M, seal bitwise (gdn_parity)
GU_SWIGLU sub16 expert kernels beyond the fused launch (window_moe_gu_* are warp-per-row) 0.20-0.35 L, seal bitwise (claimed)
MMVQ_IL interleaved MMVQ 2-4 and 5-8 columns (we run the old head_n*_t*; dense 2.25 ms against a floor of ~2.0) 0.10-0.40 L, seal bitwise (claimed)
HEAD_MIX_MULTI (one multi-token head mix) 0.06-0.10 S bitwise
GR_UP75 delta, batched K/V and indexer append, float4 combine, fused norm+rope 0.05-0.10 each S-M, seal bitwise

Their sum is 1.0-1.4 ms per round, i.e. the "+1.3 ms in quiet windows" of the step profile; none is a single big defect. spd-cuo (ours, shipped package with the lever 1 switches) and spd-cuv (vanilla VANL) take one 15 s CUPTI window each over request 29 of the replay (67k context, 4,741 output tokens), decode_rounds.py --tsv per arm gives the measured per-kernel table.

Lever 5, variant R (LELEKA_REFILL_DEFER=on), clean paired result, 10 blocks (2026-11-08)

Run ab-l5v2 (server /data/leleka-e2e/spd-gap/runs/), A = release package, R = A + refill deferred into the decode assembly, 27 requests per block after the 3-request warm-up, 10 block pairs, ab_report.py:

metric A R diff 95 % CI
decode tok/s 180.19 178.53 -0.92 % -1.63..-0.21 %
end-to-end tok/s 162.93 163.84 +0.56 % -0.15..+1.27 %
ms/round 19.95 20.31 +1.80 % -1.26..+4.87 %
tokens/round 3.59 3.63 +0.87 % -2.69..+4.43 %

Reading: the deferred refill moves prefill time into decode (decode slower by about 0.9 %, significant), the end-to-end gain is +0.56 % and not significant. Not a lever by itself; stays an opt-in, off by default. out_sha identity is not usable in live replay (A/A floor about 10/30), so no identity claim from this run.

Lever 3, variant H (larger VRAM reserves → slot count), clean paired result, 10 blocks (2026-11-09)

Run ab-l3v2, A = release package, H = A with the reserve settings of variant H, 27 requests per block after warm-up, 10 block pairs, ab_report.py:

metric A H diff 95 % CI
decode tok/s 181.00 181.91 +0.51 % -0.19..+1.20 %
end-to-end tok/s 163.07 164.79 +1.06 % -0.38..+2.50 %
ms/round 20.23 19.79 -2.19 % -3.55..-0.83 %
tokens/round 3.66 3.60 -1.69 % -3.33..-0.05 %
VRAM % of routed 90.31 90.75 +0.44 pp +0.19..+0.79 pp

Reading: the extra resident share (+0.44 pp) makes the round shorter (significant), but tokens per round fall by a similar amount (the tier placement differs, accept changes), so decode and end-to-end gains are not significant. Placement-class change: would need a quality gate against the control placement before any default. Not a lever on this evidence.

Kernel level: one CUPTI window of request 29 (67k context), LEL against VANL (2026-11-09)

Runs cupti/CL.1 (release package + lever 1 switches) and cupti/VANL (vanilla 0.2.6, tail skip and CPU prefill share off, no engine-side profile), 15 s over the same replay request (/data/leleka-e2e/spd-gap/runs/cupti/*/win-r29.lct); analysis decode_rounds.py --tsv, scripts/e2e/codex/speed/{cupti_verify_graph,cupti_stream_overlap,kernel_roles}.py. One window per arm, greedy trajectories differ a little: shapes, not CIs.

Round (graph start to start): LEL 17.86 ms, VANL 15.89 ms (-1.98). Verify graph GPU span 13.56 against 11.75 (-1.81); after the verify graph to the next start (draft, commit, host, CPU-leg join) 4.30 against 4.14 (-0.16). Kernels per verify graph 2061 against 2098; idle inside the graph 0.21 against 0.12 ms (launch gaps are negligible). Outside the verify graph: 630 against 147 kernels per round, 5.38 against 4.47 graph executions, 207 against 20 API calls, 121 against 12 copies (71.5 against 23.6 MB), 27.8 against 89 syncs (2.47 against 0.93 ms) per round; the tail they feed is only 0.16 ms longer.

Structure: in LEL the verify graph is on ONE stream (714; kernel sum 13.35 ms = span 13.56 ms, zero overlap). In VANL it forks over 11 streams (kernel sum 13.73 ms, span 11.75 ms): wall time with two or more streams active is 2.03 ms per graph (1.52 expert/shared-expert branches against the main stream, 0.51 the QSA mixer branch: native_mmvq_il + norm_rope on side streams). That 2.03 ms is the verify gap (1.81 ms).

Matched kernels are not slower in LEL: attention leleka_qsa_decode_chunk_daily 18.3 us against attn_chunk_kernel_pre75 17.1, topk 17.3 against 18.0, scores 14.2 against 17.1; draft chain chain_gr_down 11.1 against gr_down_staged 11.5, chain_gr_split 3.1 against 2.9; GDN equal; dense (head_n*, mmvf) 3.9 against 4.6 ms (LEL faster); routed experts at equal entry count: window_moe_down_20 with 40 entries 13.6 us against native_down_multi<20> 17.4 us, sm120_moe_gu_swiglu_22 with 50 entries 12.3 us against vanilla 26 us (with 40). Mean-per-kernel comparisons are distorted by the entry mix (vanilla has many empty 0.7 us launches). CPU/PCIe leg handling in total (flag waits + doorbell + mapped copies + fetch_blobs) 3.25 ms in LEL against 3.08 ms in VANL.

Conclusion: no single kernel explains the gap; the verify graph has no parallel branches. Candidate steps in order: (1) measure the existing GDN SIDE_MIXER at this context (CUPTI window overlap + paired A/B), then port the QSA part (indexer/queries chain, about 0.5 ms of overlap in VANL), then the routed/shared-expert branch (about 1.5 ms of overlap); bitwise (only graph edges change). (2) the draft/commit tail: 0.16 ms.