freepdfeditor/docs/spike-results
ai-ad4 d43d0402b8 feat(spike-E): resolve Cap'n Proto socketpair stall; wire RPC transport (M2 prereq)
The M0 Spike E recorded that Cap'n Proto two-party RPC over an AF_UNIX
socketpair stalled (server processed requests, responses never reached the
client). Root cause, confirmed with a standalone reproduction: EzRpcServer(int
fd, ...) expects a LISTENING socket and calls accept() on it; a socketpair end
is already CONNECTED, so accept() fails with EINVAL and the bootstrap never
completes. Fix: server side uses the low-level path —
LowLevelAsyncIoProvider::wrapSocketFd(fd) + TwoPartyVatNetwork(SIDE_SERVER) +
makeRpcServer(network, bootstrap). The client uses EzRpcClient(fd), which is
designed for an already-connected socket. This is the production M2 transport
shape.

- spike/E_sandbox/DocumentProcess.cpp: low-level TwoPartyVatNetwork server
  over wrapSocketFd; serves DocumentProcess::Server capability with 16 MiB
  payload cap (ADR-0004 bidirectional trust boundary)
- spike/E_sandbox/UIProcess.cpp: EzRpcClient(fd) + parse() RPC; validates
  every response field. ASan caught a use-after-free (ParseResult::Reader
  outliving its Response) — fixed by validating inside the Response scope
  (validates §7.2 sanitizers-from-day-one)
- spike/E_sandbox/Sandbox.cpp: allow ioctl (FIONBIO) — KJ's wrapSocketFd sets
  non-blocking mode via ioctl; strace identified it as the denied syscall
- spike/CMakeLists.txt: Cap'n Proto via pkg-config (the Debian CMake config
  hard-requires libatomic via a check that fails on x86-64 where it isn't
  needed); schema compiled with the capnp tool + --src-prefix
- docs/spike-results/0004: record the resolution; gate still MET (1000/1000
  under seccomp, ~58us avg; ASan-clean with sandbox disabled — ASan's pipe2
  conflicts with the seccomp allow-list, an ASan-only artefact)
2026-07-27 10:54:21 +00:00
..
0001-spike-a-verbatim-roundtrip.md build(license): convert dep5 to REUSE.toml; record Spike A result 2026-07-25 20:30:43 +00:00
0002-spike-b-reconstruction.md feat(spike-B): reconstruction pipeline; F1=0.963 on synthetic corpus (§14 step 5) 2026-07-25 20:38:24 +00:00
0003-spike-c-subset-growth.md feat(spike-C): hb-subset font growth; new glyph renders (§14 step 6) 2026-07-25 20:41:02 +00:00
0004-spike-e-sandbox.md feat(spike-E): resolve Cap'n Proto socketpair stall; wire RPC transport (M2 prereq) 2026-07-27 10:54:21 +00:00
0005-spike-d-deferred.md docs(spike-D): record deferral — needs PDFium+Skia build (§14 step 7) 2026-07-25 20:53:52 +00:00
0006-spike-b1-glyph-unicode.md feat(spike-B1): glyph→Unicode ladder on real embedded font; 98% coverage (§4.1 step 1) 2026-07-25 20:57:02 +00:00