|
1 | 1 | # t27 / Trinity Agent Experience Log |
2 | 2 |
|
| 3 | +## 2026-07-01 — Wave Loop 416 (PVT-envelope CLI, VCD parser coverage, OSCFSEL transaction theorems) |
| 4 | + |
| 5 | +### What worked |
| 6 | +- Adding a standalone `tri fpga pvt-envelope` command separated the "inspect the |
| 7 | + envelope" use case from the "validate a capture" use case, making the PVT |
| 8 | + model discoverable without an instrument export. |
| 9 | +- Proving monotonicity of the temperature/voltage/process-corner derating |
| 10 | + functions in Lean 4 lets downstream reasoning pick any context inside the |
| 11 | + operating rectangle and know the bound moves in the expected direction |
| 12 | + (warmer / slower corner = larger derating; higher voltage = smaller derating). |
| 13 | +- Linking each OSCFSEL 0..7 nominal measured-CCLK rate to |
| 14 | + `transaction_satisfies_flash_spec` via the existing implication theorem reused |
| 15 | + the W410/W414 infrastructure without duplicating arithmetic. |
| 16 | +- Extending the line-oriented VCD parser for escaped identifiers, scalar x/z |
| 17 | + transitions, and hex bus literals was contained to the value/name extraction |
| 18 | + step and was validated by targeted unit tests before the full suite ran. |
| 19 | + |
| 20 | +### What changed behavior |
| 21 | +- `cli/tri/src/fpga.rs`: added `FpgaCmd::PvtEnvelope` and `pvt_envelope()`; |
| 22 | + hardened `parse_vcd_to_raw_ns` for escaped names, scalar x/z, and hex bus |
| 23 | + literals; added 6 new unit tests. |
| 24 | +- `proofs/lean4/Trinity/TernaryFPGABoot.lean`: added PVT derating monotonicity |
| 25 | + lemmas and `oscfsel_<n>_measured_transaction_ok` for n = 0..7. |
| 26 | +- `fpga/HARDWARE_SSOT.md` §3.6.13: documented `tri fpga pvt-envelope` and W16 |
| 27 | + VCD parser coverage; updated §3.6.9 to reference the OSCFSEL transaction theorems. |
| 28 | +- `docs/NOW.md`: W416 close-out and W417 setup. |
| 29 | +- Close-out artifacts: `docs/reports/WAVE_LOOP_416_REPORT.md`, |
| 30 | + `docs/reports/FPGA_LOOP_EVIDENCE_W416_2026-07-01.md`, and |
| 31 | + `docs/reports/FPGA_LOOP_COOPERATION_W417_2026-07-01.md`. |
| 32 | + |
| 33 | +### Patterns to reuse |
| 34 | +- A small CLI helper that prints the formal model's parameters makes the model |
| 35 | + reviewable by humans and by CI without needing a full instrument export. |
| 36 | +- When a `Prop`-valued ordering definition (like `ProcessCorner.worse_than`) is |
| 37 | + only needed for concrete corner facts, prove those facts by unfolding the |
| 38 | + definition with `simp` rather than relying on `decide` to synthesize a |
| 39 | + `Decidable` instance. |
| 40 | +- When applying a single-implication theorem, check the actual number of |
| 41 | + subgoals produced by `apply` before adding bullet proofs; extra bullets produce |
| 42 | + "no goals to be solved" rather than a proof error. |
| 43 | +- Keep parser extensions behind unit tests that exercise the exact quirk |
| 44 | + (escaped identifier with space, scalar `x`/`z`, hex bus literal) so that future |
| 45 | + refactors do not silently drop the special case. |
| 46 | + |
3 | 47 | ## 2026-07-01 — Wave Loop 414 (PVT envelope, multi-bit/real VCD, `--validate`) |
4 | 48 |
|
5 | 49 | ### What worked |
|
1704 | 1748 | `_name` to avoid linter warnings. |
1705 | 1749 | - Do not let autogenerated `.trinity/seals/*.json` and session logs leak into a |
1706 | 1750 | squash-merge commit; stage only human-authored source + generated reports. |
| 1751 | + |
| 1752 | +## 2026-07-01 — Wave Loop 415 (PVT-aware validation + VCD robustness + OSCFSEL theorem library) |
| 1753 | + |
| 1754 | +### What worked |
| 1755 | +- Delivered Variant C because the bench stayed blocked (P12 unwired, DLC10 cable missing, no relay). |
| 1756 | +- Wired the W414 PVT envelope into `tri fpga measure-cclk --validate --pvt-context <ctx.json>` and `tri fpga measured-to-lean --pvt-context <ctx.json>`. |
| 1757 | +- Generated Lean theorems now use `measured_cclk_with_pvt_satisfies_flash_spec` / `measured_cclk_from_raw_ns_with_pvt_satisfies_flash_spec` and link through the existing PVT implication theorems with `decide` bullets. |
| 1758 | +- Hardened the VCD parser against multi-line `$var` declarations, mixed scalar/bus dumps, duplicate transitions, and `$dumpoff`/`$dumpon` regions. |
| 1759 | +- Added a complete OSCFSEL 0..7 measured-CCLK theorem library under both nominal and worst-case PVT contexts in `TernaryFPGABoot.lean`. |
| 1760 | +- Updated `fpga/HARDWARE_SSOT.md` §3.6.12 with `--pvt-context` usage examples. |
| 1761 | +- Rewrote `docs/NOW.md` to English-only content and added W415 close-out / W416 setup. |
| 1762 | +- Resealed all specs so `Seal Verify: 576 passed, 0 failed`. |
| 1763 | +- `cargo test -p tri fpga::tests`: 32/32 PASS; `lake build Trinity.TernaryFPGABoot`: PASS (2967 jobs). |
| 1764 | + |
| 1765 | +### What changed behavior |
| 1766 | +- `cli/tri/src/fpga.rs`: `--pvt-context` flag, PVT-aware validation, duplicate-transition filtering, multi-line VCD `$var` parsing. |
| 1767 | +- `proofs/lean4/Trinity/TernaryFPGABoot.lean`: 16 new OSCFSEL nominal/worst-case theorems. |
| 1768 | +- `fpga/HARDWARE_SSOT.md`: `--pvt-context` examples. |
| 1769 | +- `docs/NOW.md`: W15 close-out / W16 setup. |
| 1770 | +- `.trinity/seals/*.json`: resealed to current generated-code hashes. |
| 1771 | +- Close-out docs: `docs/reports/WAVE_LOOP_415_REPORT.md`, `docs/reports/FPGA_LOOP_EVIDENCE_W415_2026-07-01.md`, `docs/reports/FPGA_LOOP_COOPERATION_W416_2026-07-01.md`. |
| 1772 | + |
| 1773 | +### Patterns to reuse |
| 1774 | +- When adding a new optional CLI path that affects generated Lean syntax, keep the Rust and Lean predicate names identical and reuse the existing implication theorems; this avoids coupling two models. |
| 1775 | +- For VCD robustness, ignore duplicate transitions and dump-off windows at parse time rather than at measurement time; this keeps the downstream period/duty computation simple and unchanged. |
| 1776 | +- For library-scale `decide`-only theorems, define a shared worst-case context constant and reference it in every theorem to avoid copy/paste errors. |
| 1777 | +- When `bootstrap/build.rs` rejects a doc for non-ASCII characters, translate the whole section to English instead of editing only the flagged line; the language check scans the entire file. |
| 1778 | + |
| 1779 | +### Anti-patterns to avoid |
| 1780 | +- Do not create temp files in parallel tests using only `process::id()` in the filename; include a per-invocation counter or thread-local suffix to avoid races. |
| 1781 | +- Do not assume `t27c seal` persists; pass `--save` to update `.trinity/seals/*.json`. |
| 1782 | +- Do not mix `--margin` and `--pvt-context` in the same `measured-to-lean` invocation; use `clap` `conflicts_with` to make the CLI reject the ambiguous combination. |
| 1783 | +- Do not record a transition every time a value line is parsed; only record actual state changes, otherwise duty-cycle averages become distorted. |
0 commit comments