Guarantees

Reading settings

Look

Mode

Definitions

Proofs

Imports

Arguments

References

References open

Saved in this browser.

ModulesGuarantees

Modules

Audit0Extract12

Base

Prelude9Syntax43

Reference

Semantics63Properties202

Pure

ObserverSet29SourceList104State16Edges12Marking117Engine103Check204Runs259Scheduler241Ownership49WholeGraph562Refinement465Witnesses244Optimised271Ledger6Collections302Concurrency141Extensions123Deltas68FastPaths435Combinators106MemoTable147MemoTableWitnesses62MemoTableFastPaths113

Heap

ObserverSet46SourceList89Ghost160Marking22Run286Scheduler7Ownership29Adequacy3Collections38Concurrency41Extensions17Deltas10MemoTable28

Conformance

Expected64Check119
On this page

On this page

FalsifiedWitnessesOptimisedMemoTableWitnessesMemoTableFastPathsChecksPropertiesEdgesWitnessesGuaranteesPropertiesObserverSetSourceListEdgesMarkingCheckRunsSchedulerOwnershipWholeGraphRefinementWitnessesOptimisedCollectionsConcurrencyExtensionsDeltasFastPathsCombinatorsMemoTableMemoTableWitnessesMemoTableFastPathsObserverSetMarkingRunSchedulerOwnershipAdequacyCollectionsConcurrencyExtensionsDeltasMemoTableExtract

Guarantees

Falsified

Ranvier.Pure.Witnesses

Ranvier.Pure.Optimised

Ranvier.Pure.MemoTableWitnesses

Ranvier.Pure.MemoTableFastPaths

Checks

Ranvier.Reference.Properties

Ranvier.Pure.Edges

Ranvier.Pure.Witnesses

Regression witness for #290: without MarkReaderCheck, a reader of a stale memo goes untold.

✓ No axioms

Check, not a guarantee.

prog_S04 ends in a state where wake_told fails with f_reader_mark cleared and holds on the present engine. wake_ok holds on both: the stale memo holds its flag. With the mark the effect logs -1, 0, 2, 3 and the signal ends at 3. Without it the log stops at -1, 0 and the signal ends at 1. The flag on with the mark off is a model configuration: 2e8f9690 predates the flag. This witness has no effect_ran_for_last_write clause: a memo that writes its own source denotes nothing.

Guarantees

Ranvier.Reference.Properties

The run holding a log, when it writes no signal, computes from one snapshot.

✓ No axioms

A trace is the concatenation of its records' events, and a given EvLog lies in some record for its node. When that record writes no signal, its reads and events are reproduced by replaying it with every read answered from one snapshot of the signals and the disposed memos' values. The guarantee is silent on a record that writes, and on every other record. A cleanup's environment, and so a value it logs, can date from the run that registered it. This describes the reference, not the engine.

Ranvier.Pure.ObserverSet

Ranvier.Pure.SourceList

A read matching neither slot drops the rest of the list and appends the source.

✓ No axioms

When the read matches neither the slot at the cursor nor the one before it, the new list is the slots before the cursor followed by the source, with the cursor at its end. The two ends of every edge still agree, and the computation appears only in the observers of sources in its new list.

Premise: the two ends of every edge agree beforehand (edge_match).

Every world between the removals of a trim stays consistent.

✓ No axioms

After any number of removals, the two ends of every edge agree, each computation holds at most one edge per source, each observer set holds an observer at most once, and the next removal moves only another computation's edge.

Premises: the first two properties hold when the trim starts.

A clear stays correct when a removal moves the computation's own later edge.

✓ No axioms

Take the source list A, B, A with an edge in each slot, the later A edge last in A's observers. The first removal moves that edge, the later slot then holds the moved handle, and Clear still succeeds, leaving an empty list and the computation in no observer set.

Premises: this exact list and the two ends of every edge agreeing. Reachable worlds exclude this list (sources_no_duplicate_edge), so this covers a world built by hand: see aba_reachable_trim.

A read that TryAdd can't answer for still leaves one edge.

✓ No axioms

When a read misses its slot, the source has more than scan_limit observers and observer_latest holds another observer, TryAdd answers TUnknown. Add still succeeds, the world stays well formed, and the computation holds exactly one position in the source's observers, whether or not the source already had a slot.

Premise: the world is well formed beforehand. The observer count and observer_latest are measured after the trim of the slots from the cursor onward.

Ranvier.Pure.Edges

Ranvier.Pure.Marking

A marking walk leaves each observer stale.

✓ No axioms

Each observer of the source that takes marks ends Check or Dirty. notify_dirty_except skips the running computation unless it has already read the source in its current run, so the guarantee covers observers other than that one and running observers that have already read the source. An observer takes marks when it is a memo, or an effect outside its disposal and its cleanups.

Ranvier.Pure.Check

Every engine function keeps the check invariant, at every fuel.

✓ No axioms

When a function returns, the check invariant still holds, g_running and g_current are back to their starting values, each node keeps its kind, and each memo's run count and disposal only go forward (frame). After run_memo or recompute of a memo, the memo is disposed, or RecomputeScoped has never cleared its Dirty, or the memo has run since RecomputeScoped last did.

Premises: the invariant holds at the start. Functions over a memo or an effect require a node of that kind, and run_effect_body requires that effect's run to be in progress.

A memo resolved Clean with settled reads has read what each source now stores.

✓ No axioms

Each source in the memo's slots has a recorded read, and each recorded read equals the source's stored value, status and failure, which can themselves be stale: self_marking_through_memo_unmoved has the source Dirty and the reader Clean.

Premises: the check invariant holds, the memo starts in Check, update_if_necessary returns with the memo Clean, and reads_settled holds at the end. reads_settled says the memo has no unnoticed difference in its reads, and neither it nor any of its sources is running. The guarantee comes from the invariant and that premise, not from the walk. The unqualified claim is false: see resolve_clean_no_move_statement.

Tagging an observer-set handle (0 <= h < 2^28) with EdgeHandle.SignalBit (2^29) produces a non-negative 31-bit Smi tagged handle distinct from untagged handles and EdgeHandle.Unlinked, and unified RemoveAt masking recovers both the raw index (&&& IndexMask, 2^28 - 1) and SignalBit.

✓ No axioms

Matches EdgeHandle.SignalBit, EdgeHandle.IndexMask, EdgeHandle.isSignal, Signal.AddObserver, Signal.TryAddObserver, and ObserverSet.RemoveAt (Core.fs:402,410): setting bit 29 (0x20000000) distinguishes signal handles (>= 2^29) from memo/untagged handles (< 2^29) and sentinels (< 0), while &&& IndexMask (0x0FFFFFFF) extracts h for 0 <= h < 2^28 and &&& SignalBit preserves SignalBit on swap-removed signal edges and 0 on untagged edges.

Skipping SignalBit-tagged sources in ResolveCheck (RefreshSourceAt) and HasStaleSource preserves exact engine behavior because updating a signal is a no-op and a signal is never stale or live-stale.

✓ No axioms

Matches SourceList.RefreshSourceAt and SourceList.HasStaleSource (Core.fs): since Signal.UpdateIfNecessary returns immediately without reading or writing state and Signal.IsStale is always false, skipping any slot whose handle carries EdgeHandle.SignalBit produces the identical state transition as calling UpdateIfNecessary and IsStale on that slot.

Ranvier.Pure.Runs

The settled invariant holds at every return of every engine function, at every fuel.

✓ No axioms

engine_settled is the invariant run-level proofs carry: the check invariant, the stack discipline, source-list bookkeeping, equal-length owner cleanup lists, an effect in its cleanups being on the stack, and the record of what each computation has been told.

Premises: the invariant holds at the start, and the function's own premise, as listed in preserved_by. A function that gets stuck or runs out of fuel returns nothing and is outside this guarantee. This is the form that holds on the present engine: engine_inv_preserved_statement adds wake_ok, and that form is false.

Every live stale source has its observers covered, apart from observers a walk resolved over a stale source.

✓ No axioms

For any edge from a live, stale source to an observer, after a whole program: the observer is stale or queued, or on the running stack, or the source holds its announcement flag, or the observer is in gh_passed. gh_passed holds exactly the computations whose check walk ended and went Clean while a slot held a live, stale source with no announcement, since their latest run start. Membership is per computation, not per source: once an observer has passed over one source, the exception covers every source of that observer until its next run starts, a different lost wake-up on another source included.

This says nothing of whether an observer read a source's latest value. A skipped notice leaves the source Clean, so it has no stale edge to cover, and effect_resolves_over_moved_source loses a re-run that way with this statement holding.

Premise: engine_settled holds at the start. A program that gets stuck or runs out of fuel returns nothing, and is outside this guarantee.

walk_passed_source_marked reaches gh_passed, and no_lost_wakeups_statement without the exception is false.

A reader of a live stale source has been told, unless a walk of its went Clean over a stale source.

✓ No axioms

For any edge from a live, stale source to an observer, after a whole program: the observer is stale or queued, or on the running stack, or in gh_over, which holds the computations whose check walk ended and went Clean while a slot held a live, stale source, since their latest run start. The source's announcement flag is not a disjunct here, so a reader that read a memo left stale and took no MarkReaderCheck breaks this statement: reader_mark_off_fires.

Premise: engine_settled holds at the start.

No lost wake-ups, when no walk has passed over a stale source.

✓ No axioms

After a whole program whose final gh_passed is empty, every observer of a live, stale source is stale, queued or running, or the source holds its announcement flag. No theorem yet says which programs keep gh_passed empty.

Premises: engine_settled holds at the start and nothing_passed holds at the end. The premise rules out one route to a lost wake-up by name, so this is a statement about every other route to an uncovered edge. It does not say a stale node's next run will happen.

A later mark of a stale or clean live memo leaves every observer stale, queued or running.

✓ No axioms

From wake_ok, when mark_check or mark_dirty of a live memo returns, each computation with an edge from the memo is stale or queued, or on the running stack. An effect in its cleanups, or disposed mid-body, ignores the mark, and is on the running stack: engine_settled carries that.

Premises: the invariant with wake_ok holds, and the memo is live. wake_ok says nothing of a disposed source, whose reader can be uncovered: see disposed_stale_source_read.

A memo stale when its body returns is stale when its run returns, holding its announcement.

✓ No axioms

This covers only the tail of a run, from the body's return to the run's. If the memo is stale at that point, it is still stale when run_memo returns, with n_unannounced set, so its next mark tells its observers again. A mark received earlier in the body can be cleared before the body returns: see marks_survive_run_statement.

Premises: the settled invariant holds at the start, the node is a memo, and run_memo returns.

A run whose value, status and failure hold still marks no observer.

✓ No axioms

Each node's freshness and the effect queue are as they were when the body returned. Marks raised during the body, by writes in it or by other nodes' runs, are outside this statement, which covers what the end of the run adds. A memo with CmpNever or CmpThrows tells its observers whatever the value: that is what those comparers ask for.

Premises: the node is a memo with the CmpEq comparer, its stored view at the return of run_memo equals the view before the run, and run_memo returns.

A moved run marks every observer Dirty, apart from the computation that was current.

✓ No axioms

When run_memo returns with the memo's stored view changed, or a comparer other than CmpEq, each observer that takes marks ends Dirty. The exception is the computation current at the run's start: NotifyDirtyExcept skips it. On a memo that loses a read: check_resolves_over_moved_source. On an effect, the same skip loses a re-run: effect_resolves_over_moved_source.

Premises: run_memo returns, and the observer is not the computation current at the start. An observer takes marks when it is a memo, or an effect outside its disposal and its cleanups.

A moved run's end leaves the computation current at its start short of Dirty when it has not read the memo.

✓ No axioms

If the computation current when run_memo started has not read n in its current run and is short of Dirty when the run's body returns, it is short of Dirty when the run returns. This is the skip of NotifyDirtyExcept, the half moved_marks_except_running leaves out. A computation that is the memo itself is outside this statement.

Premises: the current computation is another node that has not read n in its current run, and run_memo returns.

After a run, a live computation's source list is its tracked reads since its latest run start.

✓ No axioms

The source list holds those reads in order, with a read of the source just read adding nothing, as sources_add stores them. A nested run of the same memo starts over: reads of the outer run ahead of it have no slot, as nested_self_run_ends_clean_and_wrong shows. So "the run" here is the latest to start, which is the reason this is not run_end_edges_are_reads_statement.

Premises: the settled invariant holds at the start, the computation is not on the running stack, run_memo or run_effect returns, and it is not disposed at the end.

After a run with no nested self-run, a live computation's source list is the reads of that run.

✓ No axioms

The source list holds the run's tracked reads in order, with a read of the source just read adding nothing, as sources_add stores them. gh_nested holds a computation when a run of it started inside its own, so the premise says that did not happen.

Premises: the settled invariant holds at the start, the computation is not on the running stack, run_memo or run_effect returns, it is not disposed at the end, and it is not in gh_nested at the end.

Entering and leaving a HostedFrame around body followed by EndRun/Clear equals hosted n body composed with EndRun/Clear.

✓ No axioms

Matches the .NET EnterHosted/LeaveHosted decomposition in Memo.Run, Effect.RunBody, EffectOn.Run, and Boundary.Run (Core.fs): replacing the closure-taking RunHosted wrapper with EnterHosted before the body and LeaveHosted in the outer finally ahead of sources.EndRun/Clear yields identical engine states and outcomes without allocating a delegate or second exception handler.

Ranvier.Pure.Scheduler

Every engine function keeps the scheduler's invariant, at every fuel.

✓ No axioms

When a function returns, the scheduler's invariant still holds with the same in-progress effect, except that execute_effect of n starts with n in progress and ends with none. The current computation, the untracked flag, the batch and pull depths and the flushing flag are back at their starting values. A flush newly owed was owed from batch depth 0. Nodes keep their kinds, a disposed node stays disposed, a disposed effect's run count and EvRun count stay put, the trace only extends, owners keep their hosts, and the cleanup events and held cleanups of a host rise by at most its registrations. run_cleanup and teardown are allowed one more per cleanup they were handed, which the detached list held before.

Premises: the invariant holds at the start, and the function's own premise, as listed in sched_ok. A function that gets stuck or runs out of fuel returns nothing, and is outside this guarantee.

An effect has at most one live queue entry, and its queued flag says whether it has one.

✓ No axioms

After a program, every node has at most one entry in the live part of g_queue, and its queued flag is set exactly when it has one. So queue_once holds of every node. During resolve_walk of an effect n in Execute, the same holds with one exception: n's flag is set with no entry, since it has been dequeued. execute_effect ends with that exception gone.

Premise: the scheduler's invariant holds at the start, and for the second and third parts its in-progress effect is n. That invariant includes this conclusion, so the theorem is a preservation statement; queued_at_most_once_new_graph discharges the premise for a program on a new graph.

A flush that returns leaves an empty queue and every live effect Clean and unqueued.

✓ No axioms

When run_flush starts outside a flush and returns, g_queue is empty and its head is 0, and each effect that is not disposed is Clean with queued unset. This needs no premise on whether a body failed.

Clean is a mark: the effect has none left to act on. It does not say the effect read up-to-date values, and this conclusion holds on three Confirmed lost wake-ups: self_marking_wake_lost (self_marking_cleanup_left_behind), walk_passed_source_marked and effect_resolves_over_moved_source. It does not say a marked effect ran either: flush_reruns_dirty holds the rerun. A disposed effect can stay stale. A flush that gets stuck or runs out of fuel returns nothing, and is outside this guarantee.

Premise: the scheduler's invariant holds at the start, with no effect in progress.

A live effect that is Dirty at its dequeue, or raised to Dirty by its walk, runs again, unless it is disposed first.

✓ No axioms

Dirty at the dequeue. When execute_effect of a live, Dirty effect returns, its EvRun count has risen by at least one, or the effect is disposed.

Check at the dequeue. When its resolve_walk leaves it Dirty, and execute_effect returns, its EvRun count has risen by at least one from the walk's end, or the effect is disposed.

The disposal is a cleanup of its discharge or of a run in its walk: run_effect tests for it ahead of the body. This is the rerun guarantee beside flush_returns_clean, which holds of an engine that clears marks and never runs. A walk that leaves the effect in Check is outside it: effect_resolves_over_moved_source resolves Clean with no run over a source that moved.

Premises: the scheduler's invariant holds with n in progress, n is an effect, and a flush is running.

A failing effect body returns, with its failure in the effect's status.

✓ No axioms

When an effect's body ends in Fail y, run_effect_body returns, the effect's status is StError and its failure is y, and the only event after the body's is EvFail n y. The queue and its head are as the body left them. This answers Effect.RunBody's handler (Core.fs 4866). drain_continues is what happens next.

Premises: the body's result is Fail y, from the state run_effect_body starts it in, and the effect exists at the body's end. The edges there are coherent, a premise this theorem takes and does not derive: engine_settled holds it at a function's return, and no theorem states it at a body's end.

A failing cleanup returns, with its failure recorded on the owner's sink.

✓ No axioms

When a cleanup's body ends in Fail y, run_cleanup returns, the failure is appended to the errors of the owner's sink, or of the owner when it has none, and the only event after the body's is EvFail of the host. This answers Owner.DisposeScope's handler (Core.fs 1171-1184). teardown_continues is what happens next.

Premises: the scheduler's invariant holds, the owner exists, and the body's result is Fail y, from the state run_cleanup starts it in.

A teardown goes on after each step.

✓ No axioms

Once a cleanup or a child's release returns, the rest of teardown is the same call on the state it returned, with that step gone. Together with cleanup_failure_contained, a failing cleanup leaves the steps behind it to run. A child's release has no outcome of its own: its failure is a cleanup of the child's scope, which the same theorem covers. The scenario flush_child_release runs that on the F#.

A failing late cleanup returns, with its failure recorded.

✓ No axioms

A cleanup registered on a disposed scope runs under detached. When its body ends in Fail y, the detached call returns with the failure appended to the errors of the owner's sink, or of the owner when it has none. This answers Owner.RunLate (Core.fs 1025-1033). exec then goes on with the command after CCleanup, by late_registration_immediate.

Premises: as for cleanup_failure_contained, from the state detached starts the cleanup in.

A failing memo run returns, with a failure in the memo's status.

✓ No axioms

When a memo's run fails with y, run_memo returns and the memo's status is StError. Its failure is y. The one exception is a memo that already held StError and y: Core.fs 4266-4274 then consults the comparer, and a comparer that throws z replaces the failure with z, as Core.fs 4275-4279 does. A reader takes the failure from the status. This answers Memo.Run's handlers (Core.fs 4247-4261).

The run fails with y in two ways, both in the premise on r: the body's result is Fail y, or the body breached a pure memo's scope, which sets n_violated and makes y the fixed pure_scope_failure whatever the body returned (Core.fs 4248-4250). memo_scope_violation_returns and memo_comparer_replaces_failure run those two paths.

Premises: r is the body's result, from the state run_memo starts it in, and the memo exists at the body's end. The edges there are coherent, and the fuel exceeds mark_measure there, so the notice has a result. This theorem takes both and does not derive them.

A throwing comparer returns, with its failure in the memo's status.

✓ No axioms

When a memo's comparer is consulted and throws z, run_memo returns, the memo's status is StError, its failure is z, and its value is the one from before the run. A reader takes the failure from the status. This answers Memo.Run's handler of the comparison (Core.fs 4275-4279).

Premises: the body's result is Ok v, from the state run_memo starts it in. The memo exists at the body's end with no scope violation, and with the status and failure it had before the run, since otherwise the comparer is not consulted. The edges there are coherent, and the fuel exceeds mark_measure there. This theorem takes both and does not derive them.

A flush that returns ends with g_flushing false and an empty live queue.

✓ No axioms

When run_flush starts outside a flush and returns, g_flushing is false, pending is empty and the head is 0. This statement has a returned flush as its premise, so it alone would hold of an engine turning a Fail into no result. These theorems close that. Each containment theorem takes a sub-body's result, a Fail or for the comparer an Ok, and concludes that the enclosing function returns, with the failure recorded where the F# records it. teardown_continues takes a step's return and goes on from it.

Core.fs Site Theorem
1025-1033 Owner.RunLate late_cleanup_contained
1171-1184 Owner.DisposeScope cleanup_failure_contained, teardown_continues
4247-4261 Memo.Run, a body or a scope violation memo_failure_contained
4275-4279 Memo.Run, a comparer comparer_throw_contained
4866 Effect.RunBody body_failure_contained

drain_continues takes the drain on from there, and flush_survives_body and the four examples after it run each failure with an effect behind it.

returns excludes the fatal path: self_read_check_overflow is a read with no result in the model, and a stack overflow that ends the process in the F#. This covers Effect. Other IScheduled items, such as a pass, are outside the model. Effect.Execute contains each of the command language's failures, so the comment at Core.fs 3140-3142, on an effect that throws, does not apply to Effect here.

Ranvier.Pure.Ownership

A scope tears down its children and cleanups in reverse acquisition order.

✓ No axioms

dispose_scope detaches the owner's lists and then runs one merged list of steps. Each child and each cleanup held at that moment appears in it exactly once, and their acquisition counts strictly fall. So a later acquisition is torn down first, and a cleanup runs before the release of any child acquired ahead of it. This covers the lists detached at the start: a registration made during the teardown joins the emptied scope.

Premise: the owner's lists are in acquisition order, acq_ok. owners_in_order holds that of every owner after a program. The fuel in the first clause is one step less than dispose_scope is given, and a step that runs out of fuel leaves the whole call with no result.

Each cleanup entry runs once, and a host's cleanup events never exceed its registrations.

✓ No axioms

The count is structural, per list entry, because a registration carries no id. These hold together:

  • The bound. After a program, EvCleanup h events plus the cleanups still held by owners of host h are at most the cleanups registered with owners of host h, late ones included. g_registered is ghost state written at CCleanup. This is a sum per host, so it alone would hold of a teardown running one cleanup twice and dropping the next.
  • The list. The cleanups of schedule ls cs, in order, are exactly cs. The bodies of owner_cleanups are o_cleanups reversed, for an owner in acq_ok.
  • The teardown. teardown is run_items over that schedule, and run_items runs run_cleanup once for each cleanup step and goes on with the rest. dispose_scope hands it the owner's detached entries, and owner_detached leaves all the lists empty, so a later teardown holds none of them.
  • The late path. On a disposed current owner, CCleanup runs run_cleanup once under detached, with no write to the owners.

Premises of the bound: the scheduler's invariant and the bound hold at the start. cleanup_once_new_graph discharges both for a program on a new graph. An entry's body can itself register or dispose, and those are further registrations and further steps.

A disposed computation holds no source edges once its run has ended.

✓ No axioms

After a program, a disposed node that is not on the running stack has no slots, no edge from any source, and appears in no source's observers. A computation disposed mid-body links edges until its run ends: disposed_running_observer_stays_clean.

Premise: engine_settled holds at the start. That invariant's b_disposed states the slots clause, so this is a preservation statement. disposed_no_edges_new_graph discharges the premise for a program on a new graph.

A disposed effect never runs again.

✓ No axioms

From a state where the effect is disposed, a whole program, a flush or a drain that returns leaves it disposed, with n_runs unchanged and no new EvRun n in the trace. The drain clause covers a disposal mid-flush: from the loop head after the effect that disposed it, its own entry is dequeued with no run, as queued_effect_disposed_skipped has it. The execute_effect clauses are that dequeue, which changes only queued, as Core.fs 4785 does. A body in progress at its disposal keeps running to its end: this is about later runs.

Premises: the scheduler's invariant holds at the start, with no effect in progress, or for execute_effect with this effect in progress. A drain starts during a flush.

A disposed memo answers from what it stored, without running.

✓ No axioms

A read of a disposed memo that returns leaves every node, the trace and the queue as they were, so no body ran and nothing was scheduled. It answers Fail of the stored failure when the status is StError (0 when n_failure is None), and otherwise Ok of the stored value. Core.fs 4372-4376 documents that a disposed memo "still answers reads, with the last value it computed".

That stored value need not be a computed one, and need not be up to date. A memo disposed before its first run answers the default: disposed_unread_answers_default. The reference tier answers from the signals at the disposal, and BUGS.md holds that difference as disposed_unread_memo_value and write_then_dispose_memo_current_value, Awaiting ruling. A tracked read can still add an edge from the disposed memo: disposed_stale_source_read.

A cleanup registered on a disposed scope runs at once.

✓ No axioms

On a disposed current owner, CCleanup b k counts the registration, runs the cleanup under detached, requests a flush, and only then continues with k, with no write to the owner's cleanup list. When the whole command returns, the trace starts with the starting trace followed by EvCleanup of the owner's host.

Premises: the current owner is disposed, and for the second clause the scheduler's invariant holds and the fuel leaves the cleanup at least one step.

Detaching a stale link changes nothing.

✓ No axioms

unlink of a link whose generation is not the owner's current one returns the state it was given. A teardown bumps the generation before its first step, so a child disposed during that teardown takes this path.

This pins the model's check and no reachable behaviour. On reachable states owner_without matches on child and acquisition, and a later generation holds no such link, so the check is redundant there. The F#'s check guards Prev and Next of a detached list (Core.fs 1053-1072), which the model does not have.

Premise: the owner exists.

Ranvier.Pure.WholeGraph

A well-behaved program keeps gh_passed empty.

✓ No axioms

After a whole program from a new graph, gh_passed is empty: each computation that resolved Clean did so over sources that were clean, disposed or holding their flag. wake_ok follows: well_behaved_no_lost_wakeups.

Premises: the program's end state has every memo outside the self-dirtying case, and every effect only reads. A CmpNever comparer falsifies the conclusion: cmp_never_passes_source. So does clearing f_unannounced: witness_302. An effect that writes or registers a cleanup is unproved either way.

A read answers from the current signals, in a well-behaved program.

✓ No axioms

After a whole program from a new graph, a read of a node outside the self-dirtying case answers what the node denotes over the current signals: a signal its value, a live memo its body, with each read in that body answered the same way, and a disposed memo what it stored, as Core.fs 4372-4376 documents.

Premises: the program's end state has every memo outside the self-dirtying case and every effect only reading, and the read returns.

The statement speaks at a program's end. A read in an open batch or a body is unstated. A read here can settle a flush, and the answer holds across it.

The form over the node alone, with its other nodes free, is false in a state with a queue: read_settles_writer. It is false at quiescence too: read_quiescent_falsified. The form with no exception for a disposed memo is false: glitch_free_read_falsified.

Convergence: at quiescence, every effect ran, and its last run read and logged what its sources now denote.

✓ No axioms

After a whole program from a new graph that leaves no live queue entry and nothing running, each live effect is Clean and has an EvRun in the trace. Each source of a tracked read in its last run has a recorded read, each answering what the source denotes over the current signals. Its last run's EvLogs are the logs of a run of its body with each tracked read answered by the denotation and each untracked read by some value, or, when its target is a memo, by some failure. An untracked read is entitled to no more: its source can move with no run, and the state records no answer, so a log of the read's value can hold any value. By reading, with the mutant run unfinished: a log after an untracked read of a memo can be absent, through the failure case. With no untracked read in the body, the body gives one result over its recorded reads and over the denotation, with the logs of its last run, and the trace ends that run with those logs, followed by an EvFail when the result is a failure.

Premises: the program's end state has every memo outside the self-dirtying case, and every effect only reads. Batches and computed read targets, in memos and in effects, and an effect's untracked reads are inside the premises: widened_forms_reached, untracked_read_reached.

Exclusions from an effect's body:

  • A write rests on a counterexample: effect_resolves_over_moved_source falsifies the conclusion (effects_only_read_needed). This premise is provisional, pending the owner's ruling on that entry.
  • A cleanup, a disposal, and an effect or other node created in the body rest on the proof's reach. They are unproved by choice of scope: no proof was attempted, no counterexample is known, and the owner has been told.

quiescent excludes the queue failed_batch_leaves_queue leaves. convergence_reached reaches every premise on a live effect over live memos. The form over all programs is the Open convergence_all_statement.

Ranvier.Pure.Refinement

A read or a walk step on any readable node ends, and raises no measure.

✓ No axioms

Every memo body in Sh meets body_ends, with its reads below its own id. From a state of gd under a flush or a batch, read_node and update_if_necessary end at enough fuel, in gd. The rank of the id bounds the memo calls, the body bounds each run and the slot count bounds each walk.

mu, the sum of the stale memos' weights and the live queue entries, does not rise. A run takes wt n off, and its marks add at most cost n, half of it. A read of a memo left stale by its own run marks the reader, within the other half.

The engine answers on a refinable program where the reference settles, when every body meets body_ends.

✓ No axioms

For a well-formed, refinable program with bodies_total, if the reference gives a trace of the history under some order, some fuel gives the engine's trace.

The measure of the drain is mu: the weights of the stale memos and the live queue entries. A run of a memo pays for its own marks and for a read's mark of its reader, and each entry the drain takes lowers mu: drain_ends and reads_end. The reference's success gives each input's target: inputs_total_of_runs.

bodies_total reads a body over all answers to its reads, so it fails on a path no run takes, and no counterexample backs it on such a program: bodies_conservative. Deriving it from the reference's success is open: answers_where_reference_settles in BUGS.md.

refinable alone is not enough: refinable_alone_no_answer. There the reference has no answer at the fuel and order computed, so that theorem does not refute the form with the reference's success. engine_of_answers_falsified refutes the statement with neither refinable nor bodies_total, which is engine_answers itself: its effect reads and then writes, so it fails both.

Weak refinement: on a refinable program, the engine's settled view is the reference's, at every batch prefix.

✓ No axioms

For each fuel, each trace engine_of gives on a refinable program extends to each batch prefix of the history, and the prefix's trace has the observe_settled of the reference's trace at that prefix.

Premises, beyond well_formed_program, each named by refinable:

erase gives every memo Pure and CmpEq. A default-policy memo returning a new reference value each run, or nan, is CmpNever in the model: this theorem does not cover it, and cmp_never_passes_source under Confirmed in BUGS.md shows it losing updates.

The unconditional statement is the Open weak_refinement_statement. engine_answers is a separate obligation: see engine_of_answers_statement.

Exact refinement, where the engine and the reference run the same effects in the same order.

✓ No axioms

On a refinable program, with an order under which every batch prefix has the same sequence of EvRuns in the engine's trace and in the reference's, the two traces are equal at every prefix.

With equal EvRun sequences, logs, failures, disposals and host reads agree event for event. The premise runs_agree excludes a redundant run (batch_restored_value_reruns, S07, and diamond_marks_running_effect, S15), a missed run and a reordering. No theorem derives runs_agree from the absence of redundant runs: see runs_agree_bridge in BUGS.md. The unconditional statement is the Open exact_refinement_statement.

A refinable program meets the premises of convergence at every batch.

✓ No axioms

This is the link between well_formed_program and well_behaved_program, effects_only_read and quiescent. Each gap between them, and what closes it:

  • Rank. memos_acyclic gives some rank over the paths that return. pure_at takes its rank from the class Rank, and the theorem holds for every rank, so a memo may read a higher id. erase keeps ids, shifted by one so that node 0 exists, and memos_below ranks the shifted ids.
  • Stuck paths. memo_reads_below says nothing of a path with no result, and body_pure covers every path. memos_below asks for every path, so a memo reading a node of equal or higher rank on a stuck path is outside the theorems, conservatively. By reading, such a read has no effect on either side's answer.
  • EVar 4096. expr_no_prev accepts it and expr_plain rejects it. rename closes this gap with no premise: rv moves a body's variables off prev_var, so a renamed body's expressions are plain (plain_rename) and the engine's binding of the previous value is out of reach of every body.
  • CmpEq. erase chooses it for every memo. A default-policy memo returning a new reference value each run, or nan, is CmpNever in the model, so neither this theorem nor the refinements cover such a memo. cmp_never_passes_source shows that memo losing updates.
  • Memo logs. well_behaved_memo allows CLog, and the reference discards a memo's logs. engine_of projects them out of the trace, which is what the reference's semantics asks for, so the refinements say nothing about how often a memo's body runs.
  • Effects. well_behaved_effect allows writes, cleanups and untracked reads. effects_read_only rejects them, as the docs of weak_refinement_except say.

The EvRuns of a flush follow the entries its drain takes.

✓ No axioms

For a refinable program, take the state of the engine at a batch's flush, and let runs be the flush's EvRuns and Q the entries the drain takes, in the reference's ids. Then:

  • runs is a sublist of Q: an entry whose effect is clean or disposed is skipped.
  • Q extends the live queue at the flush's start, in order: live_queue_of is the head of Q.
  • Under queue_steady, runs is ordered by engine_order.

The last conjunct is conditional on its premise: queue_steady is a statement about the computed drain, not a class of programs. What this theorem delivers for every refinable program is "runs follow the drain". The last conjunct with no premise is the Open engine_order_exact_statement, and engine_order_exact_falsified refutes it for the queue at a flush's start. That says nothing of history_order, the order that fits a whole history.

Exact refinement under the engine's own order.

✓ No axioms

exact_refinement_except at history_order. The order conclusion holds by construction, since history_order is read from the engine's runs. The content is at the level of values: under runs_agree, logs, failures, disposals and host reads agree event for event. runs_agree has content: runs_agree_has_content has it fail at history_order on a program with a redundant run, and history_order_reached meets it on a program where the order of creation does not.

Ranvier.Pure.Witnesses

Ranvier.Pure.Optimised

Ranvier.Pure.Collections

Every attached direct observer is visited by ObserverSet's backward walk despite concurrent swap-removals.

✓ No axioms

In any world_point (including arbitrary interleavings of SourceList computations and direct_link / direct_unlink observers), every attached observer c of s occupies a unique slot in observers_of w s (held_once) and is therefore visited by walk (NotifyDirty, NotifyDirtyExcept, NotifyCheck) whenever each intermediate mutation point comes from a world_point in which c remains attached.

In Projection.ApplyDiff, size entries + length adds = size seen holds if and only if zero live keys were removed (dom entries ∖ seen = ∅).

✓ No axioms

During Enumerate, every visited key is added to seen without duplicates, and adds collects every visited key absent from entries (entries !! k = None). Because dom entries partitions into (dom entries ∩ seen) ⊎ (dom entries ∖ seen) while seen partitions into (dom entries ∩ seen) ⊎ list_to_set adds, we obtain the exact removal-count identity size entries + length adds = size seen + size (dom entries ∖ seen). Thus ApplyDiff (Projections.fs lines 987–993) can skip iterating entries altogether whenever entries.Count + Pass.AddedCount = seen.Count, including when failed rows are hidden via HideLast (which leaves entries, seen, and adds intact).

A key-direct derived row (RowsByKey) occupies one inline source slot for its upstream row and still wakes Dirty when the upstream row retires.

✓ No axioms

Certifies the RowsByKey optimisation in Projections.fs and Combinators.fs: derived view rows (MapView, SliceView, FilterView, DistinctView, SortView, GroupView, perKey) read upstream by a fixed key 'K rather than through an intermediate per-row Signal<'K>. Linking directly to up_row keeps the row memo at a single source slot (length = 1) when up_row is its sole source, and retiring up_row via notify_removed marks row_m Dirty without any item-signal write.

ChooseView's per-key boolean gate cuts off every Some u1 -> Some u2 edit (moved = false) while classifying Ready, Pending, and Failed chooser outcomes identically to a two-projection Option.isSome FilterView.

✓ No axioms

Certifies the ChooseView single-projection fusion in Combinators.fs:

  1. After settling GR_Ready (Some u1), a subsequent GR_Ready (Some u2) transition produces moved = false on the boolean gate memo, resolving ChooseView's Check walk to Clean with zero view passes while choices.Get yields Some u2.
  2. Across every Ready, Pending (both unsettled and previously settled), and Failed transition, classify_choice_gate matches FilterView's predicate = true classification over Option.isSome.

Lazily allocating HeldOut's signal cell and staging list refines an eager Signal<'K[]> initialized to Array.empty, preserving read values, observer status, and wake notifications while allocating nothing on empty passes.

✓ No axioms

Certifies the HeldOut<'K> lazy cell and pass-buffer optimisation in Combinators.fs:

  1. Initially (eho = ([], [], false), lho = (None, None, false)) satisfies held_out_rel with zero allocated signal or buffer.
  2. Reading Keys/Cell allocates Some [] on demand, marks it observed, returns the exact same slice as the eager cell, and preserves held_out_rel.
  3. Publishing any combination of staged keys and inherited PendingExtra keys preserves held_out_rel, leaves lho_cell = None whenever no key has ever been held out or read, and wakes observers iff the eager cell wakes observers.

Pooling unionBuf and revisitBuf across Lookup.Invalidate error-recovery passes (with a fresh-buffer fallback on reentrant entry) revisits the exact duplicate-free union failed ∪ affected and restores the empty-buffer invariant.

✓ No axioms

Certifies the Lookup.Invalidate pooled buffer optimisation in Projections.fs:

  1. Whenever failed ≠ ∅ and lookup_pool_inv ps holds, both the non-reentrant pooled branch (lps_busy = false) and the reentrant fallback branch (lps_busy = true) produce a duplicate-free revisit list whose elements are precisely failed ∪ list_to_set affected — identical to allocating a fresh KeySet and ResizeArray per call.
  2. Clearing unionBuf, revisitBuf, and invalidating in finally preserves lookup_pool_inv for subsequent transitions.

Reinserting a single rank-changed key at its binary-search partition point produces the exact output array of a full lexicographic (rank, upstreamIndex) sort.

✓ No axioms

Certifies the SortView.updateOrder single-key fast path in Combinators.fs:

  1. When placed keys are unchanged and only changedIdx changed rank, removing changedIdx from oldPos leaves the n - 1 unchanged indices before ++ after strictly ordered under R(i, j) := compareRanks ranks[i] ranks[j] < 0 ∨ (compareRanks = 0 ∧ i < j).
  2. Binary search partitions before ++ after into pre ++ suf where every index in pre precedes changedIdx under R and changedIdx precedes every index in suf under R.
  3. Shifting order in-place to pre ++ changedIdx :: suf yields a strictly R-sorted permutation of all n indices, which by strict-order permutation uniqueness equals (=) the array produced by any full sort (Array.sortInPlaceWith).

Incremental Grouping move isolates untouched inner views and refines member and outer FirstIdx scans.

✓ No axioms

Moving row u0 from optional group mg_old to mg_new removes u0 from group mg_old (if Some), inserts (u0, k0) by ascending upstream index into group mg_new (if Some), leaves every other group's member cell completely untouched, yields exact group_scan_members for every group (so untouched inner GroupView readers stay asleep), and sorting active non-empty groups by FirstIdx (Members[0].UpIdx) equals group_scan_order over the updated rows.

Bottom-up tournament build finds an optimal rank at the earliest Keys-order slot.

✓ No axioms

For any tree height h, base slot index base, and optional slot ranks leaves:

  • tour_winner (build_tour h base leaves) equals the left-to-right extreme_scan over [base, base + 2^h), and
  • if it returns Some (i_win, r_win), then i_win is a settled slot in [base, base + 2^h) with rank r_win, (r_win <= r)%Z for every settled slot in [base, base + 2^h), and strictly (r_win < r)%Z for every settled slot strictly before i_win.

Incremental SiftUp with early stop agrees bit-for-bit with a full tournament rebuild.

✓ No axioms

Updating slot target in [base, base + 2^h) from leaves to leaves' (v_new at target, leaves everywhere else) and running sift_id_step along the ancestor path of target yields build_id_tree h base leaves', preserves exact equality whenever the early-stop condition fires (cont = false implies nextW = oldW and nextW <> Some target), and shifts left-justified leaves under capacity doubling (build_id_tree_double_cap) with zero comparisons.

Restoring EnsureLive () immediately after keyOf value in CollectionProjection.AddOrUpdateBy prevents inserting zombie items after reentrant disposal during the selector, while agreeing identically with unguarded upserts whenever the collection remains live (Collections.fs AddOrUpdateBy).

✓ No axioms

Models the bug fix from codex-astra-plan.md §2:

Reading a live CollectionProjection row's Signal directly and applying cached ProjectionFold adapters preserves exact equivalence with the two-level RowsOf row-memo read across steady updates, batch-restored cutoffs, generation replacement (remove + re-add), and external FoldReads or comparer failures (Collections.fs, Combinators.fs).

✓ No axioms

Models the Stage B direct collection-row contribution path from codex-astra-plan.md §3:

  • When item_sig_by_gen !! rc_gen cell = Some cell, read_direct_row cell equals read_indirect_row item_sig_by_gen (rc_gen cell).
  • Under the same generation match, fold_direct_step produces the identical row state (fra_gen, fra_has_value, fra_value, fra_err) and fold accumulator state (fas_state, fas_valued, fas_failed, fas_full, fas_moved) as fold_indirect_step — both when rc_gen cell = fra_gen r (in-place update) and when rc_gen cell <> fra_gen r (remove + re-add triggering detach and re-attach).
  • Writing an unchanged or batch-restored value (eq_v (fra_value r) (rc_signal_val cell) = Some true with rc_status = StNone, fra_has_value = true, fra_err = None, rc_gen = fra_gen) leaves both r and fs untouched (fas_moved unchanged, no reducer call).
  • For an invertible, live, unfailed changed row (rc_status = StNone, fra_has_value = true, fra_err = None, eq_v (fra_value r) (rc_signal_val cell) = Some false), the replacement adapter computes sub_fn (fas_state fs) ext (fra_value r) ≫= fun s' => add_fn s' ext (rc_signal_val cell) under the external FoldReads context ext, setting fas_full := true if either fails.

An untracked read (ProjectionFold.Read Peek) on a clean, ready (StNone, stale_live = false) memo returns Ok (n_value d) in identical state s with zero edge mutations, trace emissions, or refresh allocations.

✓ No axioms

Models the Clean /\ StNone Peek fast path in ProjectionFold.Read (Combinators.fs): because read (S (S f)) m false s runs read_node (S f) m inside untracked, g_current is None during track m (so live_current = None and no dependency edge is added), stale_live d = false bypasses refresh_or_pull, and n_status d = StNone directly returns Ok (n_value d) while restoring s verbatim.

When SortView's linear order scan confirms every adjacent pair (rank, up_idx) is ordered under rank_up_le (LocallySorted / Sorted), full_insertion_sort is the identity.

✓ No axioms

Models the certified strict-order fast path for sorted reactive collections: if incoming (rank, up_idx) pairs already satisfy pairwise rank_up_le (whether witnessed by the computable scan is_rank_up_sorted, adjacent LocallySorted rank_up_le, or standard Sorted rank_up_le), full_insertion_sort xs leaves xs unchanged, justifying skipping insertion-sort allocations altogether.

Ranvier.Pure.Concurrency

Under ThreadAffinity.Serialised, graph_enter grants exclusive ownership to a free caller on the construction context (must_release = true), allows reentrant entry by the current holder (must_release = false), and rejects any concurrent thread or wrong context.

✓ No axioms

Matches Graph.Acquire and Graph.Enter (Core.fs lines 2736–2749, 2792, 3274–3306):

  • If cs_holder cs = me, a nested entry succeeds with must_release = false and keeps cs_holder = me.
  • If cs_holder cs = 0 and ctx = cs_context cs, the outermost entry sets cs_holder = me and returns must_release = true.
  • If cs_holder cs holds another thread (cs_holder cs <> 0 /\ cs_holder cs <> me) or ctx <> cs_context cs, entry fails (None).

The PostQueued / PumpFromDispatcher / Release protocol preserves drain_guaranteed and re-posts a drain on exit whenever a contended pump was skipped.

✓ No axioms

Proves the handover comment at Core.fs lines 2756 and 3229 (a full fence ensures the inbox check observes every enqueue whose drain found the graph held by the exiting thread):

  1. post_queued establishes drain_guaranteed.
  2. If PumpFromDispatcher runs while another thread holds the graph (cs_holder cs > 0), skipping the pump (pump_from_dispatcher_contended) preserves drain_guaranteed because cs_holder > 0.
  3. When the holding thread subsequently calls graph_release, cs_pump_posted is guaranteed to be true whenever cs_inbox is non-empty, so no queued work item is ever stranded.

graph_drain_inbox drains every item in FIFO arrival order, isolates throwing items into ds_root_errors without stranding later items, and requests a flush whenever at least one item ran.

✓ No axioms

Matches Graph.Drain (Core.fs lines 3198–3205, where one bad continuation must not strand the rest of the inbox, for the same reason one bad effect must not strand the flush queue):

  • Returns ran = length (ds_inbox ds) and empties ds_inbox.
  • Appends every InboxOk eff in arrival order to ds_applied.
  • Appends every InboxThrow err in arrival order to ds_root_errors.
  • Sets ds_flush_requested = true whenever ds_inbox ds <> [].

Exactly one of pd_try_claim (drain execution), pd_try_close (cancellation), or pd_try_close (graph disposal) succeeds from PdWaiting (0), and all subsequent attempts are no-ops (false).

✓ No axioms

Proves the PendingDispatch<'T> contract (Core.fs lines 1747–1775):

  • Starting from st = 0, the first transition (pd_try_claim or pd_try_close) returns true and moves st to 1 or 2.
  • Once st is 1 (claimed by the drain) or 2 (cancelled or abandoned on disposal), both pd_try_claim and pd_try_close return (st, false), so a cancelled/abandoned item is skipped by the drain and a claimed item cannot be cancelled or faulted by disposal.

Splitting Signal.Value set into inline Enter / unjournaled cutoff check and SetChanged / SetJournaled / SetAfterAcquire cold helpers refines the Entered setter identically and still enforces Guarded affinity before cutoff.

✓ No axioms

Matches Signal.Value (set), SetSlow, SetChanged, SetJournaled, and SetAfterAcquire (Core.fs lines 4450–4547): journaled equal writes still append to the journal, and off-thread equal writes under ThreadAffinity.Guarded still fail (None) before any cutoff check is reached.

Encoding EqualityComparer<'T>.Default on value types and ReferenceComparer<'T> on reference types as null, and null as NullComparer<'T>.Instance, preserves exact comparison and exception outcomes across value, reference, custom, throwing, and faulty-null comparers.

✓ No axioms

Matches NullComparer<'T> and ComparerSentinel.encode / ComparerSentinel.equals (Core.fs lines 4304–4337) and Signal.SetFast / Signal.SetCustom (Core.fs lines 4454–4493):

  • for value types (is_val_type = true), EqualityComparer<'T>.Default maps to SentDefaultNull (null), dispatching directly to val_eq a b without interface dispatch;
  • for reference types (is_val_type = false), ReferenceComparer<'T> maps to SentDefaultNull (null), dispatching directly to ref_eq a b (obj.ReferenceEquals) without interface calls or generic dictionary lookups;
  • a faulty policy returning null maps to SentNullComparer (NullComparer<'T>.Instance), still raising NullReferenceException (CmpNullRef) on comparison;
  • any other comparer (EqualityComparer<string>.Default, StructuralPolicy reference comparers, or custom/throwing comparers) is preserved unchanged as SentCustom.

check_fast_write_token passes inline if and only if the graph is unjournaled and either Unchecked or Guarded on its owner thread (short-circuiting tok = -1 before reading OwnerThreadToken.Current and rejecting uninitialized 0 threads under Guarded), and signal_set_token_fast refines signal_set_entered identically.

✓ No axioms

Matches OwnerThreadToken (Core.fs lines 1792–1807), Graph.fastWriteToken (Core.fs lines 2476–2479), and Signal.SetFast / Signal.SetSlow (Core.fs lines 4454–4506):

  • Since tok >= 0 is checked first, tok = -1 (Serialised or journaled) short-circuits to false without reading OwnerThreadToken.Current, routing all Serialised (including reentrant) and journaled writes to SetSlow.
  • Under Guarded without a journal (tok = owner_tok >= 1), tok = 0 is false and tok = caller_tok holds iff the caller is the owner thread (in particular, an uninitialized thread with caller_tok = 0 is rejected).
  • Across all affinities, threads, and journal states, signal_set_token_fast equals signal_set_entered.

Calling RequestFlushFromEntered after graph_enter has already succeeded skips a redundant Enter/Release round-trip identically to RequestFlush.

✓ No axioms

Matches Graph.RequestFlushFromEntered called from Signal writes, Graph.RunBatchCore, and Graph.Drain (Core.fs): once graph_enter me ctx cs = Some (cs_entered, must_rel), re-entering the same thread immediately returns Some (cs_entered, false) with no state change or release duty, so calling RunFlush directly on cs_entered preserves concurrency and flush behavior across all ThreadAffinity modes.

Caching usesJsIdentity once per Graph and short-circuiting Graph.EncodedComparer to null (SentDefaultNull) produces the exact same sentinel and comparison outcomes as resolving options.Equality.Comparer<'T>() and encoding per node.

✓ No axioms

Matches Graph.usesJsIdentity and Graph.EncodedComparer<'T>() (Core.fs), plus RowsOf / RowsByKey pre-encoded row comparer reuse (Projections.fs): under JsIdentityPolicy on Fable (is_val_type = false, JS ===), Comparer<'T>() always resolves to ReferenceComparer<'T> (CmpRefIdentity), whose encoded sentinel is SentDefaultNull.

Encoding TimedOptions.Comparer (Some c vs None via Graph.EncodedComparer) and short-circuiting reference-type seed checks in Identity.sameSeed preserve exact comparison and exception outcomes across value, reference, custom, throwing, and faulty-null comparers.

✓ No axioms

Matches Timed (Timed.fs), StreamMemo (Streams.fs), and Identity.sameSeed (Api.fs):

Splitting pullable (StreamMemo, AsyncMemo, Boundary) and push (AsyncSource, Timed) Value/TryValue reads on is_clean_and_ready_bits and is_unready_bits preserves exact read outcomes and dependency tracking across all freshness, disposal, and status states.

✓ No axioms

Matches AsyncSource.Value, AsyncMemo.Value/TryValue, Boundary.Value/TryValue (Core.fs), StreamMemo.Value/TryValue (Streams.fs), and Timed.Value (Timed.fs):

Replacing virtual ISource dispatch on Binding (OfSignal vs OfMemo) and Editable.set_Value with concrete IsStaleNode/IsActiveNode/EnsureCurrent calls and a clean-ready Memo.Peek shortcut produces identical refresh and read outcomes across all states.

✓ No axioms

Matches Memo.EnsureCurrent / IsStaleNode / IsActiveNode (Core.fs), Binding.Execute / Binding.Run (Bindings.fs), and Editable.Value setter (Api.fs):

  • is_stale_node m_fr m_disp equals m_fr <> Clean && negb m_disp.
  • Guarding EnsureCurrent with is_stale_node (Editable.set_Value) equals calling EnsureCurrent directly.
  • Concrete Binding.Execute check resolution distinguishes OfSignal (IsStale = false, no loop) from OfMemo identically to ISource.IsStale && ISource.IsActive.
  • binding_read_fast (elif memo.IsCleanAndReady then memo.Peek) equals memo.ReadUntracked () for every (fr, disp, st, v, err).

Encoding struct (int * 'T) voption edits as EditState(version, value) with Unedited.Version = -1 and EditComparer's negative-version short-circuit refines the option-tuple edit representation across cutoff equality, Reset, IsEdited, and Value selection.

✓ No axioms

Matches EditState<'T>, EditComparer<'T>, and Editable<'T> (Api.fs):

  • edit_state_of_opt maps None to es_ver = -1 and Some (ver, v) to es_ver = Z.of_nat ver >= 0.
  • edit_state_eq val_eq matches ref_edit_opt_eq val_eq for any cutoff comparator val_eq, regardless of the arbitrary default payload stored in unedited_state.
  • read_edit_state (IsEdited, Value) matches read_edit_opt for any in_force predicate (covering both Editable and Draft).

Clearing wakePosted := 0 (Volatile.Write) strictly before Enqueue (effect_queued := true) in Timed.Wake makes lost wakeups unreachable across all fine-grained atomic interleavings with off-thread Interlocked.Exchange(&wakePosted, 1).

✓ No axioms

Models Timed.OnTimerFired (TwTimerFire, setting pending_fire := true and posting a wake iff wake_posted = 0), graph-thread Timed.Wake split into two atomic steps (TwWakeClear clearing wake_posted := 0 while tw_wake_in_flight stays true, followed by TwWakeEnqueue setting effect_queued := true and keeping tw_wake_in_flight := (wake_posted =? 1)), and Timed.Execute (TwConsume). Across any interleaving tr from any invariant-preserving state st0 (and from init_timed_wake_state), tw_pending_fire st = true implies tw_wake_posted st = 1 \/ tw_wake_in_flight st = true \/ tw_effect_queued st = true, and a concurrent fire arriving between TwWakeClear and TwWakeEnqueue preserves both tw_wake_posted = 1, tw_wake_in_flight = true, and tw_effect_queued = true. By contrast, running run_bad_wake_trace with Enqueue before Clear reaches a lost wakeup (tw_pending_fire = true /\ tw_wake_posted = 0 /\ tw_wake_in_flight = false /\ tw_effect_queued = false).

Clearing drainPosted before a drain's first take, and when a dispatcher-run pump raises, posts a drain for every queued item across all fine-grained interleavings of off-thread enqueues and posts.

✓ No axioms

Models PostQueued as two atomic steps (DpEnqueue, then DpPost: CompareExchange (&drainPosted, 1, 0) and, on success, dispatcher.Post), a posted or owner-started drain (DpDispatchStart, DpPumpStart: Drain's Interlocked.Exchange (&drainPosted, 0) before the first TryTake), the drain's takes (DpTake, DpDrainEnd), and a dispatcher-run pump that raises before draining (DpDispatchRaise: PumpFromDispatcher's Volatile.Write). Across any trace from a state satisfying dp_inv, and from a new graph:

  1. every queued item is taken by a running drain, has a posted drain ahead of it, has its own post yet to run, or waits for the owning thread's Pump after a raising drain (dp_no_lost_drain);
  2. a set drainPosted always has a posted drain yet to start, so a post that finds it set has a drain to join;
  3. after a raising drain, the next item's post posts a new drain.

By contrast, a drain that clears drainPosted after it ends (run_late_reset_trace) strands an item enqueued after its last take, and a raising pump that leaves drainPosted set (run_raise_keeps_flag_trace) leaves the next item with no posted drain.

Ranvier.Pure.Extensions

Gating a CmpNever signal write behind bool_decide (n_value d <> v) preserves exact equality cutoff when n_value d = v and wakes all observers (ends_dirty) when n_value d <> v.

✓ No axioms

Proves the PublicationComparer optimization contract (Types.fs lines 133–136, Entry.fs lines 10–16, 55–65, 231–249): precomputing changed outside graph.Batch over a CmpNever signal avoids comparing a second time inside Signal.Set while preserving both halves of the signal cutoff contract:

  • When n_value d = v, guarded_pub_write is a no-op (Some (s, tt)), waking zero observers.
  • When n_value d <> v, publishing v updates n and marks every observer m dirty (ends_dirty s1 m).

Refreshing a loaded QueryEntry (qe_data = Some v) or failing a refresh retains qe_data = Some v and never faults the initial-load gate.

✓ No axioms

Proves the stale-while-revalidate contract (Entry.fs lines 81–100, 111–115, 167–185):

  • When qe_data qe = Some v, qe_start preserves qe_data = Some v while setting qe_status = FsFetching and qe_stale = true.
  • When qe_data qe = Some v and the active flight fails (outcome = inr err), qe_publish preserves qe_data = Some v, records qe_error = Some err and qe_stale = true, and keeps qe_gate_faulted = false (only an initial load failure with qe_data = None faults the gate).

QueryLease.Dispose is idempotent, decrements the family reference count at most once, and evicts the shared QueryEntry iff the last active lease releases.

✓ No axioms

Proves the QueryLease ownership contract (Queries.fs lines 66–79, 125–133):

  • Disposing a lease twice equals disposing it once (query_lease_dispose (query_lease_dispose st) = query_lease_dispose st).
  • When ql_lease_disposed st = false and ql_ref_count st = S k with ql_entry_alive st = true, query_lease_dispose sets ql_ref_count to k and keeps ql_entry_alive = true iff k > 0 (evicting and disposing the entry exactly when k = 0, i.e., ql_ref_count st = 1).

QueryDraft edits compose in order on loaded data, leave unloaded entries empty, reject reentrant client calls during staging, and leave the cache untouched if Prepare() fails.

✓ No axioms

Proves the QueryStaging and Commit contracts (Types.fs lines 52–80, Queries.fs lines 163–207, 234–273):

  • Applying [DraftUpdate f; DraftUpdate g] to a loaded draft (Some v) yields Some (g (f v)) with qd_stale = false and qd_updated = true.
  • Applying any sequence of DraftUpdate and DraftInvalidate edits to an unloaded draft (None) preserves qd_data = None and qd_stale = true (unloaded entries are invalidated, never fabricated).
  • While staging = true, client_reentrancy_allowed is false.
  • If prepare_all = None, commit_staging returns the original cache unmodified.

Once the constructing scope is torn down (mvu_disposed = true), mvu_apply drops every message and mvu_run_cmds skips all remaining commands.

✓ No axioms

Proves the scope-bound lifetime contract of Ranvier.Elmish (Mvu.fs lines 17–20, 38–46, 63–65):

  • When mvu_disposed st = true, mvu_apply step msg st = st and mvu_run_cmds cmds st = st.
  • If a command c tears down the owning scope (mvu_disposed (c st) = true), mvu_run_cmds (c :: rest) st runs c and immediately halts without executing any command in rest.

Mvu.Arrive bypassing RunUntracked when graph.IsTracking () = false and Mvu.RunCommands skipping JournalWork when graph.Options.Journal.IsNone agree identically with the full untracked and journaled paths.

✓ No axioms

Proves the Mvu.fs hot-path bypasses:

  • For any tracking environment e and callback apply, arrive_fast e apply = arrive_run_untracked e apply, and when ae_tracking e = false it returns (apply false, e) directly without touching host scope state.
  • For any has_journal flag, command list cmds, and Mvu state st, run_cmds_opt agrees with run_cmds_journaled_spec while emitting WorkNone when has_journal = false.

Lazy initial-load gate allocation (EnsureGate) simulates eager AsyncSource allocation across every trace of entry operations and leaves le_gate = None whenever .Value is never read while empty.

✓ No axioms

Proves the lazy gate optimization in QueryEntry<'T> (Entry.fs):

Unboxed (hasData, data) and per-entry inline draftStaged staging (with DraftSet fusion and pre-batch / rollback reset) refine map-allocated QueryDraft over 'T option for arbitrary edit sequences.

✓ No axioms

Proves the Entry.fs / Queries.fs inline staging optimization:

  • For any initial (has_data, cur) and arbitrary sequence es of ExtUpdate, ExtSet, and ExtInvalidate edits, decode_draft (apply_inline_drafts es (init_inline_draft has_data cur)) equals apply_draft_edits (map to_model_edit es) (init_draft (if has_data then Some cur else None)).
  • Under any edit sequence es, inline_prepare computes the exact same changed bit as model_prepare.
  • Both successful Publish (publish = true) and rollback ResetDraft (publish = false) clear id_staged to false, while rollback leaves (has_data, cur) unmodified.

QueryKey default-comparer equality/hashing handles nullable and unit (None) keys consistently, and checking QuerySession.Guard once at QueryLease matches double-checked QueryLease + QueryEntry guards.

✓ No axioms

Proves the Queries.fs QueryKey devirtualization and QuerySession single-guard elimination:

  • Whenever eqZ is reflexive (eqZ x x = true) and hash-compatible (eqZ x y = true -> hashZ x = hashZ y), qk_default_eq eqZ is reflexive on all option Z (including None for unit/null) and preserves qk_default_hash hashZ without invoking a null dereference on None.
  • For all thread, disposal, and staging flags, single_checked_op agrees with double_checked_op.

QueryEntry.AwaitImmediate allocates zero waiters when FetchStatus = FsIdle with identical outcome, QueryAwaiter.TryClaim is idempotent, and OwnerLink-backed QueryLease.Dispose detaches cleanly and decrements refcount at most once.

✓ No axioms

Proves the Entry.fs / Queries.fs waiter and lease-link optimizations:

BoundValue / BoundSignal struct reads and unchanged-BoundState reuse match fresh allocations under default equality, and BoundSignal.set_Value direct on-thread dispatch matches Graph.Dispatch.

✓ No axioms

Proves the Memo.TryReadStruct, BoundValue/BoundSignal unchanged-state reuse, and BoundSignal.set_Value optimizations (Core.fs, Bindings.fs):

  • decode_struct_reading faithfully decodes TryReadStruct (Status * 'T * exn) tuples into BRReady, BRPending, and BRFailed.
  • Whenever eqZ respects strict equality when custom_cmp = false (forall a b, eqZ a b = true -> a = b), bound_refresh_reuse false eqZ old r = bound_refresh_alloc eqZ old r across all prior states old and readings r, and for custom_cmp = true both also agree unconditionally (bound_refresh_reuse true eqZ old r = bound_refresh_alloc eqZ old r).
  • direct_signal_dispatch on_thread inbox v = queued_signal_dispatch on_thread inbox v.

Synchronous ReactiveCommand execution without CancellationTokenSource preserves exact running-count, error, and task-outcome semantics, and skipping RunUntracked without handlers emits identical events.

✓ No axioms

Proves the ReactiveCommand and ReactiveBindings.notify optimizations (Bindings.fs):

  • rc_sync_direct failure st produces the exact same post-execution rc_state (including restoring rc_running to rc_running st, updating rc_error to failure, and leaving rc_flights unchanged) and rc_task_outcome as rc_sync_with_cts failure st.
  • rc_onthread_task need_task out matches immediate completed task return when need_task = false and exact faulted/canceled propagation when need_task = true.
  • notify_delivered skips RunUntracked (fst = false) whenever has_handlers = false and produces the exact same delivered notifications snd as notify_eager.

Reactive.AnyPending while loop short-circuits cleanly, Exposure.publish backwards scan preserves registration order with zero empty-diff changes, InputState.isModifierKey matches the 15 DOM modifier names, and empty-observer DOM fast-paths match full iteration.

✓ No axioms

Proves the loop, publishing, and observer-guard optimizations in Reactive.fs, Exposure.fs, and Ranvier.Dom:

  • any_pending_loop is_pending xs returns (existsb is_pending xs, vis) where vis is a prefix of xs that visits xs strictly in order up to the first pending node (all prior nodes non-pending, stopping immediately at true).
  • exposure_rev_diff pairs matches exposure_filter_diff pairs and is [] iff every entry text equals its previous text (Forall (fun '(_, a, b) => a = b) pairs).
  • is_modifier_key_match k = existsb (String.eqb k) modifier_key_names for every string k.
  • dispatch_dom_observers obs = obs for every observer snapshot obs.

Skipping any surrogate-free prefix in loneSurrogate, validating single char scalars in-place, and skipping plain BMP runs inside Prescan.check strings preserve exact scanner results.

✓ No axioms

Proves the UTF-16 scalar validation and JSON string pre-scan optimizations (Helpers.fs, Prescan.fs):

  • For any surrogate-free prefix pref (Forall (fun c => is_any_surr c = false) pref) and any suffix suf, lone_surr_from (pref ++ suf) idx = lone_surr_from suf (idx + length pref) (and None when suf = []).
  • For a single UTF-16 code unit c (encodeChar), lone_surr_from [c] 0 = (if is_any_surr c then Some 0 else None).
  • Whenever pending = 0 inside a JSON string, skipping a contiguous run plain of unescaped non-quote characters below 0xD800 (55296%Z) leaves prescan_plain_loop true 0 (plain ++ suf) = prescan_plain_loop true 0 suf.

inPropertyOrder without array-index keys is the identity, Dictionary.Count increase characterizes first-time member insertion, and fitsDecimal in-place mantissa scanning matches string-allocating normalization and ordinal comparison.

✓ No axioms

Proves the Helpers.fs and Codecs.fs zero-allocation algorithms:

  • Whenever is_idx is false on all elements of xs, filter is_idx xs ++ filter (negb ∘ is_idx) xs = xs.
  • For any finite dictionary m : gmap nat Z, inserting (k, v) strictly increases size iff m !! k = None.
  • On any digit/dot list xs, scan_mantissa max_digits xs computes (length (mantissa_digits xs), cmp) such that scan_fits_mantissa max_digits xs = ref_fits_mantissa max_digits (mantissa_digits xs) with zero intermediate list or string allocations.

Ranvier.Pure.Deltas

Ranvier.Pure.FastPaths

Including g_flushing in deferring (deferring_b1) preserves exact program outcomes, states, and traces, and makes pull identical to refresh when g_flushing = true, g_pull_depth = 0, and g_current = None.

✓ No axioms

Every engine primitive except refresh_or_pull is identical between Engine and Engine_B1, and whenever g_flushing = true, any pull leaves g_flushing = true, restores g_pull_depth, and skips settle_flush. Consequently whole-program execution from any non-flushing state (including init fl) and single-node pulls during a flush reach identical final states (hence identical g_trace).

Ranvier.Pure.Combinators

Two-phase memo_on_step surfaces Phase 1 CPending/CFailed while preserving (mo_has_key, mo_last_key, mo_phase2_out, mo_scope_gen), restores mo_phase2_out with zero Phase 2 runs on eq_K-equal settled keys (even after arbitrary unready excursions), and increments mo_scope_gen and mo_compute_runs only on initial or eq_K-unequal settled keys.

✓ No axioms

Matches createMemoOn, createMemoOnWithComparer, createMemoWithOn, and createOwningMemoOnWithComparer (Core.fs, Api.fs): Phase 1 unready readings never clobber the Phase 2 key or discharge its owned scope, equal settled keys restore the cached Phase 2 reading (CReady or Phase 2 CFailed), and unequal settled keys discharge the prior scope generation and invoke compute once.

Across all six FlightPolicy constructors, async_on_step preserves Phase 2 state on eq_K-equal settled keys and Phase 1 CPending/CFailed overlays, sets ao_queued = 2 strictly on unequal settled keys while ao_queued <> 0 under FinishCurrent/Drop/DropWhilePending (resetting ao_has_key = false on owed faulted drops and holding ao_owed_trailing = true on owed FinishCurrent RVal completions), surfaces background completions across all six active policies once Phase 1 recovers, and drains Queue in FIFO start order.

✓ No axioms

Certifies the two-phase AsyncMemo *On engine (createAsyncOn, createAsyncWithOn, createAsyncOnWithPolicy, createOwningAsyncOnWithPolicy, AsyncMemo.bind*, and AsyncSource.bind):

  1. Equal settled keys clear ao_phase1_overlay and ao_owed_trailing while preserving ao_flight_gen, ao_queued, ao_scope_gen, ao_last_key, and ao_phase2_slot.
  2. Phase 1 CPending/CFailed readings uniformly set ao_phase1_overlay across all six policies without mutating ao_has_key, ao_last_key, ao_flight_gen, ao_queued, ao_fifo, ao_phase2_slot, or ao_owed_trailing.
  3. Unequal settled CReady k' during an active deferring flight (ao_queued <> 0 under FinishCurrent/Drop/DropWhilePending) sets ao_queued = 2 while retaining ao_last_key and ao_flight_gen.
  4. Under active_overlay_flight st (active in-flight state across all six policies, covering both CPending and CFailed Phase 1 overlays), background settlement updates ao_phase2_slot behind the overlay and surfaces immediately with zero new launches once Phase 1 settles back to an eq_K-equal key.
  5. When an owed (ao_queued = 2) flight faults under FinishCurrent or DropWhilePending, async_on_settle resets ao_has_key = false so async_on_step on any CReady k (even k = ao_last_key) launches a fresh flight (ao_queued = 1, ao_flight_gen = S gen); when an owed FinishCurrent flight completes with RVal u, ao_phase2_slot stores CReady u while ao_owed_trailing = true holds ao_visible = CPending ao_self_id until async_on_step on eq_K-equal CReady k clears ao_owed_trailing and surfaces CReady u with zero new launches.
  6. Under Queue, out-of-order completions g2 then g1 (g1 <> g2) hold ao_phase2_slot until g1 arrives and apply out1 then out2 in start order.

Fused eval_fused_chain produces the exact same (St * comb_reading B), origin, and multi-step trace as sequential unfused eval_unfused_chain over arbitrary boolean stage cutoffs eq_i without Leibniz equality, early-exiting on intermediate stage cutoffs and attributing stage throws to the throwing stage's node_id.

✓ No axioms

Certifies MapFusion (FusedSignalMap1--4, FusedSourceMap1--4, FusedChainMap in Core.fs) across Signal.map, Memo.map, AsyncMemo.map, AsyncSource.map, and StreamMemo.map (Core.fs, Streams.fs, Api.fs):

  1. From any synchronized state chain_sync uc fc, single-step eval_fused_chain and eval_unfused_chain return identical (St, comb_reading B) and preserve chain_sync across CPending, upstream CFailed, stage throws, intermediate cutoffs, and full CReady propagation.
  2. Over any input trace inputs starting from init_fused_chain spec and init_unfused_chain spec, run_fused_chain and run_unfused_chain yield identical final St (allocation/identity state) and output reading sequences.
  3. On an intermediate cutoff (eq_m old_m v_mid = true) or stage throw (RThrow ex), eval_fused_chain stops at that stage without invoking downstream rest steps, preserving cached_tail or attributing CFailed ex id to stage id.

Static eval_map2 and eval_zip match sequential let! x = r1 in let! y = r2 in f x y across all 3 * 3 comb_reading pairs, preserving St, failure origin, and static [id1; id2] upstream edges.

✓ No axioms

Certifies map2 and zip across Signal, Memo, AsyncMemo, AsyncSource, StreamMemo, and RanvierExtensions.Zip: the fast both-ready check combined with slow left-to-right unready resolution yields the exact same (St * comb_reading C) and origin as monadic comb_bind evaluation across all nine constructor combinations, skips f (St unchanged) whenever either input is unready, and retains both static upstream edges [id1; id2] without dynamic re-tracking churn.

Split split_bind_step invokes binder iff outer settles to an initial or eq_K-unequal key, discharges the prior outer scope iff sb_has_key = true and outer settles to an eq_K-unequal key, and performs zero binder calls or scope discharges across inner U transitions and transient outer CPending/CFailed excursions recovering to an eq_K-equal key.

✓ No axioms

Certifies Signal.bind, Memo.bind (SplitBindState in Core.fs, Api.fs), and RanvierExtensions.SelectMany (Ranvier.CSharp/Extensions.fs):

  1. sb_binder_runs increments if and only if r_outer = CReady k with sb_has_key = false or eq_K sb_last_key k = false; otherwise sb_binder_runs is unchanged.
  2. sb_discharges increments if and only if r_outer = CReady k with sb_has_key = true and eq_K sb_last_key k = false; otherwise sb_discharges is unchanged.
  3. Across any sequence of inner U transitions inners ++ [inner_last] while outer settles to an eq_K-equal key k, split_bind_inner_ticks updates sb_visible to inner_last inner_id with zero binder runs and zero scope discharges.
  4. Across any sequence us of transient outer CPending/CFailed readings followed by CReady k with eq_K sb_last_key k = true, split_bind_outer_steps preserves sb_bound, sb_last_key, sb_binder_runs, and sb_discharges, resuming resolve_bound_inner directly.

with_eval_depth and with_suspended_run return ce_depth to its entry value on every RVal/RThrow outcome, MemoBuilder.BindReturn at depth 0 constructs one static node (MemoStatic) and leaves read and f unevaluated, and at depth S d it evaluates inline (MemoInline) with a tracked Phase 1 read, an untracked f, and zero node allocations of its own.

✓ No axioms

Certifies the reentrant evalDepth dispatch of Ranvier.CE (InternalCeState, MemoStep<'Phase, 'Prev, 'U>, and MemoRunner.EvalBound / CeRuntime.ProbeBound):

  1. with_eval_depth (CeRuntime.CreateDynamicMemo) runs body at depth S d and with_suspended_run (CeRuntime.SuspendNested / InternalCeState.SuspendForNestedRun) runs it at depth 0; both end at the entry depth d with the body's outcome res, tracking flag, and node count, for RVal v and RThrow ex alike via InternalCeState.ExitEval.
  2. After a dynamic evaluation entered at depth 0 ends with any outcome, including a Phase 1 NotReadyException or an exception thrown inside match!, the next top-level MemoBuilder.BindReturn dispatches statically.
  3. At depth 0, ce_bind_return_eval returns OfFactory n (MemoStatic) for the fresh node n = ce_nodes_created st and increments the node count by one. The result is independent of read and f.
  4. At depth S d, read runs with ce_tracking = true. An unready Phase 1 reading ends the step with its exact CPending src or CFailed ex orig and the entry state, leaving f unevaluated. A ready reading runs f at depth S d with ce_tracking = false (EnterUntrackedPure / RunUntrackedPureArg) and the entry node count; the step then restores the entry tracking flag and takes its depth and node count from the result state of f.
  5. A synchronous CPending src raised by the untracked f surfaces as CFailed (wrap_ex src) self_id.
  6. CeRuntime.SuspendNested around MemoRunner.EvalBound (with_suspended_run around ce_bind_return_eval) constructs one node via CeRuntime.ProbeBound and returns to the entry depth, at the top level and for a nested memo { ... } inside an owning Phase 2 callback alike.

Right-nested MergeSources over $n \ge 2$ sources reads as the sequential let! chain, with left-to-right CPending/CFailed precedence and exact origin, and its nested struct-tuple key cuts off iff every component predicate holds.

✓ No axioms

Certifies let! ... and! ... over $n \ge 2$ sources in Ranvier.CE (MergeSources returning MergedSignals, MergedMemos, or MergedReactive, nested to the right), generalizing the two-source precedence of B19:

  1. eval_merged_chain sc = eval_seq_chain sc: the merged reading is the nested tuple of all $n$ ready values, or else the exact CPending src or CFailed ex origin of the leftmost unready source.
  2. eq_chain eqs k1 k2 = true iff every entry of eq_checks eqs k1 k2 is true.
  3. On a Memo.CreateOn node (memo_on_step, B16) under eq_chain eqs with no settled key, a run that settles sc to CReady k1 followed by a run that settles sc' to CReady k2 keeps mo_compute_runs unchanged on the second run iff eq_chain eqs k1 k2 = true.

Ranvier.Pure.MemoTable

T9b: Settled Forward Simulation (CutoffComparer, Ruling R2).

✓ No axioms

Under cutoff_sound (PolyComparer eq_V), for EVERY demonic schedule tr_ev of ActEvictPayload and ActRetireKey, MemoTable (evict_enabled = true) produces obs_eq read answers for all ActGet queries across the entire trace, and at every quiescent flush (tr_ev ++ [ActFlush]) settles every live Effect (eid ∈ all_effects) to the exact same ef_settled output as the unbounded memo family (evict_enabled = false) on strip_evictions tr_ev ++ [ActFlush].

T10: Converse Termination / Completeness (unbounded_family_refines_memotable).

✓ No axioms

Whenever the unbounded 'K -> Memo<'V> program settles in fuel_unb steps on tr_unb (dag_run_fueled fuel_unb cm false tr_unb = Some (st_unb, outs_unb)), then for every finite demonic eviction schedule tr_ev projecting to tr_unb (strip_evictions tr_ev = tr_unb), MemoTable terminates at length tr_ev with obs_eq read answers and identical signal state.

T12: Quiescent Denotational Agreement / No Lost Wakeups (memotable_no_lost_wakeups).

✓ No axioms

After any sequence of signal writes, Get reads, intermediate flushes, payload evictions, and key retirements ending in ActFlush (under either PolyStamp or PolyComparer satisfying cutoff_sound cm), every live Effect (eid ∈ all_effects) is Clean and its settled output equals the pure denotation eff_eval eid (dg_sigs st_ev) (fun k => (rule_eval (dg_sigs st_ev) k).1), and every subsequent ActGet k returns an outcome obs_eq to (rule_eval (dg_sigs st_ev) k).1.

Ranvier.Pure.MemoTableWitnesses

T14: Pre-Track fan-out coherence.

✓ No axioms

When caller reads k for the first time (observer_count s (sl_node sl) = 0), pinning k before running compute k ensures that even if compute k creates sibling keys and executes arbitrary retirement sweeps ops (trying to retire every ObserverCount = 0 slot, including k), sl_node sl remains live and un-retired so the subsequent sources_add caller (sl_node sl) (Graph.Track) links caller -> sl_node sl coherently with world_reachable and memotable_inv preserved.

Ranvier.Pure.MemoTableFastPaths

Ranvier.Heap.ObserverSet

Ranvier.Heap.Marking

Ranvier.Heap.Run

Ranvier.Heap.Scheduler

Ranvier.Heap.Ownership

Ranvier.Heap.Adequacy

Ranvier.Heap.Collections

Ranvier.Heap.Concurrency

Ranvier.Heap.Extensions

Ranvier.Heap.Deltas

Ranvier.Heap.MemoTable

T25: Separation-logic specifications for slot_get_code (slot_get_and_refill_spec)

✓ No axioms

covering:

  1. Post-dispose guard (disposed = true returns InjLV #disposed_table_failure),
  2. Cycle detection (is_active = true returns InjLV #cycle_detected_failure or InjRV #cycle_val, Ruling R1),
  3. Resident hot hit (SlotResident v ms returns InjRV #v and preserves pin count via +64 / -64),
  4. Oversized bypass (max_w < item_w returns InjRV #v, transitions slot directly to SlotEvicted ms with value_cell = NONEV, and leaves warm is_lru_ring completely untouched, Ruling R5),
  5. Within-budget miss/refill (item_w <= max_w stores SOMEV #v, pushes sl to MRU head of is_lru_ring, and restores pin count).

T26: Payload eviction (slot_clear_payload_code) and dormant slot retirement (slot_evict_and_retire_spec)

✓ No axioms

composing:

  1. GC-root payload clearing (value_cell <- NONE), keeping SOMEV #st when keep_stamp = true (CutoffStamp, T9a) and dropping stamp_cell <- NONE when keep_stamp = false (CutoffComparer, T9b),
  2. Upstream EdgeWorld detachment via sources_clear_code (world_direct_unlink_spec in Heap/Collections.v),
  3. Active mid-list OwnerLink unlinking from mt_owner via owner_links_unlink_code (owner_links_active_mid_unlink_spec in Heap/Collections.v).

T27: Passive, idempotent MemoTable.Dispose() specification (memotable_dispose_spec, Ruling R3):

✓ No axioms
  1. When already disposed (disposed = true), memotable_dispose_header_code is a pure no-op;
  2. When live (disposed = false), memotable_dispose_header_code sets disposed <- #true, detaches all child OwnerLinks from mt_owner (ol) in O(1) via owner_links_detach_code (incrementing ol's generation so stale unlinks become no-ops), resets hdr's head, tail, and total_weight to 0, and leaves scheduler queues untouched.

Ranvier.Extract