Skip to content

story: pilot moving mcpx to Rust — what it takes, what it gains, measured #13669

Backlog

Description

@dezren39

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

The pilot

  1. 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.
  2. Implement that slice in Rust behind the same config and protocol surface, fed by the same settings file the Go daemon reads.
  3. Record a representative workload (real session traffic shapes: tool fan-out, large payloads, many small calls) once, replay it against both.
  4. Measure, both sides: throughput, p50/p99 latency, RSS at idle and under load, cold start, binary size.
  5. 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)

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.

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions