ELSEIF
Your brief EB
310 stories from 200 feeds 1253 clusters Refreshed 6 minutes ago next pull 14:21

LANGUAGES Signal 253

Microsoft ports Copilot runtime to Rust using AI agents for $120K

Microsoft migrated the Copilot runtime from TypeScript to Rust using AI agents, achieving a 15.9x speedup and significant memory reduction at a cost of approximately $120,000 in token usage.

WHY IT MATTERS

The migration demonstrates that AI agents can handle large-scale language ports, though they still struggle with Rust-specific regressions. The performance gains in startup time and memory density address critical bottlenecks for embedding Copilot in diverse Microsoft products. This case study provides concrete data on the cost and complexity of using LLMs for production-grade code translation.

Written by elseif from the cluster below · every claim links back to a source

The three things worth knowing

01

The port converted 430,000 lines of TypeScript into 800,000 lines of Rust over 14.5 weeks, with agents handling most of the work.

02

Benchmarking showed the Rust implementation completed 120 session lifecycles per second compared to 7.55 for TypeScript, while reducing memory usage from 1,383 MB to 126 MB.

03

Managers had to address a few dozen regressions, highlighting that AI agents still face challenges in fully understanding Rust's type system and semantics.

THE READ

What the cluster adds up to.

ORIGINAL ANALYSIS

Microsoft has completed the migration of the Copilot runtime, the engine behind GitHub Copilot and various Office applications, from TypeScript to Rust. The project was executed primarily by AI agents, which converted 430,000 lines of TypeScript into 800,000 lines of production Rust. This shift was driven by the need for lower startup overhead and predictable resource usage, requirements that the previous Node.js and V8-based implementation struggled to meet at scale.

The performance impact of the migration is substantial, particularly in high-concurrency scenarios. In a benchmark involving 1,000 one-turn session lifecycles with 100 concurrent pipelines, the Rust version achieved 120 lifecycles per second, a 15.9x improvement over the TypeScript version's 7.55. Memory consumption also dropped dramatically, with a 10-client batch using only 126 MB in Rust compared to 1,383 MB in TypeScript, largely because the Rust implementation runs in-process rather than spawning external background processes.

The cost of this migration was approximately $120,000 in AI token usage, supplemented by about three weeks of developer time. The process spanned 14.5 weeks and involved over 135 releases, with roughly 1.3 port pull requests opened per day. While the agents handled the bulk of the conversion, the project was not without friction; managers had to deal with a few dozen regressions, indicating that AI agents still require human oversight to ensure correctness in complex Rust codebases.

The workflow revealed unexpected behaviors in the AI agents, such as spending more time gathering information and coordinating with other sessions than writing code. For instance, porting a single 30,000-line file took 25 hours, during which the agent made 122 tool calls for clarification and spawned 15 child sessions to manage the work. This iterative, investigative approach contrasts with the common perception of AI simply generating code, suggesting that effective agentic coding relies heavily on context management and inter-session communication.

Despite the success, the port was intentionally limited to a module-by-module replacement without optimizing the underlying runtime structure. Microsoft engineers noted that this approach was chosen to keep the port simple, with structural optimization planned for future work. The experience underscores that while AI can accelerate large-scale language migrations, it does not eliminate the need for careful architectural planning and human intervention to manage regressions and ensure the final code meets production standards.

Written by elseif from the cluster below · checked for specifics the sources never contained

THE CLUSTER

Same story, 1 feed.

ORDERED BY FIRST SEEN
www.theregister.com - Articles Microsoft agentically ports Copilot runtime to Rust for $120K Open ↗