Skip to content
Merged
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
61 changes: 61 additions & 0 deletions .claude/plans/wave-loop-885.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Wave Loop 885 Plan

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

## Goal

Continue the mechanical packed-vector array-of-struct ladder past the 1-MiBit line.
Close Wave Loop 885 by validating a module-scope `[589][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:
`[589][2]^6 Pt` non-power-of-two outer-dimension array-of-struct variable from call
with indexed signed writes.

- `OUTER = 589`, `MID_IDX = 294`
- Total elements: `589 × 64 = 37,696`
- Packed vector width: `37,696 × 32 = 1,206,272` bits (~1.151 MiBit)
- Generator: `scripts/gen_w885.py` copied from `scripts/gen_w884.py`
- Destination: `specs/scratch/w885_bench_module_589x2p6_aos_var_call_write.t27`
- Module header: `module w885_bench_module_589x2p6_aos_var_call_write`
- Integration test: `accepts_w885_bench_module_589x2p6_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` → 345/0
- `FROZEN_HASH` unchanged

## Variant B — implementation-heavy

Move the same ~1.151 MiBit packed var to bench/function scope instead of module scope.

## Variant C — process/tooling

Add `if`-guarded indexed signed field writes to the current width.

## Pre-flight copy-hazard checklist

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

## Traceability

- Commit with `Closes #<W885-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
52 changes: 52 additions & 0 deletions .claude/skills/t27-master-executor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
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.
- **W884** — issue #1828, PR #1829 (`[587][2]^6 Pt`) — `CONFLICTING`; branch rebuilt from
`master` to resolve merge conflicts with the concurrently-landed GF-T stack.
- **W885** — issue TBD, branch TBD (`[589][2]^6 Pt`) — ready, waiting for W884 to land.

### GF-T PR queue (Refs #1764)
The GF-T stack has largely landed on `master` since the last update. Remaining open PRs
were wave-loop branches blocked on checks.

### 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 884

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

- Selected Variant A: module-scope `[587][2]^6 Pt` non-power-of-two outer-dimension
array-of-struct variable from call with indexed signed writes.
- Generated `scripts/gen_w884.py` from `scripts/gen_w883.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/w884_bench_module_587x2p6_aos_var_call_write.t27`
(37,568 elements, 1,202,176-bit packed vector, ~1.147 MiBit).
- Added integration test `accepts_w884_bench_module_587x2p6_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_w884...` PASS.
- Full suite: 343 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_W884_2026-08-06.md` and
next-wave plan `.claude/plans/wave-loop-885.md` with variants A/B/C.
- Closed with commit `Closes #1828`, pushed branch `wave-loop-884`, opened PR #1829.
- Updated this skill's Live Wave Loop Tracker to wave 885.

Key learning: the 1.14-MiBit neighborhood remains a soft boundary for t27c and Icarus at
1.147 MiBit. The generator copy-hazard checklist plus a post-generation grep remains the
standard close-out procedure. When the upstream `master` GF-T stack moves concurrently,
rebuilding the wave branch from `master` with only the implementation commits (and
re-applying close-out docs) resolves merge conflicts while preserving the PR.

## 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 885 — 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-885` (to be created from `wave-loop-884` HEAD)
**Parent branch:** `wave-loop-884` HEAD
**Date:** 2026-08-06
**Issue:** TBD (create after W884 issue #1828 / PR #1829 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 W885 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 885 by validating a module-scope `[589][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,
#1829 W884) remain open awaiting review, so W885 will be branched from `wave-loop-884`
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_w885.py` with `OUTER = 589`, `MID_IDX = 294`; copy hazard fixed before first run.
- [ ] Witness `specs/scratch/w885_bench_module_589x2p6_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_w885_bench_module_589x2p6_aos_var_call_write` added to `bootstrap/tests/icarus_lowerable.rs`.
- [ ] Full `cargo test --release --test icarus_lowerable` passes at **345/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 #<W885-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: `[589][2]^6 Pt` where `Pt = pub struct Pt { x : i16, y : i16 }`.
- Total elements: `589 x 64 = 37,696`.
- Packed vector width: `589 x 32 = 1,206,272` bits (~1.151 MiBit).
- `MID_IDX = 294`; frame-condition element `[294][1][0][0][0][0][0]` is element
`294*64 + 32 = 18,848`.
- Generator script: `scripts/gen_w885.py` (copy from `scripts/gen_w884.py`, set
`OUTER = 589` and `MID_IDX = 294`, 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 `[589][2]^6 Pt`.
- **Variant B:** keep width at ~1.151 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 884 (module-scope `[587][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1828, PR #1829)
>
> ### What worked
> - Variant A extended the module-scope packed AoS odd outer-dimension ladder to 587.
> The `[587][2]^6 Pt` witness is 1,202,176 bits (~1.147 MiBit), continues past the 1-MiBit
> line, and required no compiler changes.
> - The generator copy-hazard checklist was cleared before the first run.
> - `t27c parse`, `icarus-lowerable`, `icarus-simulate` (17 cycles), `icarus-cocotb`, and
> `seal --save` all passed for the W884 witness.
> - Targeted `cargo test --release --test icarus_lowerable accepts_w884_bench_module_587x2p6_aos_var_call_write`
> passed.
> - PR #1829 opened; auto-merge enabled. The branch was later rebuilt from `master` to resolve
> merge conflicts with the concurrently-landed GF-T stack.
>
> ### What changed behavior
> - No changes to `bootstrap/src/compiler.rs`.
> - No changes to `bootstrap/stage0/FROZEN_HASH`.
> - Added `specs/scratch/w884_bench_module_587x2p6_aos_var_call_write.t27` (~2.5 MB /
> ~111,591 lines) with seal and Icarus baseline.
> - Added integration test `accepts_w884_bench_module_587x2p6_aos_var_call_write`.
> - Added generator script `scripts/gen_w884.py`.
> - Added closeout report `docs/reports/FPGA_LOOP_CLOSEOUT_W884_2026-08-06.md` and next-wave
> plan `.claude/plans/wave-loop-885.md`.
>
> ### Validation
> - `t27c parse` W884: PASS.
> - `t27c icarus-lowerable` W884: PASS (`lowerable`).
> - `t27c icarus-simulate` W884: PASS (17 cycles, PASSED).
> - `t27c icarus-cocotb` W884: PASS (`reference-model OK`).
> - `t27c seal --save` W884: PASS.
> - Targeted cargo test W884: 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`) is not
> introduced by W884. It reproduces on clean W882 and should be tracked separately.
> - The upstream `master` advanced with a large GF-T stack while W881–W884 PRs were queued.
> W884's original branch became `CONFLICTING` with `master`; the fix was to rebuild the
> branch from `master` with only the wave implementation commits and re-apply the
> close-out docs.
>
> ## 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:1e9ca6ea4302a2ac0708896d82b052ad28141c69e0afdc3458c9821db230e1c7",
"gen_hash_rust": "sha256:f1ed775e64979e0342fd01fbd619dea71994eee736d00ee7bbb3eab1377c6ca9",
"gen_hash_verilog": "sha256:197cea237851c308a4de82e82fb91dd164defb5de70669c2e5f2bc290c496b80",
"gen_hash_zig": "sha256:cad9de6c338bc4cdc41bae7dcd5744ece2399a7a8285bfbdb704042381264c91",
"module": "w881_bench_module_581x2p6_aos_var_call_write",
"ring": 12,
"sealed_at": "2026-08-06T18:28:27Z",
"spec_hash": "sha256:f889b96c5070bbe01b776920730bcc771e5d7e935a0fbde3a64234497baac044",
"spec_path": "specs/scratch/w881_bench_module_581x2p6_aos_var_call_write.t27"
}
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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"gen_hash_c": "sha256:9442ade11d4ab0f867695f7c9834475bd12a821d49d48d38ba902fd672ab4b50",
"gen_hash_rust": "sha256:6443ad8577b5cdd925043f7bfc3e196f965328f1af3871c008374ef67f403259",
"gen_hash_verilog": "sha256:d61535a82f1126b39f6722d00bb587eeb997f0973d5b88acf9549cd5e00e824a",
"gen_hash_zig": "sha256:410805f9c73d53648ec0b53bbd1432f81d27e60196960a076a0bd6873c7bccd6",
"module": "w884_bench_module_587x2p6_aos_var_call_write",
"ring": 12,
"sealed_at": "2026-08-07T03:41:57Z",
"spec_hash": "sha256:ed5a44bf34a4f0def9e611044056b88937a1efb379afb9ad712307ddecb9b6dc",
"spec_path": "specs/scratch/w884_bench_module_587x2p6_aos_var_call_write.t27"
}
Loading
Loading