STOKE: Stanford's superoptimizer finds optimal assembly through randomness with early pruning

lauriewired · x · 2026-10-13

Security researcher lauriewired explains STOKE, Stanford's superoptimizer that randomly mutates a program's assembly to search for optimal machine code — 99%+ of candidates are wrong, but it occasionally finds dramatic wins. STOKE isn't purely random: it rejects bad-looking branches early to concentrate compute on promising paths. The attached figure shows STOKE seeing through gcc -O3's literal translation of a cycling-through-3-values benchmark and rediscovering the intuitive algorithm using conditional moves.

Original post →

More from Research

Research channel →