|
1 | | -# Wave Loop 411 — real P12 + OSCFSEL 6/7 retry, relay CI gate, or auto-proof tooling |
| 1 | +# Wave Loop 412 — FPGA physical capture + relay CI gate or PVT refinement |
2 | 2 |
|
3 | | -**Issue:** #1329 |
4 | | -**Branch:** `wave-loop-411` |
5 | | -**Milestone:** W410 completed the measured-duty formal link but both physical |
6 | | -paths (real P12 capture and DLC10-based `OSCFSEL=6,7` boot) remain blocked. W411 |
7 | | -either finally connects the bench or uses the extra cycle to build automation / |
8 | | -formal tooling. |
| 3 | +**Issue:** #1332 |
| 4 | +**Branch:** `wave-loop-412` |
| 5 | +**Milestone:** Continue the FPGA boot-evidence line from W411. |
9 | 6 |
|
10 | 7 | --- |
11 | 8 |
|
12 | 9 | ## Goal |
13 | 10 |
|
14 | | -1. **Variant A** — Real P12 CCLK capture + physical `OSCFSEL=6,7` cold-POR |
15 | | - boot. Wire P12 to ADBUS4 (or a DSLogic/scope channel), connect the DLC10 |
16 | | - cable, capture the real CCLK, run the 6/7 sweep, and turn the measured |
17 | | - values into a `measured_cclk_satisfies_flash_spec` proof. |
18 | | -2. **Variant B** — Relay-controlled cold-POR hardware CI gate. Build the |
19 | | - relay + tri-stateable JTAG automation infrastructure so the flash-boot gate |
20 | | - can run unattended. |
21 | | -3. **Variant C** — Auto-proof tooling + PVT margins. Add a subcommand that |
22 | | - generates a Lean theorem from a `--json` measurement, and extend the formal |
23 | | - model with conservative process/voltage/temperature margins. |
24 | | - |
25 | | -Default recommendation: **Variant A + C bundle**. If the bench is still |
26 | | -unavailable, pick **Variant B** or **Variant C alone**. |
| 11 | +1. **Variant A + B (preferred when bench is available):** |
| 12 | + - Wire P12 to a logic-analyzer channel and capture real CCLK for |
| 13 | + `OSCFSEL=6` and `OSCFSEL=7`. |
| 14 | + - Verify the Digilent DLC10 cable is detected with `dlc10 idcode`. |
| 15 | + - Boot from flash with both oscillator settings and collect boot logs. |
| 16 | + - Feed the measured `(frequency, duty)` into |
| 17 | + `tri fpga measured-to-lean --json` and commit the generated Lean theorems. |
| 18 | + - Add relay-controlled cold-POR automation (`tri fpga cold-por`) with a |
| 19 | + mock CI path. |
| 20 | + |
| 21 | +2. **Variant C (fallback if bench still blocked):** |
| 22 | + - Replace the placeholder 2× PVT constants with real N25Q128 PVT derating |
| 23 | + data or document the assumption more precisely. |
| 24 | + - Extend `tri fpga measured-to-lean` to emit a self-contained `.lean` file. |
| 25 | + - Add raw-ns input mode (`period_ns`, `low_ns`, `high_ns`) and a |
| 26 | + corresponding Lean predicate. |
27 | 27 |
|
28 | 28 | --- |
29 | 29 |
|
30 | 30 | ## Decomposed plan |
31 | 31 |
|
32 | | -See `docs/reports/FPGA_LOOP_COOPERATION_W411_2026-07-04.md` for the full |
33 | | -weak-point / competitor scan and detailed decomposition. |
| 32 | +See `.claude/plans/wave-loop-412.md` and |
| 33 | +`docs/reports/FPGA_LOOP_COOPERATION_W412_2026-07-04.md`. |
34 | 34 |
|
35 | 35 | | Step | File(s) | Deliverable | |
36 | | -|---|---|---| |
37 | | -| 1 | `docs/reports/FPGA_LOOP_COOPERATION_W411_2026-07-04.md` | Cooperation variants | |
38 | | -| 2 | `fpga/HARDWARE_SSOT.md` §3.6.1/§3.6.9 (Variant A) | Real measured CCLK and 6/7 boot status | |
39 | | -| 3 | `build/fpga/` + `docs/reports/` (Variant A) | Real capture CSV + boot-log JSON | |
40 | | -| 4 | `proofs/lean4/Trinity/TernaryFPGABoot.lean` (Variant A/C) | `measured_*_satisfies_flash_spec` instance from real data | |
41 | | -| 5 | `cli/tri/src/fpga.rs` (Variant B/C) | Relay trait + auto-power-cycle mode, or `measured-to-lean` subcommand | |
42 | | -| 6 | `docs/reports/*` | W411 report, evidence, W412 cooperation | |
43 | | -| 7 | `.trinity/experience.md` | W411 learnings | |
44 | | -| 8 | `docs/NOW.md` | W411 entry | |
45 | | -| 9 | git/PR | squash-merge to master, close #1329, open #W412 | |
| 36 | +|------|---------|-------------| |
| 37 | +| 1 | `.claude/plans/wave-loop-412.md` | Decomposed plan + weak points + competitor scan | |
| 38 | +| 2 | `fpga/HARDWARE_SSOT.md` §3.6.12 | Relay wiring and CI cold-POR protocol (A+B) | |
| 39 | +| 3 | `cli/tri/src/fpga.rs` + new `fpga/src/relay.rs` | `tri fpga cold-por` with mock + hardware backends (A+B) | |
| 40 | +| 4 | `proofs/lean4/Trinity/TernaryFPGABoot.lean` | Real-measurement theorems or PVT refinement (C) | |
| 41 | +| 5 | `docs/reports/*` | W412 report, evidence, W413 cooperation | |
| 42 | +| 6 | `.trinity/experience.md` | W412 learnings | |
| 43 | +| 7 | git/PR | squash-merge to `master`, close #1332, open #1333 | |
46 | 44 |
|
47 | 45 | --- |
48 | 46 |
|
49 | 47 | ## Acceptance criteria |
50 | 48 |
|
51 | | -- [ ] AC-A1: real P12 CCLK capture CSV exists (or blocker documented). **Blocked — P12 not wired.** |
52 | | -- [ ] AC-A2: `OSCFSEL=6,7` boot logs exist (PASS or documented failure). **Blocked — DLC10 cable missing.** |
53 | | -- [ ] AC-A3: a Lean theorem links the captured `(frequency, duty)` pair to |
54 | | - `transaction_satisfies_flash_spec`. **Delivered via `measured-to-lean` generated theorems on synthetic data.** |
55 | | -- [ ] AC-B1: relay auto-power-cycle mode exists behind a trait with a board-less |
56 | | - mock path, or explicitly deferred. **Deferred to W412.** |
57 | | -- [x] AC-C1: `measured-to-lean` subcommand generates a type-correct theorem |
58 | | - skeleton from `--json`. |
59 | | -- [x] AC-C2: PVT margin predicate exists in Lean 4 and implies |
60 | | - `measured_cclk_satisfies_flash_spec`. |
61 | | -- [x] AC-C3: A Lean theorem proves that the PVT margin predicate implies |
62 | | - `transaction_satisfies_flash_spec`. |
63 | | -- [x] AC-D1: `lake build Trinity.TernaryFPGABoot` passes. |
64 | | -- [x] AC-D2: `cargo test -p tri fpga::tests` passes. |
65 | | -- [x] AC-D3: `./scripts/tri test` parse/typecheck/gen/seal-verify phases pass. |
66 | | -- [x] AC-D4: gen-verilog-yosys-smoke failures remain tracked separately. |
67 | | -- [x] AC-D5: W411 report + evidence + W412 cooperation variants committed. |
68 | | - |
69 | | ---- |
| 49 | +### Bundle A + B (deferred — bench unavailable) |
| 50 | +- [ ] AC-A1: P12 is wired to a logic-analyzer channel and a real CCLK capture CSV exists for `OSCFSEL=6` and `OSCFSEL=7`. |
| 51 | +- [ ] AC-A2: `dlc10 idcode` returns the expected Artix-7 IDCODE. |
| 52 | +- [ ] AC-A3: Cold-POR boot logs exist for `OSCFSEL=6` and `OSCFSEL=7`. |
| 53 | +- [ ] AC-A4: Measured `(frequency, duty)` theorems are generated and `lake build` green. |
| 54 | +- [ ] AC-B1: `tri fpga cold-por --relay-port MOCK` runs in CI and returns a JSON boot log. |
| 55 | +- [ ] AC-B2: `fpga/HARDWARE_SSOT.md` documents the relay wiring. |
70 | 56 |
|
71 | | -## Close-out note |
| 57 | +### Bundle C (delivered) |
| 58 | +- [x] AC-C1: PVT placeholder model is documented in `fpga/HARDWARE_SSOT.md` §3.6.12 with falsification plan. |
| 59 | +- [x] AC-C2: `tri fpga measured-to-lean --standalone --out File.lean` emits a self-contained file. |
| 60 | +- [x] AC-C3: Raw-ns input predicate `measured_cclk_from_raw_ns_satisfies_flash_spec` is defined and implies `transaction_satisfies_flash_spec`. |
72 | 61 |
|
73 | | -W411 implemented **Variant C alone** because the bench blockers persisted. The |
74 | | -`tri fpga measured-to-lean` subcommand and the PVT-margin predicate close two |
75 | | -real weak points in the measured-to-formal pipeline. Variant A and the physical |
76 | | -half of any bundle remain blocked until P12 is wired and the DLC10 cable is |
77 | | -connected. |
| 62 | +### Invariant checks |
| 63 | +- [x] `./scripts/tri test` parse/typecheck/gen/seal-verify phases pass (16 pre-existing yosys-smoke failures remain). |
| 64 | +- [x] `lake build Trinity.TernaryFPGABoot` passes. |
| 65 | +- [x] `cargo test -p tri fpga::tests` passes (16/16). |
78 | 66 |
|
79 | 67 | --- |
80 | 68 |
|
81 | 69 | ## Default variant |
82 | 70 |
|
83 | | -**Variant A + C bundle**: physical measurement and 6/7 boot, with auto-proof |
84 | | -tooling. If the bench is still unavailable, fall back to **Variant B** (relay |
85 | | -CI gate) or **Variant C alone** (formal-tooling improvements). |
| 71 | +Execute **Variant A + B** when the bench becomes available. Otherwise fall back |
| 72 | + to **Variant C** to keep the formal tooling useful while the physical blockers |
| 73 | +persist. |
86 | 74 |
|
87 | 75 | --- |
88 | 76 |
|
89 | | -*phi^2 + phi^-2 = 3 | TRINITY* |
| 77 | +*φ² + φ⁻² = 3 | TRINITY* |
0 commit comments