island discovery: dfs discovery with flood fill#1102
Open
thowell wants to merge 7 commits intogoogle-deepmind:mainfrom
Open
island discovery: dfs discovery with flood fill#1102thowell wants to merge 7 commits intogoogle-deepmind:mainfrom
thowell wants to merge 7 commits intogoogle-deepmind:mainfrom
Conversation
Model fields: - ntree: number of kinematic trees - tree_dofadr: start address of tree's DOFs (ntree,) - tree_dofnum: number of DOFs in tree (ntree,) - tree_bodynum: number of bodies in tree (ntree,) - body_treeid: id of body's tree; -1 for static (nbody,) - dof_treeid: id of dof's tree (nv,) All fields are imported directly from mjModel via the dataclass field matching pattern in put_model(). Test: test_tree_structure_fields verifies all fields match MuJoCo.
- _find_tree_edges kernel scans Jacobian for tree-tree connections - On-device deduplication using radix sort and prefix sum compaction - Helper kernels: _compute_edge_keys, _init_indices, _mark_unique_edges, _compact_edges - find_tree_edges host function orchestrates the full pipeline - 5 tests: single edge, self-edge, chain, deduplication, no constraints
d2c27aa to
1f91cfc
Compare
matches MuJoCo's mj_floodFill() approach. This directly assigns island IDs during traversal without needing iterative label updates. Key changes: - Add _flood_fill kernel that performs sequential DFS per world - Each thread handles one world, using a stack for traversal - Directly assigns island IDs to tree_island array - Remove unused kernels (_init_labels, _compact_island_ids, _mark_roots)
1f91cfc to
8cbb8ad
Compare
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.
depends on #1100 and #1101