Skip to content

Commit 9ca9c94

Browse files
hyperpolymathclaude
andcommitted
chore(l1): record CapnProto.jl decision + all L1 design questions settled
STATE.a2ml [l1-design-decisions]: julia-ipc-library = CapnProto.jl (Option A); UDS path /run/echidna/ipc.sock; no IPC-layer signing; request-response for L1; Chapel locale transit = byte-copy safe. src/julia/ipc.jl: promote Option A to primary path with concrete steps; retain Zig shim reference as fallback of last resort. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b2a2ff7 commit 9ca9c94

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,3 +987,11 @@ known-p0-failure-modes = [
987987
]
988988
recommended-action = "Manually open https://github.com/hyperpolymath/echidna/actions/workflows/live-provers.yml and inspect the most recent scheduled run (triggered 2026-04-26T03:00Z on 757df703). For any red T2 cell: pull the log via 'gh run view <id> --log-failed --job <jobId>', classify against the four P0 failure modes above, and open a GitHub issue titled 'live-provers nightly red: <backend> — <one-line root cause>' (body: run URL, failing step, ~10-line log excerpt, suspected fix). Do NOT open issues for T1 reds."
989989
branch = "nightly-triage/2026-04-26"
990+
991+
[l1-design-decisions]
992+
summary = "L1 Cap'n Proto design questions settled 2026-04-26."
993+
julia-ipc-library = "CapnProto.jl (Option A). Decision: use CapnProto.jl for the Julia-side deserialisation rather than the Zig C-ABI shim. Rationale: idiomatic Julia, schema evolution propagates automatically via regenerated bindings. Risk acknowledged: CapnProto.jl is pre-1.0 and the RPC layer may need patching; patch upstream if required rather than switching approaches. Zig shim (Option B) remains scaffolded in ffi/zig/src/capnp_bridge.zig as a fallback if CapnProto.jl proves unworkable in practice."
994+
uds-path = "Primary: /run/echidna/ipc.sock (overridable via $ECHIDNA_IPC_SOCK). TCP fallback: 127.0.0.1:9090 (overridable via $ECHIDNA_IPC_HOST + $ECHIDNA_IPC_PORT). Both sides (Rust src/rust/ipc/mod.rs and Julia src/julia/ipc.jl) use the same env-var priority order."
995+
handshake-signing = "None at the IPC layer. BLAKE3/SHAKE3-512 integrity is per-solver-binary (src/rust/integrity/), not per-IPC-connection. The IPC channel is local UDS only; no TLS or signing needed."
996+
streaming = "Request-response for L1. Cap'n Proto RPC streaming deferred to L2 when Chapel batching requires it."
997+
chapel-schemas = "Cap'n Proto messages are self-contained byte strings — locale-to-locale transit is byte-copy safe. No special multi-locale handling needed in L1; revisit when L2.5 (multi-locale PGAS) is scoped."

src/julia/ipc.jl

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,22 @@
1919

2020
# ─── TODO: what must land before this stub becomes real ──────────────────────
2121
#
22-
# Option A — CapnProto.jl (preferred if the package reaches stability):
22+
# DECISION (2026-04-26): Use CapnProto.jl (Option A).
23+
#
24+
# Implementation steps:
2325
# 1. Add CapnProto to Project.toml / Manifest.toml.
24-
# 2. Replace gnn_rank_request body with:
26+
# 2. Add a Julia codegen target to the `just capnp-gen` Justfile recipe
27+
# so that `capnp compile -ojulia schemas/echidna.capnp` generates
28+
# GnnRankRequest / GnnRankResponse Julia structs.
29+
# 3. Replace gnn_rank_request body with:
2530
# msg = CapnProto.build(GnnRankRequest, parse_request_fields(request_json))
2631
# write(sock.sock, CapnProto.encode(msg))
2732
# raw = read(sock.sock, CapnProto.ResponseHeader)
2833
# return CapnProto.decode(GnnRankResponse, raw)
29-
# 3. Wire GnnRankRequest / GnnRankResponse structs from generated Julia
30-
# bindings (add a Julia target to the `just capnp-gen` Justfile recipe).
31-
#
32-
# Option B — Zig C-ABI shim (fallback if CapnProto.jl is not viable):
33-
# 1. Build ffi/zig/src/capnp_bridge.zig as a shared library.
34-
# 2. Use ccall to call:
35-
# ccall((:echidna_capnp_gnn_rank, "libechidna_capnp"),
36-
# Cint, (Cint, Ref{EchidnaGnnRequest}, Ref{EchidnaGnnResponse}),
37-
# fd, req, resp)
38-
# 3. The Zig shim handles Cap'n Proto framing and socket I/O; Julia only
39-
# passes/receives C-compatible structs.
34+
# 4. If CapnProto.jl's RPC layer is missing/broken, patch upstream rather
35+
# than switching approaches. The Zig C-ABI shim in
36+
# ffi/zig/src/capnp_bridge.zig remains as a fallback of last resort.
4037
#
41-
# Decision tracked in: docs/handover/TODO.md §L1 design questions
4238
# Gated on: L3 Tier-1 green for ≥ 7 days (same gate as Rust IPC side).
4339
# ─────────────────────────────────────────────────────────────────────────────
4440

0 commit comments

Comments
 (0)