Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 3 min read Research hardMaster

VESPA: Static profiling for binary optimization

VESPA (Vintage ESP Amended) lets the BOLT binary optimizer run without dynamic profiling by predicting branch probabilities statically. A neural network is trained on applications with known dynamic profiles, using features such as branch condition codes and whether the target block is a loop header. Its predicted probabilities are converted into code frequency estimates that BOLT consumes as if they were real profiles. Compared with the original ESP technique, VESPA adds an improved model, new program features, and the derivation of frequencies rather than just branch directions. Integrated into BOLT, it delivers about a 6% speedup on top of Clang -O3 binaries, versus roughly 20% with real profiles, which makes binary optimization viable where profiling is impossible, such as mobile apps.

Assumes: profile-guided optimizationbranch prediction basicsbinary optimizers

Related posts

  • From hand-tuned Go to self-optimizing code: Building BitsEvolve

    Datadog Engineering mediumAdept

    Datadog cut CPU in Go hot paths by removing compiler bounds checks in NormalizeTag (25% faster, 0.75% service CPU) and adding an ASCII fast path to NormalizeTagArbTagValue (90% faster, hundreds of thousands of dollars in projected annual savings), guided by production data showing nearly all inputs were ASCII. These manual techniques became the heuristics for BitsEvolve, an AlphaEvolve-inspired agent that uses an island-model evolutionary algorithm, benchmark fitness functions and Temporal orchestration to mutate code. BitsEvolve rediscovered the hand-tuned versions and improved Murmur3 and CRC32 by about 20%. The key lesson is that realistic benchmarks matter, so production data captured with Live Debugger is used to build trustworthy fitness functions, and the work then extends toward SIMD kernels for Go.

  • Faster Assisted Generation with Dynamic Speculation

    Hugging Face mediumAdept

    Dynamic speculative decoding stops the draft model's token generation as soon as its softmax confidence falls below a threshold (assistant_confidence_threshold), rather than always drafting a fixed or heuristically adjusted number of tokens before verification by the target model. An oracle analysis shows optimal speculation lookahead varies widely across iterations, so static values waste forward passes. On an RTX 4090 the dynamic schedule beat the heuristic in every tested model pair, reaching 2.71x on OPT-6.7B summarization and 1.52x for Llama-3.1-8B with Llama-3.2-1B where the heuristic gave no speedup. It is the default for assisted generation in Transformers 4.45.0 and can be tuned or reverted through generation_config parameters.

  • Auditing in the age of (good enough) AI

    Trail of Bits hardMaster

    Before auditing the Miden zero-knowledge VM, Trail of Bits spent six months using Claude and Codex agents to build tooling for its custom stack-based assembly language (MASM): an LSP server, a decompiler with a reusable IR, an abstract-interpretation static analysis engine, and a Lean model of the VM executor. The analyses flagged 400+ locations with missing type validation and a high-severity bug where an unvalidated prover-supplied remainder in mod_12289 would let a malicious prover forge Falcon signatures and drain accounts. Agents also produced 95 machine-checked Lean correctness proofs covering the core library's binary arithmetic, uncovering edge-case bugs in rotr and wrapping_mul. The broader point is that capable agents make exploratory, hard-to-justify tooling projects cheap enough to pursue routinely.

  • Adding the V8 CPU Profiler to v8go

    Shopify Engineering mediumAdept

    Exposing V8's CPU profiler through v8go, the Go library for running JavaScript in V8 isolates via Cgo, came down to a choice between lazily fetching each profile node property with its own Cgo call or eagerly building the whole call tree in C++ and rebuilding it in Go from a single pointer. Cgo calls cost roughly 54 ns Go-to-C and 149 ns C-to-Go, which made eager loading look like the obvious winner. Benchmarks showed lazy loading was actually faster on a small profile (~20µs vs ~25µs), and eager loading only pulled ahead on a large tree from the Hydrogen starter template (~60µs vs ~90µs). Keeping getters over private fields leaves room to offer both modes, and the broader lesson is to benchmark rather than trust intuition and to use inputs that reflect real usage.

  • Strobelight: A profiling service built on open source technology

    Meta Engineering mediumAdept

    Strobelight is Meta's fleet-wide profiling orchestrator, running 42 profilers (mostly eBPF-based, plus ad-hoc bpftrace scripts) on every production host with safeguards against PMU counter conflicts, concurrency limits and queuing. Default continuous profiling uses dynamic sampling that retunes run probability daily per service to hit target sample counts, with sample weights normalizing data for cross-host and cross-service comparison. LBR data feeds Meta's FDO pipeline (CSSPGO and BOLT), cutting CPU cycles up to 20% for top services, and one efficiency win alone saved an estimated 15,000 servers annually. Stack Schemas and thread-local Strobemeta enrich stacks with tags and request metadata, while a centralized symbolization service built on DWARF, gsym and blazesym avoids on-host debug-info parsing, relying on frame pointers in all user-space binaries.

The quest for software engineering knowledge.

Look:
Layout: