Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

simaudit

Installable diagnostics for your own simulator, with explicit limits on what was assessed. Supply a small Python adapter; NumPy is the only core dependency. Gymnasium and MuJoCo are optional examples. Version 0.1.0a2 is an alpha, not a generally calibrated simulator-certification service.

Alpha: APIs may change. Feedback is welcome via GitHub issues. Package: PyPI.

Install

# Pre-release: pip skips alpha versions unless you ask for them.
python -m pip install --pre simaudit
# Optional adapters and pytest integration:
python -m pip install --pre 'simaudit[gymnasium,mujoco,pytest]'
# Or from a source checkout:
python -m pip install .

Python 3.11 or newer (CI matrix 3.11-3.14; local validation on 3.14.6 and 3.12.3). Nothing downloads, runs experiments, or imports an optional simulator on package import. For development: python -m pip install '.[dev]'.

Test your own simulator

import numpy as np
from simaudit import Adapter, Feature, Report, check_order

# Wrap your simulator so each call restores every dependency of its next step.
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="my simulator", step_fn=step, native_step_fn=native_reference,
    features=[Feature("dynamics", "tested", "Smooth scalar ODE, no hidden state", True)],
    smooth=True, declared_order=1, dt=0.2,
)
result = check_order(adapter, [[0.5], [1.0], [1.5]], [0, 0, 0])
report = Report([result])
print(report.summary())
report.write("audit.json")

The native reference should call the original simulator without the adapter transformation being tested. A user-provided reference and inventory are trusted inputs, not automatically verified specifications. See the adapter guide for mutable simulators, noise, arbitrary state metrics, assignment factories, observation maps and capability requirements.

The CLI loads a trusted local module:function returning an adapter. From this directory, run the included NumPy-only example:

PYTHONPATH=examples simaudit order --factory custom_simulator:factory \
  --probes examples/probes.json --strict --json audit.json

Python factories execute code with your Python process's privileges. Probe files contain only states and matching actions. The same interface works with your own importable adapter module. python -m simaudit is equivalent to simaudit.

Four independent checks

Check Python API Needs What it reports
Parameter assignment check_assignment Replay, native reference, assignment factory Baseline/direct/fresh comparison; no-op, stale, consistent or unresolved
Numerical order check_order Replay, native reference, timestep, declared order, smoothness, distance Stable refinement slopes, below-declaration order, or inability to diagnose
Release/variant comparison compare_releases Factory and two supplied Python interpreters First-step differences on identical inputs; later differences recorded separately
Observation consistency check_observation Replay, native reference, observed and reference observation maps Differences above the precision/noise floor

The package doesn't implement the papers' energy-fingerprint classifier, algebraic localisation, parameter identification or automatic equation diagnosis. A numerical-order pass cannot establish that equations are correct.

Results and limitations

Every result contains PASS, FAIL, ABSTAIN, SKIPPED, PARTIAL or BLOWUP, a reason, scope, limitations, mandatory feature coverage, modifications, versions and raw probe measurements. Limitations and untested features are printed beside results.

  • Float32 or a declared noise floor blocks a healthy consistency verdict in checks A, B and D. A and D can still flag discrepancies above their floors.
  • Missing capabilities return SKIPPED; unsupported smoothness/features give PARTIAL; unresolved or unstable slopes give ABSTAIN.
  • Nonfinite trajectories or detected engine resets give BLOWUP.
  • A failed adapter replay/native-step self-test blocks downstream diagnosis.
  • PASS covers the supplied probes under the declared conditions only. A wrong reference, shared implementation error or unreported hidden state can escape it.

By default FAIL exits 1; other nonpasses print a warning and exit 0. --strict exits 1 on any nonpass. Configuration errors exit 2. Empty reports are never all-clear. Report contract.

Optional adapters and releases

simaudit assignment --factory simaudit.adapters.cartpole:cartpole \
  --probes examples/cartpole-probes.json --parameter masscart --value 2 --json cartpole.json

This deliberately detects the paper's assignment discrepancy and exits 1. The fresh CartPole reference explicitly rebuilds dependent constants; it does not assert that Gymnasium promises arbitrary attribute mutation.

mujoco_xml(xml) supplies native replay for smooth autonomous rigid models and rejects unsupported features. reacher() supplies a cache-consistency comparison against the shipped observation map after mj_forward. Both live in simaudit.adapters.mujoco; imports are lazy. Custom adapters are not subject to these built-in models' limitations but must declare their own.

For a release pair, create two separate environments yourself, with NumPy and the simulator versions you want, then supply their Python paths:

simaudit release --factory simaudit.adapters.cartpole:cartpole \
  --probes examples/cartpole-probes.json --python-a /path/a/bin/python \
  --python-b /path/b/bin/python --strict --json releases.json

The worker runs the current package source in each interpreter. The package does not install or upgrade either environment. Your custom factory module must also be importable there. Missing versions remain untested. A changed first step means compatibility changed, not necessarily that either release is wrong.

pytest and verification

Install the pytest extra to use the auto-discovered simaudit_check fixture:

def test_simulator(simaudit_check):
    simaudit_check(check_order(adapter, [[1.0]], [0]))

FAIL fails the test; other nonpasses skip with their original status and full reason. pytest --simaudit-strict --simaudit-json results.json fails the session on any nonpass and preserves the separate audit counts. Reporting is serial; pytest-xdist aggregation is not supported.

Run software tests with python -m pytest. Build with python -m build. See validation results, prospective paper-case protocol, and requirements and acceptance criteria. These are small package tests and selected reproductions, not a general false-alarm guarantee.

Cite the two method papers

  1. Tesfay Zemuy Gebrekidan (2026). Diagnosing Model and Discretisation Errors in Reinforcement Learning Simulators Using Invariants. Zenodo.
  2. Tesfay Zemuy Gebrekidan and Hadush Hailu Gebrerufael (2026). Diagnosing Faults in Reinforcement Learning Simulators with Canonical Polynomial Invariants. arXiv:2609.13194v2.

CITATION.cff, BibTeX, and reuse and licence notices preserve the attribution. MIT licensed.

What it has found so far

From VALIDATION.md; each row is scoped to the supplied probes.

Case Result
Gymnasium CartPole masscart/masspole/length assignment FAIL (no-op / stale / partly stale) vs a freshly constructed reference; gravity PASS
MuJoCo 3.16.0 and 3.17.0, RK4 heavy top on a ball joint FAIL: 23/24 probes below declared order 4 (1/24 ABSTAIN), median slope 1.96
MuJoCo 4.0.1, same model and probes PASS 24/24, median slope 3.92
Same model with three hinges (control) PASS in every tested engine
Reacher post-step observation vs refreshed map FAIL, largest discrepancy 2.4e-6 (3.16.0, 3.17.0 and 4.0.1)

MuJoCo 4.0.0 itself was not installed or tested; no result is inferred for it.

Roadmap

Not implemented in 0.1.0a1, and not claimed anywhere in this package:

  • 0.2: energy-refinement fingerprint (model-versus-discretisation label), a decision table combining checks, and a one-parameter fit, each only with its negative-control suite passing.
  • 0.3: algebraic invariant screening behind an optional extra.
  • Other classic-control assignment adapters, vector environments, and shipped Ant/Humanoid with contacts and actuation.

Documentation

File Purpose
docs/ADAPTERS.md Writing an adapter and declaring its features
docs/REPORTS.md Report schema, statuses and JSON round trip
docs/REQUIREMENTS.md Acceptance criteria recorded before validation
VALIDATION.md What was actually run, and the limits of those runs
validation/PROTOCOL.md Paper-case protocol and scripts
evidence/README.md Archived result files and the hash receipt
CHANGELOG.md Release history

Metadata

Release files for simaudit 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simaudit 0.1.0a2
File Size Uploaded Provenance Actions
simaudit-0.1.0a2.tar.gz 41.9 kB With provenance Details for simaudit-0.1.0a2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simaudit 0.1.0a2
File Interpreter ABI Platform Actions
simaudit-0.1.0a2-py3-none-any.whl Python 3 none any Details for simaudit-0.1.0a2-py3-none-any.whl

Total release size: 68.2 kB

Release files / simaudit-0.1.0a2.tar.gz

Download URL simaudit-0.1.0a2.tar.gz
Size 41.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b90c04c4e65ee8fa9018805c7e5baddc0c4d4d10e53810d64d5ab94c18c8d40f
BLAKE2b-256 checksum
How to use checksums
122b541e02f8ed6a260fbf871c34cba9c8041a8fab9044356bc491f33954057b
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 15, 2026.

Transparency log

Release files / simaudit-0.1.0a2-py3-none-any.whl

Download URL simaudit-0.1.0a2-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e45640e9ed05c269d98fff1c5afeee8afd75a267cf78000a836824f8d77fc1e4
BLAKE2b-256 checksum
How to use checksums
74f6cd31b259bcdde3d24e400452d3d5b20286dff4453fff441f0b73b28776c6
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 15, 2026.

Transparency log

Security for simaudit 0.1.0a2

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.

Select from 2 files

Attestation for simaudit-0.1.0a2.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 15, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page