# NFT-PERF-03 — Cold-start TTFF

**Task**: AZ-430_nft_perf_03_ttff
**Name**: AC-NEW-1 cold-start TTFF ≤ 30 s on Tier-2 (AC-NEW-1)
**Description**: Implement NFT-PERF-03 — Tier-2; cold-boot SITL with `cold-boot-fixture`; cold-start SUT (no FDR / cache warm-up); push first nav-camera frame; measure `t_first_emission − t_first_frame_arrival ≤ 30 s`; record p50/p95.
**Complexity**: 5 points
**Dependencies**: AZ-406, AZ-407, AZ-444
**Component**: Blackbox Tests / Performance (epic AZ-262)
**Tracker**: AZ-430
**Epic**: AZ-262 (E-BBT)

## Problem

Cold-start TTFF (Time To First Fix) is critical for flight-resume scenarios — AC-NEW-1 sets the 30 s budget. This must be measured on real Jetson hardware over a sample large enough for p95 confidence.

## Outcome

- pytest scenario at `e2e/tests/performance/test_nft_perf_03_ttff.py`. Tier-2 ONLY.
- Sample of N=10 cold-starts (configurable via env var; default 10 to balance run time vs confidence).
- Each iteration: clean `fdr-output` volume; load `cold-boot-fixture` into SITL; start SUT; push first frame; measure TTFF.
- Assert `p95 TTFF ≤ 30 s` AND `max ≤ 45 s` (a relaxed cap to flag tail-latency outliers).

## Scope

### Included
- N=10 cold-start iterations.
- Per-iteration TTFF measurement.
- p50/p95/max computation + assertions.

### Excluded
- Position accuracy at first emission — owned by FT-P-11 (AZ-419).

## Acceptance Criteria

**AC-1: tier guard**
Given the test is invoked with `tier == tier1-docker`
Then the test SKIPs.

**AC-2: clean state per iteration**
Given each cold-start iteration
Then `fdr-output` volume is removed + recreated AND any persistent SUT state is cleared.

**AC-3: TTFF p95**
Given N=10 (or more) iterations
Then `p95(TTFF) ≤ 30 s`.

**AC-4: TTFF max**
Given the same iterations
Then `max(TTFF) ≤ 45 s`.

**AC-5: parameterization**
Given conftest parameterization
Then the scenario runs per `(fc_adapter, vio_strategy)`.

## System Under Test Boundary

End-to-end on real hardware through public boundaries.

- **Allowed**: SITL parameter load, SITL state read, SUT lifecycle (`docker compose up` / `systemctl start`).
- **Forbidden**: pre-warming SUT internal caches.

## Constraints

- Tier-2 only.
- N=10 is the default; more iterations strengthen the p95 estimate but cost CI time.

## Document Dependencies

- `_docs/02_document/tests/performance-tests.md` § NFT-PERF-03
- `_docs/02_document/tests/test-data.md` § Performance (NFT-PERF-03 row)
