docs / validation

Simulation (Material Twin)

The Material Twin is the digital twin of the execution substrate. It simulates Matter inside Material constraints -- verifying behavior, testing constraints, and establishing baseline distributions before committing to physical execution on Material Cloud.

Purpose

Physical execution on Material Cloud consumes real resources and modifies physical state. The Material Twin exists to catch problems before Matter reaches Material substrates. Every Molebyte should pass simulation before it is eligible for policy approval and physical scheduling.

Simulation results become evidence: they attach to the Molebyte in Vault and are referenced during policy evaluation. A Molebyte without simulation evidence may be denied by policy, depending on consequence tier requirements.

What simulation validates

Behavioral correctness

Verifies that gate logic produces expected output distributions for given inputs. Tests state transitions, boundary conditions, and edge cases against the substrate model.

Constraint satisfaction

Confirms that declared constraints (confidence thresholds, drift tolerances, cost ceilings) are achievable under modeled substrate conditions. Flags constraints that are likely to be violated during physical execution.

Baseline establishment

Produces the expected output distributions that become the reference baseline for drift detection. After physical execution, signals are compared against these simulation baselines to detect divergence.

Cost estimation

Models the expected resource consumption and execution cost. Cost estimates feed into policy evaluation and help operators decide whether to proceed, optimize, or select a different substrate pool.

Simulation workflow

  1. Submit Molebyte -- Provide the compiled artifact and target substrate model to the simulation engine.
  2. Model selection -- The engine selects the appropriate substrate model based on the Molebyte's substrate specification.
  3. Execution -- The PEP runs against the model. Multiple iterations generate statistical distributions.
  4. Evidence production -- Results are packaged as simulation evidence: output distributions, constraint feasibility, cost estimates.
  5. Vault attachment -- Evidence is stored in Vault and linked to the Molebyte for policy evaluation.

Simulation evidence structure

{
  "simulation_id": "sim_01HQ3Y9L0MEBB4SQWDH7D9XFNT",
  "artifact_id": "mb_01HQ3X7K9NFAA2RPWDG5B8VCMT",
  "substrate_model": "molecular_v2",
  "iterations": 2048,
  "results": {
    "output_distribution": {
      "mean": 0.89,
      "std_dev": 0.04,
      "confidence_interval": [0.82, 0.95]
    },
    "constraint_feasibility": {
      "confidence_threshold": "pass",
      "cost_ceiling": "pass",
      "drift_tolerance": "pass"
    },
    "estimated_cost": 0.031
  },
  "completed_at": "2026-02-20T14:32:00Z"
}

Simulation vs. physical execution

The Material Twin runs Matter against mathematical models of Material substrates, not physical substrates. This means simulation results are predictions, not measurements. The gap between Material Twin and Material Cloud execution is expected and is precisely what drift detection monitors. The Material Twin establishes the prediction; Material Cloud produces the measurement; diffing quantifies the gap.