The frozen native line
Condensed from Design 0119 (2026-10-16), Design 0320 (2026-10-26), and Design 0357 (2026-11-08). Over 340 records in the companion repository (0009–0356) belong to this experimental P3 “native” line, which was frozen on 2026-11-08 when the project adopted the MVP goal. The 2026-11-08 status review explains why.
Goal of the native line
After freezing the P0–P2 single-primary candidates on 2026-10-08, the experimental P3 line explored whether a gateway could precharge and bound every byte of memory and I/O before admitting a request—covering PostgreSQL wire frames, TLS handshakes, Go runtime cold start, garbage-collection workers, and Linux kernel task/socket allocations—under a fixed three-part ledger (32 MiB Raw, 15 MiB Work, 32 MiB Backing).
Under that strict rule, native connection admission (Native CLOSED) remained disabled as long as any cold-start, runtime, or kernel resource category had an unproved upper bound (Known0).
Four phases of research (records 0009–0356)
| Records | Area | What was built and tested |
|---|---|---|
0009–0026 | Custom wire and TLS transport | Fixed-extent Linux TCP socket handling, PostgreSQL SSLRequest framing without plaintext fallback, DER certificate validation, and preallocated TLS record and PostgreSQL StartupMessage / SELECT packet banks |
0031–0118 | Staged capture engine | Staged SQL transaction engine (Before probe, Target primary check, application Execute/TailV2, sole COMMIT, and After diagnostic query), preallocated 1,024-slot I/O books, and Patroni readiness/pidfd shutdown polling |
0119–0318 | Custom Go 1.27 runtime accounting | Custom Go runtime overlays (ABI V1 through V47) tracking cold-start M0 bootstrap allocations, procresize P/M births, g0/gsignal stack spans, mheap page-table levels, and GC worker nodes |
0319–0356 | Linux kernel resource accounting | Source review and isolated guest instrumentation of Debian Linux 6.12.111-1 kernel allocation and retirement paths (alloc_pid, idr_preload, __radix_tree_preload, SLUB caches, and RCU teardown) |
Runtime and shared-kernel accounting boundaries
Two findings showed why exact precharge accounting cannot be closed purely inside a gateway process on a standard runtime and OS kernel:
- Cold-launch
GOMAXPROCS(P) history (Design 0119): The Go runtime does not destroy per-PGC worker goroutines whenGOMAXPROCSdecreases. In candidate1464/v1, a process whosePhistory moved7 -> 11 -> 5 -> 2retained11worker nodes (5,632attributed bytes), whereas point observations of the launch setting (7), firstGOMAXPROCSreturn (5), and currentP(2) only declared7. Point observations at startup cannot certify an unobserved intermediate peak. - Shared Linux kernel caches and RCU retirement (Design 0320): Reviewing Debian kernel
6.12.111-1(1637/kernel-model-v1) showed thatalloc_pidcallsidr_preloadper PID namespace level, and__radix_tree_preloaddrops its local lock around each allocation while refilling a per-CPU radix-node pool that concurrent nonblocking operations can consume. That preload path strips__GFP_ACCOUNTon a slab cache withoutSLAB_ACCOUNT, bypassing SLUB memcg charging. On teardown, PID release and task-stack reclamation wait for asynchronous RCU callbacks and per-CPU caches, sowait4()completion and cgroup counter drops do not prove physical page release. Closing that boundary would require a custom kernel ABI outside PostgreSQL and the Go gateway.
Why the native line was frozen (Design 0357)
Because requiring a custom Go runtime overlay and a custom Linux kernel accounting ABI prevented shipping a usable etcd-on-PostgreSQL gateway, Design 0357 froze the entire P3 native line on 2026-11-08:
- All P3 candidate trees are preserved as research material and are disabled in the default gateway build.
- The MVP candidates (
v0.1.0-rc1,v0.1.0-rc2) build directly from the root Go 1.27.3 source tree andpg_etcdC extension, enforcing request, stream, and revision budgets at the protocol and SQL boundaries while relying on standard PostgreSQL 18 and OS resource management. See Status and Releases.
