Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
546b17a
Core vertical slice: docs/abi.md contract, native/lgj-abi, Java facade
AdaWorldAPI Aug 17, 2026
a1e65cc
Merge main (bootstrap commit) into dev branch to establish shared his…
AdaWorldAPI Aug 17, 2026
bdd40b2
Valhalla lab: three-truths method, causal isolation, 3 real reproducers
AdaWorldAPI Aug 17, 2026
317ee83
Merge main (squash of PR #1) to fix history divergence for PR #2
AdaWorldAPI Aug 17, 2026
ea4753c
Merge main (squash of PR #2) to keep dev branch history aligned
AdaWorldAPI Aug 17, 2026
4ab0da8
Vector API bench: real JMH, cross-checked; the crossing does not alwa…
AdaWorldAPI Aug 17, 2026
96eccff
Merge main (squash of PR #3) to keep dev branch history aligned
AdaWorldAPI Aug 17, 2026
cd7782b
Phase I synthesis docs + fusion-sweep 256-row re-run + board hygiene
AdaWorldAPI Aug 17, 2026
ddeaecb
Merge main (squash of PR #4) to keep dev branch history aligned
AdaWorldAPI Aug 17, 2026
e4463cb
Board: PR #4 arc entry (post-merge)
AdaWorldAPI Aug 17, 2026
e8b6dc2
SoA row store: 512B rows, 32 facet lanes, ABI minor 2 (W1+W2)
AdaWorldAPI Aug 17, 2026
aff72f3
Merge main (squash of PR #5) to keep dev branch history aligned
AdaWorldAPI Aug 17, 2026
8fceaca
Board: PR #5 arc entry (post-merge)
AdaWorldAPI Aug 17, 2026
91e22f3
Knowledge: assess the archived layout-bridge discussion; name W6
AdaWorldAPI Aug 17, 2026
6927961
Plans: OGAR Machine (exploratory) + lance-graph-hydrate dependency note
AdaWorldAPI Aug 17, 2026
7e218ed
Merge main (squash of PR #6) to keep dev branch history aligned
AdaWorldAPI Aug 17, 2026
9cc85ad
Board: PR #6 arc entry (post-merge)
AdaWorldAPI Aug 17, 2026
f3bbab7
Waves calcified: dispatch maps for every plan; Ghidra plan from real …
AdaWorldAPI Aug 17, 2026
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
46 changes: 46 additions & 0 deletions .claude/board/EPIPHANIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,52 @@
> `**Status:**`/`**Confidence:**` line. A correction gets its own new,
> dated entry that references the one it corrects — the storno rule.

## 2026-08-17 — E-LGJ-CALCIFY-THEN-DISPATCH-1

**Status:** DOCTRINE (operator-ruled: "don't execute the consumer plans yet,
just calcify the insights and make sure the muscle memory of the epiphanies
helps to gain momentum"). **Confidence:** High.

The working rhythm this repo now runs on, made explicit so it compounds
instead of being re-derived:

**plan → wave map → (shelf) → dispatch → gates → merge → arc entry**

A *plan* says what and why. A *wave file* (`.claude/waves/`) says exactly
who edits which file under which verbatim guardrails, with which disable-runs
and gate commands — dispatchable as-is, months later, by a session with zero
shared context. Writing the wave map WITHOUT executing it is not deferral;
it is the calcification step: decisions get made while the context is hot
(worker scopes, D1-style design forks, STOP triggers, the graph wave's
discovery that the fixture payload is PRNG noise and traversal needs a
deliberate edge-bearing generator arm — found at MAPPING time, not
mid-dispatch), and execution later starts from momentum instead of from
archaeology.

**The muscle memory, in one list** (each item earned at least once this
session, provenance in the entries below and in PR bodies #1–#6):

1. **Disable-run or it didn't happen.** Green tests prove nothing about a
guard; break the thing, watch exactly the right tests go red, restore.
2. **Scaffolding-vs-target check.** When a proposal doesn't fit the code,
ask which one is the placeholder before declining the proposal.
3. **The membrane never grows from the consumer side.** A needed symbol
goes back through the wave process (now stamped in every consumer wave).
4. **Measure before believing direction** — the Vector API beat the
crossing; fusion was noise at 65K rows and 3× at 256; the doc that
assumed otherwise got corrected by the bench, not vice versa.
5. **Independent recomputation over golden blobs** — parity tests
transcribe the generator; two (better: three) independent paths to one
number.
6. **Assessments happen once, on the record** — archived discussions get
one knowledge-doc verdict (kept/pinned-wrong) so they are never
re-mined or cited naively.
7. **Exact-span over round-up** at every boundary a segment can be built
from (the `byte_len` lesson — the difference between a view and an
out-of-bounds capability).
8. **Board in the same commit** as the work it records; arc entry at
merge; realign after every squash.

## 2026-08-17 — E-LGJ-THE-MIDDLE-TIER-IS-DELETED-NOT-WRAPPED-1

**Status:** DOCTRINE (operator-stated, scope confirmed). **Confidence:** High —
Expand Down
26 changes: 26 additions & 0 deletions .claude/board/LATEST_STATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## 2026-08-17 (latest) — waves calcified, Ghidra plan grounded, NOTHING dispatched

Operator ruling: consumer plans are **calcified, not executed** — insights
locked in while hot, execution starts from momentum later. Rhythm now
explicit in `E-LGJ-CALCIFY-THEN-DISPATCH-1` (plan → wave map → shelf →
dispatch → gates → merge → arc).

- **`.claude/waves/`** created: README (standing rules + the verbatim
worker preamble) + six dispatchable wave maps — substrate W3+W4 (the
only one marked READY; W3 is still the next action), three consumer
waves (DO-NOT-DISPATCH), Ghidra G1+G2 (shelved), OGAR-Machine P-M1
(BLOCKED, 4-condition gate incl. explicit operator go).
- **`ghidra-integration-v1.md`** written from REAL archaeology against
the fresh clone (`/workspace/ghidra`, 12.2 DEV, Java 25+): the true
P-code op set is **74 opcodes** (not the sketch's ~13); Ghidra ships
its own sequential `PcodeEmulator` — upgrading the OGAR-Machine oracle
story to reference-implementation parity (the tesseract-rs method);
`Toy` processor = the minimal lift target; `SymbolicSummaryZ3` = the
in-tree precedent for the far-future branch-population direction.
- **Mapping-time discoveries** (the payoff of calcifying): the graph
consumer needs a deliberate edge-bearing generator arm (fixture payload
is PRNG noise) — a substrate change, flagged before anyone hits it
mid-dispatch; the graph hop has a real design fork (D1a Java-side
scatter via WRITABLE mask words / D1b native `lgj_hop`, minor 3) with
ruling guidance recorded.

## 2026-08-17 (Slice 2) — the SoA row store is REAL: ABI minor 2, W1+W2 shipped

**The reframing that started it** (operator, three directives): the flat
Expand Down
22 changes: 22 additions & 0 deletions .claude/board/PR_ARC_INVENTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@
> anti-pattern the imported board rules name. Backfilled below in one
> pass rather than left stale; PR #4 onward gets its entry at merge time.

## PR #6 — layout-bridge assessment, OGAR Machine plan, hydrate note (merged 2026-08-17, squash `8954e53`)

- **Added:** `.claude/knowledge/prior-art-and-the-layout-bridge-claim.md`
(the first archived ChatGPT context assessed once: convergent
confirmation; kept the callability-vs-shared-executable-layout
positioning + the schema-key extractable + the baseline-dependent
claims discipline; pinned its three errors so it is never cited
naively); `.claude/plans/ogar-machine-v1.md` (the second context — a
genuinely NEW workload: population emulation, one row = one machine
state, Ghidra P-code as guest ISA, differential migration testing;
EXPLORATORY, gated on W3 + a W5 example + archaeology + probe P-M1).
- **Locked:** W6 named in the substrate plan (schema/classid field on the
descriptors when ClassView lands); lance-graph #957's
`lance-graph-hydrate` recorded as the INHERITED hydration path — never
re-derived here (#958 is its hardening fast-follow, owned elsewhere).
- **Deferred:** everything in ogar-machine-v1 (named, not scheduled).
- **Docs:** the PR IS docs; `AdaWorldAPI/ghidra` attached + shallow-cloned
at `/workspace/ghidra` for the future P-code archaeology.
- **Confidence:** High for the assessments (checked against shipped code
and measurements); the OGAR Machine plan is explicitly exploratory.
Both bot reviewers hit usage limits and did not run.

## PR #5 — SoA row store: 512B rows, 32 facet lanes, ABI minor 2 (merged 2026-08-17, squash `78aa60e`)

Companion: **AdaWorldAPI/ndarray#279** (W1), merged first — `lgj-abi`'s
Expand Down
90 changes: 90 additions & 0 deletions .claude/plans/ghidra-integration-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# ghidra-integration-v1 — the P-code front end and the parity oracle

> **Status: PLANNED** (2026-08-17). Companion to `ogar-machine-v1.md` —
> that plan owns the population-execution side; this one owns the Ghidra
> side: how a legacy binary becomes a normalized program image, and how
> Ghidra's own emulator becomes the parity oracle. G0 (archaeology) ran
> against the real clone before this plan was written; every path and
> number below is verified, not sketched.

## G0 — archaeology (DONE 2026-08-17, against `/workspace/ghidra` @ `52bb03d`)

`AdaWorldAPI/ghidra` is a fork of upstream at **12.2 DEV**
(`Ghidra/application.properties`), minimum **Java 25**, Gradle ≥ 9.1 —
our JDK 26 toolchain covers it.

| fact | where | why it matters |
|---|---|---|
| **74 real P-code opcodes** (`CPUI_COPY = 1` … `CPUI_MAX = 75`) | `Ghidra/Features/Decompiler/src/decompile/cpp/opcodes.hh:37-131` | The discussion's ~13-op sketch was a fraction; the real normalized ISA is 74 ops (arithmetic incl. signed/unsigned compares, zext/sext, FLOAT_* family, MULTIEQUAL/INDIRECT decompiler ops). The population interpreter implements a **subset** and must halt loudly on the rest — see op-set discipline below |
| Java-side opcode mirror | `Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/PcodeOp.java` | The lift script reads ops through this surface (`Instruction.getPcode()`) |
| Headless entry point | `Ghidra/RuntimeScripts/support/analyzeHeadless` (+ `analyzeHeadlessREADME.md`) | Lifting is a batch job: import binary → analyze → post-script → exit. No GUI anywhere in the loop |
| **In-tree P-code emulator** | `Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/emu/` (`PcodeEmulator`, `PcodeMachine`, `BytesPcodeThread`, `DefaultPcodeThread`…) | **The parity oracle.** Ghidra ships a sequential reference execution of exactly the IR we will population-execute — the same role libtesseract played for tesseract-rs. We never have to *invent* ground truth |
| `Toy` processor | `Ghidra/Processors/Toy` | A teaching ISA with full SLEIGH spec — the smallest possible lift target for G1, before any real x86 binary |
| ~39 processor modules incl. x86, AARCH64, RISCV, JVM, Z80, 68000 | `Ghidra/Processors/` | The "don't implement x86" promise is real: every guest ISA arrives through SLEIGH, and the OGAR Machine sees only the one 74-op IR |
| Symbolic extension precedent | `Ghidra/Extensions/SymbolicSummaryZ3` | The "carry both branch populations" far-future direction has an in-tree symbolic P-code precedent to study first — do not design that from scratch |

License note: Ghidra core is Apache-2.0 (compatible with everything in
this stack); the `GPL/` subtree (demangler etc.) is not needed for
lifting and stays untouched.

## The integration shape — two roles, both offline

```
legacy binary ──analyzeHeadless + post-script──▶ normalized program image (LE file)
┌────────────────────────┤
▼ ▼
Ghidra PcodeEmulator OGAR Machine population path
(sequential ORACLE) (rows = machine states)
│ │
└──────── parity ────────┘
```

1. **Ghidra as lift-time compiler.** Runs ONCE per binary, offline. Never
at OGAR-Machine runtime — the same footing tesseract-rs gives its C++
oracles ("only the oracle's link deps, never in the Rust path").
2. **Ghidra as parity oracle.** `PcodeEmulator` executes the same program
sequentially; the population path must match it bit-for-bit per world.
This is the tesseract-rs byte-parity method transplanted: we diff
against the reference *implementation*, not against our own scalar
rewrite alone (which stays as the second, independent check).

## Waves

| wave | deliverable | falsifier |
|---|---|---|
| **G1 — lift proof** | An `analyzeHeadless` post-script (lands in the ghidra fork, `ghidra_scripts/`) that walks one function of a **Toy**-ISA test binary and dumps every instruction's `getPcode()` sequence to a deterministic text form | The dump's opcode mnemonics/order for that function match the decompiler's own listing view of the same function — two independent Ghidra surfaces agreeing, not one surface trusted |
| **G2 — the image format** | A versioned LE program-image format (header + op records: `opcode u32` + varnode triples `(space u32, offset u64, size u32)` for output/inputs) + a Rust loader in a NEW crate (NOT `lgj-abi` — the membrane stays lean; the loader is a consumer-tier crate) | Round-trip (emit → load → re-emit byte-identical); a hand-built image of known ops decodes to exactly those ops; a truncated/garbled image is refused with a status, never partially loaded |
| **G3 — probe P-M1** (shared gate with `ogar-machine-v1.md`) | Population interpreter over a deliberately small op subset (COPY, INT_ADD/SUB/AND/OR/XOR, INT_EQUAL/LESS, CBRANCH, BRANCH, RETURN), one hand-written program, 64K input worlds over the row store | Bit-identical final states vs an independent scalar Rust interpreter; planted-divergence two-sided test (one known behavioral difference between two program variants → the divergence mask finds exactly that world set) |
| **G4 — oracle parity** | The same image through Ghidra's `PcodeEmulator` (JVM side, sequential, N sampled worlds) vs the population path | Final machine state bit-identical per sampled world; a deliberately mis-implemented op (disable-run) must be CAUGHT by the oracle diff |

Sequencing: G1 is independently startable (pure Ghidra-side, no OGAR
Machine code). G2 depends on G1's real dump shape. G3/G4 are gated
exactly as `ogar-machine-v1.md` gates them (W3 + one W5 example shipped
first). One wave = one PR, gates central, per house style.

## Op-set discipline (the falsifiability rule applied to an ISA)

74 opcodes exist; the interpreter implements a declared subset. Any op
outside the subset must **halt that world loudly** — a per-row status
lane recording "unimplemented op X at cycle N" — never skip, never
best-effort. A world that halted is excluded from parity comparison *and
counted*, so "we handled the corpus" can never silently mean "we skipped
the hard ops." (Same family as tesseract-rs's "a guard that cannot fire
is the defect one level up.")

## Boundaries (so drift is visible)

- **No Ghidra at OGAR-Machine runtime.** Lift-time + oracle-time only.
- **No second object model.** The image loader emits ops + varnodes into
lanes; it does not grow a Rust AST of P-code (the Core-first lesson —
the substrate is the model).
- **Guest RAM stays dense** (ogar-machine-v1 rule 3); varnode SPACE ids
are how register-lane vs memory-page routing is decided at execute
time.
- **Fork discipline:** the lift script and any exporter live in the
`AdaWorldAPI/ghidra` fork; whether G1 *runs* against a fork build or a
released Ghidra distribution is a cost decision made at G1 time (the
fork build needs JDK 25 + Gradle 9.1 — available here, but a release
binary may be cheaper; the fork remains the source of truth either
way).
14 changes: 10 additions & 4 deletions .claude/plans/ogar-machine-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ CALL, RETURN, INT_ADD/SUB/MULT/AND/OR/XOR, …); the OGAR Machine executes
P-code only. `legacy.exe → Ghidra (once) → normalized program image →
population execution`. This is the same shape as the workspace's
ruff→OGAR harvest arms: an existing analyzer becomes the transcoder
front-end, and the substrate executes the normalized IR. First concrete
archaeology step in the fresh clone: locate the P-code opcode enum and
SLEIGH lifting surface, and size the *real* op set (the list above is the
discussion's sketch, not a verified inventory).
front-end, and the substrate executes the normalized IR.

**The archaeology ran — see `ghidra-integration-v1.md` G0** (2026-08-17):
the real op set is **74 opcodes** (`opcodes.hh`, `CPUI_MAX = 75`), not the
sketch's ~13; the fork is 12.2 DEV / Java 25+; `analyzeHeadless` is the
lift entry; and Ghidra ships its own sequential `PcodeEmulator`
(`Ghidra/Framework/Emulation/.../pcode/emu/`) — which upgrades this plan's
oracle story from "our own scalar reference" to "diff against the
reference implementation," the tesseract-rs method. Wave detail, image
format, and op-set discipline live in that companion plan.

## The four load-bearing design rules captured from the discussion

Expand Down
53 changes: 53 additions & 0 deletions .claude/waves/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Execution waves — agent-dispatch maps, one per plan

> A **plan** says what and why; a **wave file** says exactly who edits
> which file, in what order, under which guardrails, and which command
> gates it. A wave file must be dispatchable as-is: the orchestrator
> copies worker briefs out of it verbatim.

| wave file | plan it executes | dispatch state |
|---|---|---|
| `wave-substrate-w3-w4.md` | `lgj-soa-substrate-v1.md` (W3 Java facade, W4 bench) | **W3 READY** — next action |
| `wave-consumer-trades.md` | `consumer-world-trades-v1.md` | gated on W3 |
| `wave-consumer-bricks.md` | `consumer-bricks-analytics-v1.md` | gated on W3 |
| `wave-consumer-graph.md` | `consumer-graph-traversal-v1.md` | gated on W3 (+ possible W6 ABI wave) |
| `wave-ghidra-g1-g2.md` | `ghidra-integration-v1.md` (G1 lift proof, G2 image format) | G1 independently READY |
| `wave-ogar-machine-pm1.md` | `ogar-machine-v1.md` (probe P-M1 / G3+G4) | BLOCKED (gate list inside) |

## Standing rules, inherited by every wave (do not restate per file)

1. **Model policy:** orchestrator + anything synthesizing across sources =
Opus-tier; bounded one-source-in/one-shape-out work = Sonnet workers.
Never Haiku.
2. **Workers never run build tools or git.** No `cargo`, no `javac`, no
`java`, no `git`, no worktrees. Edit-only. The orchestrator compiles,
tests, lints, commits — centrally, once (`agent-cargo-hygiene.md`).
3. **Disjoint file ownership.** Two workers in one file is a lost-write
race. Shared files (module wires, `AllTests`, build scripts, board
files) are ORCHESTRATOR-ONLY and are edited after workers land.
4. **Every worker brief carries the verbatim preamble** (below) plus its
file scope and STOP triggers. A spawn without it is a protocol
violation.
5. **A wave is done when its gate table is green AND its disable-runs ran
red-then-green** — never when workers report success ("completed" is a
process status, not a quality status).
6. **One wave = one PR** (cross-repo waves: one PR per repo, merge order
stated in the wave file). Board updates land in the same commit.

## The verbatim worker preamble (copy into every brief)

```
You are an edit-only worker. HARD RULES:
- Do NOT run cargo, javac, java, git, gradle, or any build/VCS command
— not once. The orchestrator compiles and tests centrally.
- Do NOT create worktrees, branches, or commits.
- Edit ONLY the files listed under YOUR SCOPE. Files under OTHER AGENTS
or ORCHESTRATOR-ONLY must not be touched, even for a one-line import.
- Do not claim code compiles or tests pass — you did not run them.
Report what you WROTE, plus anything you could not resolve.
- Read .claude/board/LATEST_STATE.md and the knowledge docs named in
your brief BEFORE writing. Do not write to any board file.
- STOP and report instead of improvising if: a symbol/type you need does
not exist; the contract (docs/abi.md) seems to disagree with code; or
your task requires touching a file outside your scope.
```
Loading