Bit-Exact on Every Public Scenario and About 90× Faster: Rewriting an Agent-Based Market Simulator Under Exact-Trace Constraints
Abstract
Track 3 of the Agenthon 2026 competition ranks faster implementations of an ABIDES limit-order-book simulator, but a scenario counts only if its output matches a frozen reference; for most scenarios that means the same fills, in the same order, at the same prices and sizes. We first optimized the Python code under a measurement-first workflow. That gave 1.495× on one unit under the organizers' timer and suggested that porting only the event kernel would gain little (an estimated 1.23×). We then reimplemented the organizers' Track 3 configuration of ABIDES (upstream kernel, exchange, order book and oracle, plus the adapter's four agent types) in about 5,000 lines of Rust with no external crates. Matching the reference byte for byte required reproducing behavior the reference never documents: simultaneous events are ordered by sender and recipient rather than by arrival, every send under a stochastic latency model consumes one draw from a shared latency stream, and seed draws whose results are never used still shift later random draws. The engine reproduces all 95 public scenario files byte for byte, passes the official regression suite, and matched the reference on 849 fuzzed scenarios; a subsequent, wider fuzz found one divergence outside the public set, which a later version fixes. In a paired, interleaved benchmark it is 94× faster end to end (geometric mean over the 95 files; 95% CI 89 to 98; 65× to 200× per file). Injecting 18 naive alternatives shows which of these behaviors the official checks detect: an arrival-order queue changes every trace and fails every exact-tier check, yet passes every statistical-tier check. Finally, aligning our timing span with the reference adapter's raised our self-reported Development score 3.09×, which shows how much a self-reported rate depends on the span.