serve: document Phase 2a gating and add a tenstorrent-serving NixOS VM check (#49, #52) #77

Merged
Grok merged 3 commits from agy/issue-49 into master 2026-09-25 22:49:12 +02:00
Owner

Documents why Phase 2a (deviceResident, enablePrefixCaching) defaults OFF, and adds a
NixOS VM check that pins the serving unit's durable defaults so they cannot be lost silently
again.

Module (modules/tenstorrent-serving.nix) — option descriptions only, no behaviour
change. deviceResident: the 09-22 record was invalidated by degenerate text, so there is
currently no valid measurement of resident decode's effect; its async lever is disabled
under prefix caching anyway (--no-async-scheduling); and deviceArgmax + prefix caching
failed 1 of 32 concurrent requests. enablePrefixCaching: the −87.5% makespan / −95% TTFT
figure is a warm 98.3%-cached burst; cold prefill on that arm is slower (−35% at 8.4k, n=1).
Both carry the gates needed before either becomes durable.

New check tests/tenstorrent-serving.nix, wired into nix flake check. It asserts
--tool-call-parser qwen3_xml (never hermes), QWEN36_SDPA_STREAMING,
QWEN36_MERGE_BATCH_GUARD, QWEN36_PREFILLED_SLOTS_FIX, QWEN36_DECODE_LOGITS_RM, the
production source mounts, and that resident decode and prefix caching are off by default.

The check as pushed could never pass and is fixed in this merge: it parsed
systemctl show -p ExecStart --value with split()[0], but systemd prints
{ path=… ; argv[]=… }, so it cat'd "{"; and its assertions matched unquoted text while
the generated script quotes every value. It now regexes path= out of the record and
compares against a quote-stripped copy. Verified green locally:
nix build .#checks.x86_64-linux.tenstorrent-serving and nix flake check.

Also fixed two stale citations the branch introduced: a record that is not on master (it
lands with decode-campaign-53-55, now marked so) and the retired DIRECTIVES-LEDGER by
its 0aaa… label, now docs/LEDGER.md.

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 file added versus
master is the new check. No PR #68 deletion was resurrected.

Refs #49, #52.

🤖 Generated with Claude Code

Documents why Phase 2a (`deviceResident`, `enablePrefixCaching`) defaults OFF, and adds a NixOS VM check that pins the serving unit's durable defaults so they cannot be lost silently again. **Module (`modules/tenstorrent-serving.nix`)** — option descriptions only, no behaviour change. `deviceResident`: the 09-22 record was invalidated by degenerate text, so there is currently **no valid measurement of resident decode's effect**; its async lever is disabled under prefix caching anyway (`--no-async-scheduling`); and `deviceArgmax` + prefix caching failed 1 of 32 concurrent requests. `enablePrefixCaching`: the −87.5% makespan / −95% TTFT figure is a warm 98.3%-cached burst; cold prefill on that arm is slower (−35% at 8.4k, n=1). Both carry the gates needed before either becomes durable. **New check `tests/tenstorrent-serving.nix`**, wired into `nix flake check`. It asserts `--tool-call-parser qwen3_xml` (never hermes), `QWEN36_SDPA_STREAMING`, `QWEN36_MERGE_BATCH_GUARD`, `QWEN36_PREFILLED_SLOTS_FIX`, `QWEN36_DECODE_LOGITS_RM`, the production source mounts, and that resident decode and prefix caching are off by default. **The check as pushed could never pass** and is fixed in this merge: it parsed `systemctl show -p ExecStart --value` with `split()[0]`, but systemd prints `{ path=… ; argv[]=… }`, so it `cat`'d `"{"`; and its assertions matched unquoted text while the generated script quotes every value. It now regexes `path=` out of the record and compares against a quote-stripped copy. Verified green locally: `nix build .#checks.x86_64-linux.tenstorrent-serving` and `nix flake check`. Also fixed two stale citations the branch introduced: a record that is not on master (it lands with `decode-campaign-53-55`, now marked so) and the retired `DIRECTIVES-LEDGER` by its `0aaa…` label, now `docs/LEDGER.md`. 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 file added versus master is the new check. No PR #68 deletion was resurrected. Refs #49, #52. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Issue #49 addresses volatility where tool calling (qwen3_xml), hugepage
reduction (hugepagesPerCard = 1), and SDPA streaming (QWEN36_SDPA_STREAMING=1)
were applied ad hoc in /run on cfx-llm2 and wiped across reboots.

Issue #52 tracks Phase 2a device-resident decode and live prefix caching.
Per performance advisory on #52:
- decode-phase2a-resident-20260922.jsonl was invalidated due to degenerate
  output, leaving no valid resident decode performance measurement.
- Prefix caching enforces synchronous execution (--no-async-scheduling),
  disabling resident decode's async-ahead mechanism.
- deviceResident forces deviceArgmax, but deviceArgmax + prefix caching
  exhibited a 1/32 concurrency failure (prefix-argmax-correctness-fail).
- -87.5% makespan at conc-8 is a warm 98.3%-cached burst; cold prefill is slower.

Document these gating conditions and safe defaults (default false) in
modules/tenstorrent-serving.nix, and add tests/tenstorrent-serving.nix to
checks in flake.nix to verify durable service generation.

Co-Authored-By: Gemini 3.8 Flash via agy <noreply@google.com>
test(serving): make the new VM check actually run, and fix two stale citations
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 16s
3bf789d399
The check as written could never pass: it parsed `systemctl show -p ExecStart --value`
with split()[0], but systemd prints `{ path=... ; argv[]=... }`, so it cat'd "{"; and
its assertions matched unquoted text while the generated script quotes every value.
A check that cannot pass is worse than none, so it now regexes path= out of the record
and compares against a quote-stripped copy. It also pins QWEN36_PREFILLED_SLOTS_FIX and
QWEN36_DECODE_LOGITS_RM, the two envs whose silent loss caused real regressions.

The module's new option docs cited a record that is not on master (it lands with
decode-campaign-53-55, now marked as such) and the retired DIRECTIVES-LEDGER by its
0aaa... label; that points at docs/LEDGER.md now.

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

verdict: approve
tier: T1

rationale: The PR is a doc-only documentation of Phase 2a gating plus a new additive checks.tenstorrent-serving runNixOSTest. No behaviour change, no leaks, no red flags. Both Phase-2a options still default OFF; the assertions match the real generated ExecStart (default parser qwen3_xml, no hermes, --no-enable-prefix-caching present, production mounts present), and the check evals green (nix eval .#checks.x86_64-linux.tenstorrent-serving -> valid set).

concerns:

  • [warn] tests/tenstorrent-serving.nix — the new assertions only verify the string template of the generated unit, not the runtime banner-matching the readinessScript does. assertCardsPresent=false + /dev/null device means no cards, so banner logic (QWEN36_DECODE_LOGITS_RM engaged, etc.) is never exercised. Cheap structural guarantee, not a runtime one — worth noting.
  • [nit] tests/tenstorrent-serving.nix — hugepagesPerCard = 1 comment cites "+5.9 GB" but gives no citation; same PR documenting gating could source it. Minor.
  • [nit] flake.nix — the check passes hostModule = self.nixosModules.tenstorrent-host; the test node imports both servingModule and hostModule, so both are used (not a dead arg). Confirming, not blocking.
**verdict:** approve **tier:** T1 **rationale:** The PR is a doc-only documentation of Phase 2a gating plus a new additive checks.tenstorrent-serving runNixOSTest. No behaviour change, no leaks, no red flags. Both Phase-2a options still default OFF; the assertions match the real generated ExecStart (default parser qwen3_xml, no hermes, --no-enable-prefix-caching present, production mounts present), and the check evals green (nix eval .#checks.x86_64-linux.tenstorrent-serving -> valid set). **concerns:** - [warn] `tests/tenstorrent-serving.nix` — the new assertions only verify the *string template* of the generated unit, not the runtime banner-matching the readinessScript does. assertCardsPresent=false + /dev/null device means no cards, so banner logic (QWEN36_DECODE_LOGITS_RM engaged, etc.) is never exercised. Cheap structural guarantee, not a runtime one — worth noting. - [nit] `tests/tenstorrent-serving.nix` — hugepagesPerCard = 1 comment cites "+5.9 GB" but gives no citation; same PR documenting gating could source it. Minor. - [nit] `flake.nix` — the check passes hostModule = self.nixosModules.tenstorrent-host; the test node imports both servingModule and hostModule, so both are used (not a dead arg). Confirming, not blocking.
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!77
No description provided.