mtp: land prompt-lookup draft source (QWEN36_MTP_LOOKUP, default off; from #222) #236

Merged
Grok merged 1 commit from land-lookup-lever into master 2026-10-10 05:42:12 +02:00
Owner

Land the prompt-lookup lever from #222 as default-off infrastructure. #222's lk12 screen measured inert (+0.07% TG, gates pass, run #7803), so this PR ships the lever + its unit tests only.

Included (from #222 commit aa6daa2):

  • patches/prod-local-metal mtp_batch.py (banner/validation at init), mtp_batch_host.py (LookupRow, plan/accept/finish swap, lookup_* counters), qwen36_vllm.py (prefill seeding)
  • tests/test_mtp_lookup.py (12 tests: config fail-closed, LookupRow, equivalence + must-fail shift/trust)
  • ttxlib runtime support the lever needs: mtplog lookup_* delta, suites MTP_CELL_STATS lookup_* columns, switchclass REBOOT entries + test_mtplog.py

Excluded (stays on #222): .forgejo/workflows/ci.yml, scripts/ci-pick-winner.py (already on master via #224/#226 anyway), bench/agent_corpus.py + fixtures, bench/serving-bench.py token-ids/agent parts, tools/ttx/tests/test_agent_bench.py + test_ci_pick_winner changes, the lk12 arm TOML (inert — not shipped), stage.py TOOL_FILES, suites _waves/deadline (screen parts).

Verification: lever defaults off (flag-off summary line unchanged, seed no-op), banner present when on; tests/test_mtp_lookup.py 12 passed; test_mtplog + test_ci_pick_winner + test_lint 58 passed; ttx lint on a control arm OK. No cards touched. Do not close #222 (owner retargets it).

Land the prompt-lookup lever from #222 as default-off infrastructure. #222's lk12 screen measured inert (+0.07% TG, gates pass, run #7803), so this PR ships the lever + its unit tests only. Included (from #222 commit aa6daa2): - patches/prod-local-metal mtp_batch.py (banner/validation at init), mtp_batch_host.py (LookupRow, plan/accept/finish swap, lookup_* counters), qwen36_vllm.py (prefill seeding) - tests/test_mtp_lookup.py (12 tests: config fail-closed, LookupRow, equivalence + must-fail shift/trust) - ttxlib runtime support the lever needs: mtplog lookup_* delta, suites MTP_CELL_STATS lookup_* columns, switchclass REBOOT entries + test_mtplog.py Excluded (stays on #222): .forgejo/workflows/ci.yml, scripts/ci-pick-winner.py (already on master via #224/#226 anyway), bench/agent_corpus.py + fixtures, bench/serving-bench.py token-ids/agent parts, tools/ttx/tests/test_agent_bench.py + test_ci_pick_winner changes, the lk12 arm TOML (inert — not shipped), stage.py TOOL_FILES, suites _waves/deadline (screen parts). Verification: lever defaults off (flag-off summary line unchanged, seed no-op), banner present when on; tests/test_mtp_lookup.py 12 passed; test_mtplog + test_ci_pick_winner + test_lint 58 passed; `ttx lint` on a control arm OK. No cards touched. Do not close #222 (owner retargets it).
mtp: prompt-lookup draft source (QWEN36_MTP_LOOKUP, default off; from #222)
All checks were successful
cards-fresh cards: fresh (run 573) fp=159664bd61da37ef
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 2m10s
tt-stack-ci / Report upstream drift (pull_request) Successful in 36s
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 32s
tt-stack-ci / Serialized card gate (pull_request) Has been skipped
f20c9d4611
Per row, when the request id history has an earlier occurrence of its
last 3 ids matching the suffix for >= QWEN36_MTP_LOOKUP_MIN ids
(default 12), the K drafts come from that continuation instead of the
MTP head; else MTP. K and verify width unchanged, greedy exact
acceptance (lossless by construction). Host-only; banner at init,
seeding at prefill; lookup_* counters only once seeded (CONTROL line
unchanged). Must-fail modes shift/trust for the self-test.

Lever only: the lk12 screen measured inert (+0.07% TG, gates pass),
so the lk12 arm TOML, CI screen (ci.yml/picker), and agent-corpus
parts of #222 stay out.
Owner

verdict: approve
tier: T1

rationale: Default-off lever with byte-identical control path (verified in-kernel: flag-off summary has no lookup_*, seed is a no-op, banner is None). Greedy exact acceptance is untouched (lossless by construction). 12/12 new tests pass; the new test_mtplog counter-delta test verifies correctly; no secret or red-flag patterns.

concerns:

  • [warn] tools/ttx/ttxlib/suites.py:572 — MTP_CELL_STATS gains 4 lookup_* keys, so attach_mtp_stats now emits lookup_*: None on every mtp_stats record, including CONTROL arms that never set the flag. This becomes the permanent schema for all future runs once merged. The pick-winner judges on accept_rate/tokens_per_row_step (unchanged), so it's safe — but consider whether the 4 null columns belong in the standing schema or should be emitted only when the flag is on. Not a block.
  • [nit] The lever is measured inert (+0.07% TG from #222's lk12 screen). It ships as infrastructure only (no arm TOML / CI screen) — that's consistent with "lever + unit tests only", so fine to land.
**verdict:** approve **tier:** T1 **rationale:** Default-off lever with byte-identical control path (verified in-kernel: flag-off summary has no `lookup_*`, seed is a no-op, banner is None). Greedy exact acceptance is untouched (lossless by construction). 12/12 new tests pass; the new `test_mtplog` counter-delta test verifies correctly; no secret or red-flag patterns. **concerns:** - [warn] `tools/ttx/ttxlib/suites.py:572` — `MTP_CELL_STATS` gains 4 `lookup_*` keys, so `attach_mtp_stats` now emits `lookup_*: None` on **every** mtp_stats record, including CONTROL arms that never set the flag. This becomes the permanent schema for all future runs once merged. The pick-winner judges on `accept_rate`/`tokens_per_row_step` (unchanged), so it's safe — but consider whether the 4 null columns belong in the standing schema or should be emitted only when the flag is on. Not a block. - [nit] The lever is measured inert (+0.07% TG from #222's lk12 screen). It ships as infrastructure only (no arm TOML / CI screen) — that's consistent with "lever + unit tests only", so fine to land.
Member

Card gate — prod vs prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob

  • PR #236 ref refs/pull/236/head
  • head f20c9d46118732a6f13ab8d638fd0723e8bed9fa merged onto master (measured tree, fingerprint in the verdict comment)
  • host cfx-llm2, slot mesh (card0+card1)
  • serving check out /nix/store/d1mg0hngjnb9vbfja47mbyba5wfbc2xq-vm-test-run-tenstorrent-serving
  • ttx ab exit 0 (3 = aborted: the job fails even if a control record exists); gates exit 0
  • sweep reps: 1. Cells kept: B=8, B=4 and B=1 at ctx 4096 and 32768, one visit per arm.

gsm8k / retrieval / equiv do not gate merge. A FAIL below is a report.

Gates

  • prod equiv: kind MEASURED verdict pass (bench/runs/ttx-prod-equiv-20261010T031944Z.jsonl)
  • prod gsm8k: kind MEASURED verdict pass (bench/runs/ttx-prod-gsm8k-20261010T031944Z.jsonl)
  • prod retrieval: kind MEASURED verdict pass (bench/runs/ttx-prod-retrieval-20261010T031944Z.jsonl)

PP tok/s and TG tok/s per user (TG ms/token secondary)

arm B ctx PP tok/s TG tok/s/user TG ms/token vs control PP vs control TG tok/s
prod 1 4096 2868.3 21.0 47.579 -48.18% -69.57%
prod 1 32768 3220.1 20.5 48.843 -50.19% -67.40%
prod 4 4096 2646.4 18.9 52.785 -51.85% -72.04%
prod 4 32768 3306.3 17.3 57.951 -49.66% -71.33%
prod 8 4096 2429.8 18.4 54.469 -55.07% -70.99%
prod 8 32768 3293.4 15.5 64.583 -49.40% -68.35%
prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob 1 4096 5535.1 69.1 14.477
prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob 1 32768 6464.4 62.8 15.921
prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob 4 4096 5496.1 67.8 14.76
prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob 4 32768 6568.4 60.2 16.612
prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob 8 4096 5408.2 63.3 15.799
prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob 8 32768 6509.0 48.9 20.443

Records

  • bench/runs/ttx-ab-prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob-switch-20261010T025310Z.jsonl
  • bench/runs/ttx-prod-equiv-20261010T031944Z.jsonl
  • bench/runs/ttx-prod-gsm8k-20261010T031944Z.jsonl
  • bench/runs/ttx-prod-retrieval-20261010T031944Z.jsonl
  • bench/runs/ttx-sweep32k-prod-ab20261010T025310Z-r0.jsonl
  • bench/runs/ttx-sweep32k-prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob-ab20261010T025310Z-r0.jsonl

Full jsonl from this run: https://git.bitp.cz/bitpartner/tt-stack/actions/runs/8017 (artifact bench-runs when the upload step ran).

## Card gate — `prod` vs `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob` - PR `#236` ref `refs/pull/236/head` - head `f20c9d46118732a6f13ab8d638fd0723e8bed9fa` merged onto `master` (measured tree, fingerprint in the verdict comment) - host `cfx-llm2`, slot mesh (card0+card1) - serving check out `/nix/store/d1mg0hngjnb9vbfja47mbyba5wfbc2xq-vm-test-run-tenstorrent-serving` - `ttx ab` exit 0 (3 = aborted: the job fails even if a control record exists); gates exit 0 - sweep reps: 1. Cells kept: B=8, B=4 and B=1 at ctx 4096 and 32768, one visit per arm. gsm8k / retrieval / equiv do **not** gate merge. A FAIL below is a report. ### Gates - `prod` `equiv`: kind `MEASURED` verdict `pass` (`bench/runs/ttx-prod-equiv-20261010T031944Z.jsonl`) - `prod` `gsm8k`: kind `MEASURED` verdict `pass` (`bench/runs/ttx-prod-gsm8k-20261010T031944Z.jsonl`) - `prod` `retrieval`: kind `MEASURED` verdict `pass` (`bench/runs/ttx-prod-retrieval-20261010T031944Z.jsonl`) ### PP tok/s and TG tok/s per user (TG ms/token secondary) | arm | B | ctx | PP tok/s | TG tok/s/user | TG ms/token | vs control PP | vs control TG tok/s | | --- | --- | --- | --- | --- | --- | --- | --- | | `prod` | 1 | 4096 | 2868.3 | 21.0 | 47.579 | -48.18% | -69.57% | | `prod` | 1 | 32768 | 3220.1 | 20.5 | 48.843 | -50.19% | -67.40% | | `prod` | 4 | 4096 | 2646.4 | 18.9 | 52.785 | -51.85% | -72.04% | | `prod` | 4 | 32768 | 3306.3 | 17.3 | 57.951 | -49.66% | -71.33% | | `prod` | 8 | 4096 | 2429.8 | 18.4 | 54.469 | -55.07% | -70.99% | | `prod` | 8 | 32768 | 3293.4 | 15.5 | 64.583 | -49.40% | -68.35% | | `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob` | 1 | 4096 | 5535.1 | 69.1 | 14.477 | | | | `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob` | 1 | 32768 | 6464.4 | 62.8 | 15.921 | | | | `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob` | 4 | 4096 | 5496.1 | 67.8 | 14.76 | | | | `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob` | 4 | 32768 | 6568.4 | 60.2 | 16.612 | | | | `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob` | 8 | 4096 | 5408.2 | 63.3 | 15.799 | | | | `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob` | 8 | 32768 | 6509.0 | 48.9 | 20.443 | | | ### Records - `bench/runs/ttx-ab-prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob-switch-20261010T025310Z.jsonl` - `bench/runs/ttx-prod-equiv-20261010T031944Z.jsonl` - `bench/runs/ttx-prod-gsm8k-20261010T031944Z.jsonl` - `bench/runs/ttx-prod-retrieval-20261010T031944Z.jsonl` - `bench/runs/ttx-sweep32k-prod-ab20261010T025310Z-r0.jsonl` - `bench/runs/ttx-sweep32k-prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob-ab20261010T025310Z-r0.jsonl` Full jsonl from this run: https://git.bitp.cz/bitpartner/tt-stack/actions/runs/8017 (artifact `bench-runs` when the upload step ran).
Member

Cards verdict: success

  • fingerprint 159664bd61da37ef8fd4f45d1baf2c496226c4714a4155f03edb70c2e7b5977c (CONTROL prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob, arms prod, 475 card files 2f1d856372e6d1ee)
  • measured tree: head f20c9d46118732a6f13ab8d638fd0723e8bed9fa merged onto base a7631340bd2c700bd7e19f6f3e86614b1cd4171c
  • run https://git.bitp.cz/bitpartner/tt-stack/actions/runs/8017

A later event with the same fingerprint reuses this verdict instead of booting the cards.

## Cards verdict: success - fingerprint `159664bd61da37ef8fd4f45d1baf2c496226c4714a4155f03edb70c2e7b5977c` (CONTROL `prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob`, arms `prod`, 475 card files `2f1d856372e6d1ee`) - measured tree: head `f20c9d46118732a6f13ab8d638fd0723e8bed9fa` merged onto base `a7631340bd2c700bd7e19f6f3e86614b1cd4171c` - run https://git.bitp.cz/bitpartner/tt-stack/actions/runs/8017 A later event with the same fingerprint reuses this verdict instead of booting the cards. <!-- tt-cards-verdict {"arms": ["prod"], "base_sha": "a7631340bd2c700bd7e19f6f3e86614b1cd4171c", "control": "prod-g2-c86-colpar2-rz3-sl-pfw2-gf-ab-so-dn-d8k16-nhp-tail-k8v4-mtp-stack-warm-kb-cm-so1-kda2-lmlofi-csplit-t0-gdc-cpk-wy-kvd-sddec-cph32-kvfold-dx-w2t-mx-b8k3c48-gpgob", "files_sha": "2f1d856372e6d1ee7ffff862b8f12a75a88cbfcb1b429dec8227fb1469146bd3", "fp": "159664bd61da37ef8fd4f45d1baf2c496226c4714a4155f03edb70c2e7b5977c", "head": "f20c9d46118732a6f13ab8d638fd0723e8bed9fa", "run_id": "8017", "run_number": "573", "run_url": "https://git.bitp.cz/bitpartner/tt-stack/actions/runs/8017", "tree": "033829d0d0bf9cf7bdfeabd7bf1dd466cae21ffe", "v": 1, "verdict": "success"} -->
Grok merged commit cc74b6d72b into master 2026-10-10 05:42:12 +02:00
Grok deleted branch land-lookup-lever 2026-10-10 05:42:12 +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.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!236
No description provided.