From 5541b47242b4af25acef577ac7b32ec3d3ba56ce Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Tue, 10 Nov 2026 03:45:09 +0100 Subject: [PATCH] ledger O8/O9: chain pipeline never engages (min_p > 0 in every draft); check merge detection PASS, 114 to 105 nodes; teacher-forced identity job Co-Authored-By: Claude Sonnet 5.5 --- docs/experiments/step-ledger.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/experiments/step-ledger.md b/docs/experiments/step-ledger.md index 537584c6..44f15b59 100644 --- a/docs/experiments/step-ledger.md +++ b/docs/experiments/step-ledger.md @@ -58,8 +58,8 @@ 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` | -| 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`) | +| 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 | | 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 | @@ -255,4 +255,5 @@ Naming rule (owner 2026-11-09): `--`, in wo | (new) | `host-decode-graph-reuse-identity-and-profile` | Q7: replay hashes and draft trace equal to shipped with `LELEKA_DECODE_GRAPH_REUSE=1`, and the `decode.assemble`/`decode.reuse`/`record.*` spans; package `pkg-s6` (commit `2a1f2eccf`) | Q7 | | (new) | `prefill-prefix-park-async-fix-identity-and-profile` | rerun of the parking identity (reuse) and sections after the ASYNC admission fix; package `pkg-s8` (commit `4fef1b009`) | B3 | | (new) | `host-draft-chain-gate-diagnosis` | which condition keeps the pipelined draft chain from engaging (`mtp.chain_gate.*` counters), and the step-graph node count with the check merge; package `pkg-s9` (commit `4b0f87bf0`) | O9, O8 | +| (new) | `host-draft-switches-teacher-forced-identity` | bitwise identity under teacher forcing (night5-long-256k, A/A floor): shipped against check merge, parking fast and decode graph reuse, one process each; test binary `dt/rt-pf9` (commit `2a1f2eccf`) | O8, B3, Q7 | | `pr-van` | removed | empty-request probe on VANL; vanilla is not re-measured (owner 2026-11-09) | A1-A3 |