Skip to content
Trending storyPast story

Prompting agents to iteratively optimize Rust until it beats state-of-the-art libraries

1 report1 sourceupdated 7 days ago

What happened

Summary

Max Woolf 用了一年多时间验证一件事:给 AI 代理定一条硬规矩——每次改代码必须至少提速 5%,否则回滚——然后让它自己去迭代优化 Rust。从 Claude Opus 4.5 开始,这套玩法在 UMAP 等算法上拿到了 2 到 20 倍的加速,对比的是已经打磨多年的成熟库,而且全程没碰 unsafe 代码。文章把提示词和基准测试结果都贴出来...

Coverage

Follow the reports to see the story from different sides.

Sep 22
  1. Hacker News front pagePick
    Prompting agents to iteratively optimize Rust until it beats state-of-the-art libraries

    Max Woolf spent over a year testing whether agentic LLMs can iteratively optimize Rust code with a hard pass/fail rule: each iteration must deliver at least a 5% speedup or roll back. With Claude Opus 4.5 and later models, he got 2–20× speedups on algorithms like UMAP versus mature libraries, all without unsafe code. The post includes the exact prompts and benchmark results. The caveat: these gains are measured on his specific benchmarks and may not translate directly to production workloads.