ttx ab: heal a dirty mesh (tt-smi -r 0 1) before every boot within the run #228

Merged
tenstorrent merged 1 commit from ttx-heal-within-run into master 2026-10-09 13:35:03 +02:00
Member

Tooling only. No card-facing paths are touched (tools/ttx/ only), so the cards job skips and nothing boots.

Why: in run 7551 (#227, verdict #227 (comment)), three separate boots in a row ended in container needed SIGKILL. runner.down marks the mesh dirty (/tmp/ttlock.d/mesh-dirty). However, heal_mesh_if_dirty only runs on the next mesh acquire, and ttx ab holds the mesh for the whole run. So every later boot in that run used an un-reset mesh: g9c2304-mix booted in ~3.5 min on rep 0, then hit the 600 s deadline on rep 1.

Change (tools/ttx/ttxlib/ab.py): before each separate boot and each switch-group boot, ab_switch now calls the existing N.heal_mesh_if_dirty(host, owner). On a dirty mesh that runs sudo tt-smi -r 0 1, checks that both cards are held by …:ab and have no containers, clears the marker and settles for MESH_SETTLE_S. On a clean mesh it does a single cat and nothing else. If the heal is refused, the run aborts (aborted = "mesh heal before boot of … refused") before any further boot, the summary is still written, and the slot is released.

Tests (tools/ttx/tests/test_arm_switch.py):

  • heal runs before every boot after a dirty stop;
  • a refused heal aborts the run with no further boot;
  • the unmocked heal_mesh_if_dirty path issues tt-smi -r 0 1 before the next up once the SIGKILL marker is set.

Local results: test_arm_switch + test_mesh_heal 36/36 OK. Full tools/ttx/tests run: 515 tests; the only error is test_seed_symlink failing to import outside the nix test env, and it fails the same way on master.

**Tooling only.** No card-facing paths are touched (`tools/ttx/` only), so the cards job skips and nothing boots. **Why:** in run 7551 (#227, verdict https://git.bitp.cz/bitpartner/tt-stack/pulls/227#issuecomment-13902), three separate boots in a row ended in `container needed SIGKILL`. `runner.down` marks the mesh dirty (`/tmp/ttlock.d/mesh-dirty`). However, `heal_mesh_if_dirty` only runs on the next mesh **acquire**, and `ttx ab` holds the mesh for the whole run. So every later boot in that run used an un-reset mesh: g9c2304-mix booted in ~3.5 min on rep 0, then hit the 600 s deadline on rep 1. **Change** (`tools/ttx/ttxlib/ab.py`): before each separate boot and each switch-group boot, `ab_switch` now calls the existing `N.heal_mesh_if_dirty(host, owner)`. On a dirty mesh that runs `sudo tt-smi -r 0 1`, checks that both cards are held by `…:ab` and have no containers, clears the marker and settles for `MESH_SETTLE_S`. On a clean mesh it does a single `cat` and nothing else. If the heal is refused, the run aborts (`aborted = "mesh heal before boot of … refused"`) before any further boot, the summary is still written, and the slot is released. **Tests** (`tools/ttx/tests/test_arm_switch.py`): - heal runs before every boot after a dirty stop; - a refused heal aborts the run with no further boot; - the unmocked `heal_mesh_if_dirty` path issues `tt-smi -r 0 1` before the next `up` once the SIGKILL marker is set. Local results: `test_arm_switch` + `test_mesh_heal` 36/36 OK. Full `tools/ttx/tests` run: 515 tests; the only error is `test_seed_symlink` failing to import outside the nix test env, and it fails the same way on master.
ttx ab: heal a dirty mesh before every boot within the run
All checks were successful
tt-stack-ci / Report upstream drift (pull_request) Successful in 1m21s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 2m41s
tt-stack-ci / Serialized card gate (pull_request) Successful in 1m9s
386a7c34f2
Run 7551/#227: three separate boots in a row ended in 'container needed SIGKILL'. runner.down marks the
mesh dirty, but heal_mesh_if_dirty only ran on the next mesh ACQUIRE, and ttx ab holds the mesh for the whole
run, so the later boots of that run ran on an un-reset mesh. g9c2304-mix booted in ~3.5 min on rep 0 and hit
the 600 s deadline on rep 1. Now ab_switch calls heal_mesh_if_dirty (tt-smi -r 0 1 + settle, owner/containers
checked) before each separate and switch-group boot. A refused heal aborts the run without booting.
Tests: heal before every boot after a dirty stop, refused heal aborts, real heal path runs tt-smi -r 0 1.
Owner

verdict: approve
tier: T1 (tooling only — tools/ttx/ttxlib/ab.py + tests; no card-facing paths, so the card job green-skips)

rationale: ab_switch now calls the existing N.heal_mesh_if_dirty(host, owner) before each fresh boot within a run (separate-arm re-boot and switch-group fallback boot), not only at the next mesh acquire. That closes the run-7551/#227 hole where SIGKILL'd stops left the mesh dirty and every later boot in the same run hit the 600 s deadline on an un-reset mesh. The heal path (owner+container pre-checks, tt-smi -r 0 1, settle) is the same code the acquire path already ran under our own slot, and a refused heal aborts the run cleanly before any further boot (summary written, slot released in finally).

concerns:

  • [nit] ab.py:222 — each refused/dirty heal adds MESH_SETTLE_S (default 120 s) before the next boot. Intended and bounded (one per re-boot, and only when the marker is set); no action needed.

Diff is +119/-0, test-covered (3 new cases: heal-before-every-boot, refused-heal-aborts, real tt-smi -r 0 1 path). No secret/vuln patterns.

**verdict:** approve **tier:** T1 (tooling only — `tools/ttx/ttxlib/ab.py` + tests; no card-facing paths, so the card job green-skips) **rationale:** `ab_switch` now calls the existing `N.heal_mesh_if_dirty(host, owner)` before each fresh boot within a run (separate-arm re-boot and switch-group fallback boot), not only at the next mesh acquire. That closes the run-7551/#227 hole where SIGKILL'd stops left the mesh dirty and every later boot in the same run hit the 600 s deadline on an un-reset mesh. The heal path (owner+container pre-checks, `tt-smi -r 0 1`, settle) is the same code the acquire path already ran under our own slot, and a refused heal aborts the run cleanly before any further boot (summary written, slot released in `finally`). **concerns:** - [nit] `ab.py:222` — each refused/dirty heal adds `MESH_SETTLE_S` (default 120 s) before the next boot. Intended and bounded (one per re-boot, and only when the marker is set); no action needed. Diff is +119/-0, test-covered (3 new cases: heal-before-every-boot, refused-heal-aborts, real `tt-smi -r 0 1` path). No secret/vuln patterns.
Author
Member

Cards skipped

PR #228 386a7c34f2c0779cb96dbd40d7ed1e36826ccc42 (refs/pull/228/head) does not touch card-facing paths (bench/arms/, patches/, kernel/op sources, or .forgejo/workflows/). No card boot. Build out: /nix/store/hbb3j0xxx0pqf760i3p54q54gzgmzpc9-vm-test-run-tenstorrent-serving.

## Cards skipped PR #228 `386a7c34f2c0779cb96dbd40d7ed1e36826ccc42` (`refs/pull/228/head`) does not touch card-facing paths (`bench/arms/`, `patches/`, kernel/op sources, or `.forgejo/workflows/`). No card boot. Build out: `/nix/store/hbb3j0xxx0pqf760i3p54q54gzgmzpc9-vm-test-run-tenstorrent-serving`.
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!228
No description provided.