6.3. Dual registry
Two parallel registries, both populated by a single
LeanBench.register call emitted by the setup_benchmark macro:
-
Compile-time (
SimplePersistentEnvExtension): used by anything that needs to inspect the catalogue at elaboration / build time. Stored in the.olean; survivesimport. -
Runtime (
IO.Ref (Std.HashMap Name RuntimeEntry)): used at runtime. Populated at module init via theinitializeblock the macro emits. The child looks uprunnerhere for dispatch; the parent looks upcomplexity(to compute ratios) andspec(to drive the ladder).
The dual is unavoidable — env extensions are an elaboration-time
concept and the runtime needs callable closures — but the macro
emits exactly one LeanBench.register call so the duality stays
out of user code.