>
Developer

What it actually took to port the Copilot runtime to Rust

There is a story going around about a Microsoft product surface being ported from a managed runtime to a compiled systems language. Most coverage collapses the story to a single number, and that is where the wrong lessons come from. The number is real. The work happened. The lessons people draw from it are mostly the lessons they wanted to draw before they read it.

I want to spend some time on what is actually going on under the headline, because the takeaways most writeups pull from this kind of story are the takeaways that mislead you the most when you try to apply them in your own shop.

The headline is the wrong thing to remember

The story I keep seeing is shaped like this: a senior engineer at a big company used an AI assistant to rewrite a large piece of infrastructure in a few months. The number attached to it is striking. So is the speed. So is the suggestion that a single person, working with an AI pair-programmer, can do work that previously required a team.

All three of those facts are true. None of them is the lesson.

The lesson is that the team in question shipped the rewrite incrementally, while the rest of the product kept moving, while customers never noticed the migration happening underneath. That is the engineering move that actually matters. The speed is downstream of the cadence. The single-developer framing is downstream of the fact that the new code landed in many small pieces rather than one big one.

If you take the headline at face value, you will end up thinking “AI made a big rewrite cheap.” If you look at the cadence, you will end up thinking “incremental delivery made a big rewrite feasible.” The second framing is closer to true, and it is the framing that lets you reproduce the result in your own work.

Why shared runtimes are suddenly everyone’s problem

The reason this particular port mattered, and the reason it landed inside Microsoft rather than as a standalone open-source rewrite, is the shape of modern AI features. A few years ago, an AI product was usually a single surface. A chat box. A code completion tool. A search bar that summarized answers. Each of those was a single product with a single team, and each team could choose its own runtime.

That is no longer the shape of the field. The same underlying AI capability now has to show up in dozens of products that share an account system, a permissions model, a security boundary, a performance budget, and a distribution channel. Each consumer wants the capability to be fast, small, safe, and consistent. None of them want to maintain their own implementation of the harness underneath.

That pushes the work into a shared layer. Once the harness is a shared layer that ships inside other apps, the constraints shift. Latency on the hot path matters more, because the runtime is now embedded in someone else’s user-facing flow. Memory inside another process matters more, because you are competing for the user’s RAM with everything else that process is doing. Security surface area matters more, because the runtime has access to whatever the host app can see. Distribution size matters more, because every consumer has to bundle it.

Those are the constraints that drove the rewrite, not a stylistic preference for a particular language. The language choice follows from the constraints. The constraints follow from the shared-layer architecture. The shared-layer architecture follows from the fact that AI capability is now a product primitive, not a feature.

What the cadence actually buys you

The interesting engineering decision was not the language. It was the shape of the delivery. The team did not freeze the runtime, take six months, do the rewrite, and swap it in. They landed the work as a steady stream of small changes that each shipped to users. Each change was small enough to review in a sitting. Each change had its own tests. Each change shipped to production behind the same release process the rest of the product uses. The product kept moving the entire time.

That cadence is what makes a large language port safe. Without it, you have a single huge change that touches every layer of the runtime, that nobody can fully review, that lands in one big batch with all of its regressions at once. With it, you have a series of changes that each one or two reviewers can hold in their head, that each ship behind the same rollback mechanisms the rest of the product already uses, that each surface a regression early while there is still time to fix it.

The technique is not new. Feature flags, strangler-fig migrations, and incremental database rollouts have been around for a decade. What is new is the cost structure. AI-assisted authoring makes the per-change work cheap enough that the cadence strategy becomes worth doing for ports that would not have been worth doing before. You do not need a team-year of engineering effort to deliver a thousand small changes when the assistant does the typing and you do the reviewing.

What “AI wrote it” actually means in practice

The phrase “most of the code came from the assistant” is the part of the story that gets quoted most often, and it is also the part that does the most damage when readers take it at face value.

The assistant generated most of the source. A human reviewed every line. The human owned the architecture. The human decided what tests needed to pass, what the public contract had to look like, and what edge cases the implementation had to handle. The assistant was a very fast junior engineer who never got tired and never forgot the syntax, and the human was the senior engineer who decided what the junior engineer should be building.

Without strong review, strong tests, and someone who owns the architecture end to end, the same volume of code becomes the same volume of technical debt. With those things in place, the same volume of code lands safely. The win is not zero human cost. The win is that the cost of the typing collapsed. The cost of the reviewing did not.

The framing I would push back on is the one that reads “AI replaced a team.” The framing I would push toward is “AI made a port possible that used to be priced out of reach.” The two framings predict different futures. The first one mostly predicts arguments about who is doing real work. The second one predicts what you can actually ship next quarter.

Trade-offs

Before you do anything else, measure. Latency on the hot path is one number. Cold start is another. Memory under load is a third. Distribution size for downstream consumers is a fourth. If those numbers are already fine for your use case, the port is not worth doing. If the number is the reason you are thinking about this in the first place, the cost of getting out of that hole may now be much lower than it used to be.

Four framings worth holding onto:

  • Shared infrastructure beats per-product reinvention when the foundation has to keep pace with the field.
  • The cadence pattern that makes large rewrites safe is now within reach for ports that used to be out of reach, because AI-assisted authoring dropped the per-change typing cost.
  • The review cost is not zero. Every line still has to land in front of a human who owns the architecture.
  • “Not feasible to port” is a temporary sentence. Constraints that ruled out a rewrite last year may not exist this year, and what was priced out of reach may now be within reach.

The trade-off is real. AI-written code at this scale needs strong review, strong tests, and a human owner. The headline number is the cheap part. The expensive part has not gotten any cheaper.

What I am taking away from this

If you maintain a service that is now shipping inside other apps, the question is not whether to rewrite. The question is whether the cost shape of a rewrite has changed enough to make the rewrite worth considering. A year ago, the answer was almost always no. Today the answer is sometimes yes, when the new language gets you out of a hot-path performance hole and when you can deliver the change as a stream of small pull requests instead of one big one.

The headline takeaway from this story is not “AI makes large rewrites cheap.” It is “the cadence strategy that has always made large rewrites safe is now cheap enough to actually do, because AI assistance has dropped the per-change authoring cost.” Those are different claims. The first one overstates what the tools can do. The second one is what the work actually showed.

If you want to use the lesson, the move is to look at your own stack and ask which of your systems is currently embedded inside other apps and is now showing its age on latency, memory, or distribution size. Pick one. Measure the actual numbers. Decide whether the cost of getting out of that hole is worth the disruption of changing it. If the answer is yes, plan the work as a stream of small pull requests, and budget for the human review cost, which has not gotten any cheaper.

Leave a comment