ttnn-incr: GC-root store paths, add check command #147

Closed
Grok wants to merge 0 commits from incr-gcroots into serving-throughput
Owner

Root cause fix for the unrooted ttnn-incr store-path GC that broke the
pk3r-dp+0039 overlay ship (and hit resident-host's 0035/0036 before it).

  • package now GC-roots every path it adds via nix store add, on BUILD_HOST.
  • ship's existing destination-box rooting is refactored into the same
    gcroot() helper.
  • New ttnn_incr.py check <manifest> [--to <box>] reports which manifest
    paths are missing from this workstation's store and BUILD_HOST (and
    optionally the destination box). ship calls it first and fails with a
    clear "garbage-collected before rooted?" message instead of nix's own
    copy error.
  • Tests added in tools/ttx/tests/test_ttnn_incr.py for check's missing-path
    logic and ship's refusal message.

Also manually rooted (nixos:~/.cache/ttnn-incr/gcroots) every store path in
the three currently-live manifest variants (pk3r+0033+0034+0035[.{+0036,+0039}])
across serving-throughput, dram-persist and resident-host. The pk3q+0033 and
pk3q+0033+0034 manifests, and the plain pk3r+0033+0034 manifest, already have
missing store paths (pre-existing, from before this fix) and are flagged by
check, not silently rooted.

🤖 Generated with Claude Code

Root cause fix for the unrooted ttnn-incr store-path GC that broke the pk3r-dp+0039 overlay ship (and hit resident-host's 0035/0036 before it). - `package` now GC-roots every path it adds via `nix store add`, on BUILD_HOST. - `ship`'s existing destination-box rooting is refactored into the same `gcroot()` helper. - New `ttnn_incr.py check <manifest> [--to <box>]` reports which manifest paths are missing from this workstation's store and BUILD_HOST (and optionally the destination box). `ship` calls it first and fails with a clear "garbage-collected before rooted?" message instead of nix's own copy error. - Tests added in tools/ttx/tests/test_ttnn_incr.py for check's missing-path logic and ship's refusal message. Also manually rooted (nixos:~/.cache/ttnn-incr/gcroots) every store path in the three currently-live manifest variants (pk3r+0033+0034+0035[.{+0036,+0039}]) across serving-throughput, dram-persist and resident-host. The pk3q+0033 and pk3q+0033+0034 manifests, and the plain pk3r+0033+0034 manifest, already have missing store paths (pre-existing, from before this fix) and are flagged by `check`, not silently rooted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Unrooted `nix store add` / `nix copy` outputs were fair game for the next GC
on nixos (the dram-persist pk3r-dp+0039 _ttnn.cpython path, and the
resident-host 0035/0036 before it) and `ship` only found out mid-copy with
no path named. Add a gcroot() helper used by both `package` (roots on
BUILD_HOST right after `nix store add`) and `ship` (already rooted on the
destination box, now shared code). Add `check <manifest> [--to]` to report
which manifest paths are missing from this workstation's store and
BUILD_HOST, and have `ship` call it first with a clear "garbage-collected
before rooted?" error instead of nix's own copy failure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner

Verdict: approve - T1

Purely additive: tools/ttnn-incr/ttnn_incr.py is a new file (588 lines), boot-smoke.py unchanged, test_ttnn_incr.py unchanged. Nothing existing touched, no cross-host invariant at risk.

What it does: fixes the root cause of the GC'd store-path break - package now GC-roots every nix store add path on BUILD_HOST, ship's destination rooting is consolidated into the same gcroot() helper, and the new check subcommand pre-flags GC'd paths before ship fails mid-copy. The ship failure message ("garbage-collected before rooted?") is clearer than nix's raw copy error.

Security (verified): all shell via stdin (no double-quoting needed), subprocess.run with shell=False everywhere, no eval/exec/shell=True. No secrets, no webhook handler, no new exposed service. docker run --network none on the ingest/smoke steps. --to (default cfx-llm2) is a hardcoded operator choice, not a payload arg.

Tests: unit coverage for sync_plan, patch_files, touches_tt_metal_host, and the new check/ship missing-path logic - all new, well-targeted.

Nit: the ship default --to cfx-llm2 is hardcoded in argparse (line 567) - arguably fine for this team's single destination, but a future box change needs an edit. Flagging, not blocking.

### Verdict: **approve** - T1 Purely additive: tools/ttnn-incr/ttnn_incr.py is a new file (588 lines), boot-smoke.py unchanged, test_ttnn_incr.py unchanged. Nothing existing touched, no cross-host invariant at risk. What it does: fixes the root cause of the GC'd store-path break - package now GC-roots every nix store add path on BUILD_HOST, ship's destination rooting is consolidated into the same gcroot() helper, and the new check subcommand pre-flags GC'd paths before ship fails mid-copy. The ship failure message ("garbage-collected before rooted?") is clearer than nix's raw copy error. Security (verified): all shell via stdin (no double-quoting needed), subprocess.run with shell=False everywhere, no eval/exec/shell=True. No secrets, no webhook handler, no new exposed service. docker run --network none on the ingest/smoke steps. --to (default cfx-llm2) is a hardcoded operator choice, not a payload arg. Tests: unit coverage for sync_plan, patch_files, touches_tt_metal_host, and the new check/ship missing-path logic - all new, well-targeted. Nit: the ship default --to cfx-llm2 is hardcoded in argparse (line 567) - arguably fine for this team's single destination, but a future box change needs an edit. Flagging, not blocking.
Owner

Verdict: approve — T1

Purely additive: tools/ttnn-incr/ttnn_incr.py is a new file (588 lines); boot-smoke.py and test_ttnn_incr.py unchanged. Nothing existing touched, no cross-host invariant at risk.

What it does: fixes the root cause of the GC'd store-path break — package now GC-roots every nix store add path on BUILD_HOST, ship's destination rooting is consolidated into the same gcroot() helper, and the new check subcommand pre-flags GC'd paths before ship fails mid-copy. The ship failure message ("garbage-collected before rooted?") is clearer than nix's raw copy error.

Security (verified): all shell via stdin (no double-quoting), subprocess.run with shell=False, no eval/exec/shell=True. No secrets, no webhook handler, no new exposed service. --to (default cfx-llm2) is a hardcoded operator choice, not a payload arg.

Tests: new unit coverage for sync_plan, patch_files, touches_tt_metal_host, and the new check/ship missing-path logic.

Nit: ship's default --to cfx-llm2 is hardcoded in argparse (line 567) — fine for the single destination, but a future box change needs an edit. Flagging, not blocking.

### Verdict: approve — T1 Purely additive: tools/ttnn-incr/ttnn_incr.py is a new file (588 lines); boot-smoke.py and test_ttnn_incr.py unchanged. Nothing existing touched, no cross-host invariant at risk. What it does: fixes the root cause of the GC'd store-path break — package now GC-roots every `nix store add` path on BUILD_HOST, ship's destination rooting is consolidated into the same `gcroot()` helper, and the new `check` subcommand pre-flags GC'd paths before ship fails mid-copy. The ship failure message ("garbage-collected before rooted?") is clearer than nix's raw copy error. Security (verified): all shell via stdin (no double-quoting), subprocess.run with shell=False, no eval/exec/shell=True. No secrets, no webhook handler, no new exposed service. --to (default cfx-llm2) is a hardcoded operator choice, not a payload arg. Tests: new unit coverage for sync_plan, patch_files, touches_tt_metal_host, and the new check/ship missing-path logic. Nit: ship's default --to cfx-llm2 is hardcoded in argparse (line 567) — fine for the single destination, but a future box change needs an edit. Flagging, not blocking.
Member

Closing: every commit on this branch (head 4ac2317d, base serving-throughput) is already on master f30ab09. Triage 2026-10-09.

Closing: every commit on this branch (head 4ac2317d, base `serving-throughput`) is already on master f30ab09. Triage 2026-10-09.
tenstorrent closed this pull request 2026-10-09 10:54:00 +02:00
Author
Owner

agent-gateway closeout (closed): cleared agent:* labels.
Hermes kanban card (if any) is left for Hermes to archive/complete.

agent-gateway closeout (closed): cleared `agent:*` labels. Hermes kanban card (if any) is left for Hermes to archive/complete.

Pull request closed

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!147
No description provided.