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.0a1 is an alpha, not a generally calibrated simulator-certification service.
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 givePARTIAL; unresolved or unstable slopes giveABSTAIN. - Nonfinite trajectories or detected engine resets give
BLOWUP. - A failed adapter replay/native-step self-test blocks downstream diagnosis.
PASScovers 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
- Tesfay Zemuy Gebrekidan (2026). Diagnosing Model and Discretisation Errors in Reinforcement Learning Simulators Using Invariants. Zenodo.
- 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.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.1.0a1.tar.gz | 41.5 kB | Without provenance | Details for simaudit-0.1.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simaudit-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details for simaudit-0.1.0a1-py3-none-any.whl |
Total release size: 67.7 kB
Release files / simaudit-0.1.0a1.tar.gz
| Download URL | simaudit-0.1.0a1.tar.gz |
|---|---|
| Size | 41.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bcc88cd831d79fd0c2ab43b8acdada013ac8ad273314f96a91afdb9e714f9bbd
|
|
BLAKE2b-256 checksum How to use checksums |
8de6c0b64712d77885aabee2a5e36c8c4fe36f313cebc33eac9953210376f3ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / simaudit-0.1.0a1-py3-none-any.whl
| Download URL | simaudit-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0269abf4df32b0c0bbe119c672a633913001b5edca2cc758b448761236c19225
|
|
BLAKE2b-256 checksum How to use checksums |
7d4d38d404a632c381ba9b7d5b548be38d38108e04c5ca52a232af9600210b68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for simaudit 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.