diff --git a/docs/experiments/step-ledger.md b/docs/experiments/step-ledger.md index 8384fa2f..38a427a1 100644 --- a/docs/experiments/step-ledger.md +++ b/docs/experiments/step-ledger.md @@ -31,16 +31,16 @@ No per-step figure exists for A1-A3; each is a `not measured` row that needs a s | id | step | LEL | VANL | difference | source | owner | status | | --- | --- | ---: | ---: | ---: | --- | --- | --- | | Q8 | request time per output token, prefill + decode | 0.59 + 5.63 = 6.22 ms | 0.36 + 4.61 = 4.97 ms | +1.25 ms (decode +1.02, prefill +0.23) | LOG | both | open | -| Q1 | prefill: time per request at equal uncached tokens (code ladder `LELEKA_PREFILL_LOAN_TIERS`) | 726 ms | 431 ms | +295 ms. Ladder (`LELEKA_PREFILL_LOAN_TIERS=1`) paired on the sparse holder, n=5 blocks: -3.1 s per 30-request session +-0.5; <= 2048 new tokens -151 ms per request (faster in 19 of 19); n=10 (5 + 5 blocks, jobs `ab3` and `prefill-ladder-ab-pairs-6-10`): -3.0 s +-0.3 per 30-request session, median -104 ms per request, <= 2048 new tokens -154 ms (19 of 19 faster), > 2048 tokens -10 ms; identity PASS (chunk residual hashes equal) | LOG | hex-finish | fixed for the ladder part (switch committed in the 5090 profiles); the remaining gap at equal uncached tokens (rows Q2, Q3) stays open | +| Q1 | prefill: time per request at equal uncached tokens (code ladder `LELEKA_PREFILL_LOAN_TIERS`) | 726 ms | 431 ms | +295 ms. Ladder (`LELEKA_PREFILL_LOAN_TIERS=1`) paired on the sparse holder, n=5 blocks: -3.1 s per 30-request session +-0.5; <= 2048 new tokens -151 ms per request (faster in 19 of 19); n=10 (5 + 5 blocks, jobs `ab3` and `prefill-ladder-ab-pairs-6-10`): -3.0 s +-0.3 per 30-request session, median -104 ms per request, <= 2048 new tokens -154 ms (19 of 19 faster), > 2048 tokens -10 ms; identity PASS (chunk residual hashes equal) | LOG | hex-finish | fixed for the ladder part (switch committed in the 5090 profiles); the remaining gap at equal uncached tokens (rows Q2, Q3) stays open 2026-11-12 GROUP e2e A/B of the stage (owner method, one A/B at the end; `prefill-host-stage-start-vs-complete-default-set-group-ab-5-pairs`, pkg-s18, 30 requests, n=5 pairs, order A0 A A A0 A0 A A A0 A0 A): A0 = the built-in profile WITHOUT loan tiers, check merge, park fast, graph reuse and stream 1536 (profile override; the `engine environment` line of up-foreground.txt proves the keys differ) against A = the profile as shipped. TTFT per request, A minus A0: all 30 requests -143.7 ms (-11.2 %, CI -318.8..+31.4; pair 1 is +100 ms, the first boot of the job, the other four pairs -204.5 ms, CI -272..-137); uncached tail 64-1023 (8 requests) -269.5 ms (-31.9 %, CI -293.4..-245.6, 5 of 5 pairs); 1024-4095 (16 requests) -230.2 ms (-19.8 %, CI -294.1..-166.3, 5 of 5); >= 4096 (6 requests) +254.7 ms (CI -457..+967, pair 1 +1,240 ms, the rest -217..+183: not resolved); decode -0.40 % (CI -3.49..+1.98): no regression. The sum of the section deltas (ladder -104, Q7 -96, stream 1536 -45, park -3 = -248 ms per request) is confirmed in direction and in class; realised -144 ms (five pairs) to -205 ms (four pairs). The first run of this group (`prefill-host-complete-default-set-group-ab-5-pairs`) compared the profile with itself (the built-in profile overrides the shell env of the engine since pkg-s14): an A/A, noise floor TTFT +4.0 ms (CI -27.5..+35.5), decode +0.19 % (CI -0.80..+1.52 tok/s). Status: fixed (group e2e confirmed). | | Q2 | prefill latency by uncached tokens (< 64, 64-256, 256-1024, 1024-4096, >= 4096), median ms | 430, 530, 722, 1002, 4405 | 268, 292, 435, 715, 2184 | +162, +238, +287, +287, +2221 | LOG | hex-finish | open AFTER THE STREAM THRESHOLD 2026-11-10: VANL means from the VANL engine logs (`read in X ms`, 3 reps): 64-256 tokens 294 ms (n=121), 256-1024 447 (n=72), 1-4k 820 (n=23), > 4k 2062 (n=8); ours `prefill.read` with `STRATA_PREFILL_STREAM_MIN=1536`: 64-256 about 400-620, 256-1024 521, 1000-1536 729, 1536-4096 830, 4k+ 1245-1500: at parity from 1 to 4k tokens and ahead beyond 4.9k, behind by +75..+170 ms below 1k tokens (VANL reads 64-256 tokens in 294 ms = 14 GB / 50 GB/s with the rest of the chunk hidden under the DMA; ours has the DMA at 45 GB/s and about 130 ms of GDN/QSA unoverlapped). Open: ring prefetch (sub-agent, switch off), U6. | | Q3 | prefill throughput over uncached tokens | 930-1050 tok/s | 1460-1560 tok/s | -35 % | LOG | hex-finish | open see Q2 (2026-11-10): the gap that remains is below 1k tokens, not a throughput gap above it. | | Q4 | prefill: fixed part of the chunk read (code `prefill.read`, 581 ms + 0.134 ms per token; 485 ms for 239 tokens) | 485-581 ms | whole prefill of that size class 292 ms | +193 and more | PROFILE | hex-finish | open: root cause found (see Q5) RING FINDINGS 2026-11-10 (jobs `prefill-ring-host-spans-profile`, `prefill-ring-copied-megabytes-profile`, pkg-s11/s12, 15 requests): `moe.ring` is DMA-bound, not host-bound. Host spans of the copy ring per request with a 1.4k tail: init 10.5 ms (`init_sync` 0.0), stage 50.7, gather 36.3, enqueue 30.1 (about 130 ms, parallel with the DMA), `finish_statuses` (host waits for the GPU/DMA) 335.8 ms; the wait grows about 200 ms fixed + 0.08 ms per tail token. Experts copied over PCIe per request: 7,002 (14.3 GB) at a 279-token tail, 8,794 (18.4 GB) at 1,243, 11,576 (24.0 GB) at 1,454, 12,762 (26.5 GB) at 2,837; 146-266 per layer, 45-55 % of the routed experts are not resident. GB / 45 GB/s = 319, 410, 459, 590 ms vs ring wall 332, 428, 462, ~590: the ring runs at the PCIe rate. So synchronisation fixes (step A: syncs, cuMemGetInfo, gather by 16) buy nothing. Offline prefetch study (`LELEKA_PREFILL_ROUTE_TRACE`, 30 requests): the experts the layer's last 3-16 chunks missed predict the next chunk's missing set with 60 % precision at 150 experts per layer (86 hits), an upper bound of about -150..-190 ms per request for a prefetch under the GDN/QSA stage; not built (complex, 40 % wasted bandwidth). PREFETCH FIRST GPU RUN 2026-11-10 (pkg-s14, `LELEKA_PREFILL_RING_PREFETCH=1`, sub-agent branch merged, default off): 9 of 30 requests failed with `class=InvalidDimension` and the chunk hashes differ (60 PREFILL-R lines vs 31): the implementation is NOT correct yet; driver error trace job queued (`prefill-ring-prefetch-failure-driver-error-trace`). Remains OFF. | -| Q5 | `moe.ring` in a small tail (72-80 % of the chunk, 48 layers x 7.4 ms, 355 ms for 238 tokens) | 355 ms | vanilla reads tails of up to 64 tokens through verify windows | +355 ms for the smallest tails. Root cause: `prompt_options` (`original_serve_stack_prefill_phase.rs`) sets `force_batched: true`; the planner already emits `PromptPath::Verify` actions for tails <= 64 tokens but the executor's `verify_window` hook (`original_prompt_executor_drop.rs:63`) is not implemented | PROFILE `prof-l5` | hex-finish | fixing (design pending) STREAM THRESHOLD 2026-11-10: vanilla streams every non-resident expert (overlapped with the mixers) from 1024-row chunks (`kStreamAllMinDefault`), ours from 4096 (`STRATA_PREFILL_STREAM_MIN`, `settings/kv.rs`, set when the expert cache was off and only 60 % of the experts were routed). Profile `prefill-expert-stream-from-1024-rows-profile` (shipped / 1024 / 256, 15 requests): prefill.read at tails 2,837 / 2,622 / 2,453 / 1,602 / 1,454 tokens 1129 / 1029 / 1001 / 782 / 799 ms became 876 / 863 / 818 / 702 / 702; no change below 1,300 tokens, worse from 256 rows (279 tokens 465 to 747). Threshold 1536. Job `prefill-expert-stream-from-1536-rows-identity-and-profile` (30 requests): PREFILL-R chunk residual hashes IDENTICAL, 31 of 31 (shipped vs stream), no failures; prefill.read by tail class (mean ms, shipped to stream): < 1000 tokens 530 to 521 (-9), 1000-1536 723 to 729 (+6), 1536-4096 1010 to 830 (-180, -17.8 %), > 4096 1245 to 1280 (+35, noise); over 29 warm requests -45 ms per request (prefill.phase 921 to 877). `STRATA_PREFILL_STREAM_MIN=1536` is set in the three 5090 profiles (not the 3080: tier off there, different trade). Two more levers remain (not done): the prefetch of Q4 and vanilla's CPU share (lossy, off in the reference arm). 2026-11-10 ring expert prefetch (`LELEKA_PREFILL_RING_PREFETCH`, `prefill-ring-prefetch-slot-wrap-fixed-identity-and-profile`, pkg-s17 `b800bba09`, 30 requests, stream 1536): the first GPU runs failed 9 of 30 with `stage.slot_not_gathered` at layers 46/47 (sources 410-460 > slots 384: prefetch hits skip staging, the wrap met a live un-gathered slot; fixed by `stage_target`, CPU test sources=460/slots=384). After the fix: identity PASS, 0 failures, chunk residual hashes 31 of 31 identical to the shipped FR.1, in the plain form (PE) and with detached drains (PED). Section delta FAIL: `prefill.read` summed over the 30 requests 26,643 ms (FP.1, shipped) -> 29,228 (PEP, +2,585) and 29,922 (PEDP); in the 11 requests where the prefetch ran it is +60..+190 ms each (mean +124 ms), the other requests are +9 ms (boot noise; request 0, the cold one, +930/+2,046). Counters per request: issued 14.4 GB, hit 8.4-12.9 GB (60-90 %), wasted 1.5-6.0 GB. Reading: the ring is PCIe-DMA-bound (Q4/Q5, 45 GB/s), so reading ahead adds traffic (the wasted share) on the link that is already the limit and gains no overlap. Verdict: stays OFF, not a gain; rows Q4/Q5 close on the sub-1k tail by U6 (expert-major bank, deferred) only. Caveat: arms ran in different boots and packages (pkg-s14 vs pkg-s17), the effect is larger than the +9 ms noise of the unaffected requests. | +| Q5 | `moe.ring` in a small tail (72-80 % of the chunk, 48 layers x 7.4 ms, 355 ms for 238 tokens) | 355 ms | vanilla reads tails of up to 64 tokens through verify windows | +355 ms for the smallest tails. Root cause: `prompt_options` (`original_serve_stack_prefill_phase.rs`) sets `force_batched: true`; the planner already emits `PromptPath::Verify` actions for tails <= 64 tokens but the executor's `verify_window` hook (`original_prompt_executor_drop.rs:63`) is not implemented | PROFILE `prof-l5` | hex-finish | fixing (design pending) STREAM THRESHOLD 2026-11-10: vanilla streams every non-resident expert (overlapped with the mixers) from 1024-row chunks (`kStreamAllMinDefault`), ours from 4096 (`STRATA_PREFILL_STREAM_MIN`, `settings/kv.rs`, set when the expert cache was off and only 60 % of the experts were routed). Profile `prefill-expert-stream-from-1024-rows-profile` (shipped / 1024 / 256, 15 requests): prefill.read at tails 2,837 / 2,622 / 2,453 / 1,602 / 1,454 tokens 1129 / 1029 / 1001 / 782 / 799 ms became 876 / 863 / 818 / 702 / 702; no change below 1,300 tokens, worse from 256 rows (279 tokens 465 to 747). Threshold 1536. Job `prefill-expert-stream-from-1536-rows-identity-and-profile` (30 requests): PREFILL-R chunk residual hashes IDENTICAL, 31 of 31 (shipped vs stream), no failures; prefill.read by tail class (mean ms, shipped to stream): < 1000 tokens 530 to 521 (-9), 1000-1536 723 to 729 (+6), 1536-4096 1010 to 830 (-180, -17.8 %), > 4096 1245 to 1280 (+35, noise); over 29 warm requests -45 ms per request (prefill.phase 921 to 877). `STRATA_PREFILL_STREAM_MIN=1536` is set in the three 5090 profiles (not the 3080: tier off there, different trade). Two more levers remain (not done): the prefetch of Q4 and vanilla's CPU share (lossy, off in the reference arm). 2026-11-10 ring expert prefetch (`LELEKA_PREFILL_RING_PREFETCH`, `prefill-ring-prefetch-slot-wrap-fixed-identity-and-profile`, pkg-s17 `b800bba09`, 30 requests, stream 1536): the first GPU runs failed 9 of 30 with `stage.slot_not_gathered` at layers 46/47 (sources 410-460 > slots 384: prefetch hits skip staging, the wrap met a live un-gathered slot; fixed by `stage_target`, CPU test sources=460/slots=384). After the fix: identity PASS, 0 failures, chunk residual hashes 31 of 31 identical to the shipped FR.1, in the plain form (PE) and with detached drains (PED). Section delta FAIL: `prefill.read` summed over the 30 requests 26,643 ms (FP.1, shipped) -> 29,228 (PEP, +2,585) and 29,922 (PEDP); in the 11 requests where the prefetch ran it is +60..+190 ms each (mean +124 ms), the other requests are +9 ms (boot noise; request 0, the cold one, +930/+2,046). Counters per request: issued 14.4 GB, hit 8.4-12.9 GB (60-90 %), wasted 1.5-6.0 GB. Reading: the ring is PCIe-DMA-bound (Q4/Q5, 45 GB/s), so reading ahead adds traffic (the wasted share) on the link that is already the limit and gains no overlap. Verdict: stays OFF, not a gain; rows Q4/Q5 close on the sub-1k tail by U6 (expert-major bank, deferred) only. Caveat: arms ran in different boots and packages (pkg-s14 vs pkg-s17), the effect is larger than the +9 ms noise of the unaffected requests. 2026-11-12 GROUP e2e A/B of the stage (owner method, one A/B at the end; `prefill-host-stage-start-vs-complete-default-set-group-ab-5-pairs`, pkg-s18, 30 requests, n=5 pairs, order A0 A A A0 A0 A A A0 A0 A): A0 = the built-in profile WITHOUT loan tiers, check merge, park fast, graph reuse and stream 1536 (profile override; the `engine environment` line of up-foreground.txt proves the keys differ) against A = the profile as shipped. TTFT per request, A minus A0: all 30 requests -143.7 ms (-11.2 %, CI -318.8..+31.4; pair 1 is +100 ms, the first boot of the job, the other four pairs -204.5 ms, CI -272..-137); uncached tail 64-1023 (8 requests) -269.5 ms (-31.9 %, CI -293.4..-245.6, 5 of 5 pairs); 1024-4095 (16 requests) -230.2 ms (-19.8 %, CI -294.1..-166.3, 5 of 5); >= 4096 (6 requests) +254.7 ms (CI -457..+967, pair 1 +1,240 ms, the rest -217..+183: not resolved); decode -0.40 % (CI -3.49..+1.98): no regression. The sum of the section deltas (ladder -104, Q7 -96, stream 1536 -45, park -3 = -248 ms per request) is confirmed in direction and in class; realised -144 ms (five pairs) to -205 ms (four pairs). The first run of this group (`prefill-host-complete-default-set-group-ab-5-pairs`) compared the profile with itself (the built-in profile overrides the shell env of the engine since pkg-s14): an A/A, noise floor TTFT +4.0 ms (CI -27.5..+35.5), decode +0.19 % (CI -0.80..+1.52 tok/s). Status: fixed (group e2e confirmed). | | B1 | prefill GDN and QSA stages of a small tail (per stage split) | `prof-l5/Q.1` has moe, moe.ring, gdn, qsa, input per chunk | none for vanilla | n/a | PROFILE | hex-finish | open | | B2 | first token sampling and publication after prefill | not measured | not measured | n/a | none | hex-finish | open | | Q6 | `prefill.refill` of the lent expert slots (2,226 copy spans) | 137-140 ms per request | none | +138 ms; deferring it into the decode assembly (`LELEKA_REFILL_DEFER`): decode -0.92 % (CI -1.63..-0.21), end-to-end +0.56 % (CI -0.15..+1.27) | PROFILE, A/B `ab-l5v2` | hex-finish | fixing PROFILE 2026-11-10 (job `prefill-refill-deferred-with-default-set-profile`, default set + stream 1536, YP without / YRP with `LELEKA_REFILL_DEFER`, 14 warm requests each): `prefill.refill` 93.9 vs 70.7 ms and `refill.sync` 23.3 vs 23.3, `refill.queue` 70.0 vs 70.2 ms (the host time to issue the copies stays, now behind the decode assembly); `decode.reuse` 13.0 vs 13.0; wall per output token 5.95 vs 6.01 ms (sums 155.0 vs 154.7 s, 26,047 vs 25,729 tokens): no gain from the deferral on top of Q7 (the host assembly it overlapped with is 13 ms now, not 98). The cost is HOST issue of about 1,000 slots x 3 `cuMemcpyHtoDAsync` = 70 us per slot; plan: one `cuMemcpyBatchAsync_v2` per few hundred copies (driver 595.99 exports it), bitwise (same bytes and order), switch `LELEKA_REFILL_BATCH` off, in progress as a sub-agent branch (host-side tests + ignored GPU test); expected -50..-60 ms per request. `LELEKA_REFILL_DEFER` stays off. BATCH COPY 2026-11-10 (job `prefill-ring-prefetch-and-refill-batch-identity-and-profile`, pkg-s14, `LELEKA_REFILL_BATCH=1`): production refill with the batch: `refill.batch_calls` 6, `batch_copies` 2,997, `per_copy` 0, `refill.queue` 41.7 to 1.0 ms but `refill.sync` 23.8 to 57.0 ms, `prefill.refill` 65.9 to 58.3 ms (-7.6 ms per request): the host issue was already overlapped with the DMA, the refill is bytes-bound (999 slots x 2 MB = 2 GB = 45 ms at 45 GB/s). R hashes of all chunks identical to shipped (31 of 31), 0 failed requests. The isolated GPU test `refill_batch_copy_gpu_slots_equal_per_copy` (Vec registered by cuMemHostRegister, 3,072 pieces) faults with error 719 on the batch arm while the per-copy arm is exact: the known driver bug of the batch entry with page-locked sources (docs/windows.md, 3080), here on driver 595.99 too; the production bank evidently takes another route. Verdict: -7.6 ms is too small to justify a driver entry that faults in some memory kinds; `LELEKA_REFILL_BATCH` stays OFF; Q6 stays bytes-bound (floor = lent slots x 2 MB / 45 GB/s). 2026-11-10 driver check `prefill-raw-batch-copy-page-locked-driver-check` (5090, driver 595.99): `pcie_copy_gpu_raw_batch_page_locked`, `..._raw_batch_mixed`, `pcie_copy_gpu_production_page_locked`, `..._production_pageable` all pass (4/4, ~0.9 s each), so a raw batched copy from page-locked memory works on this driver; the CUDA 719 of the slots-equal GPU test is specific to that test's registered Vec, not to batch copy. Switch stays OFF (gain -7.6 ms, bytes-bound). | -| Q7 | `decode.assemble` (graph re-recording per request: `record_all` 83 ms of 98-109 ms, nine graphs, 54-62 capture + 27-30 instantiate) | 98-109 ms per request | none (vanilla keeps its graphs) | +98-109 ms | PROFILE | both | fixing (code 7570247d9, wired behind `LELEKA_DECODE_GRAPH_REUSE`, identity and section delta pending on the GPU): the speed session's handles, `park`/`rearm`/`reseed` and this side's key, `GraphReuse::begin`/`end`, QSA owner loan, drafter decision, shared-expert pin and stack wiring are merged and tested host-side and on the lifecycle fake; compare `decode.assemble` with `decode.reuse`, `decode.disassemble` with `decode.keep`, `record.*`, the first-draft capture, VRAM at the low-water mark; design and scenarios `docs/experiments/decode-graph-reuse.md` GPU (job `host-decode-graph-reuse-identity-and-profile`, package `pkg-s6` = our wiring + the speed session's handles/re-arm, 4 profiled boots x 30 requests): REUSE WORKS. Per request, shipped (AP.1/AP.2): `decode.assemble` 103.5/104.1 ms (`record_all` 86.5/86.9, capture 34.0, instantiate 22.2) + `decode.disassemble` 14.7/12.3 = 118/116 ms. With `LELEKA_DECODE_GRAPH_REUSE=1` (RGP.1/RGP.2): `decode.assemble` 6.0 + `decode.reuse` 14.0/13.8 + `decode.keep` 0.7/0.6 = 20.7/20.4 ms, `record_all` 5.4 (the one full assembly of the first request averaged over 30), `record.capture` 1.1, `record.instantiate` 1.3: section delta about -97 ms per request (a reused request costs ~18 ms: re-arm with the 118 MB reseed). 29 of 30 requests reused, 1 full assembly, zero `decode graphs recorded again` lines (no retire), all HTTP 200. VRAM low-water unchanged (535 MiB free in both). ms/token (unpaired, free-running): 6.18/6.19 shipped against 6.10/6.12 with reuse. Identity: teacher-forced bitwise job queued (`host-draft-switches-teacher-forced-identity`, P4); free-running hashes cannot decide it BITWISE IDENTITY PASS (job `host-draft-switches-teacher-forced-identity`, test binary `rt-pf9`, night5-long-256k, teacher forced, 5 requests to 243k, 240 forced tokens each): top-16 logprob rows 2057 of 2057 identical in both arms, draft trace 1036 of 1036 lines identical, A/A floor identical (q_tail_gate PASS, d_top1 0.0000, flips 0). FIXED for the section: -97 ms per request (118 to 20.7 ms) and identity; ON by default in the three 5090 profiles (`LELEKA_DECODE_GRAPH_REUSE=1`, test `the_switches_that_passed_the_bitwise_gate_are_on_for_the_5090_profiles_only`); the end-to-end paired A/B of the group is still to come GROUP A/B 2026-11-10 (job `host-draft-switches-group-ab`, n=10 per arm, 30 requests each, free-running): the group arm X = chain pipeline + check merge + park fast (reuse RG is NOT in X; its own paired e2e arm is still to run). Decode ms/token A 6.33, X 6.30, paired -0.03 +-0.08 (no regression, no gain visible); session time A 329 +-19 s, X 340 +-20 s but output lengths differ run to run (free-running), so time per equal-output pair is the fair figure: 66 pairs with output within 2 %, mean X-A -73 ms (se 46), median -5 ms. Section deltas stand (Q7 -97 ms per request); the e2e effect is below the A/B noise (about 3 % of session time), CLOSED on section + bitwise identity; ON in the three 5090 profiles; e2e confirmation by RG paired arm pending. SECTION DELTA 2026-11-10 (job `host-set-profile-paired-section-deltas`, one profiled boot per arm, 15 requests, package pkg-s9; AP shipped, YP = check merge + park fast + graph reuse): `decode.assemble` 97.8 ms median + `decode.disassemble` 12.0 ms (= 109.8 ms per request) became `decode.reuse` 13.1 ms + `decode.keep` 0.63 ms (= 13.8 ms) on 14 of 15 requests; the first request records (assemble 178 ms, `record_all` 162 ms vs 81.6 ms shipped, the one-time cost of building the held set); over all 15: 1,726 ms to 373 ms = -90 ms per request including the cold one (-96 ms on the 14 warm ones). Matches the earlier -97 ms. FIXED: section delta + bitwise identity (teacher-forced 2057/2057 rows); ON in the 5090 profiles. | -| B3 | prefill: prefix-cache parking in the request path (code `prefix.export_kv` 19.0 + `export_index` 2.3 + `park_tail` 14.7 + `park_block` 6.5 + `after_prefill` 9.4 + `after_chunk` 0.7 + `after_decode` 12.5, mean per request) | 65.1 ms | vanilla parks the conversation (checkpoints) inside its own prompt time, not separable | n/a until the instrumented vanilla | PROFILE `runs/dc1` | hex-finish | fixing (code a88a77b25, switches `LELEKA_PREFIX_PARK_FAST=1` and `LELEKA_PREFIX_PARK_ASYNC=1`, both off by default, identity and section delta pending). Reading of the code: the seven listed spans are nested, not additive (`export_kv` and `export_index` sit inside `park_block` and `park_tail`, which sit inside `after_prefill`, `after_chunk` and `after_decode`), so the request-path total is `after_prefill` + `after_chunk` + `after_decode` = 22.6 ms, not 65.1 ms. FAST: one context drain per park instead of 12, K/V pages copied into unzeroed vectors, index rows take the device-read staging as the result (same bytes; compare `prefix.export_kv` and `prefix.export_index`, new `prefix.export_drain`; the sub-spans `export.copy_fast` and `export.index_copy_fast` replace `export.sync`, `export.alloc`, `export.copy`, `export.index_alloc`, `export.index_copy`). ASYNC (with `--prefix-cache-tail reply`): the `after_decode` part (12.5 ms) is taken after the terminal event of the request, before the prefix summary and before the next request, and reported on the line `DBG profile park_deferred` (sum the `request` and `park_deferred` lines for an equal-work comparison); the tail node is in the store before the next request exactly as before. Not deferred: `after_prefill` and `after_chunk` (the last page also holds cells the decode overwrites and the recurrent state the decode advances, so a later park gives other bytes). Not done: pooled buffers (the store retains the vectors) and threaded copies of the 12 layers. GPU run 2026-11-09 (`prefill-prefix-park-identity-and-profile`): FAST kept the prefix reuse and cut the three `after_*` sections by 2.0 ms (23.5 to 21.5; the first-touch page faults of fresh host memory dominate and stay); ASYNC was refused by the runner (the busy mark `active` was still set while the owner ran the deferred step, so the next request got `runtime_capacity`). Fixed in the next commit: the busy mark is released before the deferred step, so a request that arrives meanwhile is admitted and waits in the control queue (test `a_request_arriving_during_the_deferred_tail_is_admitted_and_queued_not_refused`); pass criterion for the rerun: `cached_tokens` equal to shipped for all 30 and no `engine refused` in requests.log. Pre-faulted buffer pool not built: the store keeps every parked vector, so a pool is the store budget held pre-touched (tens of GiB, or sizes that do not match the variable tail) and needs a store free list or a slab type; allocator tuning (`MALLOC_TOP_PAD_`, `MALLOC_TRIM_THRESHOLD_`) can be tried without code BITWISE IDENTITY PASS (job `host-draft-switches-teacher-forced-identity`, test binary `rt-pf9`, night5-long-256k, teacher forced, 5 requests to 243k, 240 forced tokens each): top-16 logprob rows 2057 of 2057 identical in both arms, draft trace 1036 of 1036 lines identical, A/A floor identical (q_tail_gate PASS, d_top1 0.0000, flips 0). FAST: identity PASS and section -2.0 ms per request: ON by default in the three 5090 profiles (`LELEKA_PREFIX_PARK_FAST=1`); ASYNC is not in the default (admission fix queued for the rerun `prefill-prefix-park-async-fix-identity-and-profile`) ASYNC rerun 2026-11-10 (job `prefill-prefix-park-async-fix-identity-and-profile`, after fix 955a72e37): no `engine_refused`/`runtime_capacity` in any of the 8 boots; `cached_tokens` equal to the shipped arm for 30 of 30 requests in every arm (1,202,318 total); `prefix.after_response` 8.7 ms median on the `park_deferred` line, the work leaves the request path (`prefix.export_kv` 17.0 to 7.6 ms median, `park_tail` 13.7-15.2 to 6.3 ms) but `prefix.after_prefill` is 9.6/9.9 ms vs 10.5/11.1 (shipped) and 9.4 (FAST): the request path gains nothing measurable beyond FAST. FAST CLOSED (bitwise identity + section delta, ON in 5090 profiles); ASYNC stays OFF (no delta beyond FAST, adds a deferred step). SECTION DELTA 2026-11-10 (same job): `prefix.after_prefill` + `prefix.after_decode` per request AP 13.30 + 10.01 = 23.3 ms, YP 13.01 + 7.21 = 20.2 ms (-3.1 ms, -13 %; earlier job: -2.0 ms); `prefix.park_tail` 16.8 to 15.3 ms, `prefix.export_drain` 3 context drains per park instead of 12 (counter 0.00/3), `prefix.export_index` 3.50 to 2.89 ms; `prefix.export_kv` 22.6 to 25.3 ms (the copies themselves are the same bytes). FAST FIXED: section delta -2..-3 ms per request + bitwise identity; ON in the 5090 profiles. ASYNC stays OFF. | +| Q7 | `decode.assemble` (graph re-recording per request: `record_all` 83 ms of 98-109 ms, nine graphs, 54-62 capture + 27-30 instantiate) | 98-109 ms per request | none (vanilla keeps its graphs) | +98-109 ms | PROFILE | both | fixing (code 7570247d9, wired behind `LELEKA_DECODE_GRAPH_REUSE`, identity and section delta pending on the GPU): the speed session's handles, `park`/`rearm`/`reseed` and this side's key, `GraphReuse::begin`/`end`, QSA owner loan, drafter decision, shared-expert pin and stack wiring are merged and tested host-side and on the lifecycle fake; compare `decode.assemble` with `decode.reuse`, `decode.disassemble` with `decode.keep`, `record.*`, the first-draft capture, VRAM at the low-water mark; design and scenarios `docs/experiments/decode-graph-reuse.md` GPU (job `host-decode-graph-reuse-identity-and-profile`, package `pkg-s6` = our wiring + the speed session's handles/re-arm, 4 profiled boots x 30 requests): REUSE WORKS. Per request, shipped (AP.1/AP.2): `decode.assemble` 103.5/104.1 ms (`record_all` 86.5/86.9, capture 34.0, instantiate 22.2) + `decode.disassemble` 14.7/12.3 = 118/116 ms. With `LELEKA_DECODE_GRAPH_REUSE=1` (RGP.1/RGP.2): `decode.assemble` 6.0 + `decode.reuse` 14.0/13.8 + `decode.keep` 0.7/0.6 = 20.7/20.4 ms, `record_all` 5.4 (the one full assembly of the first request averaged over 30), `record.capture` 1.1, `record.instantiate` 1.3: section delta about -97 ms per request (a reused request costs ~18 ms: re-arm with the 118 MB reseed). 29 of 30 requests reused, 1 full assembly, zero `decode graphs recorded again` lines (no retire), all HTTP 200. VRAM low-water unchanged (535 MiB free in both). ms/token (unpaired, free-running): 6.18/6.19 shipped against 6.10/6.12 with reuse. Identity: teacher-forced bitwise job queued (`host-draft-switches-teacher-forced-identity`, P4); free-running hashes cannot decide it BITWISE IDENTITY PASS (job `host-draft-switches-teacher-forced-identity`, test binary `rt-pf9`, night5-long-256k, teacher forced, 5 requests to 243k, 240 forced tokens each): top-16 logprob rows 2057 of 2057 identical in both arms, draft trace 1036 of 1036 lines identical, A/A floor identical (q_tail_gate PASS, d_top1 0.0000, flips 0). FIXED for the section: -97 ms per request (118 to 20.7 ms) and identity; ON by default in the three 5090 profiles (`LELEKA_DECODE_GRAPH_REUSE=1`, test `the_switches_that_passed_the_bitwise_gate_are_on_for_the_5090_profiles_only`); the end-to-end paired A/B of the group is still to come GROUP A/B 2026-11-10 (job `host-draft-switches-group-ab`, n=10 per arm, 30 requests each, free-running): the group arm X = chain pipeline + check merge + park fast (reuse RG is NOT in X; its own paired e2e arm is still to run). Decode ms/token A 6.33, X 6.30, paired -0.03 +-0.08 (no regression, no gain visible); session time A 329 +-19 s, X 340 +-20 s but output lengths differ run to run (free-running), so time per equal-output pair is the fair figure: 66 pairs with output within 2 %, mean X-A -73 ms (se 46), median -5 ms. Section deltas stand (Q7 -97 ms per request); the e2e effect is below the A/B noise (about 3 % of session time), CLOSED on section + bitwise identity; ON in the three 5090 profiles; e2e confirmation by RG paired arm pending. SECTION DELTA 2026-11-10 (job `host-set-profile-paired-section-deltas`, one profiled boot per arm, 15 requests, package pkg-s9; AP shipped, YP = check merge + park fast + graph reuse): `decode.assemble` 97.8 ms median + `decode.disassemble` 12.0 ms (= 109.8 ms per request) became `decode.reuse` 13.1 ms + `decode.keep` 0.63 ms (= 13.8 ms) on 14 of 15 requests; the first request records (assemble 178 ms, `record_all` 162 ms vs 81.6 ms shipped, the one-time cost of building the held set); over all 15: 1,726 ms to 373 ms = -90 ms per request including the cold one (-96 ms on the 14 warm ones). Matches the earlier -97 ms. FIXED: section delta + bitwise identity (teacher-forced 2057/2057 rows); ON in the 5090 profiles. 2026-11-12 GROUP e2e A/B of the stage (owner method, one A/B at the end; `prefill-host-stage-start-vs-complete-default-set-group-ab-5-pairs`, pkg-s18, 30 requests, n=5 pairs, order A0 A A A0 A0 A A A0 A0 A): A0 = the built-in profile WITHOUT loan tiers, check merge, park fast, graph reuse and stream 1536 (profile override; the `engine environment` line of up-foreground.txt proves the keys differ) against A = the profile as shipped. TTFT per request, A minus A0: all 30 requests -143.7 ms (-11.2 %, CI -318.8..+31.4; pair 1 is +100 ms, the first boot of the job, the other four pairs -204.5 ms, CI -272..-137); uncached tail 64-1023 (8 requests) -269.5 ms (-31.9 %, CI -293.4..-245.6, 5 of 5 pairs); 1024-4095 (16 requests) -230.2 ms (-19.8 %, CI -294.1..-166.3, 5 of 5); >= 4096 (6 requests) +254.7 ms (CI -457..+967, pair 1 +1,240 ms, the rest -217..+183: not resolved); decode -0.40 % (CI -3.49..+1.98): no regression. The sum of the section deltas (ladder -104, Q7 -96, stream 1536 -45, park -3 = -248 ms per request) is confirmed in direction and in class; realised -144 ms (five pairs) to -205 ms (four pairs). The first run of this group (`prefill-host-complete-default-set-group-ab-5-pairs`) compared the profile with itself (the built-in profile overrides the shell env of the engine since pkg-s14): an A/A, noise floor TTFT +4.0 ms (CI -27.5..+35.5), decode +0.19 % (CI -0.80..+1.52 tok/s). Status: fixed (group e2e confirmed). | +| B3 | prefill: prefix-cache parking in the request path (code `prefix.export_kv` 19.0 + `export_index` 2.3 + `park_tail` 14.7 + `park_block` 6.5 + `after_prefill` 9.4 + `after_chunk` 0.7 + `after_decode` 12.5, mean per request) | 65.1 ms | vanilla parks the conversation (checkpoints) inside its own prompt time, not separable | n/a until the instrumented vanilla | PROFILE `runs/dc1` | hex-finish | fixing (code a88a77b25, switches `LELEKA_PREFIX_PARK_FAST=1` and `LELEKA_PREFIX_PARK_ASYNC=1`, both off by default, identity and section delta pending). Reading of the code: the seven listed spans are nested, not additive (`export_kv` and `export_index` sit inside `park_block` and `park_tail`, which sit inside `after_prefill`, `after_chunk` and `after_decode`), so the request-path total is `after_prefill` + `after_chunk` + `after_decode` = 22.6 ms, not 65.1 ms. FAST: one context drain per park instead of 12, K/V pages copied into unzeroed vectors, index rows take the device-read staging as the result (same bytes; compare `prefix.export_kv` and `prefix.export_index`, new `prefix.export_drain`; the sub-spans `export.copy_fast` and `export.index_copy_fast` replace `export.sync`, `export.alloc`, `export.copy`, `export.index_alloc`, `export.index_copy`). ASYNC (with `--prefix-cache-tail reply`): the `after_decode` part (12.5 ms) is taken after the terminal event of the request, before the prefix summary and before the next request, and reported on the line `DBG profile park_deferred` (sum the `request` and `park_deferred` lines for an equal-work comparison); the tail node is in the store before the next request exactly as before. Not deferred: `after_prefill` and `after_chunk` (the last page also holds cells the decode overwrites and the recurrent state the decode advances, so a later park gives other bytes). Not done: pooled buffers (the store retains the vectors) and threaded copies of the 12 layers. GPU run 2026-11-09 (`prefill-prefix-park-identity-and-profile`): FAST kept the prefix reuse and cut the three `after_*` sections by 2.0 ms (23.5 to 21.5; the first-touch page faults of fresh host memory dominate and stay); ASYNC was refused by the runner (the busy mark `active` was still set while the owner ran the deferred step, so the next request got `runtime_capacity`). Fixed in the next commit: the busy mark is released before the deferred step, so a request that arrives meanwhile is admitted and waits in the control queue (test `a_request_arriving_during_the_deferred_tail_is_admitted_and_queued_not_refused`); pass criterion for the rerun: `cached_tokens` equal to shipped for all 30 and no `engine refused` in requests.log. Pre-faulted buffer pool not built: the store keeps every parked vector, so a pool is the store budget held pre-touched (tens of GiB, or sizes that do not match the variable tail) and needs a store free list or a slab type; allocator tuning (`MALLOC_TOP_PAD_`, `MALLOC_TRIM_THRESHOLD_`) can be tried without code BITWISE IDENTITY PASS (job `host-draft-switches-teacher-forced-identity`, test binary `rt-pf9`, night5-long-256k, teacher forced, 5 requests to 243k, 240 forced tokens each): top-16 logprob rows 2057 of 2057 identical in both arms, draft trace 1036 of 1036 lines identical, A/A floor identical (q_tail_gate PASS, d_top1 0.0000, flips 0). FAST: identity PASS and section -2.0 ms per request: ON by default in the three 5090 profiles (`LELEKA_PREFIX_PARK_FAST=1`); ASYNC is not in the default (admission fix queued for the rerun `prefill-prefix-park-async-fix-identity-and-profile`) ASYNC rerun 2026-11-10 (job `prefill-prefix-park-async-fix-identity-and-profile`, after fix 955a72e37): no `engine_refused`/`runtime_capacity` in any of the 8 boots; `cached_tokens` equal to the shipped arm for 30 of 30 requests in every arm (1,202,318 total); `prefix.after_response` 8.7 ms median on the `park_deferred` line, the work leaves the request path (`prefix.export_kv` 17.0 to 7.6 ms median, `park_tail` 13.7-15.2 to 6.3 ms) but `prefix.after_prefill` is 9.6/9.9 ms vs 10.5/11.1 (shipped) and 9.4 (FAST): the request path gains nothing measurable beyond FAST. FAST CLOSED (bitwise identity + section delta, ON in 5090 profiles); ASYNC stays OFF (no delta beyond FAST, adds a deferred step). SECTION DELTA 2026-11-10 (same job): `prefix.after_prefill` + `prefix.after_decode` per request AP 13.30 + 10.01 = 23.3 ms, YP 13.01 + 7.21 = 20.2 ms (-3.1 ms, -13 %; earlier job: -2.0 ms); `prefix.park_tail` 16.8 to 15.3 ms, `prefix.export_drain` 3 context drains per park instead of 12 (counter 0.00/3), `prefix.export_index` 3.50 to 2.89 ms; `prefix.export_kv` 22.6 to 25.3 ms (the copies themselves are the same bytes). FAST FIXED: section delta -2..-3 ms per request + bitwise identity; ON in the 5090 profiles. ASYNC stays OFF. 2026-11-12 GROUP e2e A/B of the stage (owner method, one A/B at the end; `prefill-host-stage-start-vs-complete-default-set-group-ab-5-pairs`, pkg-s18, 30 requests, n=5 pairs, order A0 A A A0 A0 A A A0 A0 A): A0 = the built-in profile WITHOUT loan tiers, check merge, park fast, graph reuse and stream 1536 (profile override; the `engine environment` line of up-foreground.txt proves the keys differ) against A = the profile as shipped. TTFT per request, A minus A0: all 30 requests -143.7 ms (-11.2 %, CI -318.8..+31.4; pair 1 is +100 ms, the first boot of the job, the other four pairs -204.5 ms, CI -272..-137); uncached tail 64-1023 (8 requests) -269.5 ms (-31.9 %, CI -293.4..-245.6, 5 of 5 pairs); 1024-4095 (16 requests) -230.2 ms (-19.8 %, CI -294.1..-166.3, 5 of 5); >= 4096 (6 requests) +254.7 ms (CI -457..+967, pair 1 +1,240 ms, the rest -217..+183: not resolved); decode -0.40 % (CI -3.49..+1.98): no regression. The sum of the section deltas (ladder -104, Q7 -96, stream 1536 -45, park -3 = -248 ms per request) is confirmed in direction and in class; realised -144 ms (five pairs) to -205 ms (four pairs). The first run of this group (`prefill-host-complete-default-set-group-ab-5-pairs`) compared the profile with itself (the built-in profile overrides the shell env of the engine since pkg-s14): an A/A, noise floor TTFT +4.0 ms (CI -27.5..+35.5), decode +0.19 % (CI -0.80..+1.52 tok/s). Status: fixed (group e2e confirmed). | | B4 | decode hand-over: tear-down of the request (code `decode.disassemble`) | 11.7 ms per request | none | +11.7 ms | PROFILE `runs/dc1` | hex-finish | open | | B5 | host: admission of CPU work (code `cpu.admit`, 819 calls per request) | 43.2 ms per request | not measured | n/a | PROFILE `runs/dc1` | hex-finish | open | @@ -59,7 +59,7 @@ Round-level totals first (they are the sum of the steps below). | id | step | LEL | VANL | difference | source | owner | status | | --- | --- | ---: | ---: | ---: | --- | --- | --- | | O9 | draft: chain steps and the host idle between them (code `LELEKA_DRAFT_CHAIN_PIPELINE`) | 0.272 ms per round (2.38 boundaries x 114 us) | idle inside the draft 0.52 ms on 4.5 streams (draft span at equal steps: 1.83 against 1.85) | +0.27 | ORCH | hex-finish | fixing: S1 `LELEKA_DRAFT_CHAIN_PIPELINE` (code `1ab37e408`, opt-in; all chain steps of a greedy draft with min_p 0 enqueued back to back, one drain, flags read once); package `pkg-s1`, identity and profile pair job `host-draft-chain-one-pass-identity`, paired A/B job `host-draft-chain-one-pass-ab` GPU (job `host-draft-chain-gate-diagnosis`, 8,377 drafts): `mtp.chain_gate.min_p` for ALL of them: the adaptive plan gives every round a positive `min_p` (the chain stops at the first step whose probability is below it), so the pipelined path (greedy, `min_p` 0) never engages in production; `mtp.chain_step` stays 0.480 ms x 2.66 steps per round. Pipelining a chain with an early stop would enqueue steps the sequential path never runs (each ~0.45 ms of GPU) against a gain of ~0.1 ms per boundary, so it is a loss without a device-side stop. S1 stays off, parked; the remaining 0.272 ms per round of host turnaround is open for cheaper per-step sync | -| O8 | draft: finite and q8 guard checks of the MTP ring (code `mtp_original_finite` 158.8 x 0.87 us, `mtp_original_q8_guard` 28 x 0.87 us per round, 186.8 launches) | 0.162 | none | +0.162 | CUPTI | hex-finish | fixing (code 306b39807, switch `LELEKA_DRAFT_CHECK_MERGE`, off by default; identity and section delta pending): S2' launches every run of ADJACENT checks of a draft step program as one `mtp_original_check_batch` (new sealed asset `mtp_original_check_batch.ptx`; each entry keeps its own buffer, count, kind and status word, so the status words are the separate launches' words). Per step 48 check launches, 3 runs (prefix guards after the GR block 5, tail after the MLP GR 5, tail after the shared gate and up 2): 12 launches become 3, 9 fewer per step, 36 per round at 4 steps (expect `mtp_original_finite` 158.8 to about 111 and `mtp_original_q8_guard` 28 unchanged per round (the merged runs hold finite checks only), plus about 12 `mtp_original_check_batch` launches, net 36 fewer; the upper bound of the gain is about 0.05 ms per round, no claim). Not done: moving a check across another command (deferral to the end of the chain): the checked buffers `qcur`, `r`, `xn`, `lo` are overwritten in place between their checks and the program has no write-set table, so it needs one first. Proofs: `cuda-model` `draft_check_batch` (the merged schedule expands to the separate one, and a NaN/Inf at the edges and middle of every buffer after every kernel leaves identical status words in a simulated step), driver tests on the real command lists, GPU test `check_batch_program_gpu` (`--ignored`, job `draft-check-merge-gpu-proof`) GPU: detection test PASS (73 cases: NaN/+Inf/-Inf in every buffer and Q8 scale, 72 raise a flag, 0 differ from the separate launches); step graph 114 -> 105 nodes (-9 per step, `DBG mtp chain-step graph`, job `host-draft-chain-gate-diagnosis` MCP against AP); section: `draft.finish` 1.392 -> 1.300 ms per round (single boot each, not paired: 6390 and 5744 rounds); bitwise identity under teacher forcing queued (`host-draft-switches-teacher-forced-identity`, P2). The free-running replay cannot decide identity: draft traces of DT, MT and XT diverge at the 12th draft and shipped against shipped differs across boots BITWISE IDENTITY PASS (job `host-draft-switches-teacher-forced-identity`, test binary `rt-pf9`, night5-long-256k, teacher forced, 5 requests to 243k, 240 forced tokens each): top-16 logprob rows 2057 of 2057 identical in both arms, draft trace 1036 of 1036 lines identical, A/A floor identical (q_tail_gate PASS, d_top1 0.0000, flips 0). Check merge: identity PASS, step graph 114 to 105 nodes: ON by default in the three 5090 profiles (`LELEKA_DRAFT_CHECK_MERGE=1`); the paired section delta stays to be read from the group A/B (`host-draft-switches-group-ab`) GROUP A/B 2026-11-10: see Q7 row (X arm includes check merge): no regression, ms/token paired -0.03 +-0.08. Identity bitwise PASS (teacher-forced, 1036/1036 draft lines); ON in the three 5090 profiles. The paired `draft.finish` delta was not profiled in that group job (no profile arm): a profiled arm X vs A is the remaining step for the section number. SECTION DELTA 2026-11-10 (same job, per call over 8,697 / 9,518 / 7,771 draft rounds): `draft.finish` AP 1.548 ms, MCP (check merge only) 1.494 ms (-0.054 ms, -3.5 %), YP (the complete set) 1.577 ms (+0.029 ms, +1.9 %); `gpu.mtp_chain_step` 0.458 / 0.452 / 0.453 ms per step and `mtp.chain_step` 0.488 / 0.480 / 0.481 equal in all three. One boot per arm cannot resolve a 2-4 % difference (boot-to-boot spread of this profile is about 3 %), and YP does not reproduce MCP's gain: the section delta is at most -0.054 ms per round (about -30 ms per request at 580 rounds), not resolved. CLOSED on bitwise identity (1036/1036 draft lines) and the graph-node count (114 to 105); no regression found; ON in the 5090 profiles. A resolved per-round number would need 3 or more boots per arm (not scheduled: owner rule 2026-11-10). | +| O8 | draft: finite and q8 guard checks of the MTP ring (code `mtp_original_finite` 158.8 x 0.87 us, `mtp_original_q8_guard` 28 x 0.87 us per round, 186.8 launches) | 0.162 | none | +0.162 | CUPTI | hex-finish | fixing (code 306b39807, switch `LELEKA_DRAFT_CHECK_MERGE`, off by default; identity and section delta pending): S2' launches every run of ADJACENT checks of a draft step program as one `mtp_original_check_batch` (new sealed asset `mtp_original_check_batch.ptx`; each entry keeps its own buffer, count, kind and status word, so the status words are the separate launches' words). Per step 48 check launches, 3 runs (prefix guards after the GR block 5, tail after the MLP GR 5, tail after the shared gate and up 2): 12 launches become 3, 9 fewer per step, 36 per round at 4 steps (expect `mtp_original_finite` 158.8 to about 111 and `mtp_original_q8_guard` 28 unchanged per round (the merged runs hold finite checks only), plus about 12 `mtp_original_check_batch` launches, net 36 fewer; the upper bound of the gain is about 0.05 ms per round, no claim). Not done: moving a check across another command (deferral to the end of the chain): the checked buffers `qcur`, `r`, `xn`, `lo` are overwritten in place between their checks and the program has no write-set table, so it needs one first. Proofs: `cuda-model` `draft_check_batch` (the merged schedule expands to the separate one, and a NaN/Inf at the edges and middle of every buffer after every kernel leaves identical status words in a simulated step), driver tests on the real command lists, GPU test `check_batch_program_gpu` (`--ignored`, job `draft-check-merge-gpu-proof`) GPU: detection test PASS (73 cases: NaN/+Inf/-Inf in every buffer and Q8 scale, 72 raise a flag, 0 differ from the separate launches); step graph 114 -> 105 nodes (-9 per step, `DBG mtp chain-step graph`, job `host-draft-chain-gate-diagnosis` MCP against AP); section: `draft.finish` 1.392 -> 1.300 ms per round (single boot each, not paired: 6390 and 5744 rounds); bitwise identity under teacher forcing queued (`host-draft-switches-teacher-forced-identity`, P2). The free-running replay cannot decide identity: draft traces of DT, MT and XT diverge at the 12th draft and shipped against shipped differs across boots BITWISE IDENTITY PASS (job `host-draft-switches-teacher-forced-identity`, test binary `rt-pf9`, night5-long-256k, teacher forced, 5 requests to 243k, 240 forced tokens each): top-16 logprob rows 2057 of 2057 identical in both arms, draft trace 1036 of 1036 lines identical, A/A floor identical (q_tail_gate PASS, d_top1 0.0000, flips 0). Check merge: identity PASS, step graph 114 to 105 nodes: ON by default in the three 5090 profiles (`LELEKA_DRAFT_CHECK_MERGE=1`); the paired section delta stays to be read from the group A/B (`host-draft-switches-group-ab`) GROUP A/B 2026-11-10: see Q7 row (X arm includes check merge): no regression, ms/token paired -0.03 +-0.08. Identity bitwise PASS (teacher-forced, 1036/1036 draft lines); ON in the three 5090 profiles. The paired `draft.finish` delta was not profiled in that group job (no profile arm): a profiled arm X vs A is the remaining step for the section number. SECTION DELTA 2026-11-10 (same job, per call over 8,697 / 9,518 / 7,771 draft rounds): `draft.finish` AP 1.548 ms, MCP (check merge only) 1.494 ms (-0.054 ms, -3.5 %), YP (the complete set) 1.577 ms (+0.029 ms, +1.9 %); `gpu.mtp_chain_step` 0.458 / 0.452 / 0.453 ms per step and `mtp.chain_step` 0.488 / 0.480 / 0.481 equal in all three. One boot per arm cannot resolve a 2-4 % difference (boot-to-boot spread of this profile is about 3 %), and YP does not reproduce MCP's gain: the section delta is at most -0.054 ms per round (about -30 ms per request at 580 rounds), not resolved. CLOSED on bitwise identity (1036/1036 draft lines) and the graph-node count (114 to 105); no regression found; ON in the 5090 profiles. A resolved per-round number would need 3 or more boots per arm (not scheduled: owner rule 2026-11-10). 2026-11-12 GROUP e2e A/B of the stage (owner method, one A/B at the end; `prefill-host-stage-start-vs-complete-default-set-group-ab-5-pairs`, pkg-s18, 30 requests, n=5 pairs, order A0 A A A0 A0 A A A0 A0 A): A0 = the built-in profile WITHOUT loan tiers, check merge, park fast, graph reuse and stream 1536 (profile override; the `engine environment` line of up-foreground.txt proves the keys differ) against A = the profile as shipped. TTFT per request, A minus A0: all 30 requests -143.7 ms (-11.2 %, CI -318.8..+31.4; pair 1 is +100 ms, the first boot of the job, the other four pairs -204.5 ms, CI -272..-137); uncached tail 64-1023 (8 requests) -269.5 ms (-31.9 %, CI -293.4..-245.6, 5 of 5 pairs); 1024-4095 (16 requests) -230.2 ms (-19.8 %, CI -294.1..-166.3, 5 of 5); >= 4096 (6 requests) +254.7 ms (CI -457..+967, pair 1 +1,240 ms, the rest -217..+183: not resolved); decode -0.40 % (CI -3.49..+1.98): no regression. The sum of the section deltas (ladder -104, Q7 -96, stream 1536 -45, park -3 = -248 ms per request) is confirmed in direction and in class; realised -144 ms (five pairs) to -205 ms (four pairs). The first run of this group (`prefill-host-complete-default-set-group-ab-5-pairs`) compared the profile with itself (the built-in profile overrides the shell env of the engine since pkg-s14): an A/A, noise floor TTFT +4.0 ms (CI -27.5..+35.5), decode +0.19 % (CI -0.80..+1.52 tok/s). Status: fixed (group e2e confirmed). | | K13 | draft chain role total (chain GR kernels, `mtp_*`) | 3.544 | 2.471 | +1.073 (includes the draft head and checks of R3 and O8; VANL books its draft in the shared GR kernels) | CUPTI role table | hex-finish | open (O8 `LELEKA_DRAFT_CHECK_MERGE` takes the adjacent checks out of this total once its section delta is measured) | | O12 | draft: finish follows the window width (0.93 ms at T 3.0, 2.5 ms at T 6.2) | window price | | part of the +3.1 ms for +0.65 tokens per round | PROFILE | hex-finish | open | | O2 | kernels outside big graphs | 630 | 147 | +483 | CUPTI | hex-finish | open | @@ -112,9 +112,9 @@ Structure first, then the layer steps in graph order: embed (R7), mixer half (V3 | verify: shared expert on a side stream (V4a) | shared expert on a side stream, forked after the doorbell, joined before the combine (`LELEKA_SM120_SIDE_SHARED`, code `255159a89`, off) | 27.6 us before the first expert | 15.0 us | section delta (`CE.1` against `CL.1`): doorbell to first expert 27.6 -> 10.9 us (VANL 15.0), FFN phase 6.600 -> 6.267 ms (-0.333; qsa layers 99.8 -> 87.6, gdn 109.3 -> 102.7 us p50), graph p50 12.386 -> 11.944 ms (-0.44); identity `spd-sqid1` P4 PASS: 2057 rows bit-identical, draft trace 518/518; A/B `ab-sqe` (L against E, n=10): decode tok/s +0.29 %, CI -0.43..+1.01 % (not significant); ms/round -0.61 (-2.97 %), CI -6.08..+0.15 %; tokens/round 3.64 -> 3.54 (live replay placement noise, numerics are identical); stays OFF; the CUPTI section gain (-0.33 ms) is of the size the replay cannot resolve at n=10, so 10 more pairs (`spd-sqe2`) and the set A/B M against all side parts (`verify-side-branches-ab-mixer-only-vs-all-branches`) are queued | CUPTI | device | fixed (closed 2026-11-09 by section delta + identity (owner method); set A/B `verify-side-branches-ab-mixer-only-vs-all-branches` (M mixer only against U all three side parts, n=10 pairs, 27 requests a block, 2026-11-10): decode tok/s 179.11 -> 182.90, +2.11 %, CI +1.18..+3.04 % (ms/token 5.583 -> 5.467); end-to-end 162.29 -> 164.70, +1.49 %, CI +0.17..+2.80 %; ms/round 20.06 -> 19.90, -0.80 %, CI -3.80..+2.21 % (not significant); tokens/round 3.59 -> 3.64, CI -2.01..+4.60 %; no regression; out_sha equal in 15 of 300 live requests, which is replay placement noise, the identity gate is the teacher-forced `spd-sqid1`) | | V4b | routed experts on their own branch (VANL: plan wait, VRAM experts, `fetch_blobs`, CPU wait, `add_hits` on a side stream; main stream does the shared expert and the next norm) | all on the capture stream | branch | none left: `SIDE_SHARED` is the same stream structure (fork after the doorbell, join before the combine); the windows CT.1/CY.1 show the VANL pattern and no serial time before the routed chain | CUPTI | device | fixed (closed 2026-11-11 by V4a, `docs/experiments/ffn-phase-loss-design.md` section 4.0) | | V4c | norms and hyper-connection reads (`gr_norm_split`, `gr_down`, `gr_up`) as separate branches | main stream | main stream (VANL does not branch them; a layer's `gr_*` chain stays on the main stream) | no structural difference; kernels in K8..K10 | CUPTI | device | proved-equal | -| V5 | flag waits on the CPU leg (`verify_wait_flag_ge` 96 x 26.9 us + `chain_wait_copy_i32` 48 x 5.4 us against `wait_flag_ge` 144 x 8.1 us) | 2.836 | 1.160 | +1.676 | CUPTI | device | open (analysis 2026-11-10, no code and no switch: the wait kernels have no overhead part to remove; script `scripts/e2e/codex/speed/cupti_flag_waits.py`, windows `verify-new-switches-cupti-windows/CL.2` (LEL) and `cupti/VANL`, request 29. Per graph from the window: LEL A 0.215 + B 0.718 + M 1.816 = 2.748 ms (the cell 2.836 is the earlier graph set), VANL 0.266 + 0.099 + 0.791 = 1.156 ms. What is waited on: A = flag A, the plan the host publishes after the doorbell; B = flag B, the PCIe copies landed (DMA mode: raised behind the copy batch, the wait ends 3.3 us (p50 3.0) after the last copy ends); M = flag M, the CPU rows in mapped memory. Three waits a layer in both (144 nodes) and the same poll loop (`while (*flag < v) __nanosleep(100); __threadfence_system()` in `original_verify.cu`, `chain_window.cu`, upstream `dp4a.hpp`). Overhead part: a wait whose flag is already set when it starts lasts 1.3-1.4 us for B and M in both sessions (VANL B median 2.2) and 2.2 us for A with the plan copy fused (VANL: wait 1.7 + separate copy 3.2-3.7), i.e. 48 x (2.2 + 1.3 + 1.4) = 0.24 ms a graph against about 0.25 ms in VANL; the poll latency after the flag is set is at most the same 1.4 us on about 35 blocked waits a graph, <= 0.05 ms, also in VANL. The rest is real waiting. By wait, LEL minus VANL: A -0.051, B +0.619, M +1.025 ms. B: 13.9 % of LEL layers have a DMA PCIe leg (3.9 MB p50, B wait 99 us mean there); in VANL 21.3 % of layers have a `fetch_blobs` above 2 us and pay the PCIe time as kernel time on the GPU stream (V6, -1.621), so V5 and V6 move the same time between wait and kernel (V7). M: the wait does not start early (M start after the doorbell, layers without a PCIe leg: LEL 70.7 us, VANL 60.1 us); the CPU rows arrive later: layers with CPU work (M wait > 4 us) 37.1 % against 24.3 %, M end after the doorbell 133.5 against 98.9 us mean (p50 111.6 against 92.8); at equal T the same (T=4: 45.5 % / 142.1 us against 24.4 % / 109.2 us; T=3: 36.5 % / 125.2 against 24.8 % / 95.6). So the loss is the arrival time of the CPU leg, not the graph kernels; to look at on the host/tier side (hand-over to `hex-finish`): the PCIe/CPU split (LEL `engine.log` `pcie_frac=0.45` fixed; VANL's PcieAuto in the same session went 0.55, 0.40, 0.35), tier state (request stats of the window's request: LEL VRAM 92.6 %, PCIe 2.2 %, CPU 5.2 %; VANL about 93.7 / 1.3 / 5.0 % from its `strata serve` lines, windows not matched), host pickup and plan latency (not visible: the trace has no timestamp of the flag word; upstream `wait_flag_ge_stamped`, `verify_kernels.cu:1250`, would give flag arrival against poll latency and needs a GPU run, not done)) 2026-11-11 per layer (profile counters `tier.lNN.vram|pcie|cpu`, commit 300d32946, `host-tier-experts-per-layer-profile`, shipped config, 30 requests, 17,032 windows): distinct non-resident experts per window (PCIe + CPU) are 3.79 per layer in layers 0-15, 2.42 in 16-31, 1.94 in 32-47 (layer 0: 6.91, layers 1-2: 5.4; VRAM 22-30 per layer); the loss against VANL per layer group from the CUPTI windows (CY.1 against VANL, VANL T mix) is 1.16 / 0.82 / 0.45 ms per graph, i.e. 48 / 34 / 18 % against 46 / 30 / 24 % of the non-resident experts. Across the 48 layers: wait M of the layer (CY.1) against CPU experts per layer r = 0.88, slope 28.6 us per CPU expert; loss against non-resident experts r = 0.67, 15.7 us per expert. Reading: the V5/V7 remainder is the CPU leg of layers that have more non-resident experts, early layers first (more experts, not a longer leg per expert: 28.6 us per CPU expert is below the 39 us compute). LEL splits its non-resident experts 33 % PCIe / 67 % CPU. VANL per-layer counts are not measured (implied by the same slope: about 1.0 CPU expert per layer against 1.83 in LEL, an inference). Next: PCIe share and mode probes `host-pcie-share-and-mode-probes-profile` (placement-class, measurement only). | +| V5 | flag waits on the CPU leg (`verify_wait_flag_ge` 96 x 26.9 us + `chain_wait_copy_i32` 48 x 5.4 us against `wait_flag_ge` 144 x 8.1 us) | 2.836 | 1.160 | +1.676 | CUPTI | device | open (analysis 2026-11-10, no code and no switch: the wait kernels have no overhead part to remove; script `scripts/e2e/codex/speed/cupti_flag_waits.py`, windows `verify-new-switches-cupti-windows/CL.2` (LEL) and `cupti/VANL`, request 29. Per graph from the window: LEL A 0.215 + B 0.718 + M 1.816 = 2.748 ms (the cell 2.836 is the earlier graph set), VANL 0.266 + 0.099 + 0.791 = 1.156 ms. What is waited on: A = flag A, the plan the host publishes after the doorbell; B = flag B, the PCIe copies landed (DMA mode: raised behind the copy batch, the wait ends 3.3 us (p50 3.0) after the last copy ends); M = flag M, the CPU rows in mapped memory. Three waits a layer in both (144 nodes) and the same poll loop (`while (*flag < v) __nanosleep(100); __threadfence_system()` in `original_verify.cu`, `chain_window.cu`, upstream `dp4a.hpp`). Overhead part: a wait whose flag is already set when it starts lasts 1.3-1.4 us for B and M in both sessions (VANL B median 2.2) and 2.2 us for A with the plan copy fused (VANL: wait 1.7 + separate copy 3.2-3.7), i.e. 48 x (2.2 + 1.3 + 1.4) = 0.24 ms a graph against about 0.25 ms in VANL; the poll latency after the flag is set is at most the same 1.4 us on about 35 blocked waits a graph, <= 0.05 ms, also in VANL. The rest is real waiting. By wait, LEL minus VANL: A -0.051, B +0.619, M +1.025 ms. B: 13.9 % of LEL layers have a DMA PCIe leg (3.9 MB p50, B wait 99 us mean there); in VANL 21.3 % of layers have a `fetch_blobs` above 2 us and pay the PCIe time as kernel time on the GPU stream (V6, -1.621), so V5 and V6 move the same time between wait and kernel (V7). M: the wait does not start early (M start after the doorbell, layers without a PCIe leg: LEL 70.7 us, VANL 60.1 us); the CPU rows arrive later: layers with CPU work (M wait > 4 us) 37.1 % against 24.3 %, M end after the doorbell 133.5 against 98.9 us mean (p50 111.6 against 92.8); at equal T the same (T=4: 45.5 % / 142.1 us against 24.4 % / 109.2 us; T=3: 36.5 % / 125.2 against 24.8 % / 95.6). So the loss is the arrival time of the CPU leg, not the graph kernels; to look at on the host/tier side (hand-over to `hex-finish`): the PCIe/CPU split (LEL `engine.log` `pcie_frac=0.45` fixed; VANL's PcieAuto in the same session went 0.55, 0.40, 0.35), tier state (request stats of the window's request: LEL VRAM 92.6 %, PCIe 2.2 %, CPU 5.2 %; VANL about 93.7 / 1.3 / 5.0 % from its `strata serve` lines, windows not matched), host pickup and plan latency (not visible: the trace has no timestamp of the flag word; upstream `wait_flag_ge_stamped`, `verify_kernels.cu:1250`, would give flag arrival against poll latency and needs a GPU run, not done)) 2026-11-11 per layer (profile counters `tier.lNN.vram|pcie|cpu`, commit 300d32946, `host-tier-experts-per-layer-profile`, shipped config, 30 requests, 17,032 windows): distinct non-resident experts per window (PCIe + CPU) are 3.79 per layer in layers 0-15, 2.42 in 16-31, 1.94 in 32-47 (layer 0: 6.91, layers 1-2: 5.4; VRAM 22-30 per layer); the loss against VANL per layer group from the CUPTI windows (CY.1 against VANL, VANL T mix) is 1.16 / 0.82 / 0.45 ms per graph, i.e. 48 / 34 / 18 % against 46 / 30 / 24 % of the non-resident experts. Across the 48 layers: wait M of the layer (CY.1) against CPU experts per layer r = 0.88, slope 28.6 us per CPU expert; loss against non-resident experts r = 0.67, 15.7 us per expert. Reading: the V5/V7 remainder is the CPU leg of layers that have more non-resident experts, early layers first (more experts, not a longer leg per expert: 28.6 us per CPU expert is below the 39 us compute). LEL splits its non-resident experts 33 % PCIe / 67 % CPU. VANL per-layer counts are not measured (implied by the same slope: about 1.0 CPU expert per layer against 1.83 in LEL, an inference). Next: PCIe share and mode probes `host-pcie-share-and-mode-probes-profile` (placement-class, measurement only). 2026-11-12 vanilla per layer (`host-vanilla-tier-experts-per-layer-pool-trace`: STRATA_POOL_TRACE on the release binary, 18,374 windows, mean T 3.66, no rebuild; the T split is not available, STRATA_SPEC_TRACE wrote nothing in the serve path): non-resident experts per layer-window 2.14 (CPU 1.65, PCIe 0.48), layer groups 0-15 / 16-31 / 32-47 = 2.69 / 1.86 / 1.86, layer 0: 1.85, layer 3: 5.35. Ours (profiled boots, mean T 4.09): 2.81, layer 0: 6.97, layer 3: 3.79. Correlation of our per-layer profile with vanilla's: 0.50 with the per-layer quota, 0.99 with the global rank fill (`EXPERT_PER_LAYER=no`, GLP; layer 0: 2.35, layer 3: 5.77). Vanilla's layer shape is the global fill; the uniform 254-slot quota is the cause of our early-layer excess (H4). Non-resident experts per window row: vanilla 0.585, ours 0.69 (quota) and 0.60 (global fill). | | V6 | PCIe fetch and CPU-row hand-over (doorbell, mapped copies, `fetch_blobs`, `add_hits`, `rebase_ptrs`) | 0.488 | 2.109 | -1.621 | CUPTI | device | proved-equal (LEL ahead) | -| V7 | V5 + V6, the whole miss-leg handling | 3.324 | 3.269 | +0.055 (+0.17 by an earlier count of the same sets) | CUPTI | device | open (analysis 2026-11-10 with V5: V5 +1.676 and V6 -1.621 are the same PCIe time counted as wait in LEL (DMA, flag B) and as kernel time in VANL (`fetch_blobs`, `rebase_ptrs`, `copy_rows_from_mapped`), so the sum is flat and no graph kernel is left to change; what remains is the CPU leg arriving 25-35 us later after the doorbell in the layers that have CPU work (V5), a host/tier/split question; closes when that is A/B'd or the tier states of the two sessions are matched) 2026-11-11 per layer (profile counters `tier.lNN.vram|pcie|cpu`, commit 300d32946, `host-tier-experts-per-layer-profile`, shipped config, 30 requests, 17,032 windows): distinct non-resident experts per window (PCIe + CPU) are 3.79 per layer in layers 0-15, 2.42 in 16-31, 1.94 in 32-47 (layer 0: 6.91, layers 1-2: 5.4; VRAM 22-30 per layer); the loss against VANL per layer group from the CUPTI windows (CY.1 against VANL, VANL T mix) is 1.16 / 0.82 / 0.45 ms per graph, i.e. 48 / 34 / 18 % against 46 / 30 / 24 % of the non-resident experts. Across the 48 layers: wait M of the layer (CY.1) against CPU experts per layer r = 0.88, slope 28.6 us per CPU expert; loss against non-resident experts r = 0.67, 15.7 us per expert. Reading: the V5/V7 remainder is the CPU leg of layers that have more non-resident experts, early layers first (more experts, not a longer leg per expert: 28.6 us per CPU expert is below the 39 us compute). LEL splits its non-resident experts 33 % PCIe / 67 % CPU. VANL per-layer counts are not measured (implied by the same slope: about 1.0 CPU expert per layer against 1.83 in LEL, an inference). Next: PCIe share and mode probes `host-pcie-share-and-mode-probes-profile` (placement-class, measurement only). | +| V7 | V5 + V6, the whole miss-leg handling | 3.324 | 3.269 | +0.055 (+0.17 by an earlier count of the same sets) | CUPTI | device | open (analysis 2026-11-10 with V5: V5 +1.676 and V6 -1.621 are the same PCIe time counted as wait in LEL (DMA, flag B) and as kernel time in VANL (`fetch_blobs`, `rebase_ptrs`, `copy_rows_from_mapped`), so the sum is flat and no graph kernel is left to change; what remains is the CPU leg arriving 25-35 us later after the doorbell in the layers that have CPU work (V5), a host/tier/split question; closes when that is A/B'd or the tier states of the two sessions are matched) 2026-11-11 per layer (profile counters `tier.lNN.vram|pcie|cpu`, commit 300d32946, `host-tier-experts-per-layer-profile`, shipped config, 30 requests, 17,032 windows): distinct non-resident experts per window (PCIe + CPU) are 3.79 per layer in layers 0-15, 2.42 in 16-31, 1.94 in 32-47 (layer 0: 6.91, layers 1-2: 5.4; VRAM 22-30 per layer); the loss against VANL per layer group from the CUPTI windows (CY.1 against VANL, VANL T mix) is 1.16 / 0.82 / 0.45 ms per graph, i.e. 48 / 34 / 18 % against 46 / 30 / 24 % of the non-resident experts. Across the 48 layers: wait M of the layer (CY.1) against CPU experts per layer r = 0.88, slope 28.6 us per CPU expert; loss against non-resident experts r = 0.67, 15.7 us per expert. Reading: the V5/V7 remainder is the CPU leg of layers that have more non-resident experts, early layers first (more experts, not a longer leg per expert: 28.6 us per CPU expert is below the 39 us compute). LEL splits its non-resident experts 33 % PCIe / 67 % CPU. VANL per-layer counts are not measured (implied by the same slope: about 1.0 CPU expert per layer against 1.83 in LEL, an inference). Next: PCIe share and mode probes `host-pcie-share-and-mode-probes-profile` (placement-class, measurement only). 2026-11-12 vanilla per layer (`host-vanilla-tier-experts-per-layer-pool-trace`: STRATA_POOL_TRACE on the release binary, 18,374 windows, mean T 3.66, no rebuild; the T split is not available, STRATA_SPEC_TRACE wrote nothing in the serve path): non-resident experts per layer-window 2.14 (CPU 1.65, PCIe 0.48), layer groups 0-15 / 16-31 / 32-47 = 2.69 / 1.86 / 1.86, layer 0: 1.85, layer 3: 5.35. Ours (profiled boots, mean T 4.09): 2.81, layer 0: 6.97, layer 3: 3.79. Correlation of our per-layer profile with vanilla's: 0.50 with the per-layer quota, 0.99 with the global rank fill (`EXPERT_PER_LAYER=no`, GLP; layer 0: 2.35, layer 3: 5.77). Vanilla's layer shape is the global fill; the uniform 254-slot quota is the cause of our early-layer excess (H4). Non-resident experts per window row: vanilla 0.585, ours 0.69 (quota) and 0.60 (global fill). | | K11 | routed experts in the verify graph, role total (gate/up/SwiGLU, down) | 2.507 | 2.484 | +0.023 (entry mix differs; at equal entry counts LEL is faster: `window_moe_down_20` 13.6 us with 40 entries against 17.4 us, `sm120_moe_gu_swiglu_22` 12.3 us with 50 entries against 26 us with 40) | CUPTI | device | open (2026-11-11 per layer pair, T 2-4: `window_moe_down_*` is 3.4-7.1 us slower than VANL in 48 of 48 layers, the gate/up kernel 3-4 us faster, and the empty PCIe pass launches at full grid every layer (about 5.5 us against about 0.7); the role total hides this in the entry mix; `docs/experiments/ffn-phase-loss-design.md` section 4.1 D1) | | K15 | hit tally `add_hits` (48 x 1.2 us against 48 x 1.3 us) | 0.059 | 0.063 | -0.004 | CUPTI | device | proved-equal (LEL ahead) | | S2 | `GU_SWIGLU` (routed expert gate/up + SwiGLU + q8_1) | on since lever 1 | on | as S1 | gap doc lever 1 | device | fixing (needs a CUPTI section delta) | @@ -193,7 +193,7 @@ The tier adapts every 4 rounds and survives across requests. | H1 | VRAM hit share in the replay | 90.8 % | 92.8 % | -2.0 points; 28 % more misses | LOG | device | open (2026-11-11 `docs/experiments/vram-hit-share-gap.md`: the -2.0 does not reproduce, the two surviving VANL replays give 91.8 unweighted / 93.4 token-weighted; gap on the 30-request replay is -0.7..-1.3 points token-weighted, -1.0..-1.6 unweighted) | | H2 | VRAM hit share weighted by decode time in real sessions | nestng-crm 91.38 %, ttt 92.68 % | 92.41 %, 93.38 % | -1.03 and -0.70 points; at most 0.57 ms per round per point, so up to 0.59 and 0.40 ms per round | LOG | device | open | | H3 | short requests (< 600 tokens) hit share | 86.9 % | 89.9 % | -3.0 points (up to 7 in single requests) | LOG | device | open | -| H4 | expert slots | 12,192 | 12,575 (+3 %) | -383 slots; variant H (reserves 130 / 500 MiB, about +190 slots): VRAM share +0.44 points, ms/round -0.44 (-2.19 %, CI -3.55..-0.83), tokens per round -1.69 %, decode +0.51 % (CI -0.19..+1.20), end-to-end +1.06 % (CI -0.38..+2.50) | A/B `ab-l3v2` | device | fixing (CORRECTION 2026-11-11 `docs/experiments/vram-hit-share-gap.md`: the earlier reading that variant H 'gained nothing' was an env leak; the clean paired A/B `ab-l3v2` (10 pairs, H 12,384 slots against A 12,192) is a real gain: hit share +0.44 points token-weighted (CI +0.24..+0.64), ms/round -2.10 % (CI -3.61..-0.59), decode tok/s +0.67 % (CI +0.02..+1.31); about 0.23 points per 100 slots, 383 missing slots are worth about 0.9 of the 1.3-point gap. Not enabled: the free VRAM at decode drops to about 355 MiB (vanilla 315), and the project rule is that real work is 256k: before any profile change a run on the 245k corpus (docs/quality-gate.md q245, `leleka/decode/`, sha in the manifest) with the memory profile, the minimum free VRAM along the run, no OOM or refusal and the memory governor without incident is required, and the memory owner (hex-finish, 2026-11-11) names the threshold: no stricter rule exists, vanilla's own minimum free VRAM of 315 MiB (`vram-footprint-5090.md`: 389 at request start, 315 after the windows are captured; `decode_headroom_mib()` = 700+130-514 = 316) is the proof of safety, so 355 MiB is inside it. Pass criteria: (1) minimum free VRAM by 100 ms sampling (`mon.csv`) over the WHOLE 245k corpus session >= 315 MiB, (2) 0 request failures / CudaExecution / OOM, (3) 3 repeats (the adaptive tier is not bitwise reproducible), (4) the cost confirmed: 12,384 slots. The VRAM floor is set by decode_reserve + usable_room (`original_cache_startup.rs`), not by the memory governor (host RAM). No current 256k stub with a memory profile exists in jobs/: nearest are `987-decode-vram` (dc-g2, `run_corpus` of dec-common.sh, prints the minimum free VRAM, old binary) and `q245-*`; the plan is `run_corpus` with the current binary and the two variables. Group A/B `decode-slots-and-adapt-every-group-ab-pg-vs-ps-pw` (PS = alias + reserve 130) queued; the per-layer-quota arm (EXPERT_PER_LAYER=no) is measured by hex-finish (`host-tier-global-rank-fill-vs-uniform-layer-quota-profile`)) UPDATE 2026-11-12: 256k session check `memory-256k-codex-session-alias-reserve130-vram-floor` (release 02c784249, alias + reserve 130, 12,432 slots, Codex fixbug-ledger x3 at 178-228k input tokens, 100 ms sampler): 0 OOM/CudaExecution, 3 accepted, but the minimum free VRAM is 212 MiB (about 400 at the start, 312 -> 212 at the longest contexts; 478 of 12,792 samples below 315): NOT PASSED. Reserve 130 is too small; about +100 MiB of reserve (about -55 slots) would be needed for the 315 floor. The group A/B (PG against PS/PW) is rerun (`decode-slots-and-adapt-every-group-ab-pg-vs-ps-pw-rerun`, the first run was refused by the faulty guard). The hex-finish candidate (quota=no + PCIE_FRAC 0.65, +62 slots, reserve unchanged) is checked separately by `memory-256k-codex-session-quota-no-pcie065-vram-floor`. UPDATE 2026-11-12 (retry with reserve 240, `memory-256k-codex-session-alias-reserve240-vram-floor`, release 02c784249a7e, alias + `DECODE_RESERVE_MIB=240`, Codex fixbug-ledger x3 at 178-224 k input tokens, 100 ms sampler, 15,268 samples): NOT PASSED by 9 MiB. Minimum free VRAM 306 MiB (target 315); 90 samples below 315; 0 OOM/CudaExecution/refused; 3 of 3 accepted (42/30/37 requests); 12,384 slots (per layer) against 12,192. Reserve 130 -> 212 MiB and 12,432 slots, reserve 240 -> 306 MiB and 12,384 slots: 110 MiB of reserve bought 94 MiB of floor and cost 48 slots, so the floor follows the reserve almost one to one. Reserve about 250 MiB would reach 315 (about -4 slots, about 12,380); not run, and PS stays a placement-class change with the quality gate pending (see the slots/adapt verdict). (floor of the hex-finish candidate, release package of the q245 job, EXPERT_PER_LAYER=no through a per-arm profile, `LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65` through the shell env, reserve unchanged): PASSED. Minimum free VRAM 338 MiB over 10,356 samples (100 ms), 0 samples below 315 MiB, 0 OOM/CudaExecution/refused in the engine log, 3 of 3 Codex fixbug-ledger sessions accepted (34/18/39 requests, first input 177,726, last 201-227 k tokens), 12,254 slots (global fill, 23.26 GiB) against 12,192. The 338 MiB floor is 23 MiB above vanilla's 315. Caveat: the engine-environment line of the effective profile does not list PCIE_FRAC (it is not a profile key; the shell variable was exported), so the PCIe share actually used is not proven by this run; it does not allocate VRAM, so the floor holds for any share, but the e2e of the candidate must record the share the engine reports. Evidence: `/data/leleka-e2e/quality-245k/runs/memory-256k-codex-session-quota-no-pcie065-vram-floor/` (`vram-floor.txt`, `vram-free.csv`). | +| H4 | expert slots | 12,192 | 12,575 (+3 %) | -383 slots; variant H (reserves 130 / 500 MiB, about +190 slots): VRAM share +0.44 points, ms/round -0.44 (-2.19 %, CI -3.55..-0.83), tokens per round -1.69 %, decode +0.51 % (CI -0.19..+1.20), end-to-end +1.06 % (CI -0.38..+2.50) | A/B `ab-l3v2` | device | fixing (CORRECTION 2026-11-11 `docs/experiments/vram-hit-share-gap.md`: the earlier reading that variant H 'gained nothing' was an env leak; the clean paired A/B `ab-l3v2` (10 pairs, H 12,384 slots against A 12,192) is a real gain: hit share +0.44 points token-weighted (CI +0.24..+0.64), ms/round -2.10 % (CI -3.61..-0.59), decode tok/s +0.67 % (CI +0.02..+1.31); about 0.23 points per 100 slots, 383 missing slots are worth about 0.9 of the 1.3-point gap. Not enabled: the free VRAM at decode drops to about 355 MiB (vanilla 315), and the project rule is that real work is 256k: before any profile change a run on the 245k corpus (docs/quality-gate.md q245, `leleka/decode/`, sha in the manifest) with the memory profile, the minimum free VRAM along the run, no OOM or refusal and the memory governor without incident is required, and the memory owner (hex-finish, 2026-11-11) names the threshold: no stricter rule exists, vanilla's own minimum free VRAM of 315 MiB (`vram-footprint-5090.md`: 389 at request start, 315 after the windows are captured; `decode_headroom_mib()` = 700+130-514 = 316) is the proof of safety, so 355 MiB is inside it. Pass criteria: (1) minimum free VRAM by 100 ms sampling (`mon.csv`) over the WHOLE 245k corpus session >= 315 MiB, (2) 0 request failures / CudaExecution / OOM, (3) 3 repeats (the adaptive tier is not bitwise reproducible), (4) the cost confirmed: 12,384 slots. The VRAM floor is set by decode_reserve + usable_room (`original_cache_startup.rs`), not by the memory governor (host RAM). No current 256k stub with a memory profile exists in jobs/: nearest are `987-decode-vram` (dc-g2, `run_corpus` of dec-common.sh, prints the minimum free VRAM, old binary) and `q245-*`; the plan is `run_corpus` with the current binary and the two variables. Group A/B `decode-slots-and-adapt-every-group-ab-pg-vs-ps-pw` (PS = alias + reserve 130) queued; the per-layer-quota arm (EXPERT_PER_LAYER=no) is measured by hex-finish (`host-tier-global-rank-fill-vs-uniform-layer-quota-profile`)) UPDATE 2026-11-12: 256k session check `memory-256k-codex-session-alias-reserve130-vram-floor` (release 02c784249, alias + reserve 130, 12,432 slots, Codex fixbug-ledger x3 at 178-228k input tokens, 100 ms sampler): 0 OOM/CudaExecution, 3 accepted, but the minimum free VRAM is 212 MiB (about 400 at the start, 312 -> 212 at the longest contexts; 478 of 12,792 samples below 315): NOT PASSED. Reserve 130 is too small; about +100 MiB of reserve (about -55 slots) would be needed for the 315 floor. The group A/B (PG against PS/PW) is rerun (`decode-slots-and-adapt-every-group-ab-pg-vs-ps-pw-rerun`, the first run was refused by the faulty guard). The hex-finish candidate (quota=no + PCIE_FRAC 0.65, +62 slots, reserve unchanged) is checked separately by `memory-256k-codex-session-quota-no-pcie065-vram-floor`. 2026-11-11 `host-tier-global-rank-fill-vs-uniform-layer-quota-profile` (pkg-s19, 30 requests, profiled, FP GLP GLP FP, key proven different: log `expert cache 12192 slots (per layer)` against `12254 slots (global)`): global rank fill instead of the 254-slot uniform quota (`LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no`, set through a profile override because the built-in profile overrides the shell env): VRAM share 89.76/90.38 -> 91.21/91.12 (+1.1 points), non-resident experts per layer-window 2.96/2.67 -> 2.40/2.47 (-13.5 %), layer 0 non-resident 7.0 -> 2.35 (layers 0-15 3.9 -> 3.1), ms/round (`round.run_window`) 16.33/15.55 -> 15.03/15.19 (mean 15.94 -> 15.11, -5.2 %), decode 186.0/182.8 -> 186.4/187.8 tok/s (+1.5 %, 2 reps, A/A floor +-1 %). Slots differ by 62 (12,254 against 12,192), about 0.1 point of the gain. Placement-class: needs the quality gate against the control placement and the VRAM/OOM floor before it may become a default. Cross-layer potential of the swap rule (`tier.cross.*`, uncapped): global minus within-layer swap gain is 0.02-0.03 % of the usage mass in both layouts (within 517 / global 524 against usage mass 27,443; miss mass 6.1 % uniform, 5.3 % global), so moving slots between layers at adaptation time adds nothing; the gain of the global fill is the initial layout, which the capped swaps (96 per 4 rounds) repair slowly (H3/H7). The layer-weight policy is therefore not needed. 2026-11-12 PLACEMENT GATE (`host-tier-quota-no-and-pcie-share-065-placement-gate`, teacher-forced night5-long-256k, 5 requests to 243k, 240 forced tokens, adaptive tier, rt-pf21 = 02c784249a7e, A/A floor 0 in all three processes): P2 = EXPERT_PER_LAYER=no + PCIE_FRAC 0.65 against the shipped placement: 1,720 common rows, argmax flips 33 (1.92 %), d_top1 p99 0.210, max 0.653; P3 = share 0.65 only: 1,741 rows, flips 39 (2.24 %), p99 0.198, max 0.763. Against the Original envelope (p99 <= 0.22, max <= 0.43, flips <= 2.8 %): p99 and flip rate inside, the single-row max outside for both (the quota change adds nothing worse than the share change alone); the draft trace differs from the first row on by construction (placement-class). Verdict: NOT a clean PASS (max); the control `host-pcie-share-control-placement-gate-035-and-055` (shares 0.35 and 0.55 against 0.45, same reference) decides whether the max is the size of any ordinary placement change. VRAM/OOM floor: the speed session's 256k Codex run of its own variant (alias + DECODE_RESERVE 130, 12,432 slots) measured a minimum free VRAM of 212 MiB (rule >= 315) with 0 OOM: FAIL for that variant; the candidate (quota=no + share, default reserve) has not been run at 256k. Default stays unchanged; the candidate is an option only. 2026-11-12 CONTROL (`host-pcie-share-control-placement-gate-035-and-055`, same binary, same reference idP1 = shipped 0.45, A/A floor 0 in both processes): an ordinary placement change of the same kind, the PCIe share alone: 0.35 (vanilla's share) 1,746 common rows, flips 39 (2.23 %), d_top1 p99 0.224, max 0.746; 0.55: 1,760 rows, flips 45 (2.56 %), p99 0.215, max 0.665. Candidate rows for reading side by side: quota=no + 0.65: flips 1.92 %, p99 0.210, max 0.653; share 0.65 only: flips 2.24 %, p99 0.198, max 0.763. The single-row max of 0.65..0.76 is therefore the size of ANY placement change (0.665 and 0.746 for a share step of 0.10 and 0.10), not a property of the candidate; the p99 and flip rate of the candidate are at or below the controls (p99 0.210 vs 0.215/0.224; flips 1.92 % vs 2.23/2.56 %). The Original envelope max <= 0.43 was measured on ~100-token prompts and is not applicable to the placement class at 243k context (every placement step overshoots it); the applicable rule is the control-relative one of `q_tail_gate.py --control` (p99, max and flip rate each <= 1.25 x the control's): the candidate passes it against the worst control (p99 0.210 <= 0.28, max 0.653 <= 0.93, flips 1.92 % <= 3.2 %). Quality gate of the candidate: PASS under the control-relative rule (n = 1 replay of 5 requests, 240 tokens, one workload; the second evidence is the e2e acceptance of the candidate run, not yet made). Still open for the candidate: the 256k VRAM/OOM floor (speed session's stub), then e2e (CRM x3 + ttt x3). Default unchanged. 2026-11-12 STAGE 7 e2e, DEFAULT profile (release 02c784249a7e, `e2e-codex-ttt-and-crm-default-profile`, nestng-crm x3 + ttt x3, saved VAN/VANL cells): CRM accepted 0/3 (54/56, 54/56, 55/56) against VAN and VANL 3/3 56/56; ttt 3/3 14/14 in every arm. The failing checks are two STATIC source-pattern checks of `accept.py` section 5 ("frontend src: a board with one column per stage" needs one file with all five stage names AND a loop - LEL keeps the names in models.ts and loops over `stages` in the html; "calls /api/companies, contacts, deals" needs the literal `/api/` or `/api/${` - LEL writes `${this.base}/companies`); all behavioural checks (REST, e2e suites, 54 of 56) pass, rounds failed 0, no tool-call error: coding style of the greedy session, not tool-call integrity. History of the same two checks over all LEL CRM cells since 2026-11-09: LEL-A 5/6 and LEL-L 6/6 (no tracing flags) vs profile/trace variants LEL-LP 0/3, LEL-AP 1/2, LEL-LS 1/8, LEL-AS 0/6 (LELEKA_SERVE_PROFILE + BRINGUP_TRACE + PROFILE_SYNC: timing changes the greedy trajectory), VANL 4/5 (one 55/56 on the same board check, 2026-11-10), VAN 3/3; the default profile now 0/3, so the style difference is systematic enough to matter but n is small and package and date are confounded. Decode (CRM): LEL 163.1 +- 2.2 tok/s against VANL 202.1 and VAN 221.4 (-39.0 +- 4.4 and -58.4 +- 7.0 paired); ttt: LEL 157 against VANL 202 and VAN 226. Wall s (CRM): LEL 465.8 +- 21.4, VAN 434.0 +- 98.9, VANL 461.8 +- 106.2 (paired LEL-VANL +4.0 +- 123.6, LEL-VAN +31.8 +- 117.0: inside the session noise; LEL runs 45 rounds against 62-71 but 9.3 s/request against 5.2-6.3); ttt wall: LEL 172 s, VAN 99 s, VANL 137 s. Plan target "accept 56/56" NOT met. Bisect step 1 queued (`e2e-codex-crm-stage-set-off-lel-r1..r3`, CRM x3, profile with LOAN_TIERS, DRAFT_CHECK_MERGE, PREFIX_PARK_FAST, DECODE_GRAPH_REUSE, STREAM_MIN dropped); if it passes >= 2/3 the five keys are bisected one by one, if it fails the regression is not the stage set (candidate: the Leleka-vs-Strata trajectory itself). BLOCKER for the plan target until the bisect is read. 2026-11-12 VRAM FLOOR of the candidate (speed session, `memory-256k-codex-session-quota-no-pcie065-vram-floor`, quota=no + PCIE_FRAC 0.65 as a shell variable, default reserve): minimum free VRAM 338 MiB over 10,356 samples (rule >= 315), below 315: 0, OOM / CudaExecution / refused: 0, 3 of 3 Codex sessions accepted, 12,254 slots (global fill, 23.26 GiB): PASS. Placement gate (control-relative rule) and floor both passed: e2e of the candidate (CRM x3 + ttt x3, `e2e-codex-ttt-and-crm-quota-no-pcie065-experimental-*`, profile keys set in the arm profile so they show in the engine environment line) queued behind the CRM bisect. Default unchanged. 2026-11-12 CORRECTION (supersedes the stage 7 and bisect paragraphs above as to the RELEASE): `cmp_codex_job.sh` unpacks the tarball into the shared `codex-compare/ours-pkg` only when it is missing and reuses it afterwards, so the runs `e2e-codex-ttt-and-crm-default-profile` and `e2e-codex-crm-stage-set-off` (and the first candidate e2e, stopped at r3) ran the STALE release 17e372944279 (2026-11-03), not 02c784249a7e: `version.txt` of the cells says 17e372944279, and the engine environment lines of the default run and of the "stage-set-off" run are byte-identical (the profile of that release has only four engine_env keys, so dropping the five stage-set keys changed nothing). The bisect verdict ("the stage set is not to blame", 55/56 x3) and the stage 7 numbers (CRM 0/3, decode 163 / 159 tok/s) therefore describe the OLD release and are VOID for the current default; the static-check statistics below stay valid as history. Fix: `cmp_codex_job_profile.sh` now requires `CMP_OURS_TAG` and uses its own `ours-pkg-`, `ours-state-`, `ours-prefix-` and refuses a package whose `version` commit differs from the tag. Re-queued on 02c784249a7e: default CRM+ttt x3, stage-set-off CRM x3, candidate CRM+ttt x3 (`scripts/e2e/codex/prefill/e2e-release/`). STATIC CHECKS over all 49 CRM cells with an acceptance log (board = one file with all five stages and a loop; api = literal /api/): LEL 41 cells, board failed 23 (56 %), api failed 6 (15 %), clean 16; of them without tracing flags 22 cells: board 7 (32 %), api 3, clean 14; with SERVE_PROFILE/BRINGUP_TRACE/PROFILE_SYNC 19 cells: board 16 (84 %), api 3, clean 2; VAN 3 cells: 0 and 0; VANL 5 cells: board 1, api 0. Fisher (two-sided) LEL board 23/41 against vanilla 1/8: p = 0.049; without tracing 7/22 against 1/8: p = 0.39; api 6/41 against 0/8: p = 0.57. Reading: with the tracing variants excluded there is no significant difference to vanilla (the checks are brittle style patterns); the tracing flags (timing) change the greedy trajectory toward the failing style; a systematic Leleka-Strata difference is not shown and not excluded (vanilla n = 8). The first release-pinned series ended at once (the check compared `leleka version`, which prints "commit unknown" for this build; fixed: `prov_commit.py` reads git_commit from the package PROVENANCE.json, the old shared package is rejected by it); fake .done markers and empty run dirs moved to garbage/g-1112-e2ecpm. UPDATE 2026-11-12 (retry with reserve 240, `memory-256k-codex-session-alias-reserve240-vram-floor`, release 02c784249a7e, alias + `DECODE_RESERVE_MIB=240`, Codex fixbug-ledger x3 at 178-224 k input tokens, 100 ms sampler, 15,268 samples): NOT PASSED by 9 MiB. Minimum free VRAM 306 MiB (target 315); 90 samples below 315; 0 OOM/CudaExecution/refused; 3 of 3 accepted (42/30/37 requests); 12,384 slots (per layer) against 12,192. Reserve 130 -> 212 MiB and 12,432 slots, reserve 240 -> 306 MiB and 12,384 slots: 110 MiB of reserve bought 94 MiB of floor and cost 48 slots, so the floor follows the reserve almost one to one. Reserve about 250 MiB would reach 315 (about -4 slots, about 12,380); not run, and PS stays a placement-class change with the quality gate pending (see the slots/adapt verdict). UPDATE 2026-11-12 (floor of the hex-finish candidate, release package of the q245 job, EXPERT_PER_LAYER=no through a per-arm profile, `LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65` through the shell env, reserve unchanged): PASSED. Minimum free VRAM 338 MiB over 10,356 samples (100 ms), 0 samples below 315 MiB, 0 OOM/CudaExecution/refused in the engine log, 3 of 3 Codex fixbug-ledger sessions accepted (34/18/39 requests, first input 177,726, last 201-227 k tokens), 12,254 slots (global fill, 23.26 GiB) against 12,192. The 338 MiB floor is 23 MiB above vanilla's 315. Caveat: the engine-environment line of the effective profile does not list PCIE_FRAC (it is not a profile key; the shell variable was exported), so the PCIe share actually used is not proven by this run; it does not allocate VRAM, so the floor holds for any share, but the e2e of the candidate must record the share the engine reports. Evidence: `/data/leleka-e2e/quality-245k/runs/memory-256k-codex-session-quota-no-pcie065-vram-floor/` (`vram-floor.txt`, `vram-free.csv`). | 2026-11-12 E2E ON THE PINNED RELEASE 02c784249a7e (PROVENANCE git_commit, tarball sha256 254ea79f...; engine environment and arm profile verified in the first cell of each series; the earlier void series are not used): (1) ACCEPTANCE VERSION MISMATCH, found while closing the CRM 0/3: the VAN/VANL cells (and the 2026-11-05 LEL cells) were re-accepted on 2026-11-05 with `codex-compare/reaccept-1/tasks/nestng-crm/accept.py` (sha256 b2e6c690...; board check = all five stage names anywhere in the frontend sources plus a loop in a file that mentions `stage`); the tool `tasks/nestng-crm/accept.py` (sha256 db1b7095..., used by every new LEL cell) still has the strict original (all five stages AND a loop inside ONE file), which the 2026-11-05 `acceptance.log.prev` of VAN r1 fails with the same message. The saved VAN workspaces fail the strict check too. So the board failure of the LEL cells is a measurement artefact, not a Leleka effect. Re-computing the relaxed board check on the 27 saved workspaces of the three new series (LEL, VAN, VANL x 3 x 3): 27/27 pass. LEL on the baseline acceptance: default 2 of 3 fully accepted (r1 54/56: besides the board check one of the 21 backend e2e tests of the agent's own app failed, rc=1 passed=20 failed=1; r2 and r3 55/56 + relaxed board = 56/56), stage-set-off 3/3, candidate 3/3 (each 55/56 + relaxed board). One backend-test failure in 9 LEL cells; the VAN/VANL cells have none; not enough to call it a trend. The earlier statistics of the board failures per variant (56 %, 32 % without tracing flags) used the strict check on the LEL side only and are void as a quality signal; the cells since 2026-11-10 are all strict-failed because they ran after the baseline was frozen on the relaxed check. Rule for the next e2e reports: run `cmp_reaccept.py` with the relaxed accept.py on every new LEL cell, or report both versions. (2) STAGE SET (LOAN_TIERS, DRAFT_CHECK_MERGE, PREFIX_PARK_FAST, DECODE_GRAPH_REUSE, STREAM_MIN) is NOT responsible for the CRM result: default and stage-set-off give the same single static finding in all six cells. Speed: CRM decode default 169.4 (167.8/170.3/170.0) vs stage-set-off 163.0 +-2.1 tok/s (about +4 % for the set); wall 527 vs 525.1 +-43.7 s; ttt (default series) decode 171.4/168.4/177.6 tok/s, wall 194.5/227.6/92.5 s. (3) CANDIDATE quota=no + PCIE_FRAC 0.65 (experimental, profile keys, engine.log meta line: expert_per_layer=0 pcie_frac=0.65, 12,254 global slots, prompt loan 2,471): CRM decode 179.4 +-0.4 tok/s (default 169.4, +5.9 %; VANL 202.1, VAN 221.4), wall 504.9 +-19.1 s (default 527, VANL 461.8 +-106.2, VAN 434.0 +-98.9; spread of VANL/VAN is larger than every Leleka difference), 55/56 + relaxed board = 56/56 in 3/3; ttt 3/3 accepted, decode 180.0 +-2.3 tok/s (default about 172, VANL 202.0, VAN 225.7), wall 156.2 +-31.3 s (default about 172, VANL 136.7 +-10.0, VAN 99.3 +-5.8). Paired LEL - VANL: decode -22.7 +-4.1 tok/s, wall +43.1 +-118.1 s (noise). Together with the placement gate and the 256k VRAM floor PASS (338 MiB free, 0 OOM) the candidate stays an experimental profile; the default is unchanged until the owner decides after the 5-pair measurement. (4) ttt WALL vs VAN (156 s against 99 s at decode 180 against 226 tok/s): the decode rate alone predicts +26 % wall (226/180), the observed gap is +57 %; the rest follows the number of rounds and calls (LEL 21 rounds / 22 calls against VAN 12.7 / 13.7, +65 %), and the trajectories differ (greedy decode differs), so on this task the wall gap is a mix of decode rate and trajectory length; s/request is 7.3 (LEL, VANL) against 8.0 (VAN), i.e. no per-request engine penalty beyond decode. Open: a paired teacher-forced replay of one trajectory would separate them; not started. | H5 | adaptive tie order (equal-gain swaps share the cap across layers, `LELEKA_ADAPT_TIE_SPREAD`, `9d130fd38`) | low layer first | | run `memory-tier-tie-spread-ab-first-half/xb` queued | gap doc | device | fixing | | H6 | tier knobs: adapt every 2, 192 swaps, decay 0.85, margin 1.0 (`spd-w1..w5`) | 4, 96, 0.7, 1.5 | same policy | runs queued | gap doc | device | fixing (W1 adapt every 2: earlier n=5 +0.56 points hit, +1.31 % tok/s (CI +0.77..+1.85); in the group A/B above as PW against PG, then 10 pairs if it holds) | | H7 | first rounds of a request see an unadapted tier | | | not isolated | gap doc | device | open (isolated for ours 2026-11-11 `docs/experiments/vram-hit-share-gap.md`: hit share 79 % in the first 4 windows of a request, 85 % at windows 16-31, 90 % at 32-63, 93 % from 128; the first 64 windows carry 20 % of the misses, a ceiling of 0.71 points; vanilla has no per-window log; a request-start warm-up needs code in `original_serve_residency/source_spans.rs`, hex-finish) | diff --git a/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_profile.sh b/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_profile.sh new file mode 100644 index 00000000..b74df27f --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/cmp_codex_job_profile.sh @@ -0,0 +1,183 @@ +#!/usr/bin/env bash +# Codex + runtime + model comparison, vanilla Strata against Leleka, on the owner's two tasks (docs/experiments/codex-compare-5090.md). Test tooling, never in serving. +# +# ONE BLOCK = one stack start of one arm, then the warm-up cell and the requested cells of ONE repetition. A queue stub sets CMP_ARM / CMP_REPS / CMP_TASKS: +# CMP_ARM=ours HOLDER JOB (inherits the sealed KAR memfd): the release package, `leleka up --foreground --kar-fd`, shipped configuration (KAR PLE, prefix cache auto / tail reply). +# CMP_ARM=vanilla holder-free window payload (started by cmp_window.sh): vanilla Strata 0.2.6 launcher, shipped defaults (route tail skip and CPU prefill share ON). +# CMP_VANILLA_LOSSY=0 turns both lossy defaults off (variant VANL instead of VAN). +# CMP_TASKS ("ttt nestng-crm") CMP_OPTIONAL (tasks dropped, with a note, when not ready) CMP_REPS ("1") CMP_WALL (cell wall limit s, default 3000) CMP_ROUNDS (round cap, default 150) CMP_RUN (default $CMP/runs/main) +# CMP_TARBALL (ours; default the final release package) +# Cells: cell.py of the codex-lossy-delta study (logging proxy, temperature 0 injected for BOTH arms, real Codex CLI, task acceptance); no AGENTS.md pad: the sessions are what a +# user gets. Output: $RUN//-r/ (cell.json, proxy/, acceptance.log ...), $RUN//stack-r/. Variants: LEL = Leleka, VAN = vanilla shipped, VANL = vanilla lossless. +set -uo pipefail +ARM=${CMP_ARM:?CMP_ARM ours|vanilla} +CMP=/data/leleka-e2e/codex-compare +TASKS_ROOT=$CMP/tasks +CELLPY=$CMP/delta/cell.py +CODEX=/home/para/work/codex-e2e/bin/codex +LOCK=/data/leleka-e2e/gpu.lock +G=$HOME/work/gpu-runs +A=/home/para/work/leleka/models/leleka-gates/assets +CUBLAS=$HOME/cuda-toolkits/cublas-12.9.1.4/lib +TASKS=${CMP_TASKS:-"ttt"} +REPS=${CMP_REPS:-"1"} +RUN=${CMP_RUN:-$CMP/runs/main} +WALL=${CMP_WALL:-3000}; ROUNDS=${CMP_ROUNDS:-150} +NODE_BIN=$(ls -d "$CMP"/toolchain/node-v*-linux-x64/bin 2>/dev/null | tail -1) +NM=$CMP/nm +case $ARM in ours) VAR=LEL;; vanilla) if [ "${CMP_VANILLA_LOSSY:-1}" = 1 ]; then VAR=VAN; else VAR=VANL; fi;; *) echo "bad CMP_ARM"; exit 2;; esac +BLK=$(echo "$REPS" | tr ' ' '+') +mkdir -p "$RUN" "$RUN/$VAR" +exec > >(tee -a "$RUN/job-$VAR-r$BLK.log") 2>&1 +log() { echo "[cmp $VAR $(date -u +%T)] $*"; } +note() { echo "[$(date -u +%FT%TZ)] [DEV codex-compare] $*" >>/data/leleka-e2e/decode/notes.md; } + +# ---- guards --------------------------------------------------------------------------------------------------------------------------------- +( cd "$CMP" && sha256sum --quiet -c INSTALL.sha256 ) || { echo "installed tools differ from INSTALL.sha256"; exit 3; } +python3 -I "$CMP/delta/taskfile.py" check "$TASKS_ROOT" >"$RUN/tasks-check-$VAR-r$BLK.txt" 2>&1 || { echo "task files differ from their manifest"; cat "$RUN/tasks-check-$VAR-r$BLK.txt"; exit 3; } +# a task listed in CMP_OPTIONAL that is not ready (not installed, or the Node toolchain not proven in the Codex sandbox) is DROPPED with a loud note instead of refusing the block +nestng_ready() { [ -f "$TASKS_ROOT/nestng-crm/task.md" ] && [ -f "$CMP/toolchain/NESTNG_OK" ] && [ -d "$NM/backend/node_modules" ] && [ -d "$NM/frontend/node_modules" ]; } +KEEP="" +for t in $TASKS; do + if [ "$t" = nestng-crm ] && ! nestng_ready; then + case " ${CMP_OPTIONAL:-} " in *" $t "*) log "TASK DROPPED: $t is not ready (toolchain/NESTNG_OK missing)"; note "codex-compare block $VAR reps [$REPS]: task $t DROPPED (not ready); queue it again later"; continue;; esac + echo "task $t is not ready (toolchain/NESTNG_OK, shared node_modules)"; exit 3 + fi + [ -f "$TASKS_ROOT/$t/task.md" ] || { echo "task $t is not installed in $TASKS_ROOT"; exit 3; } + KEEP="$KEEP $t" +done +TASKS=${KEEP# } +[ -f "$TASKS_ROOT/smoke-mini/task.md" ] || { echo "task smoke-mini is not installed"; exit 3; } +[ -x "$CODEX" ] || { echo "no codex binary"; exit 3; } +[ -n "$NODE_BIN" ] && [ -x "$NODE_BIN/node" ] || { echo "no node toolchain under $CMP/toolchain"; exit 3; } +STANDALONE=0; FD=${LELEKA_STRA169_KAR_FD:-} +if [ "$ARM" = ours ]; then + readlink "/proc/self/fd/$FD" 2>/dev/null | grep -q '^/memfd:' || { echo "ours needs the holder's sealed memfd"; exit 3; } + [ -d "$G/MODEL.lock" ] || { echo "MODEL.lock is not held"; exit 3; } +else + mkdir "$G/MODEL.lock" 2>/dev/null || { echo "MODEL.lock is held (holder still up?)"; exit 3; }; STANDALONE=1 +fi +got=0 +for _ in $(seq 1 4320); do + if mkdir "$LOCK" 2>/dev/null; then echo "codex-compare $VAR $(date -u +%FT%TZ) $RUN" >"$LOCK/owner"; got=1; break; fi + sleep 5 +done +[ $got = 1 ] || { echo "GPU lock held by: $(cat $LOCK/owner 2>/dev/null)"; [ $STANDALONE = 1 ] && rmdir "$G/MODEL.lock"; exit 3; } +SUP_PID=; MON_PID= +stop_stack() { + if [ -n "$SUP_PID" ] && kill -0 "$SUP_PID" 2>/dev/null; then kill -TERM "$SUP_PID" 2>/dev/null; for _ in $(seq 1 120); do kill -0 "$SUP_PID" 2>/dev/null || break; sleep 2; done; fi + SUP_PID= +} +cleanup() { + stop_stack + [ -n "$MON_PID" ] && kill "$MON_PID" 2>/dev/null + pkill -KILL -f "$CMP/ours-prefix-${CMP_OURS_TAG:-none}/bin/" 2>/dev/null + if [ "$ARM" = vanilla ]; then ( cd "$HOME/work/vanilla-strata/control" && ./bin/strata launch --stop >/dev/null 2>&1 ); fi + sleep 3 + rm -f "$LOCK/owner"; rmdir "$LOCK" 2>/dev/null + [ $STANDALONE = 1 ] && rmdir "$G/MODEL.lock" 2>/dev/null + note "codex-compare block $VAR reps [$REPS] ended: $RUN" +} +trap cleanup EXIT +note "codex-compare block $VAR started: $RUN tasks=[$TASKS] reps=[$REPS] wall=$WALL cap=$ROUNDS; holds gpu.lock" +if [ -n "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ]; then echo "something uses the GPU"; exit 3; fi +if pgrep -u "$USER" -x 'leleka-inference|strata-next|leleka-daemon' >/dev/null; then echo "a stack process exists"; exit 3; fi +for p in 18766 18080 8081 8090; do ss -ltn "sport = :$p" 2>/dev/null | grep -q LISTEN && { echo "port $p in use"; exit 3; }; done +export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} +# what the agent's shell sees, identical for both arms: Node on PATH, no analytics, caches in /tmp (the sandbox writes the workspace and /tmp only) +export PATH=$NODE_BIN:$PATH NG_CLI_ANALYTICS=false npm_config_cache=/tmp/cmp-npm-cache npm_config_update_notifier=false npm_config_fund=false npm_config_audit=false CI=1 +{ date -u +%FT%TZ; uname -r; nvidia-smi --query-gpu=name,driver_version,power.limit --format=csv,noheader; free -g | sed -n 2p; uptime; $CODEX --version; node --version; sha256sum "$CODEX"; } | tee "$RUN/$VAR/host-r$BLK.txt" +STK=$RUN/$VAR/stack-r$BLK; mkdir -p "$STK" +nvidia-smi --query-gpu=timestamp,temperature.gpu,clocks.sm,clocks.mem,power.draw,utilization.gpu --format=csv -l 10 >"$STK/mon.csv" 2>/dev/null & MON_PID=$! + +run_cells() { # $1 upstream url, $2 upstream model, $3 engine log, $4 api key ('' = none) + local url=$1 model=$2 elog=$3 key=$4 rep task t1 rc list link + for rep in $REPS; do + list="smoke-mini $TASKS" + [ $((rep % 2)) = 0 ] && list="smoke-mini $(echo $TASKS | tr ' ' '\n' | tac | tr '\n' ' ')" # task order alternates with the repetition + for task in $list; do + CELL=$RUN/$VAR/$task-r$rep; [ "$task" = smoke-mini ] && CELL=$RUN/$VAR/smoke-mini-r$((100 + rep)) + [ -f "$CELL/cell.json" ] && { log "cell $CELL already done: skipped"; continue; } + link=""; [ "$task" = nestng-crm ] && link="--link-tree backend/node_modules=$NM/backend/node_modules --link-tree frontend/node_modules=$NM/frontend/node_modules" + t1=$(date +%s) + E2E_API_KEY=${key:-none} CLD_CODEX=$CODEX timeout $((WALL + 900)) python3 -I "$CELLPY" --cell-dir "$CELL" --variant "$VAR" --task "$task" --rep "$([ "$task" = smoke-mini ] && echo $((100 + rep)) || echo $rep)" \ + --tasks-root "$TASKS_ROOT" --upstream "$url" --upstream-model "$model" --codex-bin "$CODEX" --wall-limit "$WALL" --max-rounds "$ROUNDS" \ + --engine-log "$elog" --active-dir "$RUN/active-$VAR" --config-extra 'model_auto_compact_token_limit = 100000000' $link >"$CELL.out" 2>&1; rc=$? + log "cell $VAR $task r$rep rc=$rc $(( $(date +%s) - t1 )) s: $(tail -1 "$CELL.out" | cut -c1-200)" + done + done +} + +if [ "$ARM" = ours ]; then + # ---- the release package, prepared ONCE into $CMP/ours-* (state, assets, prefix) and reused by every block --------------------------------------- + TARBALL=${CMP_TARBALL:-/data/leleka-e2e/release-5090/leleka-0.1.0-17e372944279-5090-linux-x86_64.tar.xz} + # CMP_OURS_TAG: package, state and prefix of THIS release only (the original script unpacked the tarball once into a shared ours-pkg and reused it for every later release: the 2026-11-12 stage 7 runs silently ran 17e372944279). Assets are shared (same files). + TAGSUF=${CMP_OURS_TAG:?CMP_OURS_TAG (release commit) is required: a shared package directory serves a stale release} + P=$CMP/ours-pkg-$TAGSUF; AS=$CMP/ours-assets; ST=$CMP/ours-state-$TAGSUF; PFX=$CMP/ours-prefix-$TAGSUF + if [ ! -x "$P/bin/leleka" ]; then mkdir -p "$P" && tar -xJf "$TARBALL" -C "$P" --strip-components=1 || { echo "unpack failed"; exit 5; }; fi + BIN=$P/bin + # the package of this release must carry the commit of the tag: PROVENANCE.json (git_commit) inside the unpacked tarball; a binary built outside git prints "commit unknown" in + python3 -I /data/leleka-e2e/prefill-latency/tools/prov_commit.py "$P/PROVENANCE.json" "$CMP_OURS_TAG" >/dev/null || { echo "package PROVENANCE git_commit does not match CMP_OURS_TAG=$CMP_OURS_TAG"; head -20 "$P/PROVENANCE.json"; exit 5; } + log "package provenance: commit $(python3 -I /data/leleka-e2e/prefill-latency/tools/prov_commit.py $P/PROVENANCE.json), tarball sha256 $(sha256sum $TARBALL | cut -c1-16)" + ( cd "$P" && sha256sum --quiet -c SHA256SUMS && echo "SHA256SUMS ok" ); "$BIN/leleka" version | tee "$STK/version.txt"; sha256sum "$TARBALL" | tee -a "$STK/version.txt" + if [ ! -e "$AS/model" ]; then + mkdir -p "$AS/data" + ln -s "$A/model" "$AS/model"; ln -s "$A/tokenizer-assets" "$AS/tokenizer-assets"; ln -s "$A/qwen-iq3-s-l2-v4.kar" "$AS/qwen-iq3-s-l2-v4.kar" + cp "$A/qwen-iq3-s-l2-v4.kar.provenance.json" "$AS/qwen-iq3-s-l2-v4.kar.provenance.json" + cp -al "$A/data/iq3_s" "$AS/data/iq3_s"; cp -al "$A/data/mtp-rt" "$AS/data/mtp-rt" + fi + COMMON="--assets $AS --state-dir $ST --prefix $PFX --bin-src $BIN --cublas-dir $CUBLAS --trust-archive --kar-fd $FD" + if [ ! -f "$ST/leleka.json" ]; then timeout 3000 "$BIN/leleka" up --mode none $COMMON >"$STK/up-prepare.txt" 2>&1; log "up --mode none rc=$?"; fi + [ -f "$ST/leleka.json" ] || { echo "up did not prepare the state"; tail -20 "$STK/up-prepare.txt"; exit 6; } + log "leleka up --foreground (shipped configuration)" + t0=$(date +%s) + FLAGS="" + if [ -n "${CMP_ARM_PROFILE_SET:-}${CMP_ARM_PROFILE_OFF:-}" ]; then + # EXPERIMENTAL arm profile = the package profile with engine_env keys set / dropped (the built-in profile overrides the shell env since pkg-s14); proof = the "engine environment" line of up-foreground.txt + "$BIN/leleka" profiles show "${CMP_PROFILE_NAME:-rtx5090-32g}" | PROF_OFF="${CMP_ARM_PROFILE_OFF:-}" PROF_SET="${CMP_ARM_PROFILE_SET:-}" python3 -I /data/leleka-e2e/prefill-latency/tools/profile_patch.py "$STK/arm-profile.json" && FLAGS="--profile $STK/arm-profile.json" || { echo "arm profile failed"; exit 6; } + log "arm profile: off=[${CMP_ARM_PROFILE_OFF:-}] set=[${CMP_ARM_PROFILE_SET:-}]" + fi + setsid "$BIN/leleka" up --foreground $COMMON $FLAGS --timeout-s 1800 >"$STK/up-foreground.txt" 2>&1 & + SUP_PID=$! + ready=0 + for _ in $(seq 1 700); do + if "$PFX/bin/leleka" status --state-dir "$ST" >/dev/null 2>&1; then ready=1; break; fi + kill -0 "$SUP_PID" 2>/dev/null || break + sleep 3 + done + if [ $ready != 1 ]; then log "NOT READY after $(( $(date +%s) - t0 )) s"; tail -20 "$STK/up-foreground.txt" | cut -c1-240; exit 7; fi + log "ready after $(( $(date +%s) - t0 )) s" + echo "$(( $(date +%s) - t0 ))" >"$STK/ready_s.txt" + "$PFX/bin/leleka" status --state-dir "$ST" >"$STK/status.txt" 2>&1; "$PFX/bin/leleka" status --state-dir "$ST" --json >"$STK/status.json" 2>&1 + "$PFX/bin/leleka" verify --quick --state-dir "$ST" --assets "$AS" >"$STK/verify-quick.txt" 2>&1 + KEY=$(cat "$ST/api-key") + run_cells http://127.0.0.1:8081 qwen-iq3 "$ST/logs/engine.log" "$KEY" + cp "$ST/logs/engine.log" "$STK/engine.log" 2>/dev/null; cp "$ST/logs/requests.log" "$STK/requests.log" 2>/dev/null + "$PFX/bin/leleka" verify --quick --state-dir "$ST" --assets "$AS" >"$STK/verify-quick-end.txt" 2>&1 + stop_stack +else + # ---- vanilla Strata 0.2.6 (launcher + engine 0.1.50), shipped defaults unless CMP_VANILLA_LOSSY=0; state redirected into the run directory ---------- + export XDG_CONFIG_HOME=$STK/xdg-config XDG_STATE_HOME=$STK/xdg-state + mkdir -p "$XDG_CONFIG_HOME/strata" "$XDG_STATE_HOME"; cp ~/.config/strata/settings.json "$XDG_CONFIG_HOME/strata/" + if [ "${CMP_VANILLA_LOSSY:-1}" = 1 ]; then unset STRATA_ROUTE_TAIL_SKIP STRATA_PREFILL_CPU_SHARE; else export STRATA_ROUTE_TAIL_SKIP=0 STRATA_PREFILL_CPU_SHARE=0; fi + unset STRATA_DECODE_TIMING STRATA_VERIFY_PROFILE + S=$HOME/work/vanilla-strata/control/bin/strata + { sha256sum "$HOME/.local/share/strata/components/engine/0.1.50-linux-x86_64-cuda-cuda13/strata"; cat "$HOME/work/vanilla-strata/control/VERSION" "$HOME/work/vanilla-strata/control/COMMIT" 2>/dev/null; env | grep -E '^STRATA_' | sort; } >"$STK/env.txt" + cd "$HOME/work/vanilla-strata/control" + t0=$(date +%s) + timeout 2400 "$S" launch --model iq3_s --family qwen --model-path "$A/model" --context 256k --kv int8 --vision off --parallel 1 --tune skip --access local --port 8090 --no-api-key --no-tui --yes >"$STK/launch.out" 2>&1 + log "vanilla launch rc=$? ready after $(( $(date +%s) - t0 )) s" + echo "$(( $(date +%s) - t0 ))" >"$STK/ready_s.txt" + if curl -fs http://127.0.0.1:8090/v1/models >"$STK/models.json"; then + MODEL=$(python3 -c "import json;print(json.load(open('$STK/models.json'))['data'][0]['id'])") + EL=$XDG_STATE_HOME/strata/launch/iq3_s-256k.engine.log + run_cells http://127.0.0.1:8090 "$MODEL" "$EL" "" + cp "$EL" "$STK/engine.log" 2>/dev/null + grep -iE "route tail skip|CPU share" "$STK/engine.log" | head -4 >"$STK/lossy-lines.txt" + else + log "vanilla did not become ready" + fi + "$S" launch --stop >>"$STK/launch.out" 2>&1 + sleep 8 +fi +log "done" diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r1.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r1.sh new file mode 100644 index 00000000..065aa6d8 --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r1.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# BISECT: the five stage-set keys (LOAN_TIERS, DRAFT_CHECK_MERGE, PREFIX_PARK_FAST, DECODE_GRAPH_REUSE, STREAM_MIN) dropped from the profile. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 1. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-crm-release-02c784249a7e-stage-set-off +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="nestng-crm" CMP_REPS="1" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz +export CMP_ARM_PROFILE_OFF="LELEKA_PREFILL_LOAN_TIERS LELEKA_DRAFT_CHECK_MERGE LELEKA_PREFIX_PARK_FAST LELEKA_DECODE_GRAPH_REUSE STRATA_PREFILL_STREAM_MIN" +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r2.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r2.sh new file mode 100644 index 00000000..7a7edabc --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r2.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# BISECT: the five stage-set keys (LOAN_TIERS, DRAFT_CHECK_MERGE, PREFIX_PARK_FAST, DECODE_GRAPH_REUSE, STREAM_MIN) dropped from the profile. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 2. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-crm-release-02c784249a7e-stage-set-off +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="nestng-crm" CMP_REPS="2" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz +export CMP_ARM_PROFILE_OFF="LELEKA_PREFILL_LOAN_TIERS LELEKA_DRAFT_CHECK_MERGE LELEKA_PREFIX_PARK_FAST LELEKA_DECODE_GRAPH_REUSE STRATA_PREFILL_STREAM_MIN" +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r3.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r3.sh new file mode 100644 index 00000000..75a7d951 --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-lel-r3.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# BISECT: the five stage-set keys (LOAN_TIERS, DRAFT_CHECK_MERGE, PREFIX_PARK_FAST, DECODE_GRAPH_REUSE, STREAM_MIN) dropped from the profile. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 3. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-crm-release-02c784249a7e-stage-set-off +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="nestng-crm" CMP_REPS="3" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz +export CMP_ARM_PROFILE_OFF="LELEKA_PREFILL_LOAN_TIERS LELEKA_DRAFT_CHECK_MERGE LELEKA_PREFIX_PARK_FAST LELEKA_DECODE_GRAPH_REUSE STRATA_PREFILL_STREAM_MIN" +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-report.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-report.sh new file mode 100644 index 00000000..0046a0ee --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-crm-release-02c784249a7e-stage-set-off-report.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# CPU-only: index and side-by-side report of the cells of crm-release-02c784249a7e-stage-set-off (LEL new, VAN/VANL saved) +set -u +C=/data/leleka-e2e/codex-compare; R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-crm-release-02c784249a7e-stage-set-off +python3 -I $C/delta/index.py $R > $R/index.out 2>&1 +python3 -I $C/tools/cmp_report.py $R > $R/report.out 2>&1 +tail -40 $R/report.out diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r1.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r1.sh new file mode 100644 index 00000000..e7adaf09 --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r1.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Stage 7, DEFAULT profile. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 1. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-default +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="1" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz + +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r2.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r2.sh new file mode 100644 index 00000000..f09a2aee --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r2.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Stage 7, DEFAULT profile. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 2. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-default +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="2" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz + +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r3.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r3.sh new file mode 100644 index 00000000..49d5d57c --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-lel-r3.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Stage 7, DEFAULT profile. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 3. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-default +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="3" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz + +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-report.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-report.sh new file mode 100644 index 00000000..05f87573 --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-default-report.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# CPU-only: index and side-by-side report of the cells of ttt-and-crm-release-02c784249a7e-default (LEL new, VAN/VANL saved) +set -u +C=/data/leleka-e2e/codex-compare; R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-default +python3 -I $C/delta/index.py $R > $R/index.out 2>&1 +python3 -I $C/tools/cmp_report.py $R > $R/report.out 2>&1 +tail -40 $R/report.out diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r1.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r1.sh new file mode 100644 index 00000000..f8925b7d --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r1.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# EXPERIMENTAL candidate (quota=no, PCIe share 0.65); not the default. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 1. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="1" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz +export CMP_ARM_PROFILE_SET="LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65" +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r2.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r2.sh new file mode 100644 index 00000000..d286d245 --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r2.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# EXPERIMENTAL candidate (quota=no, PCIe share 0.65); not the default. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 2. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="2" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz +export CMP_ARM_PROFILE_SET="LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65" +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r3.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r3.sh new file mode 100644 index 00000000..32e0eb43 --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-lel-r3.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# EXPERIMENTAL candidate (quota=no, PCIe share 0.65); not the default. Release 02c784249a7e (CMP_OURS_TAG: own package, state and prefix directories; the earlier stage 7 / bisect / candidate runs of 2026-11-12 ran the STALE shared package 17e372944279 and are void), repetition 3. Saved vanilla cells (VAN, VANL) are symlinked and never re-run. +unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL CMP_ARM_PROFILE_SET CMP_ARM_PROFILE_OFF CMP_OURS_TAG +R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental +mkdir -p $R; for v in VAN VANL; do [ -e $R/$v ] || ln -s /data/leleka-e2e/codex-compare/runs/main/$v $R/$v; done +export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="3" CMP_RUN=$R CMP_OURS_TAG=02c784249a7e CMP_TARBALL=/data/leleka-e2e/prefill-latency/release-s20/leleka-0.1.0-02c784249a7e-linux-x86_64.tar.xz +export CMP_ARM_PROFILE_SET="LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65" +exec bash /data/leleka-e2e/prefill-latency/tools/cmp_codex_job_profile.sh diff --git a/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-report.sh b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-report.sh new file mode 100644 index 00000000..73effc6e --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental-report.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# CPU-only: index and side-by-side report of the cells of ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental (LEL new, VAN/VANL saved) +set -u +C=/data/leleka-e2e/codex-compare; R=/data/leleka-e2e/prefill-latency/runs/e2e-codex-ttt-and-crm-release-02c784249a7e-quota-no-pcie065-experimental +python3 -I $C/delta/index.py $R > $R/index.out 2>&1 +python3 -I $C/tools/cmp_report.py $R > $R/report.out 2>&1 +tail -40 $R/report.out diff --git a/scripts/e2e/codex/prefill/e2e-release/profile_patch.py b/scripts/e2e/codex/prefill/e2e-release/profile_patch.py new file mode 100644 index 00000000..0fb444ed --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/profile_patch.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +"""stdin: leleka profile JSON; env PROF_OFF / PROF_SET (space separated keys / KEY=VALUE); argv[1]: output file.""" +import json, os, sys +p = json.load(sys.stdin) +e = p["engine_env"] +for k in os.environ.get("PROF_OFF", "").split(): + e.pop(k, None) +for kv in os.environ.get("PROF_SET", "").split(): + k, v = kv.split("=", 1) + e[k] = v +json.dump(p, open(sys.argv[1], "w"), indent=1) diff --git a/scripts/e2e/codex/prefill/e2e-release/prov_commit.py b/scripts/e2e/codex/prefill/e2e-release/prov_commit.py new file mode 100644 index 00000000..0bf2a66f --- /dev/null +++ b/scripts/e2e/codex/prefill/e2e-release/prov_commit.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 +"""usage: prov_commit.py PROVENANCE.json [TAG]: prints git_commit; with TAG exits 1 unless it starts with TAG.""" +import json, sys +c = json.load(open(sys.argv[1]))["git_commit"] +print(c) +sys.exit(0 if len(sys.argv) < 3 or c.startswith(sys.argv[2]) else 1) diff --git a/scripts/e2e/codex/prefill/group-ab/host-tier-quota-no-pcie065-vs-default-release-group-ab-5-pairs.sh b/scripts/e2e/codex/prefill/group-ab/host-tier-quota-no-pcie065-vs-default-release-group-ab-5-pairs.sh new file mode 100644 index 00000000..ffc26e68 --- /dev/null +++ b/scripts/e2e/codex/prefill/group-ab/host-tier-quota-no-pcie065-vs-default-release-group-ab-5-pairs.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# GROUP A/B of the EXPERIMENTAL placement candidate (quota=no + PCIe share 0.65) against the shipped default, on the pinned release 02c784249a7e (PROVENANCE git_commit, tarball sha256 254ea79f...). +# Owner 2026-11-12: "measure first" before any decision about the default PCIe share. Engine configured for 262,144 context; the replayed Codex cell is VANL/nestng-crm-r2 (30 requests, same prompts every block). +# A = the built-in profile as shipped (per-layer quota yes, PCIe share 0.45) QN = A + EXPERT_PER_LAYER=no + PCIE_FRAC=0.65 (profile keys, no tracing flag) +# AT = A/A twin of A (same environment): the noise floor of the pairs A.k vs AT.k (k = 1..3) +# Arm guard (pf_ab_job_q.sh): the engine-log meta line must show expert_per_layer / pcie_frac of the arm, else the block is marked INVALID. +# Report: ab_report.py RUN_DIR A QN ; ab_report.py RUN_DIR A AT (A/A) ; min free VRAM from mon.csv (memory.free, 1 s samples) per block. +unset PF_VARIANTS PF_CELLS PF_OUT PF_MAX PF_CLIENT PF_TEST_BIN PF_TEST_FILTERS PF_RELEASE_TAG PF_STATE PF_PREFIX +export PF_PKG=/data/leleka-e2e/codex-compare/ours-pkg-02c784249a7e PF_RELEASE_TAG=02c784249a7e +export PF_STATE=/data/leleka-e2e/prefill-latency/state-02c784249a7e PF_PREFIX=/data/leleka-e2e/prefill-latency/prefix-02c784249a7e +export PF_VARIANTS="A.1 QN.1 AT.1 QN.2 A.2 AT.2 A.3 QN.3 AT.3 QN.4 A.4 A.5 QN.5" PF_MAX=30 +export PF_OUT=/data/leleka-e2e/prefill-latency/runs/host-tier-quota-no-pcie065-vs-default-release-group-ab-5-pairs +exec bash /data/leleka-e2e/prefill-latency/tools/pf_ab_job_q.sh diff --git a/scripts/e2e/codex/prefill/group-ab/pf_ab_job_q.sh b/scripts/e2e/codex/prefill/group-ab/pf_ab_job_q.sh new file mode 100644 index 00000000..5e9c3afa --- /dev/null +++ b/scripts/e2e/codex/prefill/group-ab/pf_ab_job_q.sh @@ -0,0 +1,176 @@ +#!/usr/bin/env bash +# Prefill fixed-latency A/B driver (docs/prefill-throughput.md, "Prefill fixed latency per request"): a copy of the speed program's spd_ab_job.sh +# (scripts/e2e/codex/speed) that runs against its own package, state and prefix directories, so it never touches the codex-compare release state. +# The SAME recorded Codex prompts are replayed through the packaged stack; a variant is named NAME or NAME.BLOCK (A.1 L.1 L.2 A.2 ...), BLOCK only names the output directory. +# replay_hash.py (next to this file in the server tools dir) records the sha256 of each request's output. +# HOLDER JOB (inherits the sealed KAR memfd). Test tooling, never in serving. +# PF_VARIANTS space separated variant names (default "A L") +# PF_CELLS recorded cells to replay, in order (default VANL/nestng-crm-r2 of the codex-compare run) +# PF_OUT result directory (default $PL/runs/main) +# PF_MAX requests per cell (default all) +# PF_ROOT the task directory (default /data/leleka-e2e/prefill-latency): pkg/bin (binaries under test), state/, prefix/, tools/ +# PF_CLIENT the client script in the tools directory (default replay_hash.py; pf_probe.py = the empty-request probe of ledger rows A1-A3) +# PF_PKG the package directory (default $PF_ROOT/pkg): bin/ and SHA256SUMS; lets a second build run next to the first +# Variants (engine environment of the `leleka up` process): +# A shipped (the prompt loan is the full 8192-row loan for every chunk) +# L the prompt loan ladder: LELEKA_PREFILL_LOAN_TIERS=1 (a chunk of at most 512 / 2048 rows borrows and refills a smaller loan) +# AR as A with LELEKA_TRACE_PREFILL_R=1: one PREFILL-R line (FNV-1a of every bit of the chunk's final residual) per chunk, the identity record +# LR as L with LELEKA_TRACE_PREFILL_R=1 +# P as A with the step profile (LELEKA_SERVE_PROFILE=1: one `DBG profile request` line of host spans per request) +# LP as L with the step profile +# LT as L with the bring-up trace (LELEKA_BRINGUP_TRACE=1: the driver error behind a failed chunk) +# C as A with the draft chain pipeline (LELEKA_DRAFT_CHAIN_PIPELINE=1: the chain steps enqueued back to back, one drain) +# DT as A with LELEKA_TRACE_DRAFT=1 (the draft-round identity lines) MC draft check merge (LELEKA_DRAFT_CHECK_MERGE=1) MT = MC + DT MCP = MC + profile +# RG decode graph reuse across requests (LELEKA_DECODE_GRAPH_REUSE=1) RGP = RG + profile RGT = RG + draft trace +# GT prefill GDN tensor-core scan (LELEKA_PREFILL_GDN_TC=1, EXPERIMENTAL, lossy) GTP = GT + profile GTD = GT + draft trace +# PF/PA parking fast / async (+P: with profile) X = chain pipeline + check merge + parking fast (the group of host/draft switches) XT = X + DT +# CP as C with the step profile AP as A with the step profile (the pair for the host spans of the draft) +set -uo pipefail +PL=${PF_ROOT:-/data/leleka-e2e/prefill-latency} +CMP=/data/leleka-e2e/codex-compare +RUN=${PF_OUT:-$PL/runs/main} +VARS=${PF_VARIANTS:-"A L"} +MAXR=${PF_MAX:-0} +CELLS=${PF_CELLS:-"$CMP/runs/main/VANL/nestng-crm-r2"} +LOCK=/data/leleka-e2e/gpu.lock +G=$HOME/work/gpu-runs +CUBLAS=$HOME/cuda-toolkits/cublas-12.9.1.4/lib +FD=${LELEKA_STRA169_KAR_FD:-} +mkdir -p "$RUN" +exec > >(tee -a "$RUN/job-$(date -u +%H%M%S).log") 2>&1 +log() { echo "[pf $(date -u +%T)] $*"; } +note() { echo "[$(date -u +%FT%TZ)] [DEV prefill-latency] $*" >>/data/leleka-e2e/decode/notes.md; } +readlink "/proc/self/fd/$FD" 2>/dev/null | grep -q '^/memfd:' || { echo "needs the holder's sealed memfd"; exit 3; } +# Guard: the shipped profiles read only the PLE extents (~15 GiB, memfd_extents ple_only). A holder that sealed the whole archive (every holder window ends with the FULL +# single-copy-holder.sh) makes `leleka up` refuse ("a second copy of model bytes") and inflates host memory. Allocated size of the inherited memfd, in GiB: +ALLOC_GIB=$(( $(stat -L -c %b "/proc/self/fd/$FD") / 2097152 )) +log "inherited memfd: $ALLOC_GIB GiB allocated" +if [ "${PF_ALLOW_FULL_MEMFD:-0}" != 1 ] && [ "$ALLOC_GIB" -gt "${PF_MEMFD_MAX_GIB:-20}" ]; then + # newest .running: stale ones of killed jobs exist + JOBF=$(ls -t "$G"/holder2/jobs/*.running 2>/dev/null | head -1); JOBN=$(basename "${JOBF%.running}") + [ -n "$JOBN" ] || { echo "memfd is not sparse and the queue entry of this job is unknown"; exit 3; } + log "memfd is not sparse ($ALLOC_GIB GiB > ${PF_MEMFD_MAX_GIB:-20}): restarting the lab holder sparse and queueing $JOBN again" + touch "$G/holder2/jobs/STOP" + ( eval "exec ${FD}>&-"; setsid nohup bash "$PL/tools/pf_sparse_requeue.sh" "$JOBN" > "$PL/window-requeue-$JOBN.launch" 2>&1 < /dev/null & ) + exit 0 +fi +[ -d "$G/MODEL.lock" ] || { echo "MODEL.lock is not held"; exit 3; } +PKG=${PF_PKG:-$PL/pkg} +AS=$CMP/ours-assets; ST=${PF_STATE:-$PL/state}; PFX=${PF_PREFIX:-$PL/prefix}; BIN=$PKG/bin +# release layout (PF_RELEASE_TAG=<12 hex>): the package is the unpacked release tarball, identity by PROVENANCE git_commit, state and prefix prepared here once +if [ -n "${PF_RELEASE_TAG:-}" ]; then + python3 -I "$PL/tools/prov_commit.py" "$PKG/PROVENANCE.json" "$PF_RELEASE_TAG" >/dev/null || { echo "package PROVENANCE git_commit does not match $PF_RELEASE_TAG"; exit 5; } + (cd "$PKG" && sha256sum -c SHA256SUMS >/dev/null 2>&1) || { echo "the release files do not match $PKG/SHA256SUMS"; exit 5; } + log "release package: commit $(python3 -I "$PL/tools/prov_commit.py" "$PKG/PROVENANCE.json" "$PF_RELEASE_TAG"), files verified against SHA256SUMS" + if [ ! -f "$ST/leleka.json" ]; then mkdir -p "$ST" "$PFX"; timeout 3000 "$BIN/leleka" up --mode none --assets $AS --state-dir $ST --prefix $PFX --bin-src $BIN --cublas-dir $CUBLAS --trust-archive --kar-fd $FD >"$RUN/up-prepare.txt" 2>&1; log "up --mode none rc=$?"; fi +fi +[ -x "$BIN/leleka" ] && [ -f "$ST/leleka.json" ] || { echo "the prefill-latency package or state is not prepared"; exit 3; } +[ -n "${PF_RELEASE_TAG:-}" ] || (cd "$BIN" && sha256sum -c ../SHA256SUMS >/dev/null 2>&1) || { echo "the package binaries do not match $PKG/SHA256SUMS"; exit 3; } +got=0; for _ in $(seq 1 4320); do if mkdir "$LOCK" 2>/dev/null; then echo "prefill-latency $(date -u +%FT%TZ) $RUN" >"$LOCK/owner"; got=1; break; fi; sleep 5; done +[ $got = 1 ] || { echo "GPU lock held by: $(cat $LOCK/owner 2>/dev/null)"; exit 3; } +SUP_PID=; MON_PID= +stop_stack() { if [ -n "$SUP_PID" ] && kill -0 "$SUP_PID" 2>/dev/null; then kill -TERM "$SUP_PID" 2>/dev/null; for _ in $(seq 1 120); do kill -0 "$SUP_PID" 2>/dev/null || break; sleep 2; done; fi; SUP_PID=; } +cleanup() { stop_stack; [ -n "$MON_PID" ] && kill "$MON_PID" 2>/dev/null; pkill -KILL -f "$PFX/bin/" 2>/dev/null; sleep 3; rm -f "$LOCK/owner"; rmdir "$LOCK" 2>/dev/null; note "prefill-latency job ended: $RUN"; } +trap cleanup EXIT +note "prefill-latency job started: variants [$VARS] cells [$CELLS] out $RUN" +[ -z "$(nvidia-smi --query-compute-apps=pid --format=csv,noheader 2>/dev/null)" ] || { echo "something uses the GPU"; exit 3; } +export LD_LIBRARY_PATH=$CUBLAS:$HOME/cuda-toolkits/13.2.2/lib64:${LD_LIBRARY_PATH:-} +COMMON="--assets $AS --state-dir $ST --prefix $PFX --bin-src $BIN --cublas-dir $CUBLAS --trust-archive --kar-fd $FD" +for v in $VARS; do + D=$RUN/$v; mkdir -p "$D"; vb=${v%%.*} + [ -f "$D/replay.jsonl" ] && { log "variant $v already done: skipped"; continue; } + unset LELEKA_PREFILL_LOAN_TIERS LELEKA_TRACE_PREFILL_R LELEKA_SERVE_PROFILE STRATA_VERIFY_PROFILE LELEKA_REFILL_DEFER LELEKA_BRINGUP_TRACE LELEKA_DRAFT_CHAIN_PIPELINE LELEKA_PREFIX_PARK_FAST LELEKA_PREFIX_PARK_ASYNC LELEKA_DRAFT_CHECK_MERGE LELEKA_TRACE_DRAFT LELEKA_PREFILL_GDN_TC LELEKA_DECODE_GRAPH_REUSE LELEKA_PREFILL_DIAG_SKIP_EXPERT_DMA LELEKA_PREFILL_ROUTE_TRACE STRATA_PREFILL_STREAM_MIN LELEKA_PREFILL_RING_PREFETCH LELEKA_PREFILL_RING_PREFETCH_WINDOW LELEKA_PREFILL_RING_PREFETCH_DETACH LELEKA_ORIGINAL_SERVE_PCIE_FRAC LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER LELEKA_ORIGINAL_SERVE_PCIE_MODE LELEKA_REFILL_BATCH LELEKA_REFILL_DEFER LELEKA_TRACE_DRIVER_ERRORS + PROF_OFF=""; PROF_SET="" # profile engine_env keys to drop / set for this variant (the built-in profile OVERRIDES the shell env of the engine since pkg-s14) + case $vb in + A) ;; # = the built-in profile as shipped (checks merge, park fast, graph reuse, stream 1536, loan tiers are ON in it) + L) export LELEKA_PREFILL_LOAN_TIERS=1;; + AR) export LELEKA_TRACE_PREFILL_R=1;; + LR) export LELEKA_PREFILL_LOAN_TIERS=1 LELEKA_TRACE_PREFILL_R=1;; + P) export LELEKA_SERVE_PROFILE=1;; + LP) export LELEKA_PREFILL_LOAN_TIERS=1 LELEKA_SERVE_PROFILE=1;; + LT) export LELEKA_PREFILL_LOAN_TIERS=1 LELEKA_BRINGUP_TRACE=1;; + C) export LELEKA_DRAFT_CHAIN_PIPELINE=1;; + CP) export LELEKA_DRAFT_CHAIN_PIPELINE=1 LELEKA_SERVE_PROFILE=1;; + AP) export LELEKA_SERVE_PROFILE=1;; + SP1) export STRATA_PREFILL_STREAM_MIN=1024 LELEKA_SERVE_PROFILE=1;; # chunks of 1024+ rows use the expert stream (vanilla default) + SP2) export STRATA_PREFILL_STREAM_MIN=256 LELEKA_SERVE_PROFILE=1;; + SR) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_TRACE_PREFILL_R=1;; + # the stream threshold of the 5090 profiles is part of the base for the prefetch and refill-batch arms + FR) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_TRACE_PREFILL_R=1;; + FP) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_SERVE_PROFILE=1;; + PE) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_PREFILL_RING_PREFETCH=1 LELEKA_TRACE_PREFILL_R=1 LELEKA_TRACE_DRIVER_ERRORS=1;; + PED) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_PREFILL_RING_PREFETCH=1 LELEKA_PREFILL_RING_PREFETCH_DETACH=1 LELEKA_TRACE_PREFILL_R=1 LELEKA_TRACE_DRIVER_ERRORS=1;; + PEDP) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_PREFILL_RING_PREFETCH=1 LELEKA_PREFILL_RING_PREFETCH_DETACH=1 LELEKA_SERVE_PROFILE=1;; + PEP) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_PREFILL_RING_PREFETCH=1 LELEKA_SERVE_PROFILE=1;; + PET) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_PREFILL_RING_PREFETCH=1 LELEKA_TRACE_DRIVER_ERRORS=1 LELEKA_SERVE_PROFILE=1;; + RB) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_REFILL_BATCH=1 LELEKA_TRACE_PREFILL_R=1;; + RBP) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_REFILL_BATCH=1 LELEKA_SERVE_PROFILE=1;; + SRP) export STRATA_PREFILL_STREAM_MIN=1536 LELEKA_SERVE_PROFILE=1;; + APR) export LELEKA_SERVE_PROFILE=1 LELEKA_PREFILL_ROUTE_TRACE=1;; + RG) export LELEKA_DECODE_GRAPH_REUSE=1;; + RGP) export LELEKA_DECODE_GRAPH_REUSE=1 LELEKA_SERVE_PROFILE=1;; + RGT) export LELEKA_DECODE_GRAPH_REUSE=1 LELEKA_TRACE_DRAFT=1;; + GT) export LELEKA_PREFILL_GDN_TC=1;; + GTP) export LELEKA_PREFILL_GDN_TC=1 LELEKA_SERVE_PROFILE=1;; + GTD) export LELEKA_PREFILL_GDN_TC=1 LELEKA_TRACE_DRAFT=1;; + DT) export LELEKA_TRACE_DRAFT=1;; + MC) export LELEKA_DRAFT_CHECK_MERGE=1;; + MT) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_TRACE_DRAFT=1;; + MCP) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_SERVE_PROFILE=1;; + X) export LELEKA_DRAFT_CHAIN_PIPELINE=1 LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1;; + XT) export LELEKA_DRAFT_CHAIN_PIPELINE=1 LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1 LELEKA_TRACE_DRAFT=1;; + Y) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1 LELEKA_DECODE_GRAPH_REUSE=1;; + # the complete prefill/host set of the 5090 profiles: check merge + park fast + graph reuse + expert stream from 1536 rows + Z) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1 LELEKA_DECODE_GRAPH_REUSE=1 STRATA_PREFILL_STREAM_MIN=1536;; + # V5/V7 probes (profiled, placement-class: CPU and GPU round an expert differently): PCIe share and PCIe mode + # tier layout: vanilla fills the profile in global rank order, the 5090 profiles give every layer the same quota (254 slots); placement-class + # candidate of the 2026-11-12 group A/B: per-layer quota off (global rank fill) + PCIe share 0.65, profile keys (no tracing flag: throughput arm); AT = the A/A twin of A (same environment) + QN) PROF_SET="LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65";; + AT) ;; + GLP) PROF_SET="LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no"; export LELEKA_SERVE_PROFILE=1;; + # the stage-start state: the profile without the prefill/host set of this stage (loan tiers, check merge, park fast, graph reuse, stream 1536) + A0) PROF_OFF="LELEKA_PREFILL_LOAN_TIERS LELEKA_DRAFT_CHECK_MERGE LELEKA_PREFIX_PARK_FAST LELEKA_DECODE_GRAPH_REUSE STRATA_PREFILL_STREAM_MIN";; + A0P) PROF_OFF="LELEKA_PREFILL_LOAN_TIERS LELEKA_DRAFT_CHECK_MERGE LELEKA_PREFIX_PARK_FAST LELEKA_DECODE_GRAPH_REUSE STRATA_PREFILL_STREAM_MIN"; export LELEKA_SERVE_PROFILE=1;; + Q55) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.55 LELEKA_SERVE_PROFILE=1;; + Q65) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65 LELEKA_SERVE_PROFILE=1;; + Q75) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.75 LELEKA_SERVE_PROFILE=1;; + Q35) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.35 LELEKA_SERVE_PROFILE=1;; + QK) export LELEKA_ORIGINAL_SERVE_PCIE_MODE=kernel LELEKA_SERVE_PROFILE=1;; + YP) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1 LELEKA_DECODE_GRAPH_REUSE=1 STRATA_PREFILL_STREAM_MIN=1536 LELEKA_SERVE_PROFILE=1;; + YRP) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1 LELEKA_DECODE_GRAPH_REUSE=1 LELEKA_REFILL_DEFER=1 STRATA_PREFILL_STREAM_MIN=1536 LELEKA_SERVE_PROFILE=1;; + DSP) export LELEKA_PREFILL_DIAG_SKIP_EXPERT_DMA=40000 LELEKA_SERVE_PROFILE=1;; # diagnostic, WRONG outputs: how much of moe.ring is bytes + PF) export LELEKA_PREFIX_PARK_FAST=1;; + PA) export LELEKA_PREFIX_PARK_FAST=1 LELEKA_PREFIX_PARK_ASYNC=1;; + PFP) export LELEKA_PREFIX_PARK_FAST=1 LELEKA_SERVE_PROFILE=1;; + PAP) export LELEKA_PREFIX_PARK_FAST=1 LELEKA_PREFIX_PARK_ASYNC=1 LELEKA_SERVE_PROFILE=1;; + *) echo "unknown variant $v"; continue;; + esac + export LELEKA_SPEC_STATS=1 + PROFARG="" + if [ -n "$PROF_OFF$PROF_SET" ]; then + "$BIN/leleka" profiles show rtx5090-32g | PROF_OFF="$PROF_OFF" PROF_SET="$PROF_SET" python3 -I -c 'import json,os,sys; p=json.load(sys.stdin); e=p["engine_env"]; [e.pop(k,None) for k in os.environ["PROF_OFF"].split()]; [e.__setitem__(*kv.split("=",1)) for kv in os.environ["PROF_SET"].split()]; json.dump(p,open(sys.argv[1],"w"),indent=1)' "$D/profile.json" && PROFARG="--profile $D/profile.json" + log "variant $v: profile override off=[$PROF_OFF] set=[$PROF_SET]" + fi + : >"$ST/logs/engine.log" 2>/dev/null + nvidia-smi --query-gpu=timestamp,temperature.gpu,clocks.sm,clocks.mem,power.draw,utilization.gpu,memory.used,memory.free --format=csv -lms 1000 >"$D/mon.csv" 2>/dev/null & MON_PID=$! + log "variant $v: leleka up --foreground" + t0=$(date +%s) + setsid "$BIN/leleka" up --foreground $COMMON $PROFARG --timeout-s 1800 >"$D/up-foreground.txt" 2>&1 & + SUP_PID=$! + ready=0 + for _ in $(seq 1 700); do "$PFX/bin/leleka" status --state-dir "$ST" >/dev/null 2>&1 && { ready=1; break; }; kill -0 "$SUP_PID" 2>/dev/null || break; sleep 3; done + [ $ready = 1 ] || { log "variant $v NOT READY"; tail -20 "$D/up-foreground.txt" | cut -c1-240; stop_stack; kill "$MON_PID" 2>/dev/null; continue; } + log "ready after $(( $(date +%s) - t0 )) s" + "$PFX/bin/leleka" status --state-dir "$ST" --json >"$D/status.json" 2>&1 + args=(); for c in $CELLS; do args+=(--cell "$c"); done + python3 -I "$PL/tools/${PF_CLIENT:-replay_hash.py}" "${args[@]}" --url http://127.0.0.1:8081 --model qwen-iq3 --key-file "$ST/api-key" --out "$D/replay.jsonl" --max-requests "$MAXR" >"$D/replay.out" 2>&1 + log "replay rc=$? $(wc -l <"$D/replay.jsonl") requests" + cp "$ST/logs/engine.log" "$D/engine.log" 2>/dev/null; cp "$ST/logs/requests.log" "$D/requests.log" 2>/dev/null + # arm guard (placement arms): the meta line of the engine log must show the share and the layout this arm asked for; a mismatch marks the block INVALID + META=$(grep -a "leleka-serve meta" "$D/engine.log" | tail -1 | grep -o "expert_per_layer=[0-9]* expert_profile=[0-9]* pcie_frac=[0-9.]*") + case $vb in QN) WANT="expert_per_layer=0 expert_profile=1 pcie_frac=0.65";; A|AT) WANT="expert_per_layer=1 expert_profile=1 pcie_frac=0.45";; *) WANT="";; esac + echo "$META" >"$D/arm-meta.txt"; if [ -n "$WANT" ] && [ "$META" != "$WANT" ]; then log "variant $v INVALID (arm guard): engine got [$META], arm wants [$WANT]"; touch "$D/INVALID"; else log "variant $v arm guard ok: $META"; fi + stop_stack; kill "$MON_PID" 2>/dev/null; MON_PID= + sleep 5 +done +log "done" diff --git a/scripts/e2e/codex/prefill/pf_ab_job.sh b/scripts/e2e/codex/prefill/pf_ab_job.sh index f20831df..6a060a13 100755 --- a/scripts/e2e/codex/prefill/pf_ab_job.sh +++ b/scripts/e2e/codex/prefill/pf_ab_job.sh @@ -73,8 +73,9 @@ for v in $VARS; do D=$RUN/$v; mkdir -p "$D"; vb=${v%%.*} [ -f "$D/replay.jsonl" ] && { log "variant $v already done: skipped"; continue; } unset LELEKA_PREFILL_LOAN_TIERS LELEKA_TRACE_PREFILL_R LELEKA_SERVE_PROFILE STRATA_VERIFY_PROFILE LELEKA_REFILL_DEFER LELEKA_BRINGUP_TRACE LELEKA_DRAFT_CHAIN_PIPELINE LELEKA_PREFIX_PARK_FAST LELEKA_PREFIX_PARK_ASYNC LELEKA_DRAFT_CHECK_MERGE LELEKA_TRACE_DRAFT LELEKA_PREFILL_GDN_TC LELEKA_DECODE_GRAPH_REUSE LELEKA_PREFILL_DIAG_SKIP_EXPERT_DMA LELEKA_PREFILL_ROUTE_TRACE STRATA_PREFILL_STREAM_MIN LELEKA_PREFILL_RING_PREFETCH LELEKA_PREFILL_RING_PREFETCH_WINDOW LELEKA_PREFILL_RING_PREFETCH_DETACH LELEKA_ORIGINAL_SERVE_PCIE_FRAC LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER LELEKA_ORIGINAL_SERVE_PCIE_MODE LELEKA_REFILL_BATCH LELEKA_REFILL_DEFER LELEKA_TRACE_DRIVER_ERRORS + PROF_OFF=""; PROF_SET="" # profile engine_env keys to drop / set for this variant (the built-in profile OVERRIDES the shell env of the engine since pkg-s14) case $vb in - A) ;; + A) ;; # = the built-in profile as shipped (checks merge, park fast, graph reuse, stream 1536, loan tiers are ON in it) L) export LELEKA_PREFILL_LOAN_TIERS=1;; AR) export LELEKA_TRACE_PREFILL_R=1;; LR) export LELEKA_PREFILL_LOAN_TIERS=1 LELEKA_TRACE_PREFILL_R=1;; @@ -116,8 +117,13 @@ for v in $VARS; do Z) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1 LELEKA_DECODE_GRAPH_REUSE=1 STRATA_PREFILL_STREAM_MIN=1536;; # V5/V7 probes (profiled, placement-class: CPU and GPU round an expert differently): PCIe share and PCIe mode # tier layout: vanilla fills the profile in global rank order, the 5090 profiles give every layer the same quota (254 slots); placement-class - GLP) export LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no LELEKA_SERVE_PROFILE=1;; + GLP) PROF_SET="LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER=no"; export LELEKA_SERVE_PROFILE=1;; + # the stage-start state: the profile without the prefill/host set of this stage (loan tiers, check merge, park fast, graph reuse, stream 1536) + A0) PROF_OFF="LELEKA_PREFILL_LOAN_TIERS LELEKA_DRAFT_CHECK_MERGE LELEKA_PREFIX_PARK_FAST LELEKA_DECODE_GRAPH_REUSE STRATA_PREFILL_STREAM_MIN";; + A0P) PROF_OFF="LELEKA_PREFILL_LOAN_TIERS LELEKA_DRAFT_CHECK_MERGE LELEKA_PREFIX_PARK_FAST LELEKA_DECODE_GRAPH_REUSE STRATA_PREFILL_STREAM_MIN"; export LELEKA_SERVE_PROFILE=1;; Q55) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.55 LELEKA_SERVE_PROFILE=1;; + Q65) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.65 LELEKA_SERVE_PROFILE=1;; + Q75) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.75 LELEKA_SERVE_PROFILE=1;; Q35) export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.35 LELEKA_SERVE_PROFILE=1;; QK) export LELEKA_ORIGINAL_SERVE_PCIE_MODE=kernel LELEKA_SERVE_PROFILE=1;; YP) export LELEKA_DRAFT_CHECK_MERGE=1 LELEKA_PREFIX_PARK_FAST=1 LELEKA_DECODE_GRAPH_REUSE=1 STRATA_PREFILL_STREAM_MIN=1536 LELEKA_SERVE_PROFILE=1;; @@ -130,11 +136,16 @@ for v in $VARS; do *) echo "unknown variant $v"; continue;; esac export LELEKA_SPEC_STATS=1 + PROFARG="" + if [ -n "$PROF_OFF$PROF_SET" ]; then + "$BIN/leleka" profiles show rtx5090-32g | PROF_OFF="$PROF_OFF" PROF_SET="$PROF_SET" python3 -I -c 'import json,os,sys; p=json.load(sys.stdin); e=p["engine_env"]; [e.pop(k,None) for k in os.environ["PROF_OFF"].split()]; [e.__setitem__(*kv.split("=",1)) for kv in os.environ["PROF_SET"].split()]; json.dump(p,open(sys.argv[1],"w"),indent=1)' "$D/profile.json" && PROFARG="--profile $D/profile.json" + log "variant $v: profile override off=[$PROF_OFF] set=[$PROF_SET]" + fi : >"$ST/logs/engine.log" 2>/dev/null nvidia-smi --query-gpu=timestamp,temperature.gpu,clocks.sm,clocks.mem,power.draw,utilization.gpu --format=csv -l 10 >"$D/mon.csv" 2>/dev/null & MON_PID=$! log "variant $v: leleka up --foreground" t0=$(date +%s) - setsid "$BIN/leleka" up --foreground $COMMON --timeout-s 1800 >"$D/up-foreground.txt" 2>&1 & + setsid "$BIN/leleka" up --foreground $COMMON $PROFARG --timeout-s 1800 >"$D/up-foreground.txt" 2>&1 & SUP_PID=$! ready=0 for _ in $(seq 1 700); do "$PFX/bin/leleka" status --state-dir "$ST" >/dev/null 2>&1 && { ready=1; break; }; kill -0 "$SUP_PID" 2>/dev/null || break; sleep 3; done diff --git a/scripts/e2e/codex/prefill/profiles/rtx5090-32g-quota-no-pcie065-experimental.json b/scripts/e2e/codex/prefill/profiles/rtx5090-32g-quota-no-pcie065-experimental.json new file mode 100644 index 00000000..1d7edf43 --- /dev/null +++ b/scripts/e2e/codex/prefill/profiles/rtx5090-32g-quota-no-pcie065-experimental.json @@ -0,0 +1,54 @@ +{ + "name": "rtx5090-32g-quota-no-pcie065-experimental", + "description": "EXPERIMENTAL, NOT A DEFAULT (ledger H4/V5/V7, owner word needed). rtx5090-32g with the global rank fill of the expert tier (EXPERT_PER_LAYER=no, vanilla layout) and PCIe share 0.65. Placement-class: p99/flip rate inside the Original envelope, max d_top1 outside (0.65), 256k VRAM floor of the candidate not yet measured. Use only as `leleka up --profile FILE`. Base description: RTX 5090 class server (sm_120, 32 GB VRAM, >= 100 GiB RAM). Single copy of every model byte in host RAM: the 50 GB routed-expert bank is the one page-locked RAM copy (from GGUF shard 0), and of the 55 GB level-2 KAR archive only the 16.0 GB the serve path reads (the PLE rows, 2 extents) is copied once into a sealed sparse memfd (memfd_extents ple_only: holes elsewhere, verified against the pinned digest of the extents), read O_DIRECT so no page-cache copy remains. Reference-equivalent agent configuration (docs/e2e-run.md 7d; GPU budget 32,819,404,800 B (31,299 MiB) since the dense-slab commits, was 30 GiB: the slab saves physical bytes the Context never counted, so the budget must rise by about that much for the slot gain to appear, docs/experiments/vram-footprint-5090.md; expert tier auto-sized per layer from data/expert-profile.bin, adaptive speculative window with spec-min-p 0, MTP draft vocabulary, prefix cache 6144 MiB (explicit cap: what `auto` resolves to on this host, 5.7-6.1 GiB; unlike `auto` it cannot grow when RAM is freed) with request-end checkpoints (reply), chain kernels): no speed claim is made in this text (the paired 245k series against vanilla Strata is docs/experiments/baseline-pair-5090.md). Prompt chunk and prefix-cache grid 8192 (paired 256k session on the 5090: TTFT sum 131 s at 2048 against 55-60 s at 8192, docs/upstream-port-plan.md). Prompt-routing seed OFF (engine_env LELEKA_ORIGINAL_SERVE_SEED=off, placement class, owner to confirm; docs/experiments/decode-tail-5090.md: +27 % decode at 45k-247k prompts). MTP draft attention = upstream pre75 chunk + merge v2 (engine_env LELEKA_SM120_ATTN_DAILY_MTP=1, bitwise identical on the replay gate, draft round 0.29 ms and whole round 0.37 ms shorter at 245k, docs/experiments/draft-round-5090.md). Main attention and gate/up SwiGLU sm_120 kernels on (engine_env LELEKA_SM120_ATTN_DAILY=1, LELEKA_SM120_GU_SWIGLU=1: bitwise identical on the teacher-forced gate, decode +1.85 % paired, docs/experiments/codex-compare-speed-gap.md). GDN gates and gate projection on two side streams of the verify graph (engine_env LELEKA_SM120_SIDE_MIXER=1: identical top-16 logprob rows and draft trace on the teacher-forced gate, decode +1.39 % paired, CI +0.46..+2.32 %, docs/experiments/step-ledger.md V3a). QSA indexer/query chains (LELEKA_SM120_SIDE_QSA=1, mixer phase of a QSA layer -14.8 us) and the shared expert (LELEKA_SM120_SIDE_SHARED=1, doorbell to first expert 27.6 -> 10.9 us) on side streams too: identical rows and draft trace, section deltas in step-ledger.md V3b/V4a. Not a formally quality-gated profile.", + "select": { + "sm_min": 120, + "sm_max": 130, + "vram_mib_min": 30000, + "vram_mib_max": 1000000 + }, + "gpu_budget_bytes": 32819404800, + "spec_min_p": 0.0, + "expert_profile": "data/expert-profile.bin", + "context_tokens": 262144, + "prefill_capacity": 8192, + "kar_source": "memfd", + "memfd_extents": "ple_only", + "expert_source": "resident", + "min_driver_major": 595, + "min_vram_total_mib": 30000, + "min_ram_total_bytes": 107374182400, + "min_ram_available_bytes": 113000000000, + "engine_env": { + "LELEKA_PREFILL_LOAN_TIERS": "1", + "LELEKA_DRAFT_CHECK_MERGE": "1", + "LELEKA_PREFIX_PARK_FAST": "1", + "LELEKA_DECODE_GRAPH_REUSE": "1", + "STRATA_PREFILL_STREAM_MIN": "1536", + "LELEKA_ORIGINAL_SERVE_EXPERT_PER_LAYER": "no", + "LELEKA_CHAIN": "all", + "LELEKA_ORIGINAL_SERVE_SEED": "off", + "LELEKA_SM120_ATTN_DAILY_MTP": "1", + "LELEKA_SM120_ATTN_DAILY": "1", + "LELEKA_SM120_GU_SWIGLU": "1", + "LELEKA_SM120_SIDE_MIXER": "1", + "LELEKA_SM120_SIDE_QSA": "1", + "LELEKA_SM120_SIDE_SHARED": "1", + "LELEKA_SM120_FUSED_QSA_PRELUDE": "1", + "LELEKA_DRAFT_FUSED_COMMIT": "1", + "LELEKA_SM120_COMBINE_VEC4": "1", + "LELEKA_SM120_DOWN_SUB16": "1", + "LELEKA_SM120_HITS_IN_COMBINE": "1", + "LELEKA_ORIGINAL_SERVE_PCIE_FRAC": "0.65" + }, + "memory": { + "prefix_cache_mib": "6144", + "prefix_cache_tail": "reply", + "prefix_cache_block": 8192, + "soft_floor_mib": 4096, + "hard_floor_mib": 2048, + "reserve_mib": 2048, + "lock": "try", + "heal": true + } +} \ No newline at end of file