1# PHASE 3 — Small MRPT, Student-t head, tests, pilot end to end (2026-11-02)23## Completed4- `models/`: gated patch embedding with resolution/position/gap embeddings; pre-norm encoder; shared vs5 cross-attention fusion; regime embedding (stats / learned / none); direct 60-step decoder with future-calendar6 queries; Student-t / Gaussian / quantile heads (scale-equivariant parametrisation); Stage-B low-rank Gaussian-copula7 head (joint paths).8- `train/`: AdamW + warm-up/cosine, clipping, early stopping on validation NLL, seeds, crash-safe checkpoints with9 resume, JSONL tracking (loss, grad norm, throughput, data fraction, MPS memory), copula-only stage.10- `inference/`: batched prediction with Monte Carlo cumulative-return samples (independent or copula), streaming11 path scores, serialization, CLI (`chronos-x`).12- Tests: 26 offline (unit 6, synthetic 5, leakage 5, numerical 10) + 5 live + 1 slow synthetic end-to-end pipeline test.1314## Commands15```bash16.venv/bin/python scripts/run_experiment.py --config configs/pilot.yaml # on M3U96b, detached via scripts/node_run.sh17.venv/bin/python scripts/run_experiment.py --config configs/synthetic_smoke.yaml # laptop, license-free (2 min 50 s)18```1920## Pilot training (M3U96b, torch 2.15 MPS, batch 64, 600 steps, 4 942 train / 5 362 val origins)21| Model | Parameters (measured) | Examples/s | Wall (train) | Peak MPS memory | Best val NLL |22|---|---|---|---|---|---|23| MRPT-S (A+B+C) | 3 455 619 | 186 | 207 s | 63 MB | −6.0663 |24| MRPT-S (A only) | 3 200 259 | 228 | 169 s | 86 MB | −6.0659 |25| TCN (A only) | 231 459 | 243 | 158 s | 35 MB | −6.0685 |26| MLP (A only, last 60 bars) | 301 827 | 253 | 152 s | 15 MB | −6.0666 |27Data-loader fraction of wall time ≈ 1 % (10 spawned workers over memory-mapped grids); the GPU forward/backward is the bottleneck.28Test scores: see `docs/PHASE_2_REPORT.md` (MRPT-S multi-resolution −2.6 % to −3.4 % CRPS vs random walk; the29one-minute-only variant, the TCN and the MLP are within 0.2 % of it on this 10-session test — no pilot claim on H1).3031## Gates32- Leakage gate: `tests/leakage` (inputs invariant to future bars; quarantined leaky fixture rejected) — PASS.33- Numerical gate: Student-t log-density vs scipy, closed-form CRPS vs Monte Carlo (2 % tolerance), copula sampling34 reproduces marginals, copula NLL minimised at independence for independent data — PASS. Two bugs were caught by35 these tests during the build (operator precedence in the PIT clamp; scipy `t.ppf` returning NaN for float32 inputs36 near 0.5) and fixed before any real-data result was produced.37- Provenance gate: dataset versions, request ids and sha256 recorded for every export; run metadata saved per experiment — PASS.38- Save/resume: `last.pt` / `best.pt`, resume tested in the trainer (step and optimiser state restored).3940## Go / no-go41GO to P4 (profiling + main ingestion already complete) and P5.42