Skip to main content

Module mc

Module mc 

Source
Expand description

Approximate probabilistic inference via Monte Carlo sampling.

This engine samples probabilistic facts / annotated disjunction decisions on the GPU and evaluates the deterministic core in each sampled world.

For programs with non-monotone recursion (cycles through not and/or aggregates), Monte Carlo evaluation requires the user to opt into the approximate probabilistic engine. The deterministic evaluation uses a bounded, cycle-aware semantics:

  • If an SCC reaches a fixpoint under synchronous iteration, that fixpoint is used.
  • If the SCC enters a cycle, the interpretation is the intersection of all states in the cycle (skeptical, invariant tuples only). This avoids parity/oscillation dependence on iteration count while remaining fully deterministic and explicit.

Structs§

EvidenceForcing
Compiled evidence forcing for the MC sampler.
McDeviceResult
Device-resident Monte Carlo result counts.
McEvalConfig
Configuration for Monte Carlo probabilistic inference.
McHotLoopTransfers
Legacy back-compat surface — tracked (data-plane) host<->device transfer deltas measured around the MC measured region.
McNoHostStats
No-host-interaction instrumentation for the measured engine region.
McProgram
McQueryEstimate
McResidentResult
Device-resident result of a GPU-resident MC run. Counts stay on device; the caller decides whether/when to download them (after the measured region).
McResult
McTimingBreakdown
Breakdown of time spent in each phase of MC evaluation. Gate with XLOG_MC_PROFILE=1 to print at the end of evaluation.
ResidentPlan
Compiled, device-uploadable plan for the resident engine.
ResidentRejection
A typed fail-closed rejection: which rule was violated, the offending construct, and the surrounding context (for diagnostics).

Enums§

ForceabilityReason
Why evidence may or may not be forceable to root Bernoulli variables.
McCountStrategy
Strategy for counting evidence-satisfied samples in the MC loop.
McEngine
Which engine produced an McResult.
McSamplingMethod
Sampling method for Monte Carlo inference.
ResidentRejectKind
Kind of a fail-closed rejection of an MC program by the resident engine.

Constants§

NONMONOTONE_SEMANTICS
Bounded semantics for non-monotone SCC evaluation inside MC sampling.

Functions§

compile_resident_plan
Compile an McProgram into a resident-engine plan, or return a typed fail-closed rejection for anything outside the supported fragment.