ttx: unique slot owner per driver; refuse foreign down/stop/skip #268

Open
Grok wants to merge 1 commit from ttx-claim-unique into master
Owner

Fixes the mesh-claim race of 2026-10-19. Every local driver claimed as ttx-<user>@<host>:ab, and slot.sh treats the same owner as re-entrant. Two ttx ab --wait queues therefore both took the mesh and booted 6 s apart. Separately, a queue stop downed another track's server.

  • Owner: #q<queue id> inside a queue step, plus .p<pid> for ab/run. $TTX_OWNER (CI, card queue) is used verbatim.
  • Acquire: re-checks the claim line after the wait and refuses to boot if the claim is not ours. The take on the box is already flocked.
  • ttx down: refuses (exit 3) a container whose claim is not ours. --force overrides.
  • Queue cleanup: the killed step's cleanup downs only this queue's containers. queue skip|stop --force lifts that for one cleanup.
  • queue skip|stop: need --id when more than one queue is alive.

No arm changes. Running queues keep their own worktree's code and are unaffected. Old-format claims can still be downed from a bare shell, but a new queue's cleanup never touches them.

Tests: tools/ttx/tests/test_claim_unique.py, 15 tests. Two concurrent waiters run against the real slot.sh, and exactly one wins. The full suite passes: 662 tests OK.

🤖 Generated with Claude Code

Fixes the mesh-claim race of 2026-10-19. Every local driver claimed as `ttx-<user>@<host>:ab`, and slot.sh treats the same owner as re-entrant. Two `ttx ab --wait` queues therefore both took the mesh and booted 6 s apart. Separately, a `queue stop` downed another track's server. - **Owner:** `#q<queue id>` inside a queue step, plus `.p<pid>` for `ab`/`run`. `$TTX_OWNER` (CI, card queue) is used verbatim. - **Acquire:** re-checks the claim line after the wait and refuses to boot if the claim is not ours. The take on the box is already flocked. - **`ttx down`:** refuses (exit 3) a container whose claim is not ours. `--force` overrides. - **Queue cleanup:** the killed step's cleanup downs only this queue's containers. `queue skip|stop --force` lifts that for one cleanup. - **`queue skip|stop`:** need `--id` when more than one queue is alive. No arm changes. Running queues keep their own worktree's code and are unaffected. Old-format claims can still be downed from a bare shell, but a new queue's cleanup never touches them. Tests: `tools/ttx/tests/test_claim_unique.py`, 15 tests. Two concurrent waiters run against the real slot.sh, and exactly one wins. The full suite passes: 662 tests OK. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ttx: unique slot owner per driver; down/queue refuse foreign containers
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 5m55s
tt-stack-ci / Report upstream drift (pull_request) Successful in 8m33s
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 20m4s
tt-stack-ci / Serialized card gate (pull_request) Successful in 55m45s
cards-fresh cards: stale, verdict run 850 fp=8cd27612f4a06ed0 != merged fp=32df1100673e4b22; push or add cards:go
cf64824499
Before: every local ttx driver claimed as ttx-<user>@<host>:ab. slot.sh treats the
same owner as re-entrant, so on 2026-10-19 two `ttx ab --wait` queues both took the
mesh after the CI gate and booted 6 s apart (one died with "Sysmem mapped at unexpected
NOC address"). A `ttx queue stop` also downed another track's server: the killed step's
cleanup downs every ttx-* container that appeared during the step, and bare skip/stop
act on `latest`, the newest queue of any agent.

Now:
- default_owner(): `#q<TTX_QUEUE_ID>` in a queue step, `.p<pid>` for ab/run (drivers);
  `ttx up` / `ttx slot` keep the queue-scoped owner so a later down/release matches.
  $TTX_OWNER (CI, card queue) stays verbatim: CI re-enters its pre-acquired claim.
- acquire re-reads the claim after the wait and refuses to boot if it is not ours.
  The box-side take was already atomic (flock); the owner was the hole.
- `ttx down` refuses (exit 3) a container whose ttx.claim/ttx.owner is not ours; --force.
- queue cleanup downs as this queue (TTX_QUEUE_ID), so foreign containers are refused;
  `queue skip|stop --force` lifts that for one cleanup.
- `queue skip|stop` without --id refuse when more than one queue is alive.
No arm changes. Running queues keep their own worktree's code; old-format claims stay
downable from a bare shell and are never downed by a new queue's cleanup.

Tests: tools/ttx/tests/test_claim_unique.py (two concurrent waiters on the real slot.sh:
one wins; shared owner shows the re-entrancy; foreign refusal; --id guard). Suite 662 OK.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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-dfr-s2

  • PR #268 ref refs/pull/268/head
  • head cf64824499932e7c90fd5545a20b87499ba2f787 merged onto master (measured tree, fingerprint in the verdict comment)
  • host cfx-llm2, slot mesh (card0+card1)
  • serving check out /nix/store/xwb4lxvrbjvcyylp5mr3pqs4lzag5bv8-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-20261019T212240Z.jsonl)
  • prod gsm8k: kind MEASURED verdict pass (bench/runs/ttx-prod-gsm8k-20261019T212240Z.jsonl)
  • prod retrieval: kind MEASURED verdict pass (bench/runs/ttx-prod-retrieval-20261019T212240Z.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 2794.0 21.0 47.621 -57.09% -71.22%
prod 1 32768 3231.6 20.5 48.781 -49.85% -68.58%
prod 4 4096 2631.5 18.9 52.842 -57.55% -75.34%
prod 4 32768 3303.1 17.2 57.991 -48.95% -72.19%
prod 8 4096 2414.6 18.3 54.568 -58.68% -71.61%
prod 8 32768 3291.3 15.4 64.725 -49.43% -70.29%
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-dfr-s2 1 4096 6511.9 73.0 13.703
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-dfr-s2 1 32768 6444.1 65.2 15.327
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-dfr-s2 4 4096 6199.0 76.7 13.031
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-dfr-s2 4 32768 6470.1 62.0 16.129
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-dfr-s2 8 4096 5843.1 64.5 15.492
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-dfr-s2 8 32768 6508.9 52.0 19.23

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-dfr-s2-switch-20261019T210108Z.jsonl
  • bench/runs/ttx-prod-equiv-20261019T212240Z.jsonl
  • bench/runs/ttx-prod-gsm8k-20261019T212240Z.jsonl
  • bench/runs/ttx-prod-retrieval-20261019T212240Z.jsonl
  • bench/runs/ttx-sweep32k-prod-ab20261019T210108Z-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-dfr-s2-ab20261019T210108Z-r0.jsonl

Full jsonl from this run: https://git.bitp.cz/bitpartner/tt-stack/actions/runs/9543 (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-dfr-s2` - PR `#268` ref `refs/pull/268/head` - head `cf64824499932e7c90fd5545a20b87499ba2f787` merged onto `master` (measured tree, fingerprint in the verdict comment) - host `cfx-llm2`, slot mesh (card0+card1) - serving check out `/nix/store/xwb4lxvrbjvcyylp5mr3pqs4lzag5bv8-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-20261019T212240Z.jsonl`) - `prod` `gsm8k`: kind `MEASURED` verdict `pass` (`bench/runs/ttx-prod-gsm8k-20261019T212240Z.jsonl`) - `prod` `retrieval`: kind `MEASURED` verdict `pass` (`bench/runs/ttx-prod-retrieval-20261019T212240Z.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 | 2794.0 | 21.0 | 47.621 | -57.09% | -71.22% | | `prod` | 1 | 32768 | 3231.6 | 20.5 | 48.781 | -49.85% | -68.58% | | `prod` | 4 | 4096 | 2631.5 | 18.9 | 52.842 | -57.55% | -75.34% | | `prod` | 4 | 32768 | 3303.1 | 17.2 | 57.991 | -48.95% | -72.19% | | `prod` | 8 | 4096 | 2414.6 | 18.3 | 54.568 | -58.68% | -71.61% | | `prod` | 8 | 32768 | 3291.3 | 15.4 | 64.725 | -49.43% | -70.29% | | `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-dfr-s2` | 1 | 4096 | 6511.9 | 73.0 | 13.703 | | | | `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-dfr-s2` | 1 | 32768 | 6444.1 | 65.2 | 15.327 | | | | `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-dfr-s2` | 4 | 4096 | 6199.0 | 76.7 | 13.031 | | | | `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-dfr-s2` | 4 | 32768 | 6470.1 | 62.0 | 16.129 | | | | `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-dfr-s2` | 8 | 4096 | 5843.1 | 64.5 | 15.492 | | | | `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-dfr-s2` | 8 | 32768 | 6508.9 | 52.0 | 19.23 | | | ### 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-dfr-s2-switch-20261019T210108Z.jsonl` - `bench/runs/ttx-prod-equiv-20261019T212240Z.jsonl` - `bench/runs/ttx-prod-gsm8k-20261019T212240Z.jsonl` - `bench/runs/ttx-prod-retrieval-20261019T212240Z.jsonl` - `bench/runs/ttx-sweep32k-prod-ab20261019T210108Z-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-dfr-s2-ab20261019T210108Z-r0.jsonl` Full jsonl from this run: https://git.bitp.cz/bitpartner/tt-stack/actions/runs/9543 (artifact `bench-runs` when the upload step ran).
Member

Cards verdict: success

  • fingerprint 8cd27612f4a06ed0fc565cbbddf1eb3f1516a36efc22ec8118164d59702dedbd (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-dfr-s2, arms prod, 514 card files 97fe6664d6ebdec5)
  • measured tree: head cf64824499932e7c90fd5545a20b87499ba2f787 merged onto base 876c0332873e31d6e0a1949a4b8d4744ff87a8e9
  • run https://git.bitp.cz/bitpartner/tt-stack/actions/runs/9543

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

## Cards verdict: success - fingerprint `8cd27612f4a06ed0fc565cbbddf1eb3f1516a36efc22ec8118164d59702dedbd` (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-dfr-s2`, arms `prod`, 514 card files `97fe6664d6ebdec5`) - measured tree: head `cf64824499932e7c90fd5545a20b87499ba2f787` merged onto base `876c0332873e31d6e0a1949a4b8d4744ff87a8e9` - run https://git.bitp.cz/bitpartner/tt-stack/actions/runs/9543 A later event with the same fingerprint reuses this verdict instead of booting the cards. <!-- tt-cards-verdict {"arms": ["prod"], "base_sha": "876c0332873e31d6e0a1949a4b8d4744ff87a8e9", "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-dfr-s2", "files_sha": "97fe6664d6ebdec5a43ce7800e5a6e5b82c0dc918987a58a6ac3892a32154d31", "fp": "8cd27612f4a06ed0fc565cbbddf1eb3f1516a36efc22ec8118164d59702dedbd", "head": "cf64824499932e7c90fd5545a20b87499ba2f787", "run_id": "9543", "run_number": "850", "run_url": "https://git.bitp.cz/bitpartner/tt-stack/actions/runs/9543", "tree": "ea3e5f8073d49645b7816a2b31c373f0e44bdd5c", "v": 1, "verdict": "success"} -->
Some checks failed
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 5m55s
tt-stack-ci / Report upstream drift (pull_request) Successful in 8m33s
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 20m4s
tt-stack-ci / Serialized card gate (pull_request) Successful in 55m45s
cards-fresh cards: stale, verdict run 850 fp=8cd27612f4a06ed0 != merged fp=32df1100673e4b22; push or add cards:go
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ttx-claim-unique:ttx-claim-unique
git switch ttx-claim-unique
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!268
No description provided.