Native binary-heap Dijkstra from the memory client #
Dijkstra.Memory.run is realized by instantiating the shared Dijkstra.Native.NativeMethods and
Dijkstra.Native.NativeAllocator interfaces with BinaryHeap.Native.HeapLayout (layoutWords),
BinaryHeap.Memory.framed, and the native binary-heap update, extraction, and dirty-allocation
certificates.
All register layouts, emitted code and clock factors precede runtime graphs, widths and memory.
The original word envelope is unchanged. Arithmetic, copies, source initialization and control
are charged; the flat endpoint retains the entire final memory and frontier of
Dijkstra.Memory.run.
Main definitions #
ValidHeap: static validity witness for a runtime binary-heap handle at capacityn.nativeMethods,nativeAllocator: binary-heap instances of the shared native Dijkstra kernel.
Main results #
realizes_run: a uniform native realization of the original allocated memory program.exists_program_state: one flat program with a charged log-linear clock and exact final state.
The instruction factor is existential. No claim preserves the old handwritten implementation's literal coefficients, and no Fibonacci-heap native endpoint is asserted here.
References #
Static validity predicate for a runtime binary-heap layout e at word width w, vertex
capacity n, and key bound K.
Handle capacity matches
n.Underlying layout is valid at width
wand key boundK.
Binary-heap instance of Dijkstra.Native.NativeMethods over the 4-word HeapLayout register
encoding.
Dirty-allocation adapter connecting BinaryHeap.Memory.allocLayout to nativeMethods.
One fixed native emitter realizes the original allocated binary-heap Dijkstra memory program. The domain retains the original graph input and word-size envelope; native arithmetic, argument delivery, initialization and control are included in its constant instruction factor.
One flat exact-basis program, chosen before every graph and word size, computes the shortest-path distances. Its charged prefix, body and halt take log-linear time, and the full final memory/frontier is exactly the state of the original memory program.