See the evidence ↗Read the original ↗Report

Shown·Codex, Other

Faster Rust ML code via benchmarks

Codex: Coding agents wrote Rust ML algorithms like UMAP from scratch, then iteratively optimized them against criterion benchmarks.

Resultrc_WMXVQ46W

Each model pass added about 1.5x to 2.0x speedup, reaching roughly 7.5x to 32x over baseline; one implementation beat xgboost on speed.

ShownBlog · Sep 21 · Last checked

Overview

How it was set up

Agents in Zed Agent with long Markdown prompts; Rust criterion benchmarks, faer, simsimd, rayon, PyO3 bindings, no unsafe code, quality checked against umap-learn.

Worth knowing

Optimizing against benchmarks can overfit to them; vague goals failed, and speed gains needed a quality check against a reference.

A prompt to start from

Run the CPU benchmarks first to set a True Performance Baseline. Then optimize the library code so all benchmarks run at least [1.2x] faster than baseline, without editing the benchmarks or adding unsafe code. Repeat until results stop improving, reporting relative speedup after each iteration.

Written by Agentic Feats from the source. Not the author's exact prompt.

Sources 1

History

Source published
2026-09-21
Added to Agentic Feats
2026-10-13
Pick
No
Markdown copy
/c/faster-rust-ml-code-via-benchmarks-codex.md

More in coding

68 feats