This release is a pre-release and may not be stable for production use.
SimAudit
SimAudit tests changes to simulators on states and actions you supply. It can detect a parameter write that left stale constants, measure numerical order, compare engine versions and check the observations a simulator returns. Version 0.2.0a1 also tests passive energy drift, fits a named parameter on independent starts, and screens trajectory logs for violations of specified physical laws.
The core requires Python 3.11+ and NumPy. Gymnasium, MuJoCo, SymPy and pytest are optional. APIs are in alpha. PyPI · Changelog · Issues
Install and run
From this checkout, install the alpha and run the included oscillator. The demo uses separate implementations of the RK4 step and its analytical update.
python -m pip install .
simaudit plan drift --inputs simaudit.demo:inputs
simaudit diagnose drift --inputs simaudit.demo:inputs --strict --json drift.json
The two checks should both print PASS and coverage should be complete. The JSON retains the refinement measurements. To exercise all eight branches, run simaudit diagnose full --inputs simaudit.demo:inputs --strict. The demo uses the same interpreter twice as a control for release comparison.
For the published package, python -m pip install --pre simaudit selects the latest alpha on PyPI. The commands above require 0.2.0a1 or later. Install simaudit[algebra] for polynomial attribution, simaudit[gymnasium] for CartPole or simaudit[mujoco] for the native MuJoCo and Reacher adapters. From a checkout use, for example, python -m pip install '.[algebra,mujoco]'.
Choose a check
| Question | Command after simaudit diagnose |
Required inputs |
|---|---|---|
| Did a parameter write take effect? | assignment |
Replay adapter, probes, direct assignment and fresh construction |
| Does a new release take a different first step? | release |
Two installed interpreters, trusted adapter factories and matched probes |
| Is the observation stale? | observation |
Replay, emitted observation and a reference observation map |
| Does the integrator reach its declared order? | order |
Smooth replay, adjustable timestep, state distance and declared order |
| Does passive energy drift agree with the declaration? | energy or drift |
Reference energy and conservative probes. drift also measures state order. |
| What value of a named parameter fits these dynamics? | fit |
Bounded affine energy family, training and held-out start groups, tolerances |
| Which named laws changed? | screen |
Independent healthy and candidate groups, matched conditions and polynomial laws |
| Which parameter explains a flagged law? | attribution |
Screen inputs, known constraints and competing bounded affine templates |
Use --inputs my_module:factory to provide a trusted Python callable returning WorkflowInputs. A plan previews prerequisites without stepping the simulator. A full diagnosis runs eligible checks and reports missing inputs. Factories execute locally with your process permissions. Workflow guide and examples
Test your own simulator
For a single check, wrap the simulator step and its native reference. Each callback must restore everything needed to reproduce the requested state, action and timestep.
import numpy as np
from simaudit import Adapter, Feature, Report, check_order
def step(state, action, dt):
return state + dt * (state + action)
def native_reference(state, action, dt):
return np.asarray([(1 + dt) * state[0] + dt * action])
adapter = Adapter(
name="Euler scalar ODE", step_fn=step, native_step_fn=native_reference,
features=[Feature("dynamics", "tested", "Smooth scalar ODE", True)],
smooth=True, declared_order=1, dt=0.2,
)
result = check_order(adapter, [[0.5], [1.0], [1.5]], [0, 0, 0])
Report([result]).write("audit.json")
print(result.status.value)
The single-check CLI accepts a trusted adapter factory and a JSON file containing matching states and actions. From this checkout run the following example. Adapter contract and energy units
PYTHONPATH=examples simaudit energy --factory passive_oscillator:factory \
--probes examples/oscillator-probes.json --strict --json energy.json
For release comparisons, supply --python-a and --python-b to simaudit release. Each worker uses its own installed simulator and records its version. Both workers must be able to import the factory. The first-step difference determines the verdict. The report also records subsequent divergence.
Read a verdict
PASS means the check met its criterion on the supplied probes. FAIL records a discrepancy. ABSTAIN means the signal could not resolve the question, SKIPPED identifies missing capabilities, PARTIAL identifies unsupported conditions, and BLOWUP records a numerical failure. Inspect the scope, reference, feature inventory and individual probe results alongside the verdict. A shared error in a simulator and its reference can escape detection. Parameter attribution is conditional on the supplied hypotheses.
A failed check or empty report exits 1. With --strict, any nonpass or incomplete workflow also exits 1. Invalid configuration exits 2. The original commands, pytest fixture and report schema 1.0 remain available. Workflow JSON embeds that report under report. Report format
Validation and development
On the conservative heavy-top model, the ball-joint RK4 check found below-declaration order on 23 of 24 probes with MuJoCo 3.2.7, 3.10.0, 3.16.0 and 3.17.0. One probe abstained in each run. All 24 passed on 4.0.0 and 4.0.1. The three-hinge control passed on every tested engine. On the Acrobot and Reacher workflow controls, six law-level attributions selected the injected parameter. Recovery abstained on the structural Acrobot fault. Measurements, versions and reproduction commands
python -m pip install -e '.[dev,mujoco,algebra]'
python -m pytest -q
python -m build
python -m twine check --strict dist/*
The pytest extra exposes the simaudit_check fixture. Pass a check result to it inside a test. A discrepancy fails the test. Other nonpasses skip with the diagnostic reason. Use pytest --simaudit-strict --simaudit-json results.json for strict serial reporting.
Method papers and licence
- Tesfay Zemuy Gebrekidan, Diagnosing Model and Discretisation Errors in Reinforcement Learning Simulators Using Invariants (2026). Source for assignment consistency, energy fingerprints, state refinement and energy-based parameter fitting. Zenodo
- Tesfay Zemuy Gebrekidan and Hadush Hailu Gebrerufael, Diagnosing Faults in Reinforcement Learning Simulators with Canonical Polynomial Invariants (2026). Source for release and observation controls, trajectory-level law screening and quotient recovery. arXiv
SimAudit is MIT licensed. The citation file credits the software and both method papers separately. Citation · BibTeX · Reuse notices · Earlier software archive
Metadata
Release files for simaudit 0.2.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simaudit-0.2.0a1.tar.gz | 74.9 kB | With provenance | Details for simaudit-0.2.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simaudit-0.2.0a1-py3-none-any.whl | Python 3 | none | any | Details for simaudit-0.2.0a1-py3-none-any.whl |
Total release size: 134.3 kB
Release files / simaudit-0.2.0a1.tar.gz
| Download URL | simaudit-0.2.0a1.tar.gz |
|---|---|
| Size | 74.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b9145586598e76ff96e74cde1f45e558dc5527fbaaaf1d766f561d4a558e4e4
|
|
BLAKE2b-256 checksum How to use checksums |
7e1fbcdc288741e5a6ea3bdd18cf2a2281af09e34a415f2db49014c36c0d24db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / simaudit-0.2.0a1-py3-none-any.whl
| Download URL | simaudit-0.2.0a1-py3-none-any.whl |
|---|---|
| Size | 59.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72f53995a1d59a21abc54690ee8231f50d448cc4e007acb3dfc2c871df8d8e56
|
|
BLAKE2b-256 checksum How to use checksums |
ca35aa833bc7884502f069b1ead88d098c93d7282212b9b27293b20a7abf0658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for simaudit 0.2.0a1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for simaudit-0.2.0a1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.