Repository navigation
Fix raycast_mesh auxiliary output shapes - #7267
Conversation
Greptile SummaryThis PR corrects
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness, security, or quality issues identified. The new reshape target matches the number of allocated auxiliary values for documented and batched ray inputs, while existing callers and tests reveal no incompatible shape expectation. Important Files Changed
Reviews (1): Last reviewed commit: "Add raycast mesh shape changelog" | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The change corrects raycast_mesh auxiliary output reshaping by using all leading ray dimensions, fixing distance and face-id returns for documented (N, 3) inputs while preserving (B, N, 3) behavior.
- Design and architecture: The existing flatten-launch-restore design remains intact. Deriving scalar auxiliary output shapes from
ray_starts.shape[:-1]is consistent with restoring vector outputs to the full input shape and supports leading batched dimensions without additional branching. - API: The documented
(N, 3)input now yields(N,)distance and face-id outputs, while batched(B, N, 3)inputs retain(B, N)outputs. Dtypes, devices, flags, and return tuple structure are unchanged. The package changelog fragment accurately records the user-visible fix. - Implementation: The distance and face-id buffers contain one element per ray, so reshaping them to the ray input’s leading dimensions matches their allocation and kernel launch cardinality. The CPU Warp regression test checks public output shapes and verifies representative distance and face-id values. A rank-one
(3,)ray input would produce scalar auxiliary outputs, but that shape is outside the documented(N, 3)contract.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
There was a problem hiding this comment.
AI review disclosure: This review was produced with assistance from multiple AI systems.
Thank you for putting this PR together.
Assessment: shape[:-1] correctly yields one scalar distance and face ID per ray for both unbatched and batched inputs.
Findings: Invalid .patch.rst changelog filename.
Requested changes: Rename the changelog fragment from .patch.rst to .rst; no code changes needed.
Changelog filename: Rename the current <slug>.patch.rst fragment to <slug>.rst for this patch-level change. IsaacLab accepts <slug>.rst (patch), <slug>.minor.rst, and <slug>.major.rst; it does not accept a .patch.rst suffix.
Test scope: Focused CPU regression is sufficient.
Documentation / AI skills: No additional documentation update is required: existing docstrings already specify the corrected shapes. No AI-skill update is required.
|
Addressed the review: renamed the patch-level changelog fragment to the accepted |
|
run-ci |
|
Backported to |
## Description Fixes #2416. `raycast_mesh()` allocates one distance and face ID per flattened ray, but reshapes those scalar outputs using the first two input dimensions. For documented `(N, 3)` inputs, requesting either output raises; higher-rank inputs can raise or silently return the wrong shape. Both scalar outputs now use `ray_starts.shape[:-1]`, restoring all leading ray dimensions. Existing `(B, N, 3)` callers retain their `(B, N)` outputs. Hit positions and normals already restore the full input shape. The runtime fix remains two reshape targets, with no new dependencies or input-validation changes. Updated against `develop` at `d9c0862035f8dadf9bf979448fa21a333942bf8d`. The added regression-test file has been removed; the final diff contains only the runtime fix and its changelog fragment. ## Validation - Ran a temporary standalone check using a real CPU Warp triangle mesh: 16 cases spanning unbatched, batched, and higher-rank ray layouts, with distance and face-ID outputs enabled independently, together, or neither. Verified output shapes, hit positions, distances, and face IDs. - Compared the same cases against unpatched current `develop`: reproduced the exceptions and silent shape mismatch; confirmed existing batched output values remain unchanged. - `uv run isaaclab -f` passed, including formatting, lint, and changelog checks against the fetched upstream base. - Changelog validation and `git diff --check` passed. - No new tests are retained in the repository. The full simulation suite was not run. ## Type of change - Bug fix ## Checklist - [x] Followed the contribution guidelines - [x] Ran formatting and lint checks - [x] Verified the fix against the unfixed baseline - [x] Added the required package changelog fragment - [x] No new dependencies ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` --------- Co-authored-by: Mustafa Haiderbhai <[email protected]> (cherry picked from commit c791679)
Description
Fixes #2416.
raycast_mesh()allocates one distance and face ID per flattened ray, but reshapes those scalar outputs using the first two input dimensions. For documented(N, 3)inputs, requesting either output raises; higher-rank inputs can raise or silently return the wrong shape.Both scalar outputs now use
ray_starts.shape[:-1], restoring all leading ray dimensions. Existing(B, N, 3)callers retain their(B, N)outputs. Hit positions and normals already restore the full input shape. The runtime fix remains two reshape targets, with no new dependencies or input-validation changes.Updated against
developatd9c0862035f8dadf9bf979448fa21a333942bf8d. The added regression-test file has been removed; the final diff contains only the runtime fix and its changelog fragment.Validation
develop: reproduced the exceptions and silent shape mismatch; confirmed existing batched output values remain unchanged.uv run isaaclab -fpassed, including formatting, lint, and changelog checks against the fetched upstream base.git diff --checkpassed.Type of change
Checklist
Release backport
develop