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
48 changes: 48 additions & 0 deletions .claude/board/ISSUES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Issues Log — Open + Resolved (double-entry, append-only)

## ISS-LGJ-HOP-SWEEPS-FULL-POPULATION (2026-08-27) — OPEN

**Found.** By running bench Component G — the F-PARITY harness — for the
first time. `lgj_hop` is the slowest of three arms at every configuration in
the §3.8-mandated sweep (2 row counts × 2 frontier densities), by 2.6× to
165× against the best scalar oracle.

**Root cause, localized.** `exports.rs:1589-1599` builds the classid mask
across the WHOLE population, once per participating facet — 32 full-width
sweeps per hop — and only then intersects with `src`:

```rust
for facet in 0..ROW_FACETS {
if (effective >> facet) & 1 == 0 { continue }
kernels::simd_rowstore_classid_mask(bytes, …, n, …) // n = ALL rows
for (w, (&sw, &cw)) in src_snapshot.iter().zip(classid_scratch.iter()) { … }
}
```

The decode/scatter half IS frontier-bounded; the sweep preceding it is not.

**The measurement's shape is the evidence, not just its ranking.** Native cost
is flat in frontier density (479 → 521 µs at 4096 rows; 24 798 → 23 634 µs at
65 536 — a 25× larger frontier costs nothing) and ~linear in population
(16× the rows → ~52× the time). A hop whose cost tracks the population it
ignores rather than the frontier it starts from is doing full-population work.

**Remedy shape (NOT implemented here).** `src_snapshot` is known before the
loop, so the sweep can be bounded to the words where `src` has bits, or
skipped for a facet whose intersection is empty. That is a kernel change and
W8's F-PARITY scope is "seeds the HARNESS only" (§12) on a component §3.8
declares non-gating — landing a kernel rewrite in a bench commit would widen
the PR past what the measurement authorises.

**Not a verdict on mask-native execution.** Allocation independence is pinned
separately and is unaffected (`GraphHopTest` G3, flat 10-vs-500 rows); the
no-row-id guarantees are structural. This is the throughput-placement axis
§3.8 says a measurement decides — and it now has one.

**Caveats carried, not buried.** The per-call `Engine.createMask` + close has
no scalar analogue and was NOT isolated (implausible as the story at 470 µs on
4096 rows, and it would not scale with `rows`; named anyway). Native absolutes
are noisy — ±12 844 on 24 798 µs — on a shared 4-vCPU container; the ordering
is robust, the absolutes are not. One machine, one run.

Data: `bench/results/jmh-results-G.csv`; narrative: `bench/RESULTS.md` § G.


## ISS-LGJ-STACK-TAIL-STRANDED-MINOR-8 (2026-08-25) — RESOLVED same day

**Found.** PR #32 (ABI minor 8) was opened against
Expand Down
2 changes: 1 addition & 1 deletion .claude/board/STATUS_BOARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ the policy guard, created at the A3 freeze.

| D-id | Deliverable | Status |
|---|---|---|
| D-LGJ-W8 | Mask-native navigation correction + 64K-compute architecture inheritance. Gate ladder: AUDIT → SPEC → COUNCIL → FREEZE → SUBSTRATE (ndarray PR-N + lgj-abi PR-W8a) → FACADE (PR-W8b) → GRAPH MIGRATION → FALSIFIERS → POLICY | **AUDIT ✓** → **SPEC ✓** → **COUNCIL ✓** (v3 ratified) → **FREEZE ✓** (PR #20, squash `c479f76`) → **SUBSTRATE ✓ 2026-08-18** — PR-N (ndarray #280, `3f3504f`: mask_andnot family + `ndarray::simd` re-export + blackboard W1a-deviation entry; 51/51, vector-path disable-run red-then-green) + PR-W8a (this commit: contract dep `default-features=false`, `FixtureClassView` + provider seam fns + `class_id_for` width pin, `lgj_mask_andnot` with the 5-branch non-commutative aliasing tree, `lgj_hop` with snapshot-then-write + composition kernel + bounds-before-cast, minor 4, status −14, abi.md §13; **110/110**, clippy `-D warnings` + fmt clean, `nm -D` **21/21** symbols, disable-runs **G6(a)-(e) ALL red-then-green** incl. the aliasing DEADLOCK proven by timeout under a bypassed dedup branch, G11 import fence honored: contract imports = class_view/canonical_node/ontology only) → **FACADE + GRAPH MIGRATION ✓ 2026-08-18 (PR-W8b, this commit)** — Java facade: `WideFieldMask` (record, `allFacets`/`ofFacets` validated/`ofMatchBits` zero-extending), `RowStore.hop` ×2 overloads + `importRows` (the ONE named import), `Mask.minus`/`materializeRows`, `Status` −14, `Downcalls` 20 handles/21 symbols + `requireMinor(4)`, `Engine.LaneWindow.setU64` (first write accessor, importRows-only); Graph migration: native `Mask` frontier (zero `long[]`/Collection fields), `from(Mask)`, `minus(long...)` REMOVED, `rows()`→`materializeRows()`, real `close()`; GraphHopTest rewritten (reflective 3-way allowlist over Graph+Edge, the vacuous literal-true assert DELETED, G9 flagship seed=133→hop→240 with zero row-ids outside the oracle, G3 allocation 384-byte floor FLAT 10-vs-500 rows). Gates central: `.so` rebuilt FIRST (stale root copy caught+refreshed), `javac -Xlint:all` 7 pre-existing warnings/0 new, **AllTests 245 ✓ + GraphHopTest 66 ✓ + TradesParity 12 ✓ + TradesAllocation 3 ✓ + BricksAuth 62 ✓ = 388 checks**; crossings MEASURED-THEN-PINNED: hop **2** (create+hop; prediction 1 wrong exactly as the brief's own reasoning anticipated), importRows **2** (create+describe; word writes in-process, 3-vs-29-row cost identical), count 1 / minus 2 / materialize-first 1 as predicted — 3 stale "one native crossing" javadoc claims corrected at the source; allowlist disable-run red-then-green (injected `long[] rows()` fired exactly G1/G8, restore green); wave/plan supersession notes appended per spec §3.7. Remaining rungs: FALSIFIERS (spec §12 F-* pre-registrations beyond what GraphHopTest carries) → POLICY |
| D-LGJ-W8 | Mask-native navigation correction + 64K-compute architecture inheritance. Gate ladder: AUDIT → SPEC → COUNCIL → FREEZE → SUBSTRATE (ndarray PR-N + lgj-abi PR-W8a) → FACADE (PR-W8b) → GRAPH MIGRATION → FALSIFIERS → POLICY | **AUDIT ✓** → **SPEC ✓** → **COUNCIL ✓** (v3 ratified) → **FREEZE ✓** (PR #20, squash `c479f76`) → **SUBSTRATE ✓ 2026-08-18** — PR-N (ndarray #280, `3f3504f`: mask_andnot family + `ndarray::simd` re-export + blackboard W1a-deviation entry; 51/51, vector-path disable-run red-then-green) + PR-W8a (this commit: contract dep `default-features=false`, `FixtureClassView` + provider seam fns + `class_id_for` width pin, `lgj_mask_andnot` with the 5-branch non-commutative aliasing tree, `lgj_hop` with snapshot-then-write + composition kernel + bounds-before-cast, minor 4, status −14, abi.md §13; **110/110**, clippy `-D warnings` + fmt clean, `nm -D` **21/21** symbols, disable-runs **G6(a)-(e) ALL red-then-green** incl. the aliasing DEADLOCK proven by timeout under a bypassed dedup branch, G11 import fence honored: contract imports = class_view/canonical_node/ontology only) → **FACADE + GRAPH MIGRATION ✓ 2026-08-18 (PR-W8b, this commit)** — Java facade: `WideFieldMask` (record, `allFacets`/`ofFacets` validated/`ofMatchBits` zero-extending), `RowStore.hop` ×2 overloads + `importRows` (the ONE named import), `Mask.minus`/`materializeRows`, `Status` −14, `Downcalls` 20 handles/21 symbols + `requireMinor(4)`, `Engine.LaneWindow.setU64` (first write accessor, importRows-only); Graph migration: native `Mask` frontier (zero `long[]`/Collection fields), `from(Mask)`, `minus(long...)` REMOVED, `rows()`→`materializeRows()`, real `close()`; GraphHopTest rewritten (reflective 3-way allowlist over Graph+Edge, the vacuous literal-true assert DELETED, G9 flagship seed=133→hop→240 with zero row-ids outside the oracle, G3 allocation 384-byte floor FLAT 10-vs-500 rows). Gates central: `.so` rebuilt FIRST (stale root copy caught+refreshed), `javac -Xlint:all` 7 pre-existing warnings/0 new, **AllTests 245 ✓ + GraphHopTest 66 ✓ + TradesParity 12 ✓ + TradesAllocation 3 ✓ + BricksAuth 62 ✓ = 388 checks**; crossings MEASURED-THEN-PINNED: hop **2** (create+hop; prediction 1 wrong exactly as the brief's own reasoning anticipated), importRows **2** (create+describe; word writes in-process, 3-vs-29-row cost identical), count 1 / minus 2 / materialize-first 1 as predicted — 3 stale "one native crossing" javadoc claims corrected at the source; allowlist disable-run red-then-green (injected `long[] rows()` fired exactly G1/G8, restore green); wave/plan supersession notes appended per spec §3.7. **FALSIFIERS ✓ 2026-08-27** — scoping corrected first: §12's own *"W8 carries only those marked [W8]"* marks exactly TWO of the eight `F-*`, the rest being pre-registered for the COMPUTE wave. **F-HYDR** was already shipped as `GraphHopTest`'s G3 gate (384-byte floor, flat 10-vs-500 rows). **F-PARITY** landed here as bench **Component G** (`G_HopExecutionBoundary`, 254 lines) — native `lgj_hop` vs the two scalar oracles preserved verbatim from `GraphHopTest`, swept on both §3.8 axes (rows {4096, 65536} × frontier {1 %, 25 %}), all three arms cross-checked to agree on the destination set in `@Setup` with an anti-vacuity empty-hop guard — **and MEASURED, not merely seeded**: native is slowest in all four configs by 2.6×–165×, with cost flat in frontier and linear in population, root-caused to `exports.rs:1589-1599` building the classid mask over the full population once per facet (`ISS-LGJ-HOP-SWEEPS-FULL-POPULATION`, remedy deliberately out of scope per §12's harness-only wording). → **POLICY ✓ (retroactive: discharged at the A3 freeze, PR #20)** — §3.9 lands the policy artifacts "BEFORE workers" and all exist dated 2026-08-18 (root `CLAUDE.md` incl. §13's compute additions, `EPIPHANIES.md:683` storno, this row, `LATEST_STATE`, `PR_ARC_INVENTORY`); the ladder's `… → FALSIFIERS → POLICY` ordering is misleading and this row carried POLICY as "remaining" for nine days. **D-LGJ-W8 COMPLETE.** |



Expand Down
53 changes: 46 additions & 7 deletions .claude/board/WAVE_STATUS_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,38 @@ Neither is `wave-ghidra-g1-g2`.
| 🧊 | `wave-consumer-trades.md`, `wave-consumer-bricks.md` | **DO NOT DISPATCH** — operator ruling 2026-08-17, "calcified, not executed, until called." Note the *deliverables* (D-LGJ-W5 trades/bricks) shipped anyway via PR #11/#12; the wave files are the un-dispatched expansion. |
| 🧊 | `wave-consumer-graph.md` | DONE 2026-08-18, ⊘ superseded in part by the D-LGJ-W8 correction. |

**The real critical path to Ghidra/R2IL consumption is upstream, not here:**
`ruff_r2il` **PR2** (drill-down proposer, gated on PR1 corpus numbers) then
**PR3** (classid mint in `ogar_codebook`, item O5, gated on PR2). Both
unmerged as of 2026-08-25.
**The real critical path to Ghidra/R2IL consumption is upstream, not here.**

> **⊘ CORRECTION 2026-08-27 — this paragraph was wrong twice, and the file
> that exists to stop stale cross-repo claims had become one.** It read:
> *"`ruff_r2il` PR2 (drill-down proposer, gated on PR1 corpus numbers) then
> PR3 (classid mint in `ogar_codebook`, item O5, gated on PR2). Both unmerged
> as of 2026-08-25."* Measured against the repo:
>
> 1. **PR1 / O1 is DONE and committed** — `ruff` `.claude/harvest/r2il/CORPUS-PROFILE-RESULT.md`:
> 100.00 % inline fit (`dst+src0+src1`), 0.00 % needing Vec routing, on all
> four corpus binaries (`stress_test`, `stress_test_opt`, `/bin/ls`,
> `/usr/bin/env`).
> 2. **PR2 is DONE and measured** — `ORACLE-RESULT.md`: the round-trip
> reconstruction oracle, **zero mismatches over 35,946 matched op sites**
> (`:120`).
> 3. **PR2 was never a "drill-down proposer".** That phrase appears nowhere in
> the r2il plans; the PR2 gate deliverable is the round-trip oracle
> (`.claude/plans/r2il-roundtrip-oracle-spec-v1.md:1`). The nearest real
> "drill proposer" is `ruff_python_spo`'s, a different crate and a
> different arm.
>
> Append-only: the wrong text is quoted above rather than deleted, because the
> failure mode — a checklist confidently asserting another repo's state — is
> the exact one this file was created to prevent.

**Actual open item:** **O6** — the attribute-gap / schema-widening decision the
oracle run opened (`ORACLE-RESULT.md`: `MemorySpace` dominates the gap;
unresolved is whether to widen the schema for it, and the shipped
`minimal_pass_one` convention's own coverage). O6 scopes **O5/PR3**, the
`ogar_codebook` classid mint that lance-graph owns. Until PR3 lands, the facet
is an opaque key and must not be persisted as a durable address
(`STAGED-CODEGEN-GUIDE.md:34`, placeholder `PROVISIONAL_R2IL_VARNODE = 0x0000`).

## 5. What this repo does NOT yet contain — measured, not assumed

Expand Down Expand Up @@ -123,10 +151,21 @@ interfaces, no Ghidra core fork required) and the vocabulary is *measured*
- [x] Core vertical slice (D-LGJ-A…AUDIT) — DONE
- [x] SoA substrate W1–W7 — DONE
- [x] Mask-native sweep, ABI minors 5–8 — DONE
- [ ] **D-LGJ-W8 FALSIFIERS** ← the real remainder of the ~90% wave
- [ ] **D-LGJ-W8 POLICY** ← the real remainder of the ~90% wave
- [x] **D-LGJ-W8 FALSIFIERS** — F-HYDR was already shipped as `GraphHopTest`'s
G3 gate (384-byte floor, flat 10-vs-500 rows); F-PARITY's harness
(bench Component G) landed 2026-08-27 **and was measured**. The other
six `F-*` are pre-registered for the COMPUTE wave, not W8 — §12's own
"W8 carries only those marked [W8]" marks exactly two.
- [x] **D-LGJ-W8 POLICY** — discharged at the **A3 freeze (PR #20)**, not last:
§3.9 says the artifacts land "BEFORE workers", and all of them exist
dated 2026-08-18 (root `CLAUDE.md` incl. §13's compute additions,
`EPIPHANIES.md:683` storno, the `STATUS_BOARD` row, `LATEST_STATE`,
`PR_ARC_INVENTORY`). The ladder's `… → FALSIFIERS → POLICY` ordering is
misleading and the board carried it as "remaining" for nine days.
- [x] ~~wave-ghidra-g1-g2~~ — **SUPERSEDED, never dispatch** (ruff PR #94)
- [ ] `ruff_r2il` PR2 → PR3 (upstream, the actual Ghidra/R2IL critical path)
- [x] `ruff_r2il` PR1/O1 (corpus profile) — DONE, measured
- [x] `ruff_r2il` PR2 (round-trip oracle) — DONE, zero mismatches / 35,946 sites
- [ ] `ruff_r2il` **O6** (MemorySpace schema-widening decision) → **O5/PR3** (`ogar_codebook` mint)
- [ ] `wave-ogar-machine-pm1` — blocked behind PR2+PR3 + operator go
- [ ] Any r2il/r2conc binding in this repo — **not started**

Expand Down
1 change: 1 addition & 0 deletions bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Output: `results/jmh-run.txt` (full log, including every warm-up iteration) and
| **D** | *(in C)* | the Vector API arm — same segment, zero copy |
| **E** | `E_FusionAndPlanning` | fused (1 crossing) vs unfused (N crossings), swept over predicate count |
| **F** | *(in E)* | what does building the fluent chain cost, with no crossing at all? |
| **G** | `G_HopExecutionBoundary` | native `lgj_hop` vs the two preserved scalar hop oracles, swept over row count × frontier density (the F-PARITY harness, spec §3.8/§12) |

C and D live in one class on purpose: the question is a comparison, and separate classes would let
a difference in setup masquerade as a difference in execution. E and F likewise share a fixture.
Expand Down
71 changes: 71 additions & 0 deletions bench/RESULTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,77 @@ Three findings, in decreasing order of confidence:
`facetMatchesInto(classId, …)` reuse form is the named follow-up if the small-row gap ever
matters — filed, not assumed to.

## G — the hop: native `lgj_hop` vs the two preserved scalar oracles

The F-PARITY harness (spec §12) and §3.8's pre-registered promotion trigger, run for the first
time. Three arms over `RowStore.openWithEdges`, swept on **both** axes §3.8 asks for — two row
counts × two frontier densities. All three arms are cross-checked to agree on the destination set
in `@Setup`, with an anti-vacuity guard that refuses a fixture whose hop reaches nothing.

Own CSV: `results/jmh-results-G.csv` (this run did NOT merge into the A–F tables — different
fixture, different axes).

| arm | 1 % / 4096 | 1 % / 65536 | 25 % / 4096 | 25 % / 65536 |
|---|---|---|---|---|
| `java_scalar_classidScan` | **8.5 µs** | **150.6 µs** | **204.0 µs** | **7 173.6 µs** |
| `java_scalar_facetMatches` | 394.9 µs | 7 142.3 µs | 433.8 µs | 10 071.5 µs |
| `native_hop` | 479.0 µs | 24 798.3 µs | 521.2 µs | 23 633.9 µs |

### The native arm is the slowest at every configuration — and the shape says why

Not a small margin: **2.6× to 165×** slower than the best scalar arm. But the ratio is the less
interesting half. Look at how `native_hop` responds to the two axes:

- **Flat in frontier density.** 479 → 521 µs at 4096 rows; 24 798 → 23 634 µs at 65 536 — a 25×
bigger frontier costs *nothing*, and at the larger size the denser run is nominally faster.
- **Linear in population.** 4096 → 65 536 rows (16×) takes 479 → 24 798 µs (~52×).

A hop whose cost tracks the population it *ignores* rather than the frontier it *starts from* is
doing full-population work per call. The kernel confirms it — `exports.rs:1589-1599`:

```rust
for facet in 0..ROW_FACETS { // 32 facets
if (effective >> facet) & 1 == 0 { continue }
kernels::simd_rowstore_classid_mask(bytes, …, n, …) // n = ALL rows
for (w, (&sw, &cw)) in src_snapshot.iter().zip(classid_scratch.iter()) { … }
}
```

The classid mask is built across the **whole** population, once per participating facet — 32
full-width sweeps per hop — and only then intersected with `src`. The decode/scatter half is
correctly frontier-bounded; the sweep that precedes it is not. At 65 536 rows that is ~2.1 M
strided classid reads per call before a single edge is decoded.

**This is what the falsifier was pre-registered to find.** §3.8's rule — *"Promotion/demotion of
the placement follows that measurement — never taste"* — now has its measurement, and it points at
a specific, local property of the kernel rather than at the architecture.

### What this does NOT say

- **It is not a verdict on mask-native execution.** The architectural claims are pinned elsewhere
and are unaffected: `GraphHopTest`'s G3 gate pins *allocation* flat against frontier size, and
the no-row-id guarantees are structural. What is measured here is throughput placement, which is
exactly the axis §3.8 says a measurement decides.
- **It is not a clean isolation of the sweep.** `native_hop` also pays one `Engine.createMask` +
close per call, which the scalar arms have no analogue for. That co-factor was not isolated. It
is very unlikely to be the story (a mask allocation cannot plausibly account for 470 µs at 4096
rows, and it would not scale with `rows` the way the data does), but it was not ruled out and is
named rather than waved away.
- **The absolute native numbers are noisy.** ±12 844 on 24 798 µs is 52 % relative error on a
shared 4-vCPU container. The *ordering* is robust — native is slowest in all four configs, by at
least 2.6× — but do not quote the native absolutes to two significant figures.
- **One machine, one run.** Same environment caveat as the rest of this file.

### The obvious remedy is deliberately NOT in this commit

`src_snapshot` is known before the loop, so the sweep could be bounded to the words where `src`
actually has bits, or skipped entirely for a facet whose intersection is empty. That is a kernel
change, and W8's scope for F-PARITY is *"seeds the HARNESS only"* (§12) against a component §3.8
declares non-gating. Landing a kernel rewrite inside a bench commit would widen the PR past what
the measurement authorises. Filed as its own item.

---

## Verdict — where does execution belong?

On the evidence, **not where the architecture currently puts it, for count-only queries.** Stated
Expand Down
Loading