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
42 changes: 42 additions & 0 deletions .claude/plans/wave-loop-886.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Plan — Wave Loop 886

**Next issue:** TBD (create as #1832 or next available)
**Next branch:** `wave-loop-886`
**Base:** `wave-loop-885` HEAD (earlier wave PRs remain open)

## Goal
Generate and validate the next mechanical packed-vector witness: module-scope `[591][2]^6 Pt` array-of-struct variable from call with indexed signed writes.

## Dimensions
- Outer dimension: 591 (non-power-of-two)
- Struct shape: `[2]^6 Pt` (2 fields × 6 trits × 32 bits = 384 bits per struct)
- Total field slots: 591 × 2 = 1,182 structs → 37,824 field slots
- Packed vector width: 37,824 × 32 = 1,210,368 bits (~1.155 MiBit)

## Steps
1. Create GitHub issue for W886 with body template.
2. Branch `wave-loop-886` from `wave-loop-885` HEAD.
3. Copy `scripts/gen_w885.py` → `scripts/gen_w886.py`.
4. Update generator copy-hazard checklist:
- `DST` path → `w886_bench_module_591x2p6_aos_var_call_write.t27`
- `OUTER = 591`
- `MID_IDX = 591 // 2` → 295
- module header → `w886_bench_module_...`
5. Run generator; verify `grep -E "w885|589|294"` is empty.
6. Run `t27c parse`, `icarus-lowerable`, `icarus-simulate`, `icarus-cocotb`, `seal --save`, `seal --verify`.
7. Add integration test `accepts_w886_bench_module_591x2p6_aos_var_call_write` to `bootstrap/tests/icarus_lowerable.rs`.
8. Run targeted test and full `icarus_lowerable` suite; expect 345 passed, 1 pre-existing failure.
9. Commit with `Closes #1832`.
10. Push branch, open PR, enable auto-merge.
11. Update `.trinity/current-issue.md`, `docs/NOW.md`, `.trinity/experience.md`, skills, and persistent memory.

## Acceptance criteria
- [ ] New spec generated and sealed.
- [ ] All `t27c` commands pass.
- [ ] Targeted Rust test passes.
- [ ] Zero compiler / reference-model / `FROZEN_HASH` changes.
- [ ] PR open with auto-merge.

## Notes
- Continue the mechanical ladder pattern.
- Watch for generator copy-hazard stale references.
40 changes: 40 additions & 0 deletions .claude/plans/wave-loop-887.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Wave Loop 887 Plan — [593][2]^6 Pt packed AoS witness

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

## Shape
- Outer dimension: `593` (non-power-of-two)
- Inner struct: `[2]^6 Pt` → 2 fields × 6 trits × 32 bits = 384 bits per element
- Total field slots: `593 × 2 = 1,186` structs → 37,952 field slots
- Packed vector width: `37,952 × 32 = 1,214,464` bits (~1.159 MiBit)

## Pattern
Module-scope variable `dst : [593][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)**: `[593][2]^6 Pt` — continue the outer-dimension ladder.
- **B**: `[591][3]^6 Pt` — keep outer dimension near W886 but scale field count to 3, increasing memory-quanta density while testing a different stride.
- **C**: `[591][2]^6 Pt` with explicit negative-index wrap-around writes — exercise signed-index bound normalization one step beyond the baseline W886 shape.

## Procedure
1. Branch `wave-loop-887` from `wave-loop-886` HEAD (earlier wave PRs remain open).
2. Copy `scripts/gen_w886.py` → `scripts/gen_w887.py` and clear the copy-hazard checklist:
- destination path,
- module header f-string,
- `MID_IDX` comment.
3. Run `python3 scripts/gen_w887.py` to produce `specs/scratch/w887_bench_module_593x2p6_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_w887_...`
5. Add the W887 integration test to `bootstrap/tests/icarus_lowerable.rs`.
6. Commit with `Closes #1834`, push `wave-loop-887`, 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`.
27 changes: 14 additions & 13 deletions .claude/skills/t27-master-executor.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@ 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.
- **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.
- **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, branch TBD (`[593][2]^6 Pt`) — ready to start once W886 lands.

### 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.
The GF-T stack has largely landed on `master`. Remaining open PRs are wave-loop branches
blocked on GitHub Actions runners.

### 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.
`specs/cloud/railway_deploy.t27` is not introduced by any Wave Loop PR.

## Procedure

Expand Down
86 changes: 80 additions & 6 deletions .claude/skills/t27-wave-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,80 @@ Phase complete: [phase name]
→ Phase [next phase number]: [next phase name]
```

## Worked example — Wave Loop 886

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

- Selected Variant A: module-scope `[591][2]^6 Pt` non-power-of-two outer-dimension
array-of-struct variable from call with indexed signed writes.
- Generated `scripts/gen_w886.py` from `scripts/gen_w885.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/w886_bench_module_591x2p6_aos_var_call_write.t27`
(37,824 elements, 1,210,368-bit packed vector, ~1.155 MiBit).
- Added integration test `accepts_w886_bench_module_591x2p6_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_w886...` PASS.
- Full suite: 345 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_W886_2026-08-06.md` and
next-wave plan `.claude/plans/wave-loop-887.md` with variants A/B/C.
- Closed with commit `Closes #1832`, pushed branch `wave-loop-886`, opened PR #1833.
- Updated this skill's Live Wave Loop Tracker to wave 887.

Key learning: the 1.15-MiBit neighborhood remains a soft boundary for t27c and Icarus at
1.155 MiBit. The generator copy-hazard checklist plus a post-generation grep remains the
standard close-out procedure.

## Worked example — Wave Loop 885

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

- Selected Variant A: module-scope `[589][2]^6 Pt` non-power-of-two outer-dimension
array-of-struct variable from call with indexed signed writes.
- Generated `scripts/gen_w885.py` from `scripts/gen_w884.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/w885_bench_module_589x2p6_aos_var_call_write.t27`
(37,696 elements, 1,206,272-bit packed vector, ~1.151 MiBit).
- Added integration test `accepts_w885_bench_module_589x2p6_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_w885...` PASS.
- Full suite: 344 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_W885_2026-08-06.md` and
next-wave plan `.claude/plans/wave-loop-886.md` with variants A/B/C.
- Closed with commit `Closes #1830`, pushed branch `wave-loop-885`, opened PR #1831.
- Updated this skill's Live Wave Loop Tracker to wave 886.

Key learning: the 1.15-MiBit neighborhood remains a soft boundary for t27c and Icarus at
1.151 MiBit. The generator copy-hazard checklist plus a post-generation grep remains the
standard close-out procedure.

## Worked example — Wave Loop 884

Wave Loop 884 continued the mechanical packed-vector AoS ladder past the 1-MiBit line:
Expand Down Expand Up @@ -3616,13 +3690,13 @@ variants are queued."

| Field | Value |
|-------|-------|
| **Current wave** | 881 |
| **Issue** | #1713 (expected) |
| **Branch** | `wave-loop-881` |
| **Parent branch** | `wave-loop-880` HEAD because earlier wave PRs remain open |
| **Recommended variant** | A — module-scope `[581][2]^6 Pt` packed array-of-struct variable from call with indexed signed writes
| **Current wave** | 887 |
| **Issue** | #1834 |
| **Branch** | `wave-loop-887` |
| **Parent branch** | `wave-loop-886` HEAD because earlier wave PRs remain open |
| **Recommended variant** | A — module-scope `[593][2]^6 Pt` packed array-of-struct variable from call with indexed signed writes
| **Status** | READY TO START
| **Next wave variants queued** | W882 Variant A `[583][2]^6 Pt`; Variant B `[581][3]^6 Pt` stride scaling; Variant C `[581][2]^6 Pt` negative-index wrap-around
| **Next wave variants queued** | W888 Variant A `[595][2]^6 Pt`; Variant B `[593][3]^6 Pt` stride scaling; Variant C `[593][2]^6 Pt` negative-index wrap-around

### Open backlog (non-blocking)

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 885
# Current Issue — Wave Loop 887

**Issue:** #1830 — feat(igla): Wave Loop 885 — module-scope [589][2]^6 Pt non-power-of-two outer-dimension array-of-struct variable from call with indexed signed writes
**Issue:** #1834 — feat(igla): Wave Loop 887 — module-scope [593][2]^6 Pt non-power-of-two outer-dimension array-of-struct variable from call with indexed signed writes

**Branch:** `wave-loop-885`
**Branch:** `wave-loop-887`

**PR:** TBD

**Spec:** `specs/scratch/w885_bench_module_589x2p6_aos_var_call_write.t27`
**Spec:** `specs/scratch/w887_bench_module_593x2p6_aos_var_call_write.t27`

**Outer dimension:** 589 (non-power-of-two)
**Outer dimension:** 593 (non-power-of-two)
**Inner struct:** `[2]^6 Pt` (2 fields × 6 trits × 32 bits = 384 bits per element)
**Total elements:** 589 × 2 = 1,178 structs → 37,696 field slots
**Packed vector width:** 37,696 × 32 = 1,206,272 bits (~1.151 MiBit)
**Total elements:** 593 × 2 = 1,186 structs → 37,952 field slots
**Packed vector width:** 37,952 × 32 = 1,214,464 bits (~1.159 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 886)
**Next issue:** TBD (Wave Loop 888)
76 changes: 76 additions & 0 deletions .trinity/experience.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
> ## 2026-08-06 — Wave Loop 886 (module-scope `[591][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1832, PR #1833)
>
> ### What worked
> - Variant A extended the module-scope packed AoS odd outer-dimension ladder to 591.
> The `[591][2]^6 Pt` witness is 1,210,368 bits (~1.155 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 W886 witness.
> - Targeted `cargo test --release --test icarus_lowerable accepts_w886_bench_module_591x2p6_aos_var_call_write`
> passed.
> - PR #1833 opened; auto-merge enabled.
>
> ### What changed behavior
> - No changes to `bootstrap/src/compiler.rs`.
> - No changes to `bootstrap/stage0/FROZEN_HASH`.
> - Added `specs/scratch/w886_bench_module_591x2p6_aos_var_call_write.t27` (~2.5 MB /
> ~112,351 lines) with seal and Icarus baseline.
> - Added integration test `accepts_w886_bench_module_591x2p6_aos_var_call_write`.
> - Added generator script `scripts/gen_w886.py`.
> - Added closeout report `docs/reports/FPGA_LOOP_CLOSEOUT_W886_2026-08-06.md` and next-wave
> plan `.claude/plans/wave-loop-887.md`.
>
> ### Validation
> - `t27c parse` W886: PASS.
> - `t27c icarus-lowerable` W886: PASS (`lowerable`).
> - `t27c icarus-simulate` W886: PASS (17 cycles, PASSED).
> - `t27c icarus-cocotb` W886: PASS (`reference-model OK`).
> - `t27c seal --save` W886: PASS.
> - Targeted cargo test W886: 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 W886. It reproduces on clean W882 and should be tracked separately.
> - The full `icarus_lowerable` suite now reports 345 passed; 1 failed (the pre-existing
> mismatch above).
>
> ## 2026-08-06 — Wave Loop 885 (module-scope `[589][2]^6 Pt` non-power-of-two outer-dimension AoS variable, issue #1830, PR #1831)
>
> ### What worked
> - Variant A extended the module-scope packed AoS odd outer-dimension ladder to 589.
> The `[589][2]^6 Pt` witness is 1,206,272 bits (~1.151 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 W885 witness.
> - Targeted `cargo test --release --test icarus_lowerable accepts_w885_bench_module_589x2p6_aos_var_call_write`
> passed.
> - PR #1831 opened; auto-merge enabled.
>
> ### What changed behavior
> - No changes to `bootstrap/src/compiler.rs`.
> - No changes to `bootstrap/stage0/FROZEN_HASH`.
> - Added `specs/scratch/w885_bench_module_589x2p6_aos_var_call_write.t27` (~2.5 MB /
> ~111,971 lines) with seal and Icarus baseline.
> - Added integration test `accepts_w885_bench_module_589x2p6_aos_var_call_write`.
> - Added generator script `scripts/gen_w885.py`.
> - Added closeout report `docs/reports/FPGA_LOOP_CLOSEOUT_W885_2026-08-06.md` and next-wave
> plan `.claude/plans/wave-loop-886.md`.
>
> ### Validation
> - `t27c parse` W885: PASS.
> - `t27c icarus-lowerable` W885: PASS (`lowerable`).
> - `t27c icarus-simulate` W885: PASS (17 cycles, PASSED).
> - `t27c icarus-cocotb` W885: PASS (`reference-model OK`).
> - `t27c seal --save` W885: PASS.
> - Targeted cargo test W885: 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 W885. It reproduces on clean W882 and should be tracked separately.
> - The full `icarus_lowerable` suite now reports 344 passed; 1 failed (the pre-existing
> mismatch above).
>
> ## 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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"gen_hash_c": "sha256:2d5973f76248c1a9e924219238049995ea7e7e91361c1ee859bb18df33f069cf",
"gen_hash_rust": "sha256:0948b6a545ad1f83d9430758dcdea27d2ae4db9ec78f00bbc06a123ee8d6d874",
"gen_hash_verilog": "sha256:518bb84dc3252b6ad6789514c781dd7bbdc48923edc52f8178a4eee51d2cfde1",
"gen_hash_zig": "sha256:15fa3bf9b43634f155a35001a0edb3df0ea8e0306075b4ee11bd5f89a7d607fb",
"module": "w886_bench_module_591x2p6_aos_var_call_write",
"ring": 12,
"sealed_at": "2026-08-07T04:02:03Z",
"spec_hash": "sha256:8303d6fe8d1bf9f45e8750a1fc88e97b25a3022a471e2a3ba4ad18372c75ed20",
"spec_path": "specs/scratch/w886_bench_module_591x2p6_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 @@ -6241,6 +6241,24 @@ fn accepts_w885_bench_module_589x2p6_aos_var_call_write() {
}
}

#[test]
fn accepts_w886_bench_module_591x2p6_aos_var_call_write() {
let dir = scratch_dir();
for name in &[
"w886_bench_module_591x2p6_aos_var_call_write.t27",
] {
let p = dir.join(name);
assert!(p.exists(), "missing W886 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
Loading
Loading