rocq/theories/Run.v
Running a function of a module as interp:run/5 does: prepare the module's initial memory, call the function, and take steps until an outcome, choosing each allocation's base as a runtime does.
A run takes its allocations' bases from a Runtime (Runtime.v): DriverR runs with R's choices, and the gates run DriverInterpRuntime (Transport.v), the interpreter's allocator. That is one instance of fresh allocation, not part of the semantics: Semantics.v's step_rel allows any fresh base.
As data_base/1: the address where the module's items start.
As data_cap/3: the capability of data with the linkage lk at base, writable or read-only; a weak declaration or an unknown linkage has none.
As filc_layout/3: the item it placed after those before it, updating the next address, the globals and the objects. A data object goes at the next address aligned to 16 or its stricter alignment, its size rounded up to 8, with a 16-byte gap after it; a function at the next 16-aligned address, 16 bytes, with the capability fn(Name). A weak declaration (extern(weak)) takes no space and stays undefined; an alias waits for alias_global.
As alias_global/3: an alias's address is its target's, the same pointer.
As filc_item_contents/4: one item of a data object written at the next address, and the address after it. A pointer item writes its symbol's address plus the offset, and the symbol's capability in the aux; a symbol the module does not define is an external one.
As filc_contents/4: a data object's items written in order from its address; other items write nothing.
The memory with no objects, every byte zero and no stored capability.
As initial_memory/4 in filc mode: the module md's globals, each name with its pointer, and the memory with every item placed in order from data_base (layout), aliases bound (alias_global), and each data object's contents written (contents).
What a run ends with: an outcome, or halted where the interpreter throws or fails, with the step that was stuck.
The driver
Running under the runtime R: R's alloc chooses each allocation's base, and R's free is the genv's.
One step, with the runtime's state beside the configuration. Where R refuses an allocation the run ends with trap(out_of_memory), at whichever allocation it is: a heap object, a named local or a variadic callee's argument snapshot (alloc_res/6, inst_result/5, call_outcome/8).
Up to 2^p steps, by halving p, so that the recursion depth is p and the gas a positive. The gas is never the limit in practice: the run's own fuel (blocks entered) ends every run first.
As run/5: the run of the function fn of the module md on the words args, entering at most fuel blocks, from the module's initial memory and R's start.