← Back to Pull requests

Fix shared OVRTX sensor timing and preserve complete captures #9336

Open
temiroff opened this pull request with 650 lines diff across 8 files
View on GitHub
temiroff temiroff commented on Dec 02, 2026 01:37 UTC
Author

Description

Cameras and lidars that share one OVRTX engine each step its clock on their own captures (a .data read, or scene.update with eager updates):

  • a camera steps by get_rendering_dt(), which is dt * render_interval or a visualizer's own value, not the time since its last render;

  • a lidar steps only its own product, by its update_period or the physics time step.
  • The engine has one clock, so with two lidars, or a camera and a lidar on one engine, the clock moves several times per physics step, and each lidar misses the time the other one stepped.

    Simulated time comes from the render context. RenderContext.update_scene_state, which every camera and lidar capture already calls, turns the physics step count into simulated time. RenderContext.get_render_dt(renderer) calculates the remaining interval using the backend-independent BaseRenderer.render_time property, and passes it explicitly to render(..., dt) / render_batch(..., dt) and lidar captures. Renderers sharing an engine expose the same last accepted submission time, so subsequent captures at the same scene time receive zero. Renderers without a scene clock receive zero and ignore it. Residuals within one unit of floating-point precision are returned as exact zero, preventing a second timed step caused by rounding. The OVRTX renderer no longer queries physics timing directly (get_physics_step_count(), get_physics_dt()).

    Each engine now takes one timed step per published time, on the first sensor capture after the time advanced, whichever sensor that is:

  • it steps by the time since the engine's previous step (kept on OVRTXBackend, so renderers that share the engine share it);

  • the time is claimed once OVRTX accepts the step (step_async): a rejected submission leaves it for the retry, and a step that fails while rendering has already advanced the clock;

  • it submits every camera and lidar product on the engine, after writing every lidar's current pose;

  • each lidar's newest complete scan from that step is kept in its render data (#9272's _publish_lidar_output), and a lidar capture copies it;

  • a later camera capture in the same physics step steps by zero, as before.
  • Stacked on #9272. Until it merges, the diff against main includes its commits. The changes of this PR are the last commits on the branch.

    A plain ovrtx probe (one engine, 2 cameras, 2 lidars, 60 Hz) showed why every product must be in the step: a product left out of a timed step loses that time. One step for all products cost 3.7 ms per env step on an RTX PRO 6000, against 300-360 ms when each sensor stepped on its own.

    Supersedes #9320. #9272's test_lidar_capture now expects the lidar time at a capture to be the physics time, because the engine clock no longer advances by update_period per capture.

    Follow-up (not in this PR): move engine stepping from the first sensor capture into the coordinator. A broader write → step → read separation can be discussed separately.

    Known behavior:

  • A lidar scan needs simulated time. A lidar read before the first physics step, or after a reset in a physics step in which another sensor already stepped the engine, returns no returns until the next physics step.

  • A camera capture after a lidar in the same physics step renders with a zero step.
  • Type of change

  • Bug fix (non-breaking change which fixes an issue)

  • Renderer API change: explicit dt arguments and the read-only BaseRenderer.render_time property. Custom renderer overrides must accept dt. Direct render calls default to zero time; callers advancing an engine must supply the elapsed interval.
  • Validation

  • Rounding follow-up f955a06a8: 42 passed locally on Windows (36 render-context tests, 4 OVRTX timing/submission/async tests, and both real lazy/eager camera/two-lidar cases). The positive and negative rounding regressions failed before the fix and pass after it; a valid sub-nanosecond interval remains nonzero. Full formatting/lint and changelog checks passed.

  • Earlier local validation of the explicit-dt change (a2e9b25e7): 326 passed, 13 skipped across the checks below. These are local results, not a remote-box or completed CI run.

  • test_ovrtx_renderer_contract.py: 114 passed, 1 skipped. Covers shared camera/lidar timing across renderer instances, accepted versus rejected submissions, internal layout retries, and asynchronous captures.

  • isaaclab/test/renderers/test_simulation_render_context.py: 33 passed. Covers elapsed intervals across skipped/repeated captures, shared versus independent engines, and lazy/eager camera updates.

  • test_ovrtx_lidar.py: 22 passed, 10 existing SDK-version skips. The real camera/two-lidar test now covers both lazy and eager updates, different capture orders, and multiple physics steps between lazy captures.

  • test_ovrtx_visual_material_sync.py: 12 passed; test_stepping.py: 17 passed; test_isaac_rtx_renderer_contract.py: 28 passed; test_ovxr_renderer.py: 96 passed, 2 skipped.

  • Newton's affected query/render test: 4 passed using the repository-pinned Newton revision in an isolated test directory.

  • Confirmed that the timing assertions fail when deliberately double-counting elapsed time or claiming time before a submission is accepted (in-memory mutations only).

  • Full repository formatting/lint and changelog checks passed through the Python CLI entry point; git diff --check passed.
  • Checklist

  • I have read and understood the contribution guidelines

  • I have run the pre-commit checks with uv run isaaclab --format

  • I have made corresponding changes to the documentation (API docstrings and migration notes)

  • My changes generate no new warnings

  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes

  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)

  • I have added my name to the CONTRIBUTORS.md or my name already exists there
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: None requested Review duration: 2498m
    All Vouch review confidence checks passed
    Residual risk 0.38 = Change Risk (0.64) × (1 − Review Confidence (0.40)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.64 · 650 lines diff across 8 files
    0.64
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #9336"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    temiroff temiroff
    Labels
    risk: medium confidence: 40.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 64% (MEDIUM) · Higher = larger blast radius
    64%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.5% · Lower = rushed or shallow review
    40.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 38.1% · Moderate risk
    38.1%