bench(#53/#55): the p150-decode-40 campaign; B=1 control at 48.5 ms, hypothesis A closed #85

Merged
Grok merged 33 commits from decode-campaign-53-55 into master 2026-09-25 23:29:29 +02:00
Owner

The #53/#55 decode campaign the owner rescued off the serving-throughput worktree before it
was deleted: bench/p150-decode-40/ (program, hypotheses, results), the control and
hypA-hostdev records, the low-level audit record, and the GDN conv-gates probes.

Recorded in docs/LEDGER.md as R-2026-09-23-decode40:

  • Control: 48.619 ms/token at B=1/4k on the production arm, reproduced at 48.494 on the
    Tracy image and 48.563 under py-spy, text sha bafed7a9… matching across all three. This
    is the valid control the serving module's deviceResident docs cite — it was a dangling
    citation until this branch landed, and is now a plain path.
  • Hypothesis A (host vs device) is CLOSED, negatively. ttnn.decorators.__call__ is
    45.297 ms, 93.3% of the step — a blocked native call, not host Python; host leaves total
    3.27 ms. No large host win at B=1, matching the earlier B=8 finding.
  • The per-op table cannot be read on this build. Both arms produced a
    cpp_device_perf_report.csv with 100% of OP NAME / METAL TRACE ID / REPLAY SESSION ID
    blank
    (5916/5916 untraced, 5962/5962 traced; P0 on 09-12 likewise). An unnamed table is not
    an inventory, so no class breakdown is quoted from it.
  • Profiled-arm window means (78.8 ms traced, 253.5 ms untraced) are drain-inflated and are not
    production numbers. bench/results.tsv records the GDN conv-gates attempts explicitly as
    not measurements (suspect accounting, then a crash, then a withdrawal).

Resurrections caught and re-deleted

Cut before PR #68, so the merge tried to bring back 21 files that overhaul removed:
CLAUDE.md, ten docs/*.md (DIRECTIVES-LEDGER, DOC-STATUS, GOAL-VLLM-SERVING,
LOOP-ITERATIVE-IMPROVEMENT, PRODUCTION-27B, AGY-TAKEOVER-BRIEF, HANDOVER-20260919,
PASS-SDPA-STREAMING-E2E, THATCH-FIR-DRIFT, UPSTREAM-WATCH-PLUGIN-METAL),
nix/production-serving-recipe.nix, and 16 bench/runs records that already live under
bench/runs/archive/2026-09/. All re-deleted in the merge commit, plus an empty untitled.md.
docs/ is back to 11.

Production files

Master's side taken for all five conflicts — master is a superset of this branch for each, and
qwen36_vllm.py most of all, where master has patch 0019 and the branch does not.

One thing the branch had that master lacked is kept, re-applied on top of master's
model.py: process_output_decode now honours _decode_logits_sharded. _lm_head sets that
flag under QWEN36_LM_HEAD_GATHER_MODE=none, but nothing read it, so the mode died on a
124160-vs-248320 reshape. No shipped arm changes — that mode is the measured +31 ms batch
regression and is never enabled at batch.

A defect the branch introduced is fixed: it re-pinned bench/profile/prod-sources.sha256
to a newer model.py while prod-decode-profile.sh still hardcoded the old sha as its
--expect-sha default, so the driver would fail immediately after its own manifest check
passed. The expected sha is now read from the manifest.

Locally green: check-cited-records.py, shellcheck, nix flake check, 41 ttx unit tests.

Refs #53, #55.

🤖 Generated with Claude Code

The #53/#55 decode campaign the owner rescued off the `serving-throughput` worktree before it was deleted: `bench/p150-decode-40/` (program, hypotheses, results), the control and hypA-hostdev records, the low-level audit record, and the GDN conv-gates probes. **Recorded in `docs/LEDGER.md` as `R-2026-09-23-decode40`:** - **Control: 48.619 ms/token** at B=1/4k on the production arm, reproduced at **48.494** on the Tracy image and **48.563** under py-spy, text sha `bafed7a9…` matching across all three. This is the valid control the serving module's `deviceResident` docs cite — it was a dangling citation until this branch landed, and is now a plain path. - **Hypothesis A (host vs device) is CLOSED, negatively.** `ttnn.decorators.__call__` is **45.297 ms, 93.3% of the step** — a blocked native call, not host Python; host leaves total **3.27 ms**. No large host win at B=1, matching the earlier B=8 finding. - **The per-op table cannot be read on this build.** Both arms produced a `cpp_device_perf_report.csv` with **100% of OP NAME / METAL TRACE ID / REPLAY SESSION ID blank** (5916/5916 untraced, 5962/5962 traced; P0 on 09-12 likewise). An unnamed table is not an inventory, so no class breakdown is quoted from it. - Profiled-arm window means (78.8 ms traced, 253.5 ms untraced) are drain-inflated and are not production numbers. `bench/results.tsv` records the GDN conv-gates attempts explicitly as *not* measurements (suspect accounting, then a crash, then a withdrawal). ## Resurrections caught and re-deleted Cut before PR #68, so the merge tried to bring back **21 files** that overhaul removed: `CLAUDE.md`, ten `docs/*.md` (DIRECTIVES-LEDGER, DOC-STATUS, GOAL-VLLM-SERVING, LOOP-ITERATIVE-IMPROVEMENT, PRODUCTION-27B, AGY-TAKEOVER-BRIEF, HANDOVER-20260919, PASS-SDPA-STREAMING-E2E, THATCH-FIR-DRIFT, UPSTREAM-WATCH-PLUGIN-METAL), `nix/production-serving-recipe.nix`, and 16 `bench/runs` records that already live under `bench/runs/archive/2026-09/`. All re-deleted in the merge commit, plus an empty `untitled.md`. `docs/` is back to 11. ## Production files Master's side taken for all five conflicts — master is a superset of this branch for each, and `qwen36_vllm.py` most of all, where master has patch 0019 and the branch does not. **One thing the branch had that master lacked is kept**, re-applied on top of master's `model.py`: `process_output_decode` now honours `_decode_logits_sharded`. `_lm_head` sets that flag under `QWEN36_LM_HEAD_GATHER_MODE=none`, but nothing read it, so the mode died on a 124160-vs-248320 reshape. **No shipped arm changes** — that mode is the measured +31 ms batch regression and is never enabled at batch. **A defect the branch introduced is fixed:** it re-pinned `bench/profile/prod-sources.sha256` to a newer `model.py` while `prod-decode-profile.sh` still hardcoded the old sha as its `--expect-sha` default, so the driver would fail immediately after its own manifest check passed. The expected sha is now read from the manifest. Locally green: `check-cited-records.py`, `shellcheck`, `nix flake check`, 41 ttx unit tests. Refs #53, #55. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Grok added 33 commits 2026-09-25 23:28:17 +02:00
Written for a successor agent picking up mid-benchmark. Carries the operational
rules, the numbers to quote, what is running right now and how to tell it is
alive, the levers that are measured vs merely committed, and the traps this
session already paid for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Believed: three host-RAM levers were all worth taking, and batching them would
save measurement time.

Measured, two arms, one rep each:
  hp-only  (pool 8->2)                        stage 3 PASS, reached stage 4
  bundle   (+ MALLOC_ARENA_MAX=2, swappiness=10)  stage 3 FAIL, 1 of 32

The hugepage cut stands: +5.9 GB of a 16 GB host (MemAvailable ~3.1 -> 9.0 GB
while serving), free=0 confirming UMD maps exactly one channel per card, and a
clean correctness gate.

MALLOC_ARENA_MAX=2 is dropped because it did the opposite of its purpose:
EngineCore RSS rose 1.97 -> 2.38 GB and VmHWM 4.70 -> 4.98 GB. The ~4.1 GB of
retained heap is real, but capping arenas is not what reclaims it. swappiness=10
is dropped with it -- not separable in this arm, and no measured benefit.

The bundle's 1-of-32 is NOT evidence against those two levers: one rep, and the
rate sits inside the intermittent band patch 0019 bounded at <=0.85%/request
rather than eliminated. They are dropped for buying nothing, not for being
convicted. This is exactly the attribution cost that batching trades for.

Still unproven: the aperture's effect on throughput. No hp=8 same-arm control
was run, and the hp-only figures are not comparable to the 328.5/88.9 baseline
(different arm, 0.0% vs 98.3% cached).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The in-flight benchmark landed while the handover was being written. Replaces
the 'in flight' section with the split verdict: keep the hugepage cut, drop the
arena cap and swap bias, and note that the aperture's throughput effect is still
unproven for want of a same-arm control.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
It read the document and pushed back before accepting it. All four were right:

- Section 5 still listed MALLOC_ARENA_MAX and swappiness as levers to batch,
  contradicting section 2, which had just dropped them on evidence. Section 5 was
  written before the result landed and I never reconciled it.
- Section 2 carried stale in-flight bullets ('Arm 1 running >2h', 'Arm 2 chained
  to auto-start') sitting directly under the conclusion that both arms finished.
- 'PR #34 is merged - verify it deploys' gave no way to verify it. Merging is not
  deploying: the unit comes from the Nix closure via nixos-llm. Added the command
  and how to read either outcome.
- 'Ship device argmax + prefix caching' was ambiguous. The arm is NAMED prefix but
  vLLM prefix caching is off and blocked; the cached fraction is the benchmark
  reusing a prompt head. Renamed and warned.

Also recorded the batching lesson where it will be read: two levers were dropped
without being convicted because one arm could not attribute its own failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Short entry point that survives a TUI paste: the long handover lost characters
when sent into the terminal, so the successor gets a file path instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Believed:
Dropping fp32_dest_acc_en for chunked prefill SDPA to take the streaming
compute kernel (v2) on Blackhole might risk numerical drift below upstream's
PCC 0.984 gate on Qwen's TP=2, HD=256, bf8 paged KV shape.

Measured:
Standalone op probe on 2x p150a mesh across chunk positions n in [0, 15, 30, 62, 120]
(0 to 245,760 context tokens):
- PCC >= 0.9994 at every ladder point (0.999838 at n=0, 0.999447 at n=120).
- Max abs error <= 0.0039, zero NaNs/Infs. Accuracy gate PASSED.
- Op latency speedup: +1.8% at n=0 (0.54 -> 0.53 ms), +5.0% to +5.3% across all
  subsequent positions (e.g. n=62: 36.62 -> 34.71 ms, n=120: 70.30 -> 66.77 ms).
- Saves ~30.5 ms/chunk at 128k context and ~56.5 ms/chunk at 245k context across 16
  attention layers.

Probe script: bench/probes/sdpa_streaming_pcc_probe.py
Run record: bench/runs/sdpa-streaming-pcc-20260919T1129Z.jsonl
The PCC probe cleared correctness and measured ~5% at the op. That is not a
result yet: the 30.5 ms/chunk figure derived from it is arithmetic over 16
layers, and this repo has a documented history of prefill wins in that class
delivering 0 to -2% end to end.

Registers the prediction (1-3% makespan, TTFT slightly better, TG unchanged) and
the refutation (<0.5% is a negative result) before the measurement, plus the
banner and one-tree discipline the arm has to satisfy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The hugepages=8 control -- the ORIGINAL aperture, no arena cap, stock
swappiness -- failed stage 3 at 1 of 32 with the byte-identical assertion
("expected one of ['391']; got: '33'") that the RAM bundle failed on.

That settles it. The failure appears at both hugepage counts, with and without
the arena cap, with and without the swap change, and under both trace modes. It
is the intermittent defect patch 0019 bounded at <=0.85%/request rather than
eliminated, and it is not attributable to any host-RAM lever.

Retracts the suspicion that MALLOC_ARENA_MAX or swappiness hurt correctness. The
earlier record already declined to convict them on one rep; this is the direct
evidence that they were innocent. They stay dropped for buying nothing -- arena
capping measurably made RSS and VmHWM worse.

Two consequences worth carrying. This is a live production defect: about one in
32 concurrent requests returns a coherent-but-wrong answer that passes serially.
And methodologically, a single stage-3 rep cannot separate an arm's own defect
from this baseline rate, so any arm reporting exactly 1-of-32 needs repeats
before that failure is pinned on it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Predicted before measuring: makespan improves by less than 3%, TTFT improves
slightly, TG unchanged. All three held.

Measured at 93,739-token prompts, both arms stage 3 PASS, one source tree with
an env-only delta:

  conc  makespan        TTFT p50        TG (ITL)
  1     -1.56%          -2.11%          -0.19%
  4     -2.07%          -2.38%          -0.29%
  8     -2.15%          -2.42%          +0.58%

Prefill 2702.9 -> 2768.7 tok/s at conc-8.

The result that matters is TTFT. Both previously cleared optimizations -- bf8 KV
and device argmax -- left TTFT flat because both are decode-side, and TTFT is
what describes the wait at the target shapes, where the last agent waits 443 s at
8x128k and 609 s at 4x256k. This is the first lever to move it.

Makespan, TTFT and prefill tok/s all agree at ~2.1-2.4% and the effect grows with
concurrency, which is the mechanism behaving correctly: more concurrent prefill
means more SDPA. TG is flat within noise, confirming the arm touched prefill only.

The op probe measured ~5% on chunked SDPA; E2E delivers ~2.2%. That ratio is the
honest conversion and it is why the 30.5 ms/chunk arithmetic was not quoted as a
result. Upstream advertised 19-25% for this change.

One rep per cell, so a 2% delta has no error bar from this run -- the three-way
agreement across independent metrics is the support, not repetition.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
serve: integrate QWEN36_SDPA_STREAMING and prefilled slots fix into production
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 21s
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 32s
2d423b5b37
- Integrate cleared Patch 0020 (QWEN36_SDPA_STREAMING=1) into production inference:
  - Add sdpaStreaming option (default true) to modules/tenstorrent-serving.nix with fail-closed readiness probe check and mount assertion.
  - Bind-mount patched attention/tp.py from patches/prod-local-metal/.
  - Add QWEN36_SDPA_STREAMING=1 to nix/production-serving-recipe.nix and scripts/vllm-tt-serve.sh.
- Incorporate Patch 0019 (QWEN36_PREFILLED_SLOTS_FIX) in patches/prod-local-metal/models/demos/blackhole/qwen36/tt/qwen36_vllm.py.
- Record benchmark harness tomls and hugepages2 control run data.
The concurrency defect is real but rarer than predicted: 0 of 192 this run
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 4s
tt-stack-ci / Report upstream drift (pull_request) Successful in 6s
d1514f66f3
Predicted 1 to 2 of 6 reps failing, implying ~0.9%/request. Measured 0 of 6 --
192 consecutive requests, zero failures. The prediction is refuted.

Pooling every stage-3 run on a healthy arm (14 runs, 2 with a failure) puts the
per-request rate at ~0.48%, about half the earlier estimate. The defect is not
in doubt: it has been directly observed twice with a byte-identical assertion,
including once on the hugepages=8 control. It is simply rarer.

What this run cannot do is refute 0.9%: P(0 failures in 192 | p=0.9%) is 17.6%.
Nor can it separate "rarer than thought" from "the SDPA streaming arm changed
it", since this is the first multi-rep characterisation and it ran on that arm.

Research refutes the leading external candidate. Upstream 5b0b687f7f5 gates only
penalty-tracking buffers, which are read only when penalties are active; our
requests are greedy, and the change is warmup-time and deterministic, so it has
no per-request degree of freedom. No pin bump is justified for it.

The surviving candidate is verified in source: the async-ahead merge reads
per-bucket-width buffers (qwen36_vllm.py:352-357) via a bare position comparison
(generator.py:2145), while 0019's exclusion set is cleared every decode step
(generator.py:2158). One-step protection against many-step staleness. It is
concurrency-only and intermittent by construction, and being gated on
on_device_sampling it predicts the argmax asymmetry already in the data.

The practical consequence of a 0.48% rate is that the discriminating test
(TT_DECODE_BUCKETING=0) now needs 256+ requests to say anything, so the next
pass is expensive and should be budgeted as such.

Ran against the live serving container: zero boots, no lock, box up throughout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The merge replay is blind to its own mechanism, so its zero means nothing
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 4s
tt-stack-ci / Report upstream drift (pull_request) Successful in 6s
8c02d00b21
E1 was meant to test the bucket-width staleness hypothesis offline: does the
async-ahead merge ever hand a slot a previous occupant's token? Predicted a
0.5-2%/request collision rate with bucket alternation and 0.000% without.

Measured 0 collisions across 5 arms and 64,000 replayed requests. That looked
like a clean refutation. It is not one.

Instrumenting the schedule rather than trusting the zero: over 19,200 steps,
steps with a non-contiguous live slot set = 0, steps with bucket < max_slots = 0.
With 32 requests, concurrency 16 and 8 slots, a freed slot is refilled from the
pending queue immediately, so num_active never leaves 8 and the bucket never
varies. The mechanism requires width alternation, so this model cannot produce a
collision whether or not the hypothesis is true.

This is the same failure this repo has built twice before -- an instrument
structurally unable to see the effect it measures. The difference is that it was
caught inside the probe, before a result was quoted. A zero from a blind
instrument is indistinguishable from a zero from a correct one.

The hypothesis stays OPEN. Its three code facts are independently verified:
bucket-keyed trace store (qwen36_vllm.py:352-357), bare position comparison
(generator.py:2145), unconditional per-step clear (generator.py:2158). What is
unproven is whether a stale entry's position can collide in practice.

E1 was chosen over E2 because it needed no hardware. Right on cost, wrong on
power. E2 (TT_DECODE_BUCKETING=0) remains the discriminator, and at the measured
0.48%/request base rate it needs 256+ requests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Log-only, inert unless QWEN36_MERGE_STALE_AUDIT=1.

The obvious instrument -- log every merge where dev_tok != host_tok -- is
useless, because that is the normal case the merge exists to perform. The
anomaly is staleness, and nothing records it. This stamps each (buffer, chunk)
with the step it was last used, which for a traced decode is also its last
write, and logs only a merge that consumes an entry more than one step old.

It also logs every bucket width change, which settles the question the offline
replay could not: whether the width varies at all under a real vLLM schedule.
That replay's hand-rolled scheduler pinned the bucket at 8 and was structurally
blind to the mechanism, so its zero carried no information.

Zero width changes under stage-3 concurrency kills the hypothesis. Stale merges
confirm it, and the fix shape is already known.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Caught the stale merge live: the device buffer outlives the batch that wrote it
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 13s
tt-stack-ci / Report upstream drift (pull_request) Successful in 13s
ffa88d8703
The audit found 5 stale merges in 96 requests, 2 of which substituted a
different token. The signature is unambiguous:

  dev_pos =[29, -1, -1, -1, -1, -1, -1, 28]
  host_pos=[22, 25, 27, 25, 22, 25, 27, 27]

Six slots inactive in the device buffer against eight active in the live batch:
that buffer belongs to an earlier request generation. Slot 7's stale position 28
equals the current host position plus one, so the bare comparison at
generator.py:2145 fires and takes a token from a request that is gone.

My predicted carrier is refuted. I expected decode-bucket-width alternation, and
there were ZERO width changes -- width was 8 throughout. The bucket store is not
the carrier here. The real one is simpler and worse: the merge block runs only on
reset_batch steps, so the buffer it reads can be many decode steps and a whole
generation old without any width change at all.

That also explains why 0019 bounded this without closing it. Its exclusion set is
cleared every decode step while the buffer persists across generations, so it can
only ever cover the step where a slot was prefilled.

Three of the five were benign -- width 1, device and host agreed, nothing
substituted. Stage 3 passed 3 of 3 even so, which fits a substituted token not
always producing a graded wrong answer, and matches the 0.48%/request rate.

Two caveats recorded in the run file: "gap" measures distance between merge
invocations rather than decode steps, so gap>1 is expected and is not itself the
anomaly; and the runner's banner guard reported not-engaged although the audit
plainly ran, so the evidence here is the WARNING output, not that guard.

The fix cannot live in the exclusion set. The buffer has to carry its own
validity -- a batch-composition or generation stamp checked before the merge.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
My teardown deleted the exec line and took serving down for 15 minutes
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 10s
tt-stack-ci / Report upstream drift (pull_request) Successful in 10s
2b4f0a25bf
The patch-0021 audit runner stripped its instrumentation with a line-pattern
delete. In this unit script the -v mounts share one physical line with the
"exec ... docker run --name vllmtt-prod" invocation, so the delete removed the
exec line itself. The service failed with "line 2: -v: command not found", then
hit the systemd start limit.

The setup half of that runner was guarded and fail-closed: it verified the mount
and the env var had landed before it would measure anything. The teardown half
had no guard and ran after the measurement, when nothing was watching. An
unexercised teardown is untested code pointed at production, and that asymmetry
is the real defect -- this is the second restore-path failure today.

Recovery rebuilt the override from the pristine nix store script and re-applied
the four deltas programmatically, checking every guard before restarting rather
than after: syntax, the exec line, the qwen3_xml parser, both patch mounts, the
SDPA env gate, and the absence of the audit. Serving is back with patches 0019
and 0020 confirmed live from their own banners.

The audit results are unaffected -- captured before the restore ran.

Standing rule: never mutate this start script by line-delete; rebuild from the
pristine source and re-apply, which is idempotent and cannot delete what it did
not add.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The stale merge is real, the guard is free, and it does not close the whole hole
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 6s
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
947872a7f6
Yesterday's audit caught the async-ahead merge consuming a device buffer that
outlived the batch that wrote it: dev_pos=[29,-1,-1,-1,-1,-1,-1,28] against an
eight-active host_pos, where slot 7's stale 28 satisfied host_pos+1 and
substituted a token from a finished request. The exclusion set cannot guard it
(cleared every decode step; the buffer outlives generations), so patch 0022
makes the BUFFER prove it belongs: its active-slot pattern must match the
batch's, or the merge falls back to host tokens through the branch the code
already takes on a shape mismatch.

Believed before: the fix might cost throughput, since it forgoes the
async-ahead token whenever it fires.

What the evidence changed. It is free. Against the current production baseline
on the same 93,739-token suite, every delta is inside +-0.5% -- makespan
-0.39/-0.21/-0.37% at conc 1/4/8, TTFT -0.48/-0.20/-0.29%, TG 86.2 -> 85.9
ms/token, prefill 2768.7 -> 2778.6 tok/s. These are single runs on separate
boots, so that is FLAT, not a win, and must not be quoted as one. Stage 3 PASS,
0 failing of 11. The guard fired 77 times and prevented 15 real token
substitutions; most rejects cost nothing but that step's async-ahead benefit.

Two things this does NOT establish. The guard keys on batch composition because
composition is the only thing that betrayed the confirmed incident, so a stale
buffer whose active pattern MATCHES the batch passes straight through -- audit
step=202 is exactly that, harmless only because its positions were far enough
apart that use_dev was False anyway. And dev_pos carries outright garbage
(1206993122, 1196966132) next to valid positions, so the buffer is not merely
stale, it can be uninitialized.

Attempt 1 reported GUARD_REJECTS=0 for a run where infbench never sent a
request: --stages takes a comma-separated list and the result grep swallowed
the argparse error. That zero was a harness failure, not a refutation, and the
runner now fails loudly when no result file appears. This project has now built
an instrument blind to its own mechanism four times.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The unaligned-resume gate dissolves: the path cannot be reached
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 4s
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
4f2cdc2671
Backlog lever 2 carried "unaligned-resume equivalence -- required before
prefix caching ships" as outstanding correctness work blocking the largest
makespan item in the project. It is not work. The condition it guards cannot
occur in any valid configuration.

Three enforced constraints compose. qwen36_prefix_cache.py:47 refuses a
block_size that is not a multiple of 2048. prefill_chunk_plan refuses a
block_size that does not divide chunk_size. model.py:2107 asserts the
2048-token chunk, and every call site passes 2048. Enumerating 64..32768,
exactly ONE block size satisfies both bounds: 2048. A resume start is a
prefix-cache hit length and so a whole number of blocks, therefore
start % chunk_size == 0 always and plan["lead"] is always None -- 0 of 1,400
enumerated (block_size, start, end) combinations reach it.

So the lead branch is defensive, not load-bearing, and must NOT be deleted:
it is the only thing between a future chunk_size change and a silent KV gap.
The trigger is explicit -- plan(2048, 9000, chunk_size=4096, block_size=2048)
returns lead=(2048, 2048), so raising the chunk above 2048 re-opens this lever
the same day.

Evidence that the offline instrument is not vacuous:
fixtures-prefix-chunk-plan-test.py passes 12 cases against the real prefix
model.py INCLUDING three unaligned shapes, and its negative control rejects
the unpatched logic on all 8 resume cases. The hardware reducer
bench/prefix_hit_equivalence.py passes 7/7 fixtures including the BLIND
detector.

One link is weaker than the other three and is recorded as such: that hit
lengths are whole blocks comes from the comment at qwen36_prefix_cache.py:28-30
plus vLLM's block-granular hit accounting, not from executing the hit path.

No hardware was used and no boot was spent. This also says nothing about
ALIGNED-resume numerical equivalence, which is the different question
cache-speed-16k-32k.sh's equiv_cold/equiv_warm/equiv_control phases exercise
and which has not been run on the current tree.

Process: I rewrote this offline test from scratch before finding the existing
fixture, which was strictly better. Grep bench/fixtures/ first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
serve: durable tool-calling, hugepage reclaim, merge batch guard & prefix caching
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 7s
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
369b48797c
Resolves and hardens across 4 key serving issues:
1. Issue #49: Fix tool-calling parser from hermes to qwen3_xml in
   tenstorrent-serving.nix so streamed tool calls populate properly;
   set default hugepagesPerCard=1 in tenstorrent-host.nix to reclaim +5.9 GB
   host RAM durably and prevent host memory exhaustion/OOM panics.
2. Issue #45: Enable QWEN36_MERGE_BATCH_GUARD=1 in generator.py and module
   environment to reject stale async-ahead device buffers whose active-slot
   patterns do not match the current batch, preventing stale token substitutions.
3. Issue #46: Add context window bounds check in generator.py to prevent
   uninitialized memory entries in the position buffer from leaking into
   position matching.
4. Issue #48: Add enablePrefixCaching configuration option and integration
   in modules/tenstorrent-serving.nix for prefix caching deployment.
Read-only comparison vs Thatch tip ci/qwen-hardware-correctness.
FIR (1->B) matches; #53314/#53319 fork vs PR-overlay delivery only.
No production patch changes.
serve: mesh/by-id gotchas, Thatch drift checklist, and upstream watch audit
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 4s
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
65c5cba994
Resolves and advances 4 key issues across serving, hardware, and upstream:
1. Issue #21: Codify Thatch mesh/by-id gotchas into scripts/vllm-tt-serve.sh
   (resolve_tt_devices, TT_DEVICE_BY_ID, MESH_PREFLIGHT), scripts/mesh-degree-preflight.sh,
   modules/tenstorrent-serving.nix (by-id guidance), and specs/p150x2/README.md.
2. Issue #20: Land docs/THATCH-FIR-DRIFT.md (read-only drift checklist vs Thatch tip).
3. Issue #36: Complete audit of vllm-tt-plugin #126 / #122; verified that our
   vendored model_runner.py already enforces prefill-first Phase 2 capture,
   protecting production from the batch-8 coherence bug without risking an
   incompatible tt-metal pin bump before #55343 merges to trymerge.
4. Issues #39 & #41: Complete audit of upstream BH SDPA stack (#56942-#56985)
   and AGMM GDN out-proj (#56759). Recorded status in docs/UPSTREAM-WATCH-PLUGIN-METAL.md:
   local 0020 remains ahead; AGMM out-proj held due to +764 MiB DRAM hazard on TP=2.
feat(serving): enable Phase 2a resident decode and live prefix caching
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 4s
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
f092aa37b1
- Add Patch 0023 for Phase 2a device-resident decode chain and on-device RoPE tables
- Wire dynamic supports_async_decode and supports_prefix_caching capabilities in qwen36_vllm.py
- Support deviceResident and enablePrefixCaching in modules/tenstorrent-serving.nix
- Update scripts/vllm-tt-serve.sh with DEVICE_RESIDENT and ENABLE_PREFIX_CACHING flags
feat(serving): complete unification of prefix caching and device resident decode
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 5s
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
d4199ce3a0
fix(resident): reshape tok_rm to tuple(tokens.shape) for ttnn.copy
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 3s
tt-stack-ci / Report upstream drift (pull_request) Successful in 7s
729a4ff5b3
bench(phase2a-prefix): stage 2/3 gates passed, B=1 decode drops to 48.5ms, makespan -87.5% at conc-8
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Failing after 5s
tt-stack-ci / Report upstream drift (pull_request) Successful in 9s
4e91d8708d
Claude Code now reads AGENTS.md natively, so the CLAUDE.md/AGENTS.md symlink
pair was a duplicate. The old file had grown to 656 lines, 479 of them a
newest-first ledger of owner directives and measured results that an agent had
to wade through before reaching the operating rules.

Split rather than trimmed: the ledger moves verbatim to
docs/DIRECTIVES-LEDGER.md with its 0aaa... labels intact, since ~30 docs cite
them as "CLAUDE.md precedence 0aaa" and that evidence must not be lost.
AGENTS.md is now 172 lines -- what the repo is, a pointer to the ledger plus a
six-bullet digest of what it currently says, the hard rules, the traps, and the
conventions. Added to the hard rules what recent sessions kept re-learning:
measure on hardware (extrapolation was wrong by +49% and +105%), arms must
self-identify from their own banners, build locally, always report PP/TG.
These files existed only as uncommitted changes in the serving-throughput
worktree (/home/orchestra/orca/workspaces/tt-stack/serving-throughput). That
branch was squash-merged as #44 and is being retired as part of harness
hygiene. The contents are byte-identical copies taken from that worktree and
committed on its HEAD (c76460b). The worktree itself was not modified.

Contents:
- the #53/#55 decode-40 campaign: bench/p150-decode-40/, the
  bench/runs/p150-decode-40-* records, and the lowlevel-audit traced-prof and
  serving-offline records;
- the gdn_conv_gates single-kernel probes;
- edits to prod-decode-profile.sh, prod-sources.sha256 and the prod model.py;
- the 2026-09-24 ThinkingCap/MTP ledger entry, which the harness-overhaul
  PR folds into docs/LEDGER.md.

This branch is not reviewed or verified. Rebase it onto master (after
harness-overhaul) before landing. The DIRECTIVES-LEDGER.md edit then becomes a
modify/delete conflict: take the deletion, because the entry is already in
docs/LEDGER.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The #53/#55 decode campaign the owner rescued off the serving-throughput worktree:
the p150-decode-40 program, its hypotheses and results, the control and hypA-hostdev
records (including the B=1 48.619 ms control the serving module's option docs cite),
the GDN conv-gates probes, and the low-level audit record.

The branch was cut before the PR #68 overhaul, so the merge tried to bring back 21
files that overhaul deliberately removed. Re-deleted here: CLAUDE.md,
docs/{DIRECTIVES-LEDGER,DOC-STATUS,GOAL-VLLM-SERVING,LOOP-ITERATIVE-IMPROVEMENT,
PRODUCTION-27B,AGY-TAKEOVER-BRIEF,HANDOVER-20260919,PASS-SDPA-STREAMING-E2E,
THATCH-FIR-DRIFT,UPSTREAM-WATCH-PLUGIN-METAL}.md, nix/production-serving-recipe.nix,
and 16 bench/runs records that already live in bench/runs/archive/2026-09/. An empty
untitled.md goes too.

Master's side was taken for the five production/spec conflicts, because master is a
superset of this branch for each -- qwen36_vllm.py most importantly, where master has
patch 0019 and the branch does not. The ONE thing the branch had that master lacked is
kept and re-applied on top: process_output_decode now honours _decode_logits_sharded.
_lm_head sets that flag under QWEN36_LM_HEAD_GATHER_MODE=none, but nothing read it, so
the mode died on a 124160-vs-248320 reshape. It changes nothing on any shipped arm --
that mode is the measured +31 ms batch regression and is never enabled at batch.

Also fixed a defect the branch introduced: it re-pinned prod-sources.sha256 to a newer
model.py while prod-decode-profile.sh still hardcoded the OLD sha as its --expect-sha
default, so the driver would fail right after its manifest check passed. The expected
sha now comes from the manifest, which is the only place it should live.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
docs(LEDGER): record the #53/#55 decode-40 campaign, including what it could NOT measure
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 8s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 50s
1292c13ff1
The campaign's durable output is two things: the B=1 control at 48.5 ms, reproduced
three ways with matching text sha, and the negative result that hypothesis A is closed
(93.3% of the step is a blocked native call; host leaves total 3.3 ms). The third thing
matters as much: the per-op CSV is 100% blank in OP NAME on this build, in both arms and
in P0 before it, so no class breakdown can be read from it and none is quoted. The
serving module's deviceResident docs now cite the control by plain path, since it lands
here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Grok merged commit 345d6db4b7 into master 2026-09-25 23:29:29 +02:00
Author
Owner

agent-gateway closeout (merged): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (merged): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.
Owner

[ho-524dce6c9795] PR #85 merged before review began — nothing in flight to abort. Skipping. Resources saved.

[ho-524dce6c9795] PR #85 merged before review began — nothing in flight to abort. Skipping. Resources saved.
Owner

verdict: approve

tier: T1

Reviewed the p150-decode-40 campaign (records + the one shipped code fix). Nothing in the diff is a risk; the only code change is a correct, gated bugfix.

What changed (vs the branch head / merge base):

  • model.py — honors (set by ) with , instead of reading one replica and reshaping to full vocab (124160 vs 248320). The flag was already set but never honoured, so the mode died on the reshape. The gate keeps the old one-replica path as the default, so no default behaviour changes. Comment explains the mechanism. Correct.
  • prod-decode-profile.sh — reads the expected sha from the manifest instead of a hardcoded second copy; fixes the driver failing immediately after its own manifest check passed. Correct, and closes a real drift bug.
  • prod-sources.sha256 — re-pin of to the newer overlay; consistent with the manifest the profile now reads from. No unexplained hash.
  • tenstorrent-serving.nix / LEDGER.md — pure doc-path fix: the docs cited the control by branch-qualified path () which is now a plain path on master. No semantic change.
  • Everything else is benchmark records + a GDN conv-gates probe. Probe scripts SSH to the host with controlled flags/vars (no user input), no injection surface. No secrets in the diff.

Note for the record: the campaign's headline finding (per-op profiler table 100% blank OP NAME on this build) is a measured negative, honestly reported, and nothing is inferred from the unreadable table. Well-documented.

One nit: comment is dense but accurate — fine for a serving hot path. No action.

## verdict: approve ## tier: T1 Reviewed the p150-decode-40 campaign (records + the one shipped code fix). Nothing in the diff is a risk; the only code change is a correct, gated bugfix. What changed (vs the branch head / merge base): - model.py — honors (set by ) with , instead of reading one replica and reshaping to full vocab (124160 vs 248320). The flag was already set but never honoured, so the mode died on the reshape. The gate keeps the old one-replica path as the default, so no default behaviour changes. Comment explains the mechanism. Correct. - prod-decode-profile.sh — reads the expected sha from the manifest instead of a hardcoded second copy; fixes the driver failing immediately after its own manifest check passed. Correct, and closes a real drift bug. - prod-sources.sha256 — re-pin of to the newer overlay; consistent with the manifest the profile now reads from. No unexplained hash. - tenstorrent-serving.nix / LEDGER.md — pure doc-path fix: the docs cited the control by branch-qualified path () which is now a plain path on master. No semantic change. - Everything else is benchmark records + a GDN conv-gates probe. Probe scripts SSH to the host with controlled flags/vars (no user input), no injection surface. No secrets in the diff. Note for the record: the campaign's headline finding (per-op profiler table 100% blank OP NAME on this build) is a measured negative, honestly reported, and nothing is inferred from the unreadable table. Well-documented. One nit: comment is dense but accurate — fine for a serving hot path. No action.
Owner

verdict: approve

tier: T1

Reviewed the p150-decode-40 campaign (records + the one shipped code fix). Nothing in the diff is a risk; the only code change is a correct, gated bugfix.

What changed (vs the branch head / merge base):

  • model.py — honors _decode_logits_sharded (set by QWEN36_LM_HEAD_GATHER_MODE=none) with ConcatMeshToTensor(dim=3) instead of reading one replica and reshaping to full vocab (124160 vs 248320). The flag was already set but never honoured, so the mode died on the reshape. The gate keeps the old one-replica path as the default, so no default behaviour changes. Comment explains the mechanism. Correct.
  • prod-decode-profile.sh — reads the expected ./model.py sha from the manifest instead of a hardcoded second copy; fixes the driver failing immediately after its own manifest check passed. Correct, and closes a real drift bug.
  • prod-sources.sha256 — re-pin of ./model.py to the newer overlay; consistent with the manifest the profile now reads from. No unexplained hash.
  • tenstorrent-serving.nix / LEDGER.md — pure doc-path fix: the deviceResident docs cited the control by branch-qualified path (decode-campaign-53-55:…) which is now a plain path on master. No semantic change.
  • Everything else is benchmark records + a GDN conv-gates probe. Probe scripts SSH to the host with controlled flags/vars (no user input), no injection surface. No secrets in the diff.

Note for the record: the campaign's headline finding (per-op profiler table 100% blank OP NAME on this build) is a measured negative, honestly reported, and nothing is inferred from the unreadable table. Well-documented.

One nit: model.py comment is dense but accurate — fine for a serving hot path. No action.

## verdict: approve ## tier: T1 Reviewed the p150-decode-40 campaign (records + the one shipped code fix). Nothing in the diff is a risk; the only code change is a correct, gated bugfix. What changed (vs the branch head / merge base): - model.py — honors `_decode_logits_sharded` (set by `QWEN36_LM_HEAD_GATHER_MODE=none`) with `ConcatMeshToTensor(dim=3)` instead of reading one replica and reshaping to full vocab (124160 vs 248320). The flag was already set but never honoured, so the mode died on the reshape. The gate keeps the old one-replica path as the default, so no default behaviour changes. Comment explains the mechanism. Correct. - prod-decode-profile.sh — reads the expected `./model.py` sha from the manifest instead of a hardcoded second copy; fixes the driver failing immediately after its own manifest check passed. Correct, and closes a real drift bug. - prod-sources.sha256 — re-pin of `./model.py` to the newer overlay; consistent with the manifest the profile now reads from. No unexplained hash. - tenstorrent-serving.nix / LEDGER.md — pure doc-path fix: the `deviceResident` docs cited the control by branch-qualified path (`decode-campaign-53-55:…`) which is now a plain path on master. No semantic change. - Everything else is benchmark records + a GDN conv-gates probe. Probe scripts SSH to the host with controlled flags/vars (no user input), no injection surface. No secrets in the diff. Note for the record: the campaign's headline finding (per-op profiler table 100% blank OP NAME on this build) is a measured negative, honestly reported, and nothing is inferred from the unreadable table. Well-documented. One nit: `model.py` comment is dense but accurate — fine for a serving hot path. No action.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitpartner/tt-stack!85
No description provided.