Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
12 changes: 12 additions & 0 deletions .claude/board/EPIPHANIES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 2026-07-02 — E-1BRC-ORCHESTRATION-SWEETSPOT-1: the sweet spot is the orchestration tier itself — lazy activation + ahead-firing batching flatten the ownership curve (23× recovery at the 64K end)
**Status:** FINDING (measured, onebrc-probe lane H t5; completes the E-1BRC-KANBAN-UPDATE-1 / E-1BRC-OWNER-GRANULARITY-1 arc; operator: "the 65536 mailboxes had no Orchestration at all — find the sweet spot")

t4a's 20× cliff was the FLAT topology: 64K eager spawns, ~63K owner-addressed casts, producers addressing owners directly. Lane H interposes the planner/kanban-executor domain's own two mechanisms — **lazy activation** (router tier spawns an owner only on first traffic: live mailboxes track OCCUPANCY ~413, never the 64K address space) and the **ahead-firing batch writer** (routers buffer per-owner entries, fire batched Applys at batch_k) — over lane G's UNCHANGED one-mailbox-per-SoA substrate, witness discipline intact (owner journals == router casts). t5 medians @4 cores: H(16) 42.2 / H(256) 36.8 / H(4096) 40.2 / **H(65536) 39.4 vs same-session flat 1.7 — 23× recovery, within ~9% of the best coarse topology (G(1) 43.2; F reference 81.7)**. The ruling that closes the arc: **orchestration FLATTENS the granularity curve — ownership granularity becomes a semantic choice (per-tile addressability, per-owner WAL), not a performance gamble. Fine-grained mailbox-as-owner is viable IF AND ONLY IF producers never address owners directly: the router/delegation tier is a LOAD-BEARING part of the kanban-update architecture, and flat fan-out to fine owners is the measured 20× anti-pattern.** graph-flow (rs-graph-llm) remains the OUTER loop by design — task-granularity persisted-cursor orchestration; per-morsel it would measure storage latency, and its in-container build is blocked by the pre-existing burn 403 (W3b). Tables: crates/onebrc-probe/README.md §5.5.
## 2026-07-02 — E-1BRC-OWNER-GRANULARITY-1: one mailbox per SoA (operator correction) — the ownership curve is a plateau then a 20× cliff; Morton tile GROUPING is what makes mailbox-as-owner viable
**Status:** FINDING (measured, onebrc-probe lane G t4a; corrects the framing of E-1BRC-KANBAN-UPDATE-1 — the numbers there stand, the topology language was inverted)

Operator: "I thought we spawn one ractor mailbox per SoA?" — ratified: that IS the canon, and lane G's "sharding the 64K SoA" framing was an ownership inversion (the code's owners were always independent, but each allocated a full 64K-slot table, making the fine-grained end unrunnable). Reworked: each owner's actor State is its OWN `OwnerSoa` sized to its tile span — one mailbox = one SoA, verbatim — unlocking the full granularity sweep including the literal 64K-concurrent-SoAs end. Medians @4 cores: G(1) 43.4 / G(16) 30.3 / G(256) 35.9 / G(4096) 18.3 / **G(65536 = one mailbox per tile) 2.1 Mrows/s — a 20× collapse** vs one owner (64K spawns paid in-run; cast fragmentation ~150→~63K messages as each morsel's ~413 stations scatter to ~413 owners; 64K mailbox tasks on 4 cores). The completed ruling: **the ownership-granularity curve is a plateau (1–256 owners, ~30–43 Mrows/s, topology noise-dominated) then a cliff; one-mailbox-per-semantic-cell is architecturally clean and measurably catastrophic at OLAP arrival rates. Morton tile GROUPING is not an optimization detail — it is the mechanism that makes mailbox-as-owner viable: the mailbox is the OWNER boundary, the tile is the ADDRESS boundary, and they must never be conflated 1:1 under load.** Owners' memory now ∝ span (the collapse is scheduling+messaging, not memory). Tables: crates/onebrc-probe/README.md §5.4a.
## 2026-07-02 — E-1BRC-KANBAN-UPDATE-1: the kanban-update write path measured — 0.54× at morsel granularity, the tax is all boundary, and ownership must not shard below contention
**Status:** FINDING (measured, onebrc-probe lane G t4, same recipe corpus as E-1BRC-ADDRESSING-1; tables `crates/onebrc-probe/README.md` §5.4; operator-requested follow-up "compare morton and the kanban vs without / 64k concurrent SoA vs Morton tile ... when using kanban update")

Lane G holds lane F's Morton-tile 64K SoA as OWNED state behind shard mailbox actors: workers pre-reduce 64K-row morsels (#227's morsel size; ndarray rebased onto master to sit on its merged Morton/morsel probe), cast dirty entries prefix-routed to owners, every applied batch witnessed with a KanbanMove (journal==casts asserted). t4 medians @4 cores: **F 79.5 (private merge, no witness) / G 43.0 @1 shard / 39.9 @4 / 36.0 @16 (one thrash collapse to 11.7); workers=3 strictly worse.** Three rulings for the architecture: (1) **kanban update costs ~0.54×** at morsel granularity and the tax decomposes entirely into boundary costs (Arc corpus copy, blocking+async oversubscription, per-morsel messaging) — the witness itself is ~free (lane E) — buying live bounded-staleness state, witnessed replayable writes, single-writer safety, bounded worker memory; (2) **do not shard ownership below contention** — at ~400 groups ONE mailbox absorbs all apply work and every extra shard is pure scheduling overhead; shard count scales with owner WORK, never with rows; (3) **the Morton prefix ROUTE is free as a mechanism** (G@4 within ~7% of G@1 before thrash) — tile-sharding stays the right tool, its trigger is owner-side contention (high cardinality / heavy per-entry work). W2d consequence: private-merge when the product is one final answer; pay the ~2× only when the product IS the live/witnessed/owned state — and the 550 ms Libet budget is untouched either way.
## 2026-07-02 — E-1BRC-ADDRESSING-1: addressing-is-aggregation measured — route-and-write is 3× the classic map; the Morton dress costs ~10%
**Status:** FINDING (measured, onebrc-probe t0–t3, recipe corpus rows=10000000 seed=42 sha256=f1853caa…5691, 4-core container; tables in `crates/onebrc-probe/README.md` §5–5.3)

Expand Down
57 changes: 57 additions & 0 deletions .claude/v3/INTEGRATION-PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,60 @@ where the win lives (B was 1.06×). All six lanes A–F + R now measured
on one regenerable recipe corpus. Board: E-1BRC-ADDRESSING-1. The probe
is COMPLETE; follow-ups (100M container-scale run, high-cardinality
corpus, SWAR parse, mmap) are priced and parked in README §1/§5.3.

#### Addendum-13 status update (2026-07-02, t4 — lane G, operator follow-up)

Operator: "compare morton and the kanban vs without — if 64k concurrent
SoA vs Morton tile can help us understand the pros and cons of our
architecture when using kanban update." Lane G SHIPPED (feature
`lane-g`): the lane-F Morton-tile 64K SoA as OWNED state behind shard
mailbox actors — prefix-routed morsel casts (64K rows, #227's morsel
size, clear-by-undo extraction), every applied batch witnessed with a
KanbanMove, journal==casts asserted. ndarray checkout rebased onto
master (#227 merged — its Morton scatter/morsel probe is the sibling
reference). t4 medians: F 79.5 / G(1 shard) 43.0 / G(4) 39.9 /
G(16) 36.0 (one thrash collapse 11.7) / G(workers=3) strictly worse.
**Ledger: kanban update = 0.54× at morsel granularity, and the tax is
all boundary (corpus copy + oversubscription + messaging), not the
witness (lane E: journal ~free). It buys live bounded-staleness state,
witnessed replayable writes, single-writer safety, bounded worker
memory. Do NOT shard ownership below contention — at ~400 groups one
mailbox absorbs everything; shards scale with owner WORK, never with
rows; the Morton prefix route itself is free (G(4)≈G(1)).** Tables +
full readings: crates/onebrc-probe/README.md §5.4. Board follow-up
appended to E-1BRC-ADDRESSING-1 thread as E-1BRC-KANBAN-UPDATE-1.

#### Addendum-13 status update (2026-07-02, t4a — topology corrected, curve completed)

Operator correction ratified: **one ractor mailbox per SoA** (canon).
Lane G reworked — each owner's State is its OWN `OwnerSoa` sized to its
tile span (no full-64K tables per owner, no "sharded one SoA" framing);
flush grouping made sort-based (no dense per-shard vecs at 64K owners);
parity test extended to 4096 mailboxes. Full ownership-granularity curve
@4 workers, medians: G(1) 43.4 / G(16) 30.3 / G(256) 35.9 / G(4096) 18.3
/ **G(65536, one mailbox per tile) 2.1 — a 20× collapse** (spawn ×64K +
cast fragmentation ~150→~63K + 64K tasks on 4 cores). **Ruling: the
ownership plateau spans 1–256 owners; Morton tile GROUPING is what makes
mailbox-as-owner viable — mailbox = OWNER boundary, tile = ADDRESS
boundary, never conflate 1:1 under load.** README §5.4a; board
E-1BRC-KANBAN-UPDATE-1 correction appended as E-1BRC-OWNER-GRANULARITY-1.

#### Addendum-13 status update (2026-07-02, t5 — orchestration sweet spot, operator follow-up)

Operator: "the 65536 mailboxes had no Orchestration at all — find the
sweet spot with rs-graph-llm or lance-graph-planner + kanban update."
Lane H SHIPPED (feature `lane-h`): router tier with LAZY owner
activation (live mailboxes track occupancy ~413, never the 64K address
space) + AHEAD-FIRING batched delivery (batch_k=64) over lane G's
unchanged one-mailbox-per-SoA substrate; witness discipline preserved
(owner journals == router casts asserted). graph-flow stays the OUTER
loop (task-granularity cursor; burn-submodule 403 blocks in-container
builds anyway) — the in-loop mechanisms are the planner/kanban-executor
domain's own. t5 medians @4 cores: H(16) 42.2 / H(256) 36.8 / H(4096)
40.2 / **H(65536) 39.4 vs flat 1.7 same-session — 23× recovery, within
~9% of G(1)=43.2; F=81.7.** RULING: orchestration FLATTENS the
granularity curve — the sweet spot is not a shard count, it is the
orchestration tier itself; fine-grained mailbox-as-owner is viable iff
producers never address owners directly (the ahead-firing batch-writer
is load-bearing, not an optimization; flat fan-out = the measured 20×
anti-pattern). README §5.5; board E-1BRC-ORCHESTRATION-SWEETSPOT-1.
9 changes: 9 additions & 0 deletions crates/onebrc-probe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ lane-d = ["dep:ractor", "dep:tokio"]
# the V3 kanban execution machinery (lance-graph-supervisor's KanbanActor +
# drivers, lance-graph-contract's kanban/scheduler/soa_view contract types).
lane-e = ["dep:lance-graph-supervisor", "dep:lance-graph-contract", "dep:ractor", "dep:tokio"]
# Lane G (kanban-update write path): the Morton-tile 64K SoA as owned state
# behind shard mailbox actors, morsel casts witnessed with KanbanMoves —
# ractor/tokio + the contract's kanban types (no supervisor needed: the
# shard owner IS the probe's actor).
lane-g = ["dep:lance-graph-contract", "dep:ractor", "dep:tokio"]
# Lane H (orchestrated fine-grained ownership): router tier with lazy
# owner activation + ahead-firing batched delivery over lane G's
# one-mailbox-per-SoA substrate — same dep set as lane-g.
lane-h = ["lane-g"]

[dependencies]
# AdaWorldAPI fork (workspace P0 rule: fork over crates.io, always — see
Expand Down
Loading
Loading