dspark: ThinkingCap acceptance measured (3.95 tok/round at K=7) and the capture harness #75

Merged
Grok merged 6 commits from dspark-thinkingcap into master 2026-09-25 22:36:13 +02:00
Owner

DSpark drafter acceptance measured on ThinkingCap, plus the harness that produced it.

Result (LEDGER R-2026-09-25-dspark-tc): tokens per draft+verify round
3.00 / 3.95 / 4.43 at K=3/7/15 on ThinkingCap vs 2.91 / 3.79 / 4.32 on Qwen base,
same prompts. Agentic reaches 5.21 at K=7. The fear that ThinkingCap's fine-tune would
degrade a Qwen-trained drafter is not supported. Acceptance only, host-CPU oracle over a
TT capture — no speed claim follows
; draft/verify/commit cost needs the TP=2 verifier.

Adds bench/dspark/ (capture, oracle, controls, tests), three records, and
.claude/skills/dspark-tt/SKILL.md. This merge also writes the result into
docs/LEDGER.md — the branch had recorded it only in commit messages, and after PR #68
the LEDGER is the only place a result is visible — and refreshes bench/runs/INDEX.tsv.

Master merged in first (branch was cut before PR #68). Verified after the merge: docs/
still 11 files, no root CLAUDE.md, AGENTS.md is the lean rewrite,
QWEN36_PREFILLED_SLOTS_FIX still in qwen36_vllm.py, and the only files added versus
master are the twelve listed above. No PR #68 deletion was resurrected.
scripts/check-cited-records.py passes locally.

🤖 Generated with Claude Code

DSpark drafter acceptance measured on ThinkingCap, plus the harness that produced it. **Result** (LEDGER `R-2026-09-25-dspark-tc`): tokens per draft+verify round **3.00 / 3.95 / 4.43 at K=3/7/15 on ThinkingCap** vs **2.91 / 3.79 / 4.32 on Qwen base**, same prompts. Agentic reaches 5.21 at K=7. The fear that ThinkingCap's fine-tune would degrade a Qwen-trained drafter is not supported. **Acceptance only, host-CPU oracle over a TT capture — no speed claim follows**; draft/verify/commit cost needs the TP=2 verifier. Adds `bench/dspark/` (capture, oracle, controls, tests), three records, and `.claude/skills/dspark-tt/SKILL.md`. This merge also writes the result into `docs/LEDGER.md` — the branch had recorded it only in commit messages, and after PR #68 the LEDGER is the only place a result is visible — and refreshes `bench/runs/INDEX.tsv`. Master merged in first (branch was cut before PR #68). Verified after the merge: `docs/` still 11 files, no root `CLAUDE.md`, `AGENTS.md` is the lean rewrite, `QWEN36_PREFILLED_SLOTS_FIX` still in `qwen36_vllm.py`, and the only files added versus master are the twelve listed above. No PR #68 deletion was resurrected. `scripts/check-cited-records.py` passes locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
We believed #23's acceptance of 0.10 was a verdict on the drafter. It was not. It came from
five harness defects. agy's advisory found two: ctx_len=1 and a RoPE off-by-one. There are
three more. The fix replays prompt tokens through decode after prefill, which advances the 48
in-place GDN states a second time and corrupts the target itself. The prompt is word salad with
no chat template. The context is truncated on a full-history drafter. No DSpark number we held
was a measurement.

Under greedy decoding, speculation is lossless. Acceptance is therefore a pure function of the
target's greedy sequence and its layer 5/19/33/47/61 features. So capture those once on the
production tree (vllm-tt:k2, src19, the prod-argmax env, ThinkingCap's own tensor cache) and
replay any K, window or control on the host. This measures acceptance without the TP=2
speculative verifier. That verifier is the blocker shared with MTP #63, and there is no point
building it for DSpark before we know DSpark beats MTP.

The oracle's cached context K/V is tested equivalent to DSparkReference at every length and
window (27 host tests). The capture fails closed on mesh-concat order, cache attribution,
prefill determinism and a phase-2 next-token mismatch.

Refs #66, #23, #63.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The capture ran clean on both arms. Mesh-concat order matched the checkpoint exactly, the
phase-2 multi-row next token matched decode on 12/12 prompts, and each arm booted from a warm
build of its own cache. We can now replay acceptance on host.

What the features show: ThinkingCap's taps match Qwen's at layer 5 (PCC 0.9999+) but drift to
0.987-0.998 at layer 61 on identical prompts. We assumed the fine-tune leaves the drafter's
inputs untouched. It moves them measurably, so acceptance on ThinkingCap has to be measured and
cannot be borrowed from Qwen or Thatch.

Fixes:
- The oracle read think_end_index from safetensors metadata as a string, and crashed.
- -1 (no </think> within the budget) now means "all thinking" when thinking is on.
- The capture's in-run PCC is now float64. The float32 values exceeded 1 (up to 1.005).

Refs #66.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
We feared ThinkingCap's fine-tune (deep taps drift to PCC 0.987 against Qwen) would degrade a
drafter trained on Qwen, and that the port would need a ThinkingCap-specific drafter that does not
exist. The oracle says the opposite. Tokens per round are 3.00/3.95/4.43 at K=3/7/15 for
ThinkingCap and 2.91/3.79/4.32 for Qwen, on the same prompts. Agentic reaches 5.21 at K=7, and a
no-think file re-emission reaches 7.55 of a possible 8.

The controls show the drafter uses the aligned, full-history features: misaligning by one
position, or windowing to 1 or 64 positions, lowers acceptance on every prompt. That is also why
#23's windowed probe could not have measured it.

These are acceptance numbers only. Verify, draft and commit cost need the TP=2 verifier shared
with #63.

Refs #66.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
docs(LEDGER): record DSpark acceptance on ThinkingCap; refresh bench/runs/INDEX.tsv
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 5s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 11s
9248806019
The branch measured it but recorded it nowhere a reader looks: LEDGER is now the
only doc that may state a result, and after the PR #68 overhaul a result that is
not there is invisible. Scope is stated explicitly (acceptance only, host CPU) so
it cannot be read as a speed claim.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Grok merged commit b605dd1a64 into master 2026-09-25 22:36:13 +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

verdict: approve
tier: T3 (research/benchmark harness — not infra, no .nix, no secrets, no merge-gate surface)

rationale: This is a self-contained acceptance-measurement harness for the DSpark drafter, not a production path. The core claim is correct — under greedy decoding speculation is lossless, so replaying the target's recorded greedy sequence over the drafter's tapped features on host CPU is an exact acceptance measurement, with no speculative verifier needed. The code is clean and the design is sound.

concerns:

  • [nit] oracle.py:1224 model.prefill_traced_chunked(...) runs the prefill with no trace parked (eager), while the real verify step uses a multi-row traced program — the capture's own docs flag that these differ at bf16/bf8 noise. --taps decode controls measure the sensitivity, and the records state taps_source: prefill, so this is disclosed rather than hidden. Acceptable for an acceptance-only benchmark.
  • [nit] run-capture.sh and tap_capture.py are device-side artifacts that only ever run inside the vllm-tt:k2 container with production mounts; they are not runnable on host/CI, so the 27 test_oracle.py host tests cover the oracle accounting but not the TT capture itself. The capture's fail-closed checks (embedding-order PCC>0.999, phase-2 next-token match, warm-cache attribution) are the real gate and are reported in the capture record's checks block.
  • [warn] The oracle holds the drafter in fp32 on CPU (~13 GB RSS) and loads a 2.5 GB lm_head — the SKILL.md correctly warns against running two oracles simultaneously. No new footprint introduced into CI/cluster.
  • [nit] docs/LEDGER.md now records the result (a legitimate follow-through to PR #68's closure rule) — scoped as acceptance-only, no speed claim. Correct.

No secret-leak, no code-execution vuln, no auth/blast-radius regression, no infra .nix. guards.sh fails closed. fetch_tensors.py streams over ssh with byte-count verification (no remote materialisation). The design properly avoids the five defects that produced #23's 0.10 (no decode-replay of prompt tokens, real chat template, full-history context). Approve.

**verdict:** approve **tier:** T3 (research/benchmark harness — not infra, no `.nix`, no secrets, no merge-gate surface) **rationale:** This is a self-contained acceptance-measurement harness for the DSpark drafter, not a production path. The core claim is correct — under greedy decoding speculation is lossless, so replaying the target's recorded greedy sequence over the drafter's tapped features on host CPU is an exact acceptance measurement, with no speculative verifier needed. The code is clean and the design is sound. **concerns:** - [nit] `oracle.py:1224` `model.prefill_traced_chunked(...)` runs the prefill with **no trace parked** (eager), while the real verify step uses a multi-row traced program — the capture's own docs flag that these differ at bf16/bf8 noise. `--taps decode` controls measure the sensitivity, and the records state `taps_source: prefill`, so this is disclosed rather than hidden. Acceptable for an acceptance-only benchmark. - [nit] `run-capture.sh` and `tap_capture.py` are device-side artifacts that only ever run inside the `vllm-tt:k2` container with production mounts; they are not runnable on host/CI, so the 27 `test_oracle.py` host tests cover the oracle accounting but not the TT capture itself. The capture's fail-closed checks (embedding-order PCC>0.999, phase-2 next-token match, warm-cache attribution) are the real gate and are reported in the capture record's `checks` block. - [warn] The oracle holds the drafter in **fp32 on CPU (~13 GB RSS)** and loads a 2.5 GB lm_head — the SKILL.md correctly warns against running two oracles simultaneously. No new footprint introduced into CI/cluster. - [nit] `docs/LEDGER.md` now records the result (a legitimate follow-through to PR #68's closure rule) — scoped as acceptance-only, no speed claim. Correct. No secret-leak, no code-execution vuln, no auth/blast-radius regression, no infra `.nix`. `guards.sh` fails closed. `fetch_tensors.py` streams over ssh with byte-count verification (no remote materialisation). The design properly avoids the five defects that produced #23's 0.10 (no decode-replay of prompt tokens, real chat template, full-history context). Approve.
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!75
No description provided.