Skip to content
23 changes: 23 additions & 0 deletions docs/notes/mujoco-warp-benchmark-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# MuJoCo Warp offline benchmark protocol

This protocol freezes the inputs and decision rules for [#22](https://github.com/ThePyProgrammer/argus/issues/22). The reference is classic MuJoCo 3.6.0. The candidate is MuJoCo Warp 3.6.0 with Warp 1.12.0, explicitly on CUDA. This experiment covers latency, throughput, and compatibility. Camera qualification, production migration and live exploration are outside its scope.

## Inputs

- Dashboard uses the flat Go2 scene, two robots with the dashboard spawn helper, 320 × 240, five physics substeps per frame and the default 200-step settle. With the viewer and perception disabled, replay a fixed stand and low-speed alternating-turn command schedule. Save the exact XML/assets, compiled model, post-settle integration state, actuator inputs per substep, and CPU-forwarded transforms per frame. Render comparisons use those CPU-forwarded transforms. A separate stepping comparison starts at the saved integration state and applies the same actuator inputs.
- E33 uses the original stationary recipe and four fixed variants from `tests/slam/test_free_space_camera_campaign.py` at 1920 × 1440. Run the original classic owned-capture and refusal checks. Compare both outputs for camera A on all five variants, and use both cameras for timing the full-resolution baseline. Use the calibrated off-axis pixel geometry and known probe depths to distinguish axial depth and ray range. Record raw and cleaned depth, invalid-mask differences, clipping and group behavior, visible-control response and current free-space refusal. Renderer outputs here are offline observations with no source qualification.
- Save each run in a fresh directory below `outputs/exploration-planning/mujoco-warp-benchmark/`. Save package versions, revision, platform, power mode, observed OpenGL vendor/renderer or explicit Warp CUDA device, IDs, dimensions, timestamps, clipping settings and raw timing rows. Keep exact host hardware and driver details with local diagnostics.

## Cases and scoring

| Case | Work | Comparison |
| --- | --- | --- |
| Dashboard bridge | Classic bridge step, both cameras and both ICP/SLAM consumers | Default classic adapter, then the requested discrete adapter if verified |
| Dashboard frozen render | CPU-forwarded transforms, two RGB-D readbacks and depth cleaning, one world | Same input and two consumers on classic and Warp |
| Dashboard replay | Five physics steps per iteration on recorded controls | Classic CPU and Warp CUDA, compare trajectory and contact geometry pairs separately |
| Dashboard batch | One, 8, 32, and 64 worlds, two cameras per world | Report physics and render throughput separately. Identify the classic worker count and stage comparability |
| Stationary E33 | Owned classic capture, Warp ray-cast comparison on the same states, render batch starting at one world | Only try larger batches when their minimum output allocation fits with at least 1 GiB device headroom. Stop on allocation failure or inadequate measured headroom |

Start each timed run in a separate process. Report process/workload startup separately, then discard 20 warm-up iterations and collect at least 100 timed iterations in each of three runs per runnable case. Report median and p95 in milliseconds and for batch cases completed world-steps/s and camera frames/s. Capture-to-consumer spans the arrival of the frozen state at the capture harness through the second consumer. Log classic render, readback, and metric-depth conversion as one combined measurement where the public renderer combines them. Synchronize Warp work around timed boundaries and measure transfer, unpacking and depth cleaning separately where supported. Record contact/constraint capacity exceedances and device-wide VRAM before startup and sampled during each run, with measurement limits. Preserve the first omitted or failed batch and its reason.

Require at least 10% lower median capture-to-consumer latency and no p95 regression against the fastest verified classic adapter in paired single-world runs, or at least 10% higher batch throughput against a comparable classic case. A positive feasibility recommendation additionally requires at least 1 GiB measured device headroom and no unresolved overflows. Missing device verification, memory, comparators, or sufficient repetitions leave the corresponding recommendation inconclusive. Camera differences must be reported even when timing passes.
132 changes: 132 additions & 0 deletions docs/notes/mujoco-warp-benchmark-results.md

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions docs/provenance/catalogue.json
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,17 @@
"read": "Query returns distances and vertex indices; missing neighbours use self.n. E35 uses selected in-range indices only, not returned distances or nearest accuracy, and recomputes exact nominal geometry distances.",
"verified_on": "2026-12-03",
"verification": "Official versioned API and installed1.17.1 docstring inspected. Acceleration is a witness selector, not a geometry/source bound or native correctness certificate."
},
"mujoco-warp-360": {
"title": "MuJoCo Warp 3.6.0 implementation and API",
"authors": "Google DeepMind and NVIDIA",
"year": 2026,
"kind": "upstream implementation",
"url": "https://github.com/google-deepmind/mujoco_warp/tree/v3.6.0",
"peer_reviewed": false,
"read": "Pinned source for CUDA physics, BVH ray casting, axial-depth output and packed colour.",
"verified_on": "2026-12-04",
"verification": "Official v3.6.0 sources, versioned API and installed render, buffer, broadphase and data-transfer implementation reviewed. This does not validate the native kernels or certify output equivalence."
}
},
"components": [
Expand Down Expand Up @@ -4318,6 +4329,59 @@
],
"depends_on": ["exploration-evaluation", "planning-grid", "astar-planner", "motion-guard", "waypoint-control"],
"lineage": "Project-authored opt-in different evidence contract. Existing controls and independent coverage collection are reused."
},
{
"id": "mujoco-warp-offline-benchmark",
"title": "Offline classic MuJoCo and Warp comparison",
"basis": "upstream",
"runtime": "offline",
"summary": "Separately compare synchronized CUDA ray-cast readback on frozen CPU-forwarded rigid states and CUDA stepping under frozen actuator inputs. Time the existing classic bridge and the owned E33 capture, and measure diagnostic pixels, contact pairs, host consumption and sampled device-wide memory.",
"files": [
"scripts/benchmark_mujoco_warp.py",
"tests/test_mujoco_warp_benchmark.py"
],
"depends_on": [
"gl-audit"
],
"assumptions": "MuJoCo and MuJoCo Warp 3.6.0, Warp 1.12.0, rigid scenes with fixed cameras, matching CPU-forwarded state for the render comparison, deterministic frozen inputs, observed classic GL context and explicit CUDA selection.",
"differences": "Warp uses float32, ray-cast visibility and packed readback. The benchmark times prescribed transfers and clean-up; its offline observations are not source-owned evidence and cannot pass the empirical free-space preflight. The GL adapter identity query is independent of the optional full compatibility-profile readback audit. Host byte unpack preserves the tagged renderer's 0xAARRGGBB channel order.",
"evidence": [
"tests/test_mujoco_warp_benchmark.py",
"tests/slam/test_free_space_camera_campaign.py",
"docs/notes/mujoco-warp-benchmark-protocol.md"
],
"gaps": "Desktop device allocation peaks are sampled, not certified. Camera probes, contact counts, geometry-pair differences and observed latency do not certify general renderer or physics equivalence.",
"entrypoints": [
{
"file": "scripts/benchmark_mujoco_warp.py",
"symbol": "main"
},
{
"file": "scripts/benchmark_mujoco_warp.py",
"symbol": "timed_frames"
},
{
"file": "scripts/benchmark_mujoco_warp.py",
"symbol": "step_replay"
},
{
"file": "scripts/benchmark_mujoco_warp.py",
"symbol": "e33"
}
],
"references": [
{
"source": "mujoco-warp-360",
"relation": "upstream",
"note": "Pinned put_model, put_data, step, render and buffer layout."
},
{
"source": "mujoco-renderer-360",
"relation": "upstream",
"note": "Classic GLFW camera readback returns metric axis depth; the public renderer bundles draw and transfer."
}
],
"lineage": "Pinned upstream implementations with project-defined fixture replay, timing and compatibility scoring."
}
]
}
29 changes: 29 additions & 0 deletions docs/provenance/catalogue.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Traceability review is not independent peer review or a correctness certificate.
| [Complete conditional nominal collision-volume to mesh-surface covers](#collision-volume-cover) | project | offline |
| [Archived Go2 depth versus nominal ray and geometry diagnostics](#admitted-region-audit) | project | offline |
| [Opt-in known-scene waypoint pilot using simulator state](#simulator-scene-prior) | project | exploration |
| [Offline classic MuJoCo and Warp comparison](#mujoco-warp-offline-benchmark) | upstream | offline |

<a id="simulation"></a>

Expand Down Expand Up @@ -2145,3 +2146,31 @@ Version and bind a single authored flat box scene and its synchronous simulator
- Existing evidence: [docs/notes/exploration-scene-prior-withdrawal-and-transfer.md](../../docs/notes/exploration-scene-prior-withdrawal-and-transfer.md)
- Conceptual inputs: [exploration-evaluation](#exploration-evaluation), [planning-grid](#planning-grid), [astar-planner](#astar-planner), [motion-guard](#motion-guard), [waypoint-control](#waypoint-control)
- Files: [`src/exploration/evaluation/scene_prior.py`](../../src/exploration/evaluation/scene_prior.py), [`scripts/verify_scene_prior_pair.py`](../../scripts/verify_scene_prior_pair.py), [`tests/exploration/test_scene_prior.py`](../../tests/exploration/test_scene_prior.py)

<a id="mujoco-warp-offline-benchmark"></a>

## Offline classic MuJoCo and Warp comparison

Separately compare synchronized CUDA ray-cast readback on frozen CPU-forwarded rigid states and CUDA stepping under frozen actuator inputs. Time the existing classic bridge and the owned E33 capture, and measure diagnostic pixels, contact pairs, host consumption and sampled device-wide memory.

**Classification:** upstream; **wiring:** offline.

**Historical lineage:** Pinned upstream implementations with project-defined fixture replay, timing and compatibility scoring.

**Implementation differences:** Warp uses float32, ray-cast visibility and packed readback. The benchmark times prescribed transfers and clean-up; its offline observations are not source-owned evidence and cannot pass the empirical free-space preflight. The GL adapter identity query is independent of the optional full compatibility-profile readback audit. Host byte unpack preserves the tagged renderer's 0xAARRGGBB channel order.

**Assumptions:** MuJoCo and MuJoCo Warp 3.6.0, Warp 1.12.0, rigid scenes with fixed cameras, matching CPU-forwarded state for the render comparison, deterministic frozen inputs, observed classic GL context and explicit CUDA selection.

**Remaining evidence:** Desktop device allocation peaks are sampled, not certified. Camera probes, contact counts, geometry-pair differences and observed latency do not certify general renderer or physics equivalence.

- Code: [`main`](../../scripts/benchmark_mujoco_warp.py#L632)
- Code: [`timed_frames`](../../scripts/benchmark_mujoco_warp.py#L316)
- Code: [`step_replay`](../../scripts/benchmark_mujoco_warp.py#L443)
- Code: [`e33`](../../scripts/benchmark_mujoco_warp.py#L538)
- Reading: [mujoco-warp-360](sources.md#mujoco-warp-360) (upstream): Pinned put_model, put_data, step, render and buffer layout.
- Reading: [mujoco-renderer-360](sources.md#mujoco-renderer-360) (upstream): Classic GLFW camera readback returns metric axis depth; the public renderer bundles draw and transfer.
- Existing evidence: [tests/test_mujoco_warp_benchmark.py](../../tests/test_mujoco_warp_benchmark.py)
- Existing evidence: [tests/slam/test_free_space_camera_campaign.py](../../tests/slam/test_free_space_camera_campaign.py)
- Existing evidence: [docs/notes/mujoco-warp-benchmark-protocol.md](../../docs/notes/mujoco-warp-benchmark-protocol.md)
- Conceptual inputs: [gl-audit](#gl-audit)
- Files: [`scripts/benchmark_mujoco_warp.py`](../../scripts/benchmark_mujoco_warp.py), [`tests/test_mujoco_warp_benchmark.py`](../../tests/test_mujoco_warp_benchmark.py)
47 changes: 46 additions & 1 deletion docs/provenance/code-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Generated; file ownership is explicit in `catalogue.json`. Python classes and their methods and top-level functions are indexed using AST without importing the runtime. Nested local functions and non-Python symbols are not individually indexed; their entire files are hashed.

599 files. Digests normalize CRLF to LF and preserve every other byte. Tests, fixtures, manifests, and UI files are classified as such, not counted as research algorithms.
601 files. Digests normalize CRLF to LF and preserve every other byte. Tests, fixtures, manifests, and UI files are classified as such, not counted as research algorithms.

## Simulation, sensor capture, depth sanitation and IMU

Expand Down Expand Up @@ -7709,3 +7709,48 @@ Owner: [simulator-scene-prior](catalogue.md#simulator-scene-prior).
- [`test_withdrawal_latches_idle_while_valid_pose_frames_continue`](../../tests/exploration/test_scene_prior.py#L97)
- [`test_held_out_fixture_requires_a_detour`](../../tests/exploration/test_scene_prior.py#L115)
- [`test_held_out_follower_reaches_the_bend_before_aiming_for_goal`](../../tests/exploration/test_scene_prior.py#L135)

## Offline classic MuJoCo and Warp comparison

### [scripts/benchmark_mujoco_warp.py](../../scripts/benchmark_mujoco_warp.py)

Owner: [mujoco-warp-offline-benchmark](catalogue.md#mujoco-warp-offline-benchmark).

- [`save_json`](../../scripts/benchmark_mujoco_warp.py#L44)
- [`request`](../../scripts/benchmark_mujoco_warp.py#L48)
- [`record_vram`](../../scripts/benchmark_mujoco_warp.py#L57)
- [`dashboard`](../../scripts/benchmark_mujoco_warp.py#L88)
- [`command_frame`](../../scripts/benchmark_mujoco_warp.py#L96)
- [`freeze_dashboard`](../../scripts/benchmark_mujoco_warp.py#L104)
- [`camera_settings`](../../scripts/benchmark_mujoco_warp.py#L139)
- [`verify_frame`](../../scripts/benchmark_mujoco_warp.py#L149)
- [`read_gl_identity`](../../scripts/benchmark_mujoco_warp.py#L158)
- [`verify_gl`](../../scripts/benchmark_mujoco_warp.py#L182)
- [`unpack_rgb`](../../scripts/benchmark_mujoco_warp.py#L195)
- [`ClassicCamera`](../../scripts/benchmark_mujoco_warp.py#L202)
- [`ClassicCamera.__init__`](../../scripts/benchmark_mujoco_warp.py#L203)
- [`ClassicCamera.capture`](../../scripts/benchmark_mujoco_warp.py#L219)
- [`ClassicCamera.close`](../../scripts/benchmark_mujoco_warp.py#L236)
- [`WarpCamera`](../../scripts/benchmark_mujoco_warp.py#L240)
- [`WarpCamera.__init__`](../../scripts/benchmark_mujoco_warp.py#L241)
- [`WarpCamera.capture`](../../scripts/benchmark_mujoco_warp.py#L269)
- [`WarpCamera.close`](../../scripts/benchmark_mujoco_warp.py#L295)
- [`make_consumers`](../../scripts/benchmark_mujoco_warp.py#L299)
- [`summarize`](../../scripts/benchmark_mujoco_warp.py#L308)
- [`timed_frames`](../../scripts/benchmark_mujoco_warp.py#L316)
- [`frozen_render`](../../scripts/benchmark_mujoco_warp.py#L365)
- [`bridge_run`](../../scripts/benchmark_mujoco_warp.py#L383)
- [`contact_pairs`](../../scripts/benchmark_mujoco_warp.py#L439)
- [`step_replay`](../../scripts/benchmark_mujoco_warp.py#L443)
- [`e33`](../../scripts/benchmark_mujoco_warp.py#L538)
- [`main`](../../scripts/benchmark_mujoco_warp.py#L632)

### [tests/test_mujoco_warp_benchmark.py](../../tests/test_mujoco_warp_benchmark.py)

Owner: [mujoco-warp-offline-benchmark](catalogue.md#mujoco-warp-offline-benchmark).

- [`BenchmarkContracts`](../../tests/test_mujoco_warp_benchmark.py#L14)
- [`BenchmarkContracts.test_packed_rgb_order_and_axial_metres`](../../tests/test_mujoco_warp_benchmark.py#L15)
- [`BenchmarkContracts.test_no_return_far_cutoff_and_free_space_refusal`](../../tests/test_mujoco_warp_benchmark.py#L28)
- [`BenchmarkContracts.test_requested_gl_adapter_fails_closed`](../../tests/test_mujoco_warp_benchmark.py#L36)
- [`BenchmarkContracts.test_renderer_identity_independent_of_compatibility_audit`](../../tests/test_mujoco_warp_benchmark.py#L51)
10 changes: 10 additions & 0 deletions docs/provenance/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,11 @@
"sha256": "85cf6ff9cf3ebe325c7377b6c3dd50df40c6a0825c30346d7b08adb253afffd2",
"reviewed_revision": "1f4dafa403dae96833b220d7619d563b44ef6c92"
},
"scripts/benchmark_mujoco_warp.py": {
"component": "mujoco-warp-offline-benchmark",
"sha256": "abb24b091ebe2988075e289f8a8cb541ab5d405c41f74fb69eec858934f70c41",
"reviewed_revision": "e3d4915e075bde8660c187ab5e3fd92c7e11460c"
},
"scripts/boxer_worker.py": {
"component": "boxer-detection",
"sha256": "1233fdd6694c6e0ca0f0c8970738a16edb14a71e2d288c508380fa342b607992",
Expand Down Expand Up @@ -2911,6 +2916,11 @@
"sha256": "0c18eda888b72e1fdf023d1f3dfbdfe11fbf120f57fc083de030a3476797c0cc",
"reviewed_revision": "1f4dafa403dae96833b220d7619d563b44ef6c92"
},
"tests/test_mujoco_warp_benchmark.py": {
"component": "mujoco-warp-offline-benchmark",
"sha256": "f6e994752ff7372de5ce98098be639dc2129dff13191f05bf6d7bf05997c81b8",
"reviewed_revision": "e3d4915e075bde8660c187ab5e3fd92c7e11460c"
},
"tests/test_provenance.py": {
"component": "verification",
"sha256": "a842a541b88cceb9b9a16714ad46a0550d08593ad02feacec81dd5e56cbcd2cc",
Expand Down
12 changes: 12 additions & 0 deletions docs/provenance/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -709,3 +709,15 @@ SciPy maintainers (1.17 API / installed1.17.1). Official software API documentat
**Read for:** Query returns distances and vertex indices; missing neighbours use self.n. E35 uses selected in-range indices only, not returned distances or nearest accuracy, and recomputes exact nominal geometry distances.

**Verification:** Official versioned API and installed1.17.1 docstring inspected. Acceleration is a witness selector, not a geometry/source bound or native correctness certificate. Checked 2026-12-03.

<a id="mujoco-warp-360"></a>

## mujoco-warp-360: MuJoCo Warp 3.6.0 implementation and API

Google DeepMind and NVIDIA (2026). upstream implementation. **Peer-reviewed paper:** not established / not applicable.

[Primary source](https://github.com/google-deepmind/mujoco_warp/tree/v3.6.0).

**Read for:** Pinned source for CUDA physics, BVH ray casting, axial-depth output and packed colour.

**Verification:** Official v3.6.0 sources, versioned API and installed render, buffer, broadphase and data-transfer implementation reviewed. This does not validate the native kernels or certify output equivalence. Checked 2026-12-04.
Loading