Dense public input with a sparse mutable overlay #
This module exposes the semantic representation used by the optimized RAM-to-Turing simulation. The immutable public input is not duplicated in the mutable snapshot; positive tags make explicit writes of zero distinguishable from an absent overlay entry.
Materializing a positive tag preserves the invariant that register zero never falls through to the dense input bank.
The initial overlay materializes register zero.
Decoding commutes exactly with one selected instruction.
One selected instruction preserves materialization of register zero.
One tagged write adds at most one mutable overlay entry.
One selected instruction adds at most one mutable overlay entry.
A dense-overlay run materializes at most one entry per executed RAM step.
A tagged write increases the live overlay code by at most the code of its address and positive value tag.
One selected instruction grows the actual live overlay code linearly in its fixed literal width and its logarithmic RAM charge.
One program-selected step satisfies the same live-code bound using the fixed program's maximum literal width.
The live mutable overlay has amortized encoded growth linear in the work actually charged by the RAM run; the immutable public input contributes no repeated sparse-store term.
Starting from the public ABI, mutable entry count is bounded solely by the executed step count.
Starting from the public ABI, live mutable code is linear in accumulated
RAM cost and carries no eager input.length * bitlen input.length term.
The initial snapshot contains only the two headers and the tagged R₀
length entry; public input bits remain in the immutable bank.