Documentation

Miri.Input.EvalForeignConstruction

Source-owned common foreign operations. This stage has no foreign/platform interpreter input and no allocator/read/write/control behavior supplied by the caller. Platform and portable dispatch assembly consumes this constructed record; it must not be substituted for a complete final foreign dictionary.

@[reducible, inline]
abbrev Miri.Input.EvalForeignConstruction.User (Os R P H D O Aff B Host : Type) :
Equations
Instances For
    @[reducible, inline]
    abbrev Miri.Input.EvalForeignConstruction.M (Os R P H D O Aff B Host A : Type) :
    Equations
    Instances For
      Instances For

        Exact compiler queries which are not yet in the prepared symbol catalog. Their outcomes are evidence obligations, not arbitrary foreign execution.

        Instances For

          Genuine host FFI and OS-error effects. The native destination is known to be memory because source force_allocation has already run.

          Instances For

            Constructed common source bodies, deliberately without platform/portable execution slots. This is a source construction intermediate, not a whole ForeignItems.Hooks baseline that an external caller may override.

            Instances For
              def Miri.Input.EvalForeignConstruction.common {Os R P H D O Aff B Host C : Type} (p : CompilerProviders.Prepared) (options : Options) (symbols : Symbols (State Os R P H D O Aff B Host)) (host : HostEffects (State Os R P H D O Aff B Host)) (access : Interpreter.ValidityMachine.Access Memory.MiriMemoryKind (Stored Os R P H D O Aff B Host)) (allocation : Interpreter.PlaceMachine.AllocationConfig Memory.MiriMemoryKind (User Os R P H D O Aff B Host)) (extras : Interpreter.MemoryExtras.Hooks Memory.MiriMemoryKind (User Os R P H D O Aff B Host) P) (deallocationDiagnostic : Memory.AllocId → Interpreter.PlaceMachine.MachineM Memory.MiriMemoryKind (User Os R P H D O Aff B Host) Unit) (nativeDrop : Option (Memory.Allocation Memory.Provenance TreeBorrows.BorrowTree → Interpreter.MachineHooks.M Memory.MiriMemoryKind (User Os R P H D O Aff B Host) Unit)) (pointer : Interpreter.PointerMachine.Hooks Memory.MiriMemoryKind (Interpreter.ValidityMachine.Control (Stored Os R P H D O Aff B Host))) (spans : Interpreter.AllocationDriver.SpanHooks) (place : Interpreter.PlaceHooks Memory.Provenance (State Os R P H D O Aff B Host) C Interpreter.MachineHooks.FrameExtra) (callFunction : C → Interpreter.CallInstance → Array (Interpreter.RvalueImmTy Memory.Provenance) → Interpreter.ReturnContinuation → M Os R P H D O Aff B Host Unit) (choice : C) :
              Except Interpreter.StepError (Common (State Os R P H D O Aff B Host))

              The common interpreter is assembled from the same source allocation, place, ABI and pointer dictionaries as MIR execution. callFunction is the internal recursive edge supplied by source Config construction.

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

                Project source-built primitives into the nonrecursive foreign Core. Exit replacement reads the actual World and needs only exact source span metadata; no whole MainMachine or platform interpreter is supplied. Native enablement is sampled from the actual loaded library list at this construction event.

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

                  math.rs uses sig.rs294–331's deprecated check for every exported arm. Capture this call's actual ABI, preserving symbol-clash before ABI/count checks; no expected ABI or scalar-layout compatibility check is added to this rule.

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

                    Portable memory/string operations consume only Core. Every byte access, write, copy and alignment check is constructed from actual MIR operations; libc::wchar_t remains an exact compiler query.

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

                      Bind portable C memory/string calls to the same physical access, pointer and place machine as MIR. Other portable names retain their existing resolver. The memory dispatcher checks its source name table before reading operands.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Miri.Input.EvalForeignConstruction.unixRandom {Os R P H D O Aff B Host C : Type} (h : Common (State Os R P H D O Aff B Host)) (spans : Interpreter.AllocationDriver.SpanHooks) (access : Interpreter.PlaceMachine.AccessConfig Memory.MiriMemoryKind (User Os R P H D O Aff B Host)) (tape : Interpreter.ExecutionChoices.Access (State Os R P H D O Aff B Host)) (place : Interpreter.PlaceHooks Memory.Provenance (State Os R P H D O Aff B Host) C Interpreter.MachineHooks.FrameExtra) (choice : C) (communicate : Bool) (hostUsizeBits : Nat) (hostFill : Nat → M Os R P H D O Aff B Host (Except String ByteArray)) (signature : String → M Os R P H D O Aff B Host (ABI.FnAbi MIR.TyId)) (errnoNegOne : String → Interpreter.MPlaceTy Memory.Provenance → M Os R P H D O Aff B Host Unit) :

                        Construct the connected Unix entropy family from Common source effects. ForeignItems uses a typed RuntimePlace, while the Unix shim ABI writes through an allocated MPlaceTy. The adapter below materializes only at the source force-allocation boundary and routes every write back through Common's actual place operations. Isolated bytes use EvalCoreMachine's tape; communicate mode requires the caller's real host getrandom effect. The signature and errno providers are the pinned compiler and Unix environment queries respectively.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Miri.Input.EvalForeignConstruction.windowsRandom {Os R P H D O Aff B Host C : Type} (h : Common (State Os R P H D O Aff B Host)) (spans : Interpreter.AllocationDriver.SpanHooks) (access : Interpreter.PlaceMachine.AccessConfig Memory.MiriMemoryKind (User Os R P H D O Aff B Host)) (tape : Interpreter.ExecutionChoices.Access (State Os R P H D O Aff B Host)) (place : Interpreter.PlaceHooks Memory.Provenance (State Os R P H D O Aff B Host) C Interpreter.MachineHooks.FrameExtra) (choice : C) (communicate : Bool) (hostUsizeBits : Nat) (hostFill : Nat → M Os R P H D O Aff B Host (Except String ByteArray)) (signature : String → M Os R P H D O Aff B Host (ABI.FnAbi MIR.TyId)) :

                          Construct the Windows entropy family through the same Common runtime place materialization and canonical memory access as ordinary MIR. The host random fill and exact named System ABI are required effects; isolated bytes consume the shared source-choice tape.

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

                            Source portable-extern order from shims/foreign_items.rs: Miri-specific, backtrace, then C memory/string arms. These three families all consume the same nonrecursive Core, so a portable shim observes the canonical state and ABI/pointer checks made by common construction. The compiler repr(C) query is kept lazy until miri_resolve_frame is selected.

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

                              Close the source dispatcher only after each source family has been constructed. The platform functions are required values (not a copied baseline Hook record); callers must pass the actual Unix or Windows source dispatcher and exact math source.

                              Equations
                              Instances For