Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .claude/plans/wave-loop-884.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Wave Loop 884 Plan

**Date:** 2026-08-06
**Issue:** TBD (to be created when W883 lands)
**Branch:** `wave-loop-884` (from `wave-loop-883` HEAD because earlier waves' PRs remain open)
**Parent:** Wave Loop 883 (`[585][2]^6 Pt`, issue #1814, PR #1815)

## Goal

Continue the mechanical packed-vector array-of-struct ladder past the 1-MiBit line.
Close Wave Loop 884 by validating a module-scope `[N][2]^6 Pt` packed array-of-struct
variable initialized from a function call, with indexed signed field writes and
`assert_eq` read-back in a `bench` block.

## Recommended variant — A

Keep the module-scope odd outer-dimension ladder:
`[587][2]^6 Pt` non-power-of-two outer-dimension array-of-struct variable from call
with indexed signed writes.

- `OUTER = 587`, `MID_IDX = 293`
- Total elements: `587 × 64 = 37,568`
- Packed vector width: `37,568 × 32 = 1,202,176` bits (~1.147 MiBit)
- Generator: `scripts/gen_w884.py` copied from `scripts/gen_w883.py`
- Destination: `specs/scratch/w884_bench_module_587x2p6_aos_var_call_write.t27`
- Module header: `module w884_bench_module_587x2p6_aos_var_call_write`
- Integration test: `accepts_w884_bench_module_587x2p6_aos_var_call_write`

Expected validation:
- `t27c parse` → PASS
- `t27c icarus-lowerable` → lowerable
- `t27c icarus-simulate` → PASSED (17 cycles)
- `t27c icarus-cocotb` → reference-model OK
- `t27c seal --save` → seal saved
- Full `cargo test --release --test icarus_lowerable` → 344/0
- `FROZEN_HASH` unchanged

## Variant B — implementation-heavy

Move the same ~1.147 MiBit packed var to bench/function scope instead of module scope.
This tests whether the Icarus lowerer handles large local temporaries differently from
module variables.

## Variant C — process/tooling

Add `if`-guarded indexed signed field writes to the current width. This exercises
conditional stores into the non-power-of-two packed vector, a stress point for both the
t27c code generator and the Icarus structural classifier.

## Pre-flight copy-hazard checklist

When copying `gen_w883.py` → `gen_w884.py`:
- [ ] Destination path string uses `w884` and outer dimension `587`
- [ ] Module header f-string uses `w884_bench_module_{OUTER}`
- [ ] `MID_IDX` comment reflects `293` for `OUTER = 587`
- [ ] Post-generation `ls specs/scratch | grep w884` + `head -n 1` sanity check

## Traceability

- Commit with `Closes #<W884-issue>`
- Open PR to `master`
- Update `.trinity/current-issue.md`, `.claude/skills/t27-wave-loop.md`, `docs/NOW.md`,
`.trinity/experience.md`, and persistent memory after PR is opened.

phi^2 + 1/phi^2 = 3 | TRINITY
54 changes: 54 additions & 0 deletions .claude/skills/t27-master-executor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: Master execution tracker for the t27 merge queue — Wave Loop ladder, GF-T stack, and repo-wide CI state.
parameters:
- name: action
type: string
description: "read | update | next-wave | check-queue"
---

# t27 Master Executor

This skill tracks the live merge queue and mechanical Wave Loop ladder for the t27 repo.
Update it at the end of every loop.

## Current status (2026-08-06)

### Wave Loop ladder
- **W881** — issue #1722, PR #1810 (`[581][2]^6 Pt`) — `MERGEABLE`, `BLOCKED` by required
status checks, auto-merge enabled.
- **W882** — issue #1812, PR #1813 (`[583][2]^6 Pt`) — `MERGEABLE`, `BLOCKED` by required
status checks, auto-merge enabled.
- **W883** — issue #1814, PR #1815 (`[585][2]^6 Pt`) — `MERGEABLE`, `BLOCKED` by required
status checks, auto-merge enabled; implementation + close-out docs committed.
- **W884** — issue TBD, branch TBD (`[587][2]^6 Pt`) — ready, waiting for W883 to land.

### GF-T PR queue (Refs #1764)
All are `MERGEABLE`, `BLOCKED` by required status checks, auto-merge enabled:
- #1801 `feat/gft-argmax4`
- #1802 `feat/gft-classifier4`
- #1803 `feat/gft-exp2-layer4-synth`
- #1808 `feat/gft-training-demo`
- #1809 `integration/gft-full-stack`

### Known blockers
- GitHub Actions required checks are `expected` across the queue; auto-merge is the
current mitigation.
- Pre-existing `corpus_classifier_matches_lean_completeness` failure for
`specs/cloud/railway_deploy.t27` reproduces on `wave-loop-882` and may affect CI once
runners are available. It is not introduced by any Wave Loop PR.

## Procedure

1. At loop start, read this skill and `.trinity/current-issue.md`.
2. After opening a wave PR, add the wave to this skill with state `mergeable/BLOCKED/auto-merge`.
3. After a PR lands, mark it `merged`, create the next wave issue/branch, and move the
tracker forward.
4. When the GF-T queue moves, update the PR statuses here.

## Invariants

- Every commit references an issue (`Closes #N`, `Refs #N`, etc.).
- Do not hand-edit files under `gen/`.
- Do not merge with `--admin` when required checks are `expected`; use auto-merge.

phi^2 + 1/phi^2 = 3 | TRINITY
39 changes: 39 additions & 0 deletions .claude/skills/t27-wave-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,45 @@ Phase complete: [phase name]
→ Phase [next phase number]: [next phase name]
```

## Worked example — Wave Loop 883

Wave Loop 883 continued the mechanical packed-vector AoS ladder past the 1-MiBit line:

- Selected Variant A: module-scope `[585][2]^6 Pt` non-power-of-two outer-dimension
array-of-struct variable from call with indexed signed writes.
- Generated `scripts/gen_w883.py` from `scripts/gen_w882.py` and fixed the three known
copy-hazard locations (destination path, module header f-string, `MID_IDX` comment),
then verified with a post-generation `grep` sanity check.
- Produced `specs/scratch/w883_bench_module_585x2p6_aos_var_call_write.t27`
(37,440 elements, 1,198,080-bit packed vector, ~1.143 MiBit).
- Added integration test `accepts_w883_bench_module_585x2p6_aos_var_call_write` to
`bootstrap/tests/icarus_lowerable.rs`.
- Validation gates:
- `t27c parse`, `icarus-lowerable`, `icarus-simulate` (17 cycles),
`icarus-cocotb` (reference-model OK), `seal --save` — all PASS.
- Targeted `cargo test --release --test icarus_lowerable accepts_w883...` PASS.
- Full suite: 342 passed; 1 pre-existing `corpus_classifier_matches_lean_completeness`
mismatch for `specs/cloud/railway_deploy.t27` tracked separately.
- Research background: Icarus Verilog has no 1-MiBit hard cap (LRM minimum is 65,536 bits;
Icarus warns near 1 Gbit; upstream commit `128c621` fixed a bound-normalization path;
Icarus V13.0 released 2026-03-02 improves packed/unpacked array handling and memory
management). Vitis HLS UG1399 `compact=bit` is the commercial analog for packing structs
into wide vectors. Vericert v2.0.0 released 2026-01-29; 2024 PLDI verified hyperblock
scheduling (DOI 10.1145/3656455) and 2026 follow-ons Graphiti (ASPLOS) and Let It Flow
(PLDI) provide the verified-HLS context. FPGA Roofline (Siracusa et al., IEEE TC 2021)
frames the ladder as a memory-quanta `Q` probe; 2026 FPGA LLM work reports BRAM/URAM
bandwidths in the TB/s range versus HBM ~460 GB/s.
- Wrote closeout report `docs/reports/FPGA_LOOP_CLOSEOUT_W883_2026-08-06.md` and
next-wave plan `.claude/plans/wave-loop-884.md` with variants A/B/C.
- Closed with commit `Closes #1814`, pushed branch `wave-loop-883`, opened PR #1815.
- Updated this skill's Live Wave Loop Tracker to wave 884.

Key learning: the 1.14-MiBit neighborhood remains a soft boundary for t27c and Icarus at
1.143 MiBit. The generator copy-hazard checklist plus a post-generation grep remains the
standard close-out procedure. A pre-existing `corpus_classifier_matches_lean_completeness`
mismatch for `specs/cloud/railway_deploy.t27` is unrelated to the mechanical ladder and
should be tracked as its own repair issue.

## Worked example — Wave Loop 880

Wave Loop 880 continued the mechanical packed-vector AoS ladder past the 1-MiBit line:
Expand Down
75 changes: 31 additions & 44 deletions .trinity/current-issue.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,52 @@
# Wave Loop 778 — Issue #1492
# Wave Loop 884 — Issue TBD

**Branch:** `wave-loop-778`
**Parent branch:** `wave-loop-777` HEAD (`995d94f0c`)
**Date:** 2026-07-24
**Issue:** #1492
**PR:** #1493 (to open)
**Branch:** `wave-loop-884` (to be created from `wave-loop-883` HEAD)
**Parent branch:** `wave-loop-883` HEAD
**Date:** 2026-08-06
**Issue:** TBD (create after W883 issue #1814 / PR #1815 lands)
**PR:** TBD (to open)
**Cooperation variant:** A (recommended)
**Status:** implementation pending, plan ready

## Goal
Select one of three W460 cooperation variants and close the wave with a green
suite, updated seals, and the standard close-out artifacts (report, evidence,
next-wave cooperation plan).

Close Wave Loop 778 by validating a module-scope `[375][2]^6 Pt` packed
array-of-struct variable initialized from a function call, with indexed signed
field writes and `assert_eq` read-back in a `bench` block. W774 PR #1484,
W775 PR #1486, W776 PR #1488, W777 PR #1491, and PR #1489 (README/W774-W776
merge) remain open awaiting review, so W778 will be branched from
`wave-loop-777` HEAD to avoid blocking the sequence.
Select one of three W884 cooperation variants and close the wave with a green targeted
test, updated seals, and the standard close-out artifacts (report, evidence, next-wave
plan).

Close Wave Loop 884 by validating a module-scope `[587][2]^6 Pt` packed array-of-struct
variable initialized from a function call, with indexed signed field writes and `assert_eq`
read-back in a `bench` block. Earlier wave PRs (#1810 W881, #1813 W882, #1815 W883) remain
open awaiting review, so W884 will be branched from `wave-loop-883` HEAD to avoid blocking
the sequence.

## Acceptance criteria

- [ ] Generator `scripts/gen_w881.py` with `OUTER = 581`, `MID_IDX = 290`; copy hazard fixed before first run.
- [ ] Witness `specs/scratch/w881_bench_module_581x2p6_aos_var_call_write.t27` generated and parsed.
- [ ] Generator `scripts/gen_w884.py` with `OUTER = 587`, `MID_IDX = 293`; copy hazard fixed before first run.
- [ ] Witness `specs/scratch/w884_bench_module_587x2p6_aos_var_call_write.t27` generated and parsed.
- [ ] `t27c icarus-lowerable`, `icarus-simulate`, `icarus-cocotb`, and `seal --save` all PASS.
- [ ] Integration test `accepts_w881_bench_module_581x2p6_aos_var_call_write` added to `bootstrap/tests/icarus_lowerable.rs`.
- [ ] Full `cargo test --release --test icarus_lowerable` passes at **341/0**.
- [ ] Integration test `accepts_w884_bench_module_587x2p6_aos_var_call_write` added to `bootstrap/tests/icarus_lowerable.rs`.
- [ ] Full `cargo test --release --test icarus_lowerable` passes at **344/0** (targeted test green; pre-existing classifier failure tracked separately).
- [ ] `bootstrap/stage0/FROZEN_HASH` unchanged.
- [ ] Closeout report, next-wave plan, skills, and persistent memory updated.
- [ ] Commit with `Closes #1713`, push branch, open PR to `master`.

1. [ ] `specs/scratch/w778_bench_module_375x2p6_aos_var_call_write.t27` is generated and parses.
2. [ ] The witness is Icarus-lowerable and simulates correctly (17 cycles, PASSED).
3. [ ] The cocotb reference model matches the t27 semantics.
4. [ ] `t27c seal --save` succeeds and FROZEN_HASH remains unchanged.
5. [ ] All cargo suites remain green.
6. [ ] Integration test `accepts_w778_bench_module_375x2p6_aos_var_call_write` is added.
7. [ ] Closeout report `docs/reports/FPGA_LOOP_CLOSEOUT_W778_2026-07-24.md` is written.
8. [ ] Learning is saved to `.trinity/experience.md`, memory, `.claude/skills/t27-wave-loop.md`, and `.trinity/current-issue.md`.
9. [ ] `.claude/plans/wave-loop-779.md` with three cooperation variants is created.
10. [ ] PR #1493 reviewed and merged to `master` (or stacked after earlier waves land).
- [ ] Commit with `Closes #<W884-issue>`, push branch, open PR to `master`.

## Notes

- Shape: `[375][2]^6 Pt` where `Pt = pub struct Pt { x : i16, y : i16 }`.
- Total elements: `375 x 64 = 24,000`.
- Packed vector width: `24,000 x 32 = 768,000` bits (~0.733 MiBit).
- `MID_IDX = 187`; frame-condition element `[187][1][0][0][0][0][0]` is element
`187*64 + 32 = 12,000`.
- Generator script: `scripts/gen_w778.py` (copy from `scripts/gen_w777.py`, set
`OUTER = 375` and `MID_IDX = 187`, fix module prefix).
- Use `assert_eq` checks on changed elements (Icarus simulation path does not
emit `assert_ne`).
- Shape: `[587][2]^6 Pt` where `Pt = pub struct Pt { x : i16, y : i16 }`.
- Total elements: `587 x 64 = 37,568`.
- Packed vector width: `37,568 x 32 = 1,202,176` bits (~1.147 MiBit).
- `MID_IDX = 293`; frame-condition element `[293][1][0][0][0][0][0]` is element
`293*64 + 32 = 18,784`.
- Generator script: `scripts/gen_w884.py` (copy from `scripts/gen_w883.py`, set
`OUTER = 587` and `MID_IDX = 293`, fix module prefix).
- Use `assert_eq` checks on changed elements (Icarus simulation path does not emit `assert_ne`).
- Include `make_grid(32768)` period-identity check because `32768 == 0 (mod 32768)`.
- Zero compiler / reference-model / FROZEN_HASH changes expected for the witness.
- Zero compiler / reference-model / `FROZEN_HASH` changes expected for the witness.

---

- **Variant A (recommended):** continue the odd outer-dimension ladder with `[377][2]^6 Pt`.
- **Variant B:** keep width at ~0.733 MiBit but move the packed var to bench/function scope.
- **Variant A (recommended):** continue the odd outer-dimension ladder with `[587][2]^6 Pt`.
- **Variant B:** keep width at ~1.147 MiBit but move the packed var to bench/function scope.
- **Variant C:** add `if`-guarded indexed signed field writes at the current width.

---
Expand Down
43 changes: 42 additions & 1 deletion .trinity/experience.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
## 2026-07-24 — Wave Loop 777 (module-scope `[373][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1490)
> ## 2026-08-06 — Wave Loop 883 (module-scope `[585][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1814, PR #1815)
>
> ### What worked
> - Variant A extended the module-scope packed AoS odd outer-dimension ladder to 585.
> The `[585][2]^6 Pt` witness is 1,198,080 bits (~1.143 MiBit), continues past the 1-MiBit
> line, and required no compiler changes.
> - The generator copy-hazard checklist (destination path, module header f-string, `MID_IDX`
> comment) was cleared before the first run; a post-generation `grep` sanity check caught
> no stale references.
> - `t27c parse`, `icarus-lowerable`, `icarus-simulate` (17 cycles), `icarus-cocotb`, and
> `seal --save` all passed for the W883 witness.
> - Targeted `cargo test --release --test icarus_lowerable accepts_w883_bench_module_585x2p6_aos_var_call_write`
> passed.
> - PR #1815 opened with auto-merge enabled.
>
> ### What changed behavior
> - No changes to `bootstrap/src/compiler.rs`.
> - No changes to `bootstrap/stage0/FROZEN_HASH`.
> - Added `specs/scratch/w883_bench_module_585x2p6_aos_var_call_write.t27` (~2.5 MB /
> ~111,211 lines) with seal and Icarus baseline.
> - Added integration test `accepts_w883_bench_module_585x2p6_aos_var_call_write`.
> - Added generator script `scripts/gen_w883.py`.
> - Added closeout report `docs/reports/FPGA_LOOP_CLOSEOUT_W883_2026-08-06.md` and next-wave
> plan `.claude/plans/wave-loop-884.md`.
>
> ### Validation
> - `t27c parse` W883: PASS.
> - `t27c icarus-lowerable` W883: PASS (`lowerable`).
> - `t27c icarus-simulate` W883: PASS (17 cycles, PASSED).
> - `t27c icarus-cocotb` W883: PASS (`reference-model OK`).
> - `t27c seal --save` W883: PASS.
> - Targeted cargo test W883: PASS.
>
> ### Notes / watch-outs
> - A pre-existing `corpus_classifier_matches_lean_completeness` failure for
> `specs/cloud/railway_deploy.t27` (Rust lowerable `false`, Lean theorem `true`) reproduces
> on clean `wave-loop-882` and is not introduced by W883. It should be tracked as a
> separate repair issue.
> - GitHub required status checks remain `expected` across the Wave Loop and GF-T queues;
> auto-merge is the current mitigation.
>
> ## 2026-07-24 — Wave Loop 777 (module-scope `[373][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1490)

### What worked
- Variant A extended the module-scope packed AoS odd outer-dimension ladder to 373.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"gen_hash_c": "sha256:3bd3dd2e1beb5af672b4a8cb7a3c307a3f78baea0994681dce9068805fdb1a1b",
"gen_hash_rust": "sha256:a2b051b868a6c32291ed666be9e2eb56f1e11d686a75c5c3ed1c7f8663bf4e55",
"gen_hash_verilog": "sha256:7af97f482b9d4d0bc7849c2ed2338a8f95f27dac3bda0fd0083526e6360effb9",
"gen_hash_zig": "sha256:7a4189be48b6b664fe9e0ea8462d31b209a510c0a7c43a2e31b534dc6394867f",
"module": "w882_bench_module_583x2p6_aos_var_call_write",
"ring": 12,
"sealed_at": "2026-08-06T19:33:53Z",
"spec_hash": "sha256:0bfd7df68e03028a1b40d7f224f970be624153a349bf464425717985d6a7c958",
"spec_path": "specs/scratch/w882_bench_module_583x2p6_aos_var_call_write.t27"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"gen_hash_c": "sha256:544c7284610ba49a1dd402af046962713d29411964e9d10071bb4291465ab11c",
"gen_hash_rust": "sha256:3513eb7a21951938cdfd7c671a1b22b1100253dbb0670c3cff53512e7bdfddb3",
"gen_hash_verilog": "sha256:1e825ddd40558c8f6ff7870797dec80e9dc6f7292b45f63c46ad8c69ac777da5",
"gen_hash_zig": "sha256:129633526be95070dc5ffe6a68773096bdfe6ea2b38d64e3d0eac3953b76ddce",
"module": "w883_bench_module_585x2p6_aos_var_call_write",
"ring": 12,
"sealed_at": "2026-08-06T20:04:40Z",
"spec_hash": "sha256:80d27981e59d266443d09783ad9f88e446352be95902df1f3c3fb37b42220587",
"spec_path": "specs/scratch/w883_bench_module_585x2p6_aos_var_call_write.t27"
}
Loading