perf: headless recording via on-demand render runner - #44
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The PR introduces at least one correctness issue (interactive renderer also gets fps=None unintentionally) and the new benchmark mis-attributes pipelined timing phases, making its results misleading.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR improves headless video recording performance for MotrixSim-backed environments by switching headless rendering to an on-demand runner (render only on sync) and updating dependencies/tools to measure and validate the new capture behavior.
Changes:
- Switch headless
MotrixSimRendererto constructRenderAppusing the on-demand runner (fps=None) to avoid idle rendering and improve capture throughput. - Add a standalone benchmark script to attribute headless capture time across submission, readback wait, pixel extraction, and encoding (serial vs pipelined schedule).
- Bump
motrixsimto0.10.1.dev123478in bothpyproject.tomlanduv.lock, and update renderer tests for the newRenderAppconstructor signature/behavior.
File summaries
| File | Description |
|---|---|
uv.lock |
Updates the locked motrixsim/motrixsim-core versions to the new dev build. |
scripts/bench_headless_capture.py |
Adds a benchmark probe to measure headless capture/encode costs and compare serial vs pipelined capture schedules. |
motrix_env_motrixsim/tests/test_renderer.py |
Adjusts mocks/assertions to account for the RenderApp(..., fps=None) headless constructor and updated sync/capture expectations. |
motrix_env_motrixsim/src/motrix_env_motrixsim/renderer.py |
Switches headless renderer creation to the on-demand runner and documents the capture/readback synchronization shape. |
motrix_env_motrixsim/pyproject.toml |
Pins motrixsim to 0.10.1.dev123478. |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ench timing - renderer: pass fps=None only for headless RenderApp; windowed mode keeps the library default (fps is a headless-only knob), resolving review thread - bench_headless_capture: attribute pipelined _grab() to the take phase and account the final pending-frame flush in wait/take/encode totals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RenderConfig.render_fpscap option — headless recording is now always unlimited-rate; the render loop no longer paces captures to a fixed tickscripts/bench_headless_capture.py, a standalone probe that times render submission, blocking readback, take, and encode separately (serial vs pipelined schedule)Verification
scripts/bench_headless_capture.py: capture+encode at 1280x720 ~100 fps, 256x256 ~200 fps, 1080p ~80 fps (batch 16, unlimited rate)play.py record_video=trueon cartpole and microduck-walk-flat: 10 s clip records in ~12 s wall including startupmotrix_env_core/tests+motrix_env_motrixsim/tests: 173 passed