Repository navigation
Backlog
Description
Spec (Drew, 2026-11-23)
Look at piloting a move of mcpx from Go to Rust: what would it take, what would it gain, and are the benefits real? Drew knows there is a lot of work involved; the question is whether the payoff justifies it. This story is a pilot, not a rewrite plan: one hot slice, measured against the Go daemon, with the decision taken from the numbers.
The evaluation doctrine (Drew, 2026-11-23)
- The goal is the most performance and the most capabilities.
- A little more boilerplate, or a couple of extra conditions, are acceptable costs when the trade is a significant performance multiplier.
- Working pattern: keep the standard, compatible choice at the library/SDK boundary (serde is the example — plenty fast for all it does), and in the binary swap the hot path out where a measured multiplier exists.
- The same lens applies everywhere, not just language choice: async runtime, database choice, file formats, indexing, graph/BLAS, ECS for games/simulations/apps.
- A multiplier is proven by benchmark on our own workload, never asserted from folklore.
Prior work and references
- Design mill pass 5: embedding research — ID and mcpx inside fleet #10394 (design mill pass 5) — embedding research: ID and mcpx inside fleet. ID embeds cleanly (Rust in Rust); mcpx being Go is the obstacle this pass circles.
- mcpx: reach a daemon by identity, not by address — iroh, and the Go-binding question it forces #1967 — reaching a daemon by identity (iroh), and the Go-binding question it forces. Iroh is Rust-native; this is where the language question first bites.
- mcpx: embedding mcpx -- a public Go API, the C ABI, WASM, and mcpx as its own upstream #1877 — embedding mcpx via a public Go API, the C ABI, WASM: the non-Rust answers to the same embedding pressure.
- mcpx program — full-investigation prompt: design completion & build-out for the MCP gateway #13264 — the mcpx program investigation; the mcpx book is the surface census: 241 settings, 75 commands in 6 groups, 94 HTTP routes.
- Recorded position (2026-10-28): mcpx pure Go is a strong preference, NOT a tenet — cgo is already accepted when a concrete need justifies it. A Rust pilot breaks no rule.
The pilot
- Choose ONE hot slice of the daemon — the aggregation/proxy request path (JSON-RPC pass-through plus per-client policy evaluation) is the standing candidate; the choice and its reasoning are recorded on this issue before work starts.
- Implement that slice in Rust behind the same config and protocol surface, fed by the same settings file the Go daemon reads.
- Record a representative workload (real session traffic shapes: tool fan-out, large payloads, many small calls) once, replay it against both.
- Measure, both sides: throughput, p50/p99 latency, RSS at idle and under load, cold start, binary size.
- Pre-register the decision thresholds on this issue before benchmarking, so the result decides: proceed to a migration design, keep the slice only where it pays, or stop with the numbers recorded.
What a full move would take (scale honesty)
- The 241-setting config system reproduced byte-faithfully, including the exemption tail and the per-client policy ceilings (id(phase-14) v2 step 1: role configuration — roles as first-class world config (#6301) #8299's line).
- 94 HTTP routes and the daemon/tsnet lifecycle. The hard fork: tsnet is Go. Rust has no tsnet — the options are iroh (mcpx: reach a daemon by identity, not by address — iroh, and the Go-binding question it forces #1967), a retained Go sidecar for the tailnet leg, or an FFI bridge; each is an architecture decision, not a detail.
- The conformance suite carried over as the oracle — it is the asset that makes any port verifiable.
- Release channels and install paths (mcpx: release.yaml, release artifacts and the install channels the docs will promise #1881) re-cut for a static Rust binary.
What it could gain (hypotheses for the pilot to prove or kill)
- Tail latency: no GC pauses on the proxy hot path.
- Footprint: materially smaller idle/under-load memory for an always-on daemon on every seat.
- Distribution and embedding: a static musl binary beside fleet-static, and a direct answer to Design mill pass 5: embedding research — ID and mcpx inside fleet #10394 — mcpx embeddable in the fleet binary instead of proxied around.
- Shared crates with id/atlas/fleet: config, policy, audit, and queue code reused instead of re-implemented per language.
- Headroom: the proxy path stops being I/O-bound folklore and gets measured room to grow (faster JSON, zero-copy framing, runtime choice).
What it would not automatically gain
- Protocol correctness or features — the Go implementation and its conformance record are the current asset.
- Ecosystem velocity — Go's MCP and tailscale ecosystems are first-class today; Rust's are not, yet.
Acceptance
- Pilot slice chosen and recorded, with the recorded workload and pre-registered thresholds.
- Benchmark report posted on this issue: both daemons, same workload, all measures above.
- A decision recorded from the numbers: proceed / slice-only / stop.
- No production cutover under this story; a migration, if any, is its own design that starts from this pilot's evidence.
Metadata
Metadata
Assignees
Labels
No labels
Activity
developing-today commentedon Nov 23, 2026
CODE-5005