Skip to content

Add grouped scene randomization with saved layout preview - #791

Draft
MuziWong wants to merge 5 commits into
mainfrom
muzi/scene_rand
Draft

MuziWong wants to merge 5 commits into
mainfrom
muzi/scene_rand

Conversation

@MuziWong

@MuziWong MuziWong commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Add grouped scene randomization for existing Scene Engine exports, building on the shared procedural generator and AABB layout solver from #761.

  • Group each direct table child with its descendants and cache source geometry and relative poses in a validated baseline YAML.
  • Accept a versioned YAML policy with seed, candidate_count, max_attempts, and collision_margin_m. Generate fixed-orientation XY layouts within the table bounds while preserving each group's internal poses. Return partial results with budget_exhausted when the attempt budget runs out.
  • Preserve exported collision settings in returned scene fragments: the default 32-hull decomposition, explicit single hulls, and custom VHACD hull budgets.
  • Save each run's resolved policy, candidate JSON files, and completion manifest. Reload and cycle the original scene and saved layouts through the existing preview, loading assets once and applying poses without advancing physics.
  • Document all 12 new public APIs, policy and playback examples, and GenSim context routing.

Generation: embodichain scene-randomization --output_root <workspace> --config <policy.yaml>

Playback: python -m embodichain.gen_sim.scene_engine.randomization.loading --layout-dir <run>/layouts --interval 3

The initial scope is a single table with rigid GLB objects and explicit support relationships. Layout acceptance checks group AABB bounds and clearances; physical stability and task feasibility require separate validation. No new dependencies.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (preserves collision configuration when consuming generated fragments)
  • Documentation update

Preview

Left: fixed input image. Right: native DexSim playback of 20 randomized layouts, shown at 2× speed (about 10 seconds per loop). Assets are loaded once; each support group and its members move together through pose updates without advancing physics.

randomization_20_comparison

Validation

  • black . using Black 26.3.1: passed; git diff --check: passed.
  • Scene randomization and core/export tests: 209 passed, comprising 204 CPU-selected cases and 5 mock-only preview cases run without global simulation initialization.
  • The three collision-configuration regression cases fail before the fix and pass afterward, covering omitted/default, explicit single-hull, and custom decomposition budgets.
  • tests/test_agent_context_map.py, tests/test_agent_context_tools.py, and tests/docs/test_check_api_docs.py: 49 passed.
  • python docs/scripts/check_api_docs.py: passed, zero missing exports.
  • context.py check: passed; CLI, Chinese grouped-scene queries, and public symbols route to GenSim while domain randomization retains its existing owner.
  • The new API documentation sections pass a Sphinx dummy build with warnings treated as errors. The full documentation dummy build succeeds with existing warnings elsewhere.
  • Local runtime tests used the installed DexSim development build with its existing JIT import-path compatibility shim. These automated checks did not launch a live simulator, GPU, or renderer; the preview above was recorded separately with native DexSim.

Checklist

  • I have run the black . command to format the code base.
  • I reviewed affected documentation and agent context, updated it where needed, or explained why no update was needed.
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py).
  • I have added tests that prove my fix is effective or that my feature works.
  • Dependencies have been updated, if applicable (no dependency changes required).

Load and validate YAML generation parameters, reuse shared scene generation and layout solving, and expand each group from a common baseline. Keep successful candidates in memory and treat budget exhaustion as a normal tagged result.

Validation: 97 focused configuration and generation tests passed; Black 26.3.1 passed across the repository. API documentation coverage remains pending because documentation updates are deferred.
@MuziWong MuziWong added enhancement New feature or request visualization Features or functions for visualization with the simulation labels Oct 16, 2026
Reuse the export loader collision conversion for generated scene fragments, covering default, single-hull and custom decomposition budgets. Document the 12 new public APIs and route grouped scene randomization through the GenSim context.
@yuecideng
yuecideng self-requested a review October 17, 2026 03:17
MuziWong added a commit that referenced this pull request Oct 17, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request visualization Features or functions for visualization with the simulation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants