Exact First, Then Fast: An Event-for-Event C++ Rebuild of the Agenthon ABIDES Market
Abstract
Agent-based market simulators such as ABIDES let researchers study trading strategies and learning agents in a fully observable market, but the Python reference processes only about 14,000 events per second. Track 3 of Agenthon asks for a faster simulator whose output passes strict automated checks against the reference: the same events and fills for most scenario families, and statistically close prices for the rest. We set a stricter target. We rebuilt the organizers’ ABIDES configuration as one static C++ binary that reproduces it event for event, with the same random numbers, the same order for simultaneous events and the same message identifiers, so that every value in every output table equals the reference’s. We then tuned it for the Final clock, which times the whole container from start to exit. We did this under the gVisor sandbox, the Final’s runtime until 30 September 2026, and re-measured under runc, which replaced it. On our machine, container start-up and shutdown take about 73 ms of every run under runc (67–82 ms across units), so on most units doing less matters more than looping faster. On the largest public unit, run on the same laptop, our simulation loop is 1,299 times faster than the reference’s, and the whole run takes under a quarter of a second instead of two minutes. The output decodes to exactly the reference’s tables in all 6,900 randomized comparisons and in replays of up to 2.1 million rows, and the same kind of comparison catches all nine bugs we planted in a mutation test, two of which pass every public unit.