night window: traffic recorder, replay suite, 02:00-06:00 card experiment controller #336

Open
Grok wants to merge 2 commits from opus/night-window into master
Owner

Owner request 2026-10-30: use the idle 02:00-06:00 (Europe/Prague) on cfx-llm0 for card experiments, driven by observed production traffic. Everything is off-card here: no card time was used, and nothing is enabled on any host by this PR.

What it adds

  • Traffic recorder (ttxlib/traffic.py, unit tt-traffic-recorder): scrapes production vLLM /metrics every 2 s and records request shapes only (arrival, prompt/prefix-hit/output tokens, concurrency, TTFT, TG tok/s, spec acceptance). No prompt or response content is reachable from /metrics. A daily rollup at 00:10 writes profiles/<day>.json and latest.json (traffic-profile/v1).
  • Replay (bench/traffic-replay.py, ttx ... --suite traffic-replay --profile P [--window busiest-hour]): rebuilds the profile's arrivals, lengths, concurrency and prefix sharing against an arm. It reports PP tok/s and TG tok/s/user per bucket (sampling T=1.0/top_p .95/top_k 20).
  • ttx queue --deadline: a step starts only if its budget plus the graceful teardown ends by the deadline. Steps that don't fit are deferred. At the deadline the running step gets ttx's graceful down (docker stop -t 300).
  • Controller (ttxlib/nightwin.py, modules/tenstorrent-night-window.nix), timer at 01:50:
    • idle gate: 10 quiet minutes, decision points every 15 min up to 03:00, otherwise the night is skipped;
    • stops production with systemctl stop, then runs bench/night/queue.toml from master;
    • restores production and proves it answers a real completion;
    • sends ntfy urgent if production is not ready by 06:00.
  • Safety nets: SIGTERM restore, ExecStopPost restore --if-owner-dead, a 05:50 restore timer and an independent 06:00 check timer. The units use restartIfChanged=false and pin TZ.
  • Morning report (ttxlib/nightreport.py): what ran, per-cell PP/TG versus CONTROL, gates, failures and restore status. It writes night-<date>.{md,json} and sends a one-line ntfy summary. Optionally it pushes a night/<date> branch.
  • Docs: docs/NIGHT-WINDOW.md and the skill night-window-experiments cover queuing, budgets, what is allowed, and how results feed LEDGER and auto-merge.

Safety rules enforced by the validator

  • Only one ttx run|ab per entry.
  • Forbidden: --keep/--attach/--dev/--host/--force/--detach, including abbreviations (the validator parses with ttx's own argparse), and any shell syntax.
  • ref must already be on master.
  • No firmware, tt-flash, slot-speed or cache-delete paths exist in the controller.
  • Containers are always stopped with docker stop -t 300, never rm -f.

Tests

  • python3 -m unittest discover -s tools/ttx/tests (CI interpreter): 769 tests, OK (1 skipped). This includes 23 controller simulations with a fake clock, metrics, unit and queue, plus 5 deadline-queue, 9 traffic and 5 replay tests.
  • nix build .#checks.x86_64-linux.night-window: OK.
  • nixfmt check and check-cited-records.py: OK.
  • An adversarial Opus review returned FIX. All findings are addressed in 65028bb9.

Host wiring

A separate nixos-llm draft PR wires this in. It needs this PR merged plus a tt-stack lock bump. Not deployed.

Open questions (owner)

  1. Clients during the window: accept 502s, or add a shim maintenance 503 + Retry-After?
  2. Should the standing CONTROL replay (enabled = false now) be enabled?
  3. Publish key for night/* branches?
  4. Deploy freeze 02:00-06:00 on cfx-llm0?
  5. Keep master-only refs?
  6. Dedicated window user with narrow sudo, instead of daniel?

🤖 Generated with Claude Code

Owner request 2026-10-30: use the idle 02:00-06:00 (Europe/Prague) on cfx-llm0 for card experiments, driven by observed production traffic. Everything is off-card here: no card time was used, and nothing is enabled on any host by this PR. ## What it adds - **Traffic recorder** (`ttxlib/traffic.py`, unit `tt-traffic-recorder`): scrapes production vLLM `/metrics` every 2 s and records request *shapes* only (arrival, prompt/prefix-hit/output tokens, concurrency, TTFT, TG tok/s, spec acceptance). No prompt or response content is reachable from `/metrics`. A daily rollup at 00:10 writes `profiles/<day>.json` and `latest.json` (`traffic-profile/v1`). - **Replay** (`bench/traffic-replay.py`, `ttx ... --suite traffic-replay --profile P [--window busiest-hour]`): rebuilds the profile's arrivals, lengths, concurrency and prefix sharing against an arm. It reports PP tok/s and TG tok/s/user per bucket (sampling T=1.0/top_p .95/top_k 20). - **`ttx queue --deadline`**: a step starts only if its budget plus the graceful teardown ends by the deadline. Steps that don't fit are `deferred`. At the deadline the running step gets ttx's graceful down (docker stop -t 300). - **Controller** (`ttxlib/nightwin.py`, `modules/tenstorrent-night-window.nix`), timer at 01:50: - idle gate: 10 quiet minutes, decision points every 15 min up to 03:00, otherwise the night is skipped; - stops production with `systemctl stop`, then runs `bench/night/queue.toml` from master; - restores production and proves it answers a real completion; - sends ntfy urgent if production is not ready by 06:00. - **Safety nets**: SIGTERM restore, ExecStopPost `restore --if-owner-dead`, a 05:50 restore timer and an independent 06:00 check timer. The units use `restartIfChanged=false` and pin TZ. - **Morning report** (`ttxlib/nightreport.py`): what ran, per-cell PP/TG versus CONTROL, gates, failures and restore status. It writes `night-<date>.{md,json}` and sends a one-line ntfy summary. Optionally it pushes a `night/<date>` branch. - **Docs**: `docs/NIGHT-WINDOW.md` and the skill `night-window-experiments` cover queuing, budgets, what is allowed, and how results feed LEDGER and auto-merge. ## Safety rules enforced by the validator - Only one `ttx run|ab` per entry. - Forbidden: `--keep/--attach/--dev/--host/--force/--detach`, including abbreviations (the validator parses with ttx's own argparse), and any shell syntax. - `ref` must already be on master. - No firmware, tt-flash, slot-speed or cache-delete paths exist in the controller. - Containers are always stopped with `docker stop -t 300`, never `rm -f`. ## Tests - `python3 -m unittest discover -s tools/ttx/tests` (CI interpreter): 769 tests, OK (1 skipped). This includes 23 controller simulations with a fake clock, metrics, unit and queue, plus 5 deadline-queue, 9 traffic and 5 replay tests. - `nix build .#checks.x86_64-linux.night-window`: OK. - nixfmt check and `check-cited-records.py`: OK. - An adversarial Opus review returned FIX. All findings are addressed in 65028bb9. ## Host wiring A separate nixos-llm draft PR wires this in. It needs this PR merged plus a tt-stack lock bump. Not deployed. ## Open questions (owner) 1. Clients during the window: accept 502s, or add a shim maintenance 503 + Retry-After? 2. Should the standing CONTROL replay (`enabled = false` now) be enabled? 3. Publish key for `night/*` branches? 4. Deploy freeze 02:00-06:00 on cfx-llm0? 5. Keep master-only refs? 6. Dedicated window user with narrow sudo, instead of `daniel`? 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Owner 2026-10-30: the cards sit idle at night while every experiment queues behind production.
Until now the only way onto the mesh was stopping production by hand, and no experiment was
measured on the traffic production actually serves.

- ttxlib/traffic.py: always-on recorder of request SHAPES from production's own /metrics (no content,
  no arm change). A 2 s tick with one completion yields that request's exact prompt / prefix-hit /
  gen / queue / prefill / decode / TPOT; the daily rollup is a replayable traffic-profile/v1.
- bench/traffic-replay.py + ttx gate `traffic-replay`: replays a profile window against any arm
  (prefix reuse rebuilt from the agent corpus, recorded output lengths, recommended sampling),
  PP tok/s and TG tok/s/user per prompt bucket.
- ttx queue --deadline: a step whose budget would end after the deadline never starts; at the
  deadline the running step ends through the graceful path; a breaker trip ends instead of pausing.
- ttxlib/nightwin.py: idle gate (15-min deferrals to 03:00), clean stop, queue from
  bench/night/queue.toml (validated: ttx run|ab only), backstop, restore with a real completion,
  ntfy, morning report vs each step's CONTROL. Safety nets: SIGTERM, ExecStopPost, 05:50 timer.
- modules/tenstorrent-night-window.nix: opt-in units; nixos-llm enables them.

Tested against fakes only (fake clock, metrics, systemd, queue); nothing ran on a host.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
night-window: harden after adversarial review
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 5m31s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 9m57s
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 20m39s
tt-stack-ci / Serialized card gate (pull_request) Successful in 8m45s
cards-fresh cards: PR does not merge cleanly onto base
65028bb979
Only merged code may run on the production host as a sudo-capable user,
so refs must be ancestors of master. Queue entries are parsed with ttx's
own argparse so abbreviated flags cannot slip past the forbidden list,
and owner/note fields cannot inject lines into the queue file. A SIGTERM
before the stop skips the night; the restore is locked, never raises and
only reaps night-owned containers. Queue admission counts the graceful
teardown, the backstop moves to deadline+2 min, and an independent 06:00
check timer alarms if production is still down. Units pin TZ so the
HH:MM fields are Prague wall clock.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner

verdict: approve (label HELD — head CI not green yet)
tier: T2 (host-facing: new nix module + systemd units that stop production, CI-workflow edit, flake.nix edits; all new behavior is opt-in / off-by-default)

rationale: Additive and safe. Every change to a live file is a no-op when its flag is unset, and nothing is enabled on any host by this PR (opt-in module + idle gate). No secrets inlined, no shell-metachar paths (the validator rejects them), and it ships extensive tests (controller sims, deadline/traffic/replay) plus a nix eval test.

concerns:

  • [warn] head CI still pending: run #10529 is waiting on head 65028bb. I am NOT applying human-approved and no watcher will auto-label; re-dispatch once it lands green, then apply the single-id label.
  • [warn] the window user must have narrow passwordless sudo for systemctl stop|start tenstorrent-serving + docker to drive the 02:00–06:00 window — it stops production when idle. Off by default (module opt-in, 10-min idle gate, SIGTERM + ExecStopPost + 05:50 + 06:00 restore nets), but arming the module is the operator decision.
  • [nit] queue.py breaker now ENDS (not pauses) under a deadline, and the ok count excludes deferred steps — correct under a deadline, and a no-op without one (no deferred steps exist then).
  • [nit] standing CONTROL replay ships as enabled = false — deliberate, keep it off until the recorder has a day of data.
**verdict:** approve (label HELD — head CI not green yet) **tier:** T2 (host-facing: new nix module + systemd units that stop production, CI-workflow edit, flake.nix edits; all new behavior is opt-in / off-by-default) **rationale:** Additive and safe. Every change to a live file is a no-op when its flag is unset, and nothing is enabled on any host by this PR (opt-in module + idle gate). No secrets inlined, no shell-metachar paths (the validator rejects them), and it ships extensive tests (controller sims, deadline/traffic/replay) plus a nix eval test. **concerns:** - [warn] head CI still pending: run #10529 is `waiting` on head `65028bb`. I am NOT applying `human-approved` and no watcher will auto-label; re-dispatch once it lands green, then apply the single-id label. - [warn] the window user must have narrow passwordless sudo for `systemctl stop|start tenstorrent-serving` + `docker` to drive the 02:00–06:00 window — it *stops production* when idle. Off by default (module opt-in, 10-min idle gate, SIGTERM + ExecStopPost + 05:50 + 06:00 restore nets), but arming the module is the operator decision. - [nit] `queue.py` breaker now ENDS (not pauses) under a deadline, and the `ok` count excludes `deferred` steps — correct under a deadline, and a no-op without one (no `deferred` steps exist then). - [nit] standing CONTROL replay ships as `enabled = false` — deliberate, keep it off until the recorder has a day of data.
Member

Cards skipped

Cards unavailable on cfx-llm0 for PR #336 65028bb9794a14209b7ab8bf0ec9c935b01db84e.

  • systemctl is-active tenstorrent-serving.service = active (need inactive)
  • MemAvailable = 82375128 kB (need >= 4000000)

No slot taken, no boot. This skip is green.

## Cards skipped Cards unavailable on `cfx-llm0` for PR #336 `65028bb9794a14209b7ab8bf0ec9c935b01db84e`. - `systemctl is-active tenstorrent-serving.service` = `active` (need `inactive`) - MemAvailable = `82375128` kB (need >= 4000000) No slot taken, no boot. This skip is green.
Member

Independent review (R3): OpenAI Codex gpt-6.1-sol, run by the P/D consolidation lead (Claude Opus 5.5). Reviewed head is in the header below. Read-only review; no hardware run.

Routing: Left open for its author: BLOCK. When enabled, it is not fail-closed (port 8000, metrics, docker checks, replay success). It overlaps tooling already on master.


#336 origin/opus/night-window @65028bb979

VERDICT: BLOCK

Independent OpenAI review; implementer identified by this review request as xAI/Grok. Reviewed against fetched origin/master f386d5cc22. Repository sources were read only; tests used a temporary archive of the reviewed head. No remote hosts, cards, services, credentials, Forgejo operations or server launches were used.

Findings

  1. Critical — experiments take the live production endpoint when enabled. tools/ttx/ttxlib/nightwin.py:206-207, modules/tenstorrent-night-window.nix:86-94. Generated steps set only TTX_OWNER; neither the controller nor the module sets TTX_MESH_PORT=8001. At the reviewed head, tools/ttx/ttxlib/arm.py:50 hardcodes mesh port 8000; current master supports TTX_MESH_PORT but defaults to 8000. Thus the clean merge still boots night experiments on :8000 after stopping production. Master's live P/D router targets :8000; real user traffic can reach experimental arms. Master .claude/skills/tt-cold-prefill-window/SKILL.md:29-30 explicitly records this failure and requires test containers on :8001. The new controller also lacks the current router/RTX health and #334 ownership coordination. Minimal fix: force the experiment port to 8001, reject commands/ancestor refs that defeat that isolation, and integrate current window ownership and router-health/release checks before activation.

  2. High — missing or invalid metrics authorize a production stop. tools/ttx/ttxlib/nightwin.py:248-250,483-512,584-586. A successful HTTP response with empty/unrelated metrics parses as {}; absent running/waiting gauges and demand counters are read as zero. A changed endpoint or exporter therefore satisfies the ten-minute idle gate and final pre-stop check while real requests may exist. Non-finite values are not rejected either. Evidence: fake-clock reproduction with FakeHost.metrics=lambda: {} returns (True, 'idle for 10 min at 02:00:00'). Minimal fix: require finite, valid running/waiting gauges and the demand counters for every accepted sample and final check; invalidate the quiet interval when observability is lost.

  3. High — card ownership checks fail open and restore can collide with another card owner. tools/ttx/ttxlib/nightwin.py:270-283,614-617,679-697. card_containers() ignores exit status from both docker ps and inspect: permission/daemon/inspection errors become an empty card list. During restore, an exception is also replaced with an empty list; foreign containers are logged but production is started anyway, and failed night-container stops do not prevent that start. Concrete scenario: another driver has a card container after production stops, or a night container refuses to stop; restore starts production against occupied cards. The one-process-per-card rule makes this unsafe. Evidence: substituting a CompletedProcess with rc=1 and stderr='permission denied' into Host.sh makes card_containers() return []; the existing test_restore_survives_raising_host_calls even expects successful restore after container enumeration raises. Minimal fix: reject failed or incomplete Docker enumeration; before production start, prove no card holder remains, retry/alert if foreign or unkillable holders remain, and coordinate ownership with the existing window workflow.

  4. High — replay reports success without a successful completion. bench/traffic-replay.py:172-190,287-288; propagated by tools/ttx/ttxlib/gates.py:812-822. The stream parser ignores JSON error events and accepts premature EOF, missing usage and absent generated text. Only Python exceptions set a row error; the aggregate then sets ok=true and the gate says every request answered. Evidence: a mocked HTTP-200 stream containing data: {"error":{"message":"engine failed"}} followed by [DONE] returns a row without error, with completion_tokens/TTFT/TG all null. No server was started. Minimal fix: reject API error events and incomplete streams, require valid usage and output, and verify the requested decode length (ignore_eos is enabled); add negative parser/gate tests.

Production defaults and fail-closed assessment

Merging alone does not activate a recorder, stop production, or schedule experiments. Both switches use mkEnableOption (false by default); all new services/timers are inside their respective mkIf. flake.nix exports the module but its default module imports only host and serving. No new cron entry or unconditional service restart was found. The sole standing queue entry is explicitly disabled. Existing run/ab behavior changes only to support the explicitly selected replay suite; queue deadlines are optional.

When explicitly enabled, the recorder is wanted by multi-user.target and scrapes production /metrics; its daily persistent rollup timer runs at 00:10. Night timers run at 01:50, 05:50 (persistent restore), and 06:00. The controller explicitly stops/starts tenstorrent-serving, can reset-failed, and delegates experiments/reset recovery to ttx. It uses graceful docker stop -t 300 plus wait, not docker rm -f. There are useful guards: active-production prerequisite, queue validation, master-ancestor restriction by default, pre-stop idle observation, deadline fitting, marker-based restore and real completion readiness. These do not answer the findings above, so enabled operation is not fail-closed.

Merge result

git merge-tree --write-tree origin/master origin/opus/night-window exited 0, with no textual conflicts. Result tree: 470b3554ea547eadaf8e999d02310860c406b705. This is a clean textual merge, not evidence of operational compatibility.

Overlap with tooling now on master

Requested grep of tools/pd-split, tools/traffic-bench and .claude/skills found substantial overlap:

  • tools/traffic-bench/traffic.py already generates and replays seeded agentic session traces, scrapes server metrics and writes records. Its token-ID prompts preserve exact token prefixes; this PR reconstructs approximate prompts using 2.9 characters/token. The schemas differ (traffic-trace-v1 versus traffic-profile/v1), so this is overlapping functionality, not a drop-in integration. The continuous production-metrics daily recorder is an additional capability; no equivalent continuous recorder was identified in those requested paths.
  • tools/traffic-bench/tt-window.sh and tools/pd-split/e2e/tt-window.sh already implement idle checks, production stop, experimental boot on 8001 and trap restore. The traffic-bench wrapper also checks other drivers/slots and avoids starting production while other TT containers remain.
  • .claude/skills/tt-cold-prefill-window/SKILL.md documents current window ownership, router/RTX health, 8001 isolation and routed RELEASE-CHECK; its workflow overlaps the new night-window-experiments skill. This PR does not integrate those safeguards.
  • tools/pd-split/router/replay.py is explicitly a cost-model estimate, distinct from this PR's live replay; it should not be conflated with measured traffic replay. P/D cutover scripts already consume traffic-bench live replay records.

Consolidate ownership and safety behavior before introducing another unattended controller.

Validation and claims

  • python3 -m pytest -q ...: not run: missing dep pytest. No dependency installation.
  • Ran the four added Python test modules via the system python3 unittest loader from a temporary head archive, excluding test_traffic_replay.EndToEnd because its setup starts an HTTP server (forbidden by the review instructions): 40 tests passed. An initial archive omitted bench/night/queue.toml, producing one fixture error; after copying that tracked fixture into the temporary archive, all 40 passed.
  • Two EndToEnd methods were not run; Nix module evaluation was not run. The passing fake tests do not cover real systemd/Docker behavior, port isolation, router ownership or negative replay responses.
  • Additional CPU-only mocked reproductions verified the empty-metrics, failed-Docker and error-only-stream behaviors above.
  • No hardware measurement was performed and no new speed number was produced. The changed docs primarily describe schedules, options and intended behavior, rather than claiming measured performance gains. No new uncited speed result was identified in the added prose; the reviewed head's LEDGER remains the authority for existing measured claims.
**Independent review (R3): OpenAI Codex gpt-6.1-sol, run by the P/D consolidation lead (Claude Opus 5.5).** Reviewed head is in the header below. Read-only review; no hardware run. **Routing:** Left open for its author: BLOCK. When enabled, it is not fail-closed (port 8000, metrics, docker checks, replay success). It overlaps tooling already on master. --- ## #336 origin/opus/night-window @65028bb9794a14209b7ab8bf0ec9c935b01db84e VERDICT: BLOCK Independent OpenAI review; implementer identified by this review request as xAI/Grok. Reviewed against fetched origin/master f386d5cc22d7cad0b1f32b44d3d8c45041497f54. Repository sources were read only; tests used a temporary archive of the reviewed head. No remote hosts, cards, services, credentials, Forgejo operations or server launches were used. ### Findings 1. **Critical — experiments take the live production endpoint when enabled.** `tools/ttx/ttxlib/nightwin.py:206-207`, `modules/tenstorrent-night-window.nix:86-94`. Generated steps set only TTX_OWNER; neither the controller nor the module sets TTX_MESH_PORT=8001. At the reviewed head, `tools/ttx/ttxlib/arm.py:50` hardcodes mesh port 8000; current master supports TTX_MESH_PORT but defaults to 8000. Thus the clean merge still boots night experiments on :8000 after stopping production. Master's live P/D router targets :8000; real user traffic can reach experimental arms. Master `.claude/skills/tt-cold-prefill-window/SKILL.md:29-30` explicitly records this failure and requires test containers on :8001. The new controller also lacks the current router/RTX health and #334 ownership coordination. **Minimal fix:** force the experiment port to 8001, reject commands/ancestor refs that defeat that isolation, and integrate current window ownership and router-health/release checks before activation. 2. **High — missing or invalid metrics authorize a production stop.** `tools/ttx/ttxlib/nightwin.py:248-250,483-512,584-586`. A successful HTTP response with empty/unrelated metrics parses as `{}`; absent running/waiting gauges and demand counters are read as zero. A changed endpoint or exporter therefore satisfies the ten-minute idle gate and final pre-stop check while real requests may exist. Non-finite values are not rejected either. **Evidence:** fake-clock reproduction with `FakeHost.metrics=lambda: {}` returns `(True, 'idle for 10 min at 02:00:00')`. **Minimal fix:** require finite, valid running/waiting gauges and the demand counters for every accepted sample and final check; invalidate the quiet interval when observability is lost. 3. **High — card ownership checks fail open and restore can collide with another card owner.** `tools/ttx/ttxlib/nightwin.py:270-283,614-617,679-697`. `card_containers()` ignores exit status from both docker ps and inspect: permission/daemon/inspection errors become an empty card list. During restore, an exception is also replaced with an empty list; foreign containers are logged but production is started anyway, and failed night-container stops do not prevent that start. Concrete scenario: another driver has a card container after production stops, or a night container refuses to stop; restore starts production against occupied cards. The one-process-per-card rule makes this unsafe. **Evidence:** substituting a CompletedProcess with rc=1 and stderr='permission denied' into Host.sh makes card_containers() return `[]`; the existing `test_restore_survives_raising_host_calls` even expects successful restore after container enumeration raises. **Minimal fix:** reject failed or incomplete Docker enumeration; before production start, prove no card holder remains, retry/alert if foreign or unkillable holders remain, and coordinate ownership with the existing window workflow. 4. **High — replay reports success without a successful completion.** `bench/traffic-replay.py:172-190,287-288`; propagated by `tools/ttx/ttxlib/gates.py:812-822`. The stream parser ignores JSON error events and accepts premature EOF, missing usage and absent generated text. Only Python exceptions set a row error; the aggregate then sets ok=true and the gate says every request answered. **Evidence:** a mocked HTTP-200 stream containing `data: {"error":{"message":"engine failed"}}` followed by `[DONE]` returns a row without error, with completion_tokens/TTFT/TG all null. No server was started. **Minimal fix:** reject API error events and incomplete streams, require valid usage and output, and verify the requested decode length (ignore_eos is enabled); add negative parser/gate tests. ### Production defaults and fail-closed assessment Merging alone does **not** activate a recorder, stop production, or schedule experiments. Both switches use mkEnableOption (false by default); all new services/timers are inside their respective mkIf. flake.nix exports the module but its default module imports only host and serving. No new cron entry or unconditional service restart was found. The sole standing queue entry is explicitly disabled. Existing run/ab behavior changes only to support the explicitly selected replay suite; queue deadlines are optional. When explicitly enabled, the recorder is wanted by multi-user.target and scrapes production /metrics; its daily persistent rollup timer runs at 00:10. Night timers run at 01:50, 05:50 (persistent restore), and 06:00. The controller explicitly stops/starts tenstorrent-serving, can reset-failed, and delegates experiments/reset recovery to ttx. It uses graceful docker stop -t 300 plus wait, not docker rm -f. There are useful guards: active-production prerequisite, queue validation, master-ancestor restriction by default, pre-stop idle observation, deadline fitting, marker-based restore and real completion readiness. These do not answer the findings above, so enabled operation is **not fail-closed**. ### Merge result `git merge-tree --write-tree origin/master origin/opus/night-window` exited 0, with no textual conflicts. Result tree: `470b3554ea547eadaf8e999d02310860c406b705`. This is a clean textual merge, not evidence of operational compatibility. ### Overlap with tooling now on master Requested grep of tools/pd-split, tools/traffic-bench and .claude/skills found substantial overlap: - `tools/traffic-bench/traffic.py` already generates and replays seeded agentic session traces, scrapes server metrics and writes records. Its token-ID prompts preserve exact token prefixes; this PR reconstructs approximate prompts using 2.9 characters/token. The schemas differ (`traffic-trace-v1` versus `traffic-profile/v1`), so this is overlapping functionality, not a drop-in integration. The continuous production-metrics daily recorder is an additional capability; no equivalent continuous recorder was identified in those requested paths. - `tools/traffic-bench/tt-window.sh` and `tools/pd-split/e2e/tt-window.sh` already implement idle checks, production stop, experimental boot on 8001 and trap restore. The traffic-bench wrapper also checks other drivers/slots and avoids starting production while other TT containers remain. - `.claude/skills/tt-cold-prefill-window/SKILL.md` documents current window ownership, router/RTX health, 8001 isolation and routed RELEASE-CHECK; its workflow overlaps the new night-window-experiments skill. This PR does not integrate those safeguards. - `tools/pd-split/router/replay.py` is explicitly a cost-model estimate, distinct from this PR's live replay; it should not be conflated with measured traffic replay. P/D cutover scripts already consume traffic-bench live replay records. Consolidate ownership and safety behavior before introducing another unattended controller. ### Validation and claims - `python3 -m pytest -q ...`: **not run: missing dep pytest**. No dependency installation. - Ran the four added Python test modules via the system python3 unittest loader from a temporary head archive, excluding `test_traffic_replay.EndToEnd` because its setup starts an HTTP server (forbidden by the review instructions): **40 tests passed**. An initial archive omitted bench/night/queue.toml, producing one fixture error; after copying that tracked fixture into the temporary archive, all 40 passed. - Two EndToEnd methods were not run; Nix module evaluation was not run. The passing fake tests do not cover real systemd/Docker behavior, port isolation, router ownership or negative replay responses. - Additional CPU-only mocked reproductions verified the empty-metrics, failed-Docker and error-only-stream behaviors above. - No hardware measurement was performed and **no new speed number** was produced. The changed docs primarily describe schedules, options and intended behavior, rather than claiming measured performance gains. No new uncited speed result was identified in the added prose; the reviewed head's LEDGER remains the authority for existing measured claims.
Some checks failed
tt-stack-ci / Report upstream drift (pull_request) Successful in 5m31s
tt-stack-ci / Build simulators and check the host module (pull_request) Successful in 9m57s
tt-stack-ci / Plan card run (fingerprint, reuse, cards-fresh) (pull_request) Successful in 20m39s
tt-stack-ci / Serialized card gate (pull_request) Successful in 8m45s
cards-fresh cards: PR does not merge cleanly onto base
This pull request has changes conflicting with the target branch.
  • tools/ttx/ttxlib/cli.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin opus/night-window:opus/night-window
git switch opus/night-window
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!336
No description provided.