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
40 changes: 40 additions & 0 deletions .claude/plans/wave-loop-889.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Wave Loop 889 Plan — [597][2]^6 Pt packed AoS witness

## Objective
Continue the mechanical packed-vector array-of-struct ladder one step past the 1.16 MiBit line, keeping the same pattern and zero compiler changes.

## Shape
- Outer dimension: `597` (non-power-of-two)
- Inner struct: `[2]^6 Pt` → 2 fields × 6 trits × 32 bits = 384 bits per element
- Total elements: `597 × 64 = 38,208` structs
- Packed vector width: `38,208 × 32 = 1,222,656` bits (~1.166 MiBit)

## Pattern
Module-scope variable `dst : [597][2]^6 Pt` initialized from a function call `make_grid(0)`, with indexed signed field writes and `assert_eq` read-back inside a `bench` block.

## Variants
- **A (recommended)**: `[597][2]^6 Pt` — continue the outer-dimension ladder.
- **B**: `[595][3]^6 Pt` — keep outer dimension near W888 but scale field count to 3, increasing memory-quanta density while testing a different stride.
- **C**: `[595][2]^6 Pt` with explicit negative-index wrap-around writes — exercise signed-index bound normalization one step beyond the baseline W888 shape.

## Procedure
1. Branch `wave-loop-889` from `wave-loop-888` HEAD (earlier wave PRs remain open).
2. Copy `scripts/gen_w888.py` → `scripts/gen_w889.py` and clear the copy-hazard checklist:
- destination path,
- module header f-string,
- `MID_IDX` comment.
3. Run `python3 scripts/gen_w889.py` to produce `specs/scratch/w889_bench_module_597x2p6_aos_var_call_write.t27`.
4. Validate:
- `t27c parse`
- `t27c icarus-lowerable`
- `t27c icarus-simulate`
- `t27c icarus-cocotb`
- `t27c seal --save` and `seal --verify`
- targeted `cargo test --release --test icarus_lowerable accepts_w889_...`
5. Add the W889 integration test to `bootstrap/tests/icarus_lowerable.rs`.
6. Commit with `Closes #1838`, push `wave-loop-889`, open PR.
7. Update trackers, skill, experience, and persistent memory.

## Invariants
- Zero changes to `bootstrap/src/compiler.rs`, reference model, or `FROZEN_HASH`.
- All generated files must pass ASCII and `seal --verify`.
22 changes: 11 additions & 11 deletions .claude/skills/t27-master-executor.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ 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`) — `OPEN`, auto-merge enabled; blocked
by required status checks.
- **W882** — issue #1812, PR #1813 (`[583][2]^6 Pt`) — `OPEN`, auto-merge enabled; blocked
by required status checks.
- **W883** — issue #1814, PR #1815 (`[585][2]^6 Pt`) — `OPEN`, auto-merge enabled; blocked
by required status checks.
- **W881** — issue #1722, PR #1810 (`[581][2]^6 Pt`) — `OPEN`, auto-merge enabled; merge
state `DIRTY` (needs conflict resolution against current `master`).
- **W882** — issue #1812, PR #1813 (`[583][2]^6 Pt`) — `OPEN`, auto-merge enabled; merge
state `DIRTY`.
- **W883** — issue #1814, PR #1815 (`[585][2]^6 Pt`) — `OPEN`, auto-merge enabled; merge
state `DIRTY`.
- **W884** — issue #1828, PR #1829 (`[587][2]^6 Pt`) — `MERGED`.
- **W885** — issue #1830, PR #1831 (`[589][2]^6 Pt`) — `MERGED`.
- **W886** — issue #1832, PR #1833 (`[591][2]^6 Pt`) — `OPEN`, auto-merge enabled; checks
in progress.
- **W887** — issue #1834, PR #1835 (`[593][2]^6 Pt`) — `OPEN`, auto-merge enabled; checks
in progress.
- **W888** — issue #1836, branch TBD (`[595][2]^6 Pt`) — ready to start once W887 lands.
- **W886** — issue #1832, PR #1833 (`[591][2]^6 Pt`) — `MERGED`.
- **W887** — issue #1834, PR #1835 (`[593][2]^6 Pt`) — `MERGED`.
- **W888** — issue #1836, PR #1837 (`[595][2]^6 Pt`) — `OPEN`, auto-merge enabled; merge
state `BLOCKED` pending required checks.
- **W889** — issue #1838, branch TBD (`[597][2]^6 Pt`) — ready to start once W888 lands.

### GF-T PR queue (Refs #1764)
The GF-T stack has largely landed on `master`. Remaining open PRs are wave-loop branches
Expand Down
38 changes: 38 additions & 0 deletions .claude/skills/t27-wave-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,44 @@ Phase complete: [phase name]
→ Phase [next phase number]: [next phase name]
```

## Worked example — Wave Loop 888

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

- Selected Variant A: module-scope `[595][2]^6 Pt` non-power-of-two outer-dimension
array-of-struct variable from call with indexed signed writes.
- Generated `scripts/gen_w888.py` from `scripts/gen_w887.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/w888_bench_module_595x2p6_aos_var_call_write.t27`
(38,080 elements, 1,218,560-bit packed vector, ~1.162 MiBit).
- Added integration test `accepts_w888_bench_module_595x2p6_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_w888...` PASS.
- Full suite: 347 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_W888_2026-08-06.md` and
next-wave plan `.claude/plans/wave-loop-889.md` with variants A/B/C.
- Closed with commit `Closes #1836`, pushed branch `wave-loop-888`, opened PR #1837.
Rebased onto latest master after W886/W887 landed to satisfy the up-to-date branch rule.
- Updated this skill's Live Wave Loop Tracker to wave 889.

Key learning: the 1.16-MiBit neighborhood remains a soft boundary for t27c and Icarus at
1.162 MiBit. When earlier waves land while a new PR is open, rebase the new branch onto
latest master before auto-merge can proceed.

## Worked example — Wave Loop 887

Wave Loop 887 continued the mechanical packed-vector AoS ladder past the 1-MiBit line:
Expand Down
9 changes: 5 additions & 4 deletions .claude/skills/wave-loop-autopilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@ criteria, generator copy-hazard checklist, and open backlog.
| 883 | #1814 | wave-loop-883 | 585 | 292 | 37,440 | 1,198,080 | 1.143 | open | #1815 |
| 884 | #1828 | wave-loop-884 | 587 | 293 | 37,568 | 1,202,176 | 1.147 | merged | #1829 |
| 885 | #1830 | wave-loop-885 | 589 | 294 | 37,696 | 1,206,272 | 1.151 | merged | #1831 |
| 886 | #1832 | wave-loop-886 | 591 | 295 | 37,824 | 1,210,368 | 1.155 | open | #1833 |
| 887 | #1834 | wave-loop-887 | 593 | 296 | 37,952 | 1,214,464 | 1.159 | open | #1835 |
| **888** | **#1836** | **wave-loop-888 (READY)** | **595** | **297** | **38,080** | **1,218,560** | **1.162** | **READY** | **TBD** |
| 889 | TBD | wave-loop-889 | 597 | 298 | 38,208 | 1,222,656 | 1.166 | planned | TBD |
| 886 | #1832 | wave-loop-886 | 591 | 295 | 37,824 | 1,210,368 | 1.155 | merged | #1833 |
| 887 | #1834 | wave-loop-887 | 593 | 296 | 37,952 | 1,214,464 | 1.159 | merged | #1835 |
| 888 | #1836 | wave-loop-888 | 595 | 297 | 38,080 | 1,218,560 | 1.162 | open | #1837 |
| **889** | **#1838** | **wave-loop-889 (READY)** | **597** | **298** | **38,208** | **1,222,656** | **1.166** | **READY** | **TBD** |
| 890 | TBD | wave-loop-890 | 599 | 299 | 38,336 | 1,226,752 | 1.170 | planned | TBD |
| 891 | TBD | wave-loop-891 | 601 | 300 | 38,464 | 1,230,848 | 1.174 | planned | TBD |

### Run-list notes
- Issue numbers follow the observed pattern (issue = previous issue + 2).
Expand Down
16 changes: 8 additions & 8 deletions .trinity/current-issue.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Current Issue — Wave Loop 888
# Current Issue — Wave Loop 889

**Issue:** #1836 — feat(igla): Wave Loop 888 — module-scope [595][2]^6 Pt non-power-of-two outer-dimension array-of-struct variable from call with indexed signed writes
**Issue:** #1838 — feat(igla): Wave Loop 889 — module-scope [597][2]^6 Pt non-power-of-two outer-dimension array-of-struct variable from call with indexed signed writes

**Branch:** `wave-loop-888`
**Branch:** `wave-loop-889`

**PR:** TBD

**Spec:** `specs/scratch/w888_bench_module_595x2p6_aos_var_call_write.t27`
**Spec:** `specs/scratch/w889_bench_module_597x2p6_aos_var_call_write.t27`

**Outer dimension:** 595 (non-power-of-two)
**Outer dimension:** 597 (non-power-of-two)
**Inner struct:** `[2]^6 Pt` (2 fields × 6 trits × 32 bits = 384 bits per element)
**Total elements:** 595 × 64 = 38,080 structs
**Packed vector width:** 38,080 × 32 = 1,218,560 bits (~1.162 MiBit)
**Total elements:** 597 × 64 = 38,208 structs
**Packed vector width:** 38,208 × 32 = 1,222,656 bits (~1.166 MiBit)

**Pattern:** module-scope array-of-struct variable initialized from a function call, then mutated via signed-index field writes and read back with `assert_eq` inside a `bench` block.

**Next issue:** TBD (Wave Loop 889)
**Next issue:** TBD (Wave Loop 890)
39 changes: 39 additions & 0 deletions .trinity/experience.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
> ## 2026-08-06 — Wave Loop 888 (module-scope `[595][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1836, PR #1837)
>
> ### What worked
> - Variant A extended the module-scope packed AoS odd outer-dimension ladder to 595.
> The `[595][2]^6 Pt` witness is 1,218,560 bits (~1.162 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 W888 witness.
> - Targeted `cargo test --release --test icarus_lowerable accepts_w888_bench_module_595x2p6_aos_var_call_write`
> passed.
> - PR #1837 opened; auto-merge enabled. The branch was rebased onto latest master after
> W886/W887 landed.
>
> ### What changed behavior
> - No changes to `bootstrap/src/compiler.rs`.
> - No changes to `bootstrap/stage0/FROZEN_HASH`.
> - Added `specs/scratch/w888_bench_module_595x2p6_aos_var_call_write.t27` (~2.6 MB /
> ~113,111 lines) with seal and Icarus baseline.
> - Added integration test `accepts_w888_bench_module_595x2p6_aos_var_call_write`.
> - Added generator script `scripts/gen_w888.py`.
> - Added closeout report `docs/reports/FPGA_LOOP_CLOSEOUT_W888_2026-08-06.md` and next-wave
> plan `.claude/plans/wave-loop-889.md`.
>
> ### Validation
> - `t27c parse` W888: PASS.
> - `t27c icarus-lowerable` W888: PASS (`lowerable`).
> - `t27c icarus-simulate` W888: PASS (17 cycles, PASSED).
> - `t27c icarus-cocotb` W888: PASS (`reference-model OK`).
> - `t27c seal --save` W888: PASS.
> - Targeted cargo test W888: 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 W888. It reproduces on clean W882 and should be tracked separately.
> - The full `icarus_lowerable` suite now reports 347 passed; 1 failed (the pre-existing
> mismatch above).
>
> ## 2026-08-06 — Wave Loop 887 (module-scope `[593][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1834, PR #1835)
>
> ### What worked
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"gen_hash_c": "sha256:c080aabc88f5e277b02f7227ef420b5f6e4071aa5da583214d33d4cb509b9a5d",
"gen_hash_rust": "sha256:55a4da61ed8b42efc4a6545659b70ff5fa9410b5f767d1b000cd4cea6be8ca66",
"gen_hash_verilog": "sha256:65a81c0f1f72db6e2048ac506a5c4af1f052281b3769add85cff84e3cd682477",
"gen_hash_zig": "sha256:c125c3d26ed2b6260a47c963068336d88d2337581cbc6ff55a93d72851b0eadb",
"module": "w888_bench_module_595x2p6_aos_var_call_write",
"ring": 12,
"sealed_at": "2026-08-07T04:53:36Z",
"spec_hash": "sha256:df70a6d690016396592710318b80ade8122ef9243f5d936036a7b1df63c67b8f",
"spec_path": "specs/scratch/w888_bench_module_595x2p6_aos_var_call_write.t27"
}
18 changes: 18 additions & 0 deletions bootstrap/tests/icarus_lowerable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6277,6 +6277,24 @@ fn accepts_w887_bench_module_593x2p6_aos_var_call_write() {
}
}

#[test]
fn accepts_w888_bench_module_595x2p6_aos_var_call_write() {
let dir = scratch_dir();
for name in &[
"w888_bench_module_595x2p6_aos_var_call_write.t27",
] {
let p = dir.join(name);
assert!(p.exists(), "missing W888 witness {}", p.display());
let (lowerable, json) = run_icarus_lowerable(&p);
assert!(
lowerable,
"expected {} to be lowerable, got: {}",
p.display(),
json
);
}
}

#[test]
fn accepts_known_lowerable_witnesses() {
let dir = scratch_dir();
Expand Down
31 changes: 29 additions & 2 deletions docs/NOW.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
# NOW — feat(igla): Wave Loop 888 (2026-08-06)
# NOW — feat(igla): Wave Loop 889 (2026-08-06)

Last updated: 2026-08-06

## feat(igla): Wave Loop 888 close-out — [595][2]^6 Pt packed AoS witness (Refs #1836)

- Branch: `wave-loop-888`
- PR: #1837 (auto-merge enabled)

### Что легло
- `specs/scratch/w888_bench_module_595x2p6_aos_var_call_write.t27` (`[595][2]^6 Pt`, 38,080 elements, 1,218,560-bit packed vector, ~1.162 MiBit): module-scope non-power-of-two outer-dimension array-of-struct variable initialized from a function call, with indexed signed field writes and `assert_eq` read-back in a `bench` block.
- Generator `scripts/gen_w888.py` copied from `gen_w887.py`, copy-hazard checklist cleared (`OUTER = 595`, `MID_IDX = 297`).
- Integration test `accepts_w888_bench_module_595x2p6_aos_var_call_write` added to `bootstrap/tests/icarus_lowerable.rs`.
- Fresh seal `.trinity/seals/scratch_w888_bench_module_595x2p6_aos_var_call_write.json` (`seal --verify` MATCH).
- Zero compiler / reference-model / `FROZEN_HASH` changes.

### Validation
- `t27c parse` → PASS
- `t27c icarus-lowerable` → lowerable
- `t27c icarus-simulate` → PASSED (17 cycles)
- `t27c icarus-cocotb` → reference-model OK
- `t27c seal --save` → saved
- Targeted `cargo test --release --test icarus_lowerable accepts_w888_bench_module_595x2p6_aos_var_call_write` → PASS
- Full suite: 347 passed; 1 pre-existing `corpus_classifier_matches_lean_completeness` mismatch for `specs/cloud/railway_deploy.t27` tracked separately.

### Next
- Create W889 issue and branch once W888 lands.
- Variant A: `[597][2]^6 Pt` (~1.166 MiBit).

---

## feat(igla): Wave Loop 887 close-out — [593][2]^6 Pt packed AoS witness (Refs #1834)

- Branch: `wave-loop-887`
- PR: #1835 (auto-merge enabled)
- PR: #1835 (merged)

### Что легло
- `specs/scratch/w887_bench_module_593x2p6_aos_var_call_write.t27` (`[593][2]^6 Pt`, 37,952 elements, 1,214,464-bit packed vector, ~1.159 MiBit): module-scope non-power-of-two outer-dimension array-of-struct variable initialized from a function call, with indexed signed field writes and `assert_eq` read-back in a `bench` block.
Expand Down
75 changes: 75 additions & 0 deletions docs/reports/FPGA_LOOP_CLOSEOUT_W888_2026-08-06.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# FPGA / Icarus Wave Loop Close-out — W888

**Date:** 2026-08-06
**Issue:** #1836
**Branch:** `wave-loop-888`
**PR:** #1837

## What was delivered

Wave Loop 888 is the next mechanical rung in the packed-vector array-of-struct ladder:

- `specs/scratch/w888_bench_module_595x2p6_aos_var_call_write.t27`
- Module-scope variable of shape `[595][2]^6 Pt`.
- Outer dimension `595` is non-power-of-two.
- Initialized from a function call (`make_grid(0)`).
- Mutated via indexed signed field writes and read back with `assert_eq` inside a `bench` block.
- **Elements:** 595 × 64 = 38,080 structs.
- **Packed vector width:** 38,080 × 32 = 1,218,560 bits (~1.162 MiBit).

- `scripts/gen_w888.py` — copied from `scripts/gen_w887.py` and verified with the copy-hazard checklist (destination path, module header, `MID_IDX` comment).
- Integration test `accepts_w888_bench_module_595x2p6_aos_var_call_write` added to `bootstrap/tests/icarus_lowerable.rs`.
- Fresh seal `.trinity/seals/scratch_w888_bench_module_595x2p6_aos_var_call_write.json` verified with `seal --verify`.

## Validation matrix

| Gate | Result |
|------|--------|
| `t27c parse` | PASS |
| `t27c icarus-lowerable` | lowerable |
| `t27c icarus-simulate` | PASSED (17 cycles) |
| `t27c icarus-cocotb` | reference-model OK |
| `t27c seal --save` | saved |
| `t27c seal --verify` | all MATCH |
| Targeted `cargo test --release --test icarus_lowerable accepts_w888_bench_module_595x2p6_aos_var_call_write` | PASS |
| Full suite `cargo test --release --test icarus_lowerable` | 347 passed; 1 pre-existing `corpus_classifier_matches_lean_completeness` mismatch for `specs/cloud/railway_deploy.t27` |

## Invariants

- No changes to `bootstrap/src/compiler.rs` or reference model.
- `bootstrap/stage0/FROZEN_HASH` unchanged.
- All generated files ASCII-only, sealed, and lowerable.

## Research background (unchanged)

The same weak-point context from prior waves applies:

- Icarus Verilog has no 1-MiBit hard cap (LRM minimum 65,536 bits; Icarus warns near 1 Gbit; upstream commit `128c621` fixed bound-normalization; Icarus V13.0 2026-03-02 improves packed/unpacked array handling).
- Vitis HLS UG1399 `compact=bit` is the commercial analog for packing structs into wide vectors.
- Vericert v2.0.0 (2026-01-29), 2024 PLDI verified hyperblock scheduling (DOI 10.1145/3656455), Graphiti (ASPLOS 2026), and Let It Flow (PLDI 2026) frame the verified-HLS context.
- FPGA Roofline (Siracusa et al., IEEE TC 2021) frames the ladder as a memory-quanta `Q` probe.

## Next wave cooperation variants (W889)

See `.claude/plans/wave-loop-889.md`.

- **Variant A (recommended):** `[597][2]^6 Pt` — continue the outer-dimension ladder to ~1.166 MiBit.
- **Variant B:** `[595][3]^6 Pt` — keep outer dimension near W888 but scale field count to 3.
- **Variant C:** `[595][2]^6 Pt` with explicit negative-index wrap-around writes — exercise signed-index bound normalization.

## Action log

1. Created issue #1836 for W888.
2. Branched `wave-loop-888` from `wave-loop-887` HEAD (earlier wave PRs remain open).
3. Generated `scripts/gen_w888.py` and produced the spec.
4. Ran `t27c parse`, `icarus-lowerable`, `icarus-simulate`, `icarus-cocotb`, `seal --save`, `seal --verify`.
5. Added targeted integration test; targeted test passes.
6. Committed and pushed with `Closes #1836`.
7. Opened PR #1837 and enabled auto-merge.
8. Rebased `wave-loop-888` onto latest `master` after W886/W887 landed, then force-pushed, because the branch protection rule requires the head to be up-to-date.
9. Created next-wave issue #1838 and plan `.claude/plans/wave-loop-889.md`.
10. Updated `.trinity/current-issue.md`, skill tracker, experience, and persistent memory.

---

φ² + 1/φ² = 3 | TRINITY
Loading
Loading