Documentation

Miri.Memory.AllocAddresses.GlobalState

A checked port of the non-host-specific state transitions in Miri's alloc_addresses/mod.rs. Allocation metadata, liveness, host addresses, borrow-tracker exposure, and cross-thread clock acquisition remain explicit caller hooks.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[instance_reducible]
        Equations
        • One or more equations did not get rendered due to their size.
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            • reuse : Bool

              Outcome of the source address-reuse Bernoulli draw.

            • crossThread : Bool

              Outcome of the cross-thread Bernoulli draw, consumed only after reuse.

            • poolIndex : Nat

              Absolute pool index in the source begin..end random range.

            • slack : Fin 16

              Slack outcome in the source 0..16 range for a fresh address.

            Instances For
              • externalAddress : Option UInt64

                Native libraries supply physical addresses; absence remains an explicit capability requirement.

              Instances For
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Instances For
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                @[instance_reducible]
                                Equations
                                • One or more equations did not get rendered due to their size.

                                A selected cross-thread reuse is not reported as immediately usable until its synchronization hook has completed.

                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Cache first in baseAddr, then add the nonzero address to the sorted inverse vector. A duplicate inverse address reports the source unwrap_err failure after retaining the earlier base-map insertion.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        The cached fast path precedes allocation-info and random-choice requirements. Managed choices remain explicit; native addresses require external hooks.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          Complete a cross-thread reuse after the caller has acquired the returned clock. The address is cached only after successful acquisition, matching the source's ? before interp_ok.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Source alloc_id_from_addr, with allocation-size and liveness lookups as explicit caller hooks. Negative accesses search from addr.saturating_sub(1). Only addresses in exposed allocations produce wildcard provenance.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def Miri.Memory.AllocAddresses.GlobalAddressState.exposeProvenance (state : GlobalAddressState) (provenance : Provenance) (allocationLive? : Option Bool) (borrowTrackerEnabled : Bool) (tagHook? : Option (Except String Unit)) :

                                              Source expose_provenance. If borrow tracking is enabled, insertion into the exposed set precedes the explicit tracker hook result.

                                              Equations
                                              Instances For

                                                Source ptr_from_addr_cast: default mode retains wildcard provenance and reports the source warning as metadata; strict mode returns the explicit stop.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For

                                                  The source GC hook only removes entries from the cached id-to-base map. The inverse map and exposed set are already cleared by free.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For

                                                    Source ptr_get_alloc. This returns a concrete allocation directly or resolves wildcard provenance through the exposed inverse map; validity and allocation bounds are checked by later memory hooks.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      Source free_alloc_id: remove inverse/exposed membership while retaining the base cache, then offer the freed range to the reuse pool.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        theorem Miri.Memory.AllocAddresses.GlobalAddressState.allocation_base_zero (state : GlobalAddressState) (address : UInt64) (id : AllocId) (hooks : AddressLookupHooks) (position : Nat) (mode : state.provenanceMode ≠ ProvenanceMode.strict) (search : Miri.Memory.AllocAddresses.GlobalAddressState.findInverseIndex✝ state.intToPtrMap address = (position, true)) (row : state.intToPtrMap[position]? = some { address := address, allocId := id }) (exposed : state.exposed.contains id = true) (live : hooks.isLive id = some true) :
                                                        state.allocIdFromAddr address 0 hooks = Except.ok (some id)

                                                        Proof interface to the existing inverse-search consumer, exact base case.

                                                        theorem Miri.Memory.AllocAddresses.GlobalAddressState.allocation_interior_zero (state : GlobalAddressState) (address base : UInt64) (id : AllocId) (hooks : AddressLookupHooks) (size : ABI.Size) (position : Nat) (mode : state.provenanceMode ≠ ProvenanceMode.strict) (search : Miri.Memory.AllocAddresses.GlobalAddressState.findInverseIndex✝ state.intToPtrMap address = (position + 1, false)) (row : state.intToPtrMap[position]? = some { address := base, allocId := id }) (known : hooks.sizeOf id = some size) (inside : address - base < size.bytes) (exposed : state.exposed.contains id = true) (live : hooks.isLive id = some true) :
                                                        state.allocIdFromAddr address 0 hooks = Except.ok (some id)

                                                        Proof interface to the existing inverse-search consumer, interior case.

                                                        theorem Miri.Memory.AllocAddresses.GlobalAddressState.pointer_from_selection (state : GlobalAddressState) (pointer : Pointer Provenance) (count : Int64) (hooks : AddressLookupHooks) (arithmetic : PointerArithmetic) (id : AllocId) (base relative : UInt64) (selected : (match pointer.provenance with | Provenance.concrete id tag => Except.ok (some id) | Provenance.wildcard => state.allocIdFromAddr pointer.offset.bytes count hooks) = Except.ok (some id)) (cached : Array.find? (fun (row : BaseAddressEntry) => row.allocId == id) state.baseAddr = some { allocId := id, address := base }) (truncated : arithmetic.truncateToTargetUsize (pointer.offset.bytes - base) = Except.ok relative) :
                                                        state.ptrGetAlloc pointer count hooks arithmetic = Except.ok (some (id, ABI.Size.ofBytes relative))

                                                        The selected allocation and a current base cache complete ptr_get_alloc.