feat(newton): skeleton NewtonSimulation(SimEngine) + config + factory registration#99
Open
cagataycali wants to merge 2 commits intostrands-labs:mainfrom
Open
feat(newton): skeleton NewtonSimulation(SimEngine) + config + factory registration#99cagataycali wants to merge 2 commits intostrands-labs:mainfrom
cagataycali wants to merge 2 commits intostrands-labs:mainfrom
Conversation
7aa29dc to
4e218b5
Compare
This was referenced Apr 21, 2026
Member
Author
45 tasks
… registration Add Newton GPU simulation backend stub that implements SimEngine ABC. No GPU dependencies at import time — warp/newton are lazy-loaded. New files: - simulation/newton/__init__.py — lazy loading, no warp import - simulation/newton/config.py — NewtonConfig dataclass (7 solvers) - simulation/newton/simulation.py — NewtonSimulation(SimEngine) skeleton Modified files: - simulation/factory.py — register newton + aliases (warp, wp) - pyproject.toml — add [newton] extras (warp-lang, newton-sim) All 12 required SimEngine methods stubbed with NotImplementedError. Newton-specific extensions (replicate, diffsim, IK, cloth, etc.) stubbed. Factory kwargs flow through to NewtonConfig. Tests: 81 passed (config validation, factory round-trip, lazy import, ABC conformance, all stub methods verified). Part 1 of 7-PR Newton backend series (issue #314). Depends on PR strands-labs#84 (SimEngine ABC).
The [newton] extra references newton-sim which is not published on PyPI yet. CI installs .[all,dev] which pulls all extras, causing pip to fail. Keep the [newton] extra defined for future use but exclude it from the [all] aggregate until newton-sim is published.
19fd75d to
e7d61ae
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.
Summary
Add Newton GPU simulation backend skeleton — the first PR in a 7-PR series to land the Newton/Warp physics engine as a SimEngine backend.
This PR adds only the foundation: the class skeleton, config dataclass, factory registration, and 81 tests. No GPU dependencies are imported at module level.
Depends on: #84 (SimEngine ABC) — this PR branches from
feat/simulation-foundation.What's Included
New files (5)
simulation/newton/__init__.pysimulation/newton/config.pyNewtonConfigdataclass — 7 solvers, 5 render backends, 3 broad-phase optionssimulation/newton/simulation.pyNewtonSimulation(SimEngine)skeleton — all 12 ABC methods + Newton extensionstests/simulation/newton/test_*.pyModified files (2)
simulation/factory.py"newton"backend + aliases ("warp","wp")pyproject.toml[newton]extras,warp.*/newton.*in mypy ignoreKey Design Decisions
Lazy imports:
import strands_robots.simulation.newtondoes NOT triggerimport warporimport newton. Heavy deps load only on first method call via_lazy_init().Factory kwargs → config:
create_simulation("newton", num_envs=4096, solver="xpbd")flows kwargs directly toNewtonConfig.Fail-fast config validation: Invalid solver, render_backend, broad_phase, physics_dt, or num_envs raise
ValueErrorimmediately in__post_init__.All ABC methods stubbed: Each raises
NotImplementedErrorwith a clear message indicating which subsequent PR will implement it.Newton extensions as public methods:
replicate(),run_diffsim(),solve_ik(),add_cloth(), etc. are NOT in the ABC — they're Newton-only capabilities.send_action()+step(n_steps): The ABC separates action buffering from physics stepping.send_action()buffers in_pending_actions,step()applies.reset_envs(env_ids): Newton extension beyond the ABC'sreset()— enables selective per-env resets for RL training.Tests (81 passed, 0 failures, 0.56s)
test_config.pytest_factory.pycreate_simulation()round-trip, kwargs passthroughtest_lazy_import.pytest_simulation.py7-PR Roadmap
create_world,destroy,reset,add_robot, procedural builders)step,send_action,get_observation,get_state)add/remove_object,render)replicate,add_cloth/cable/particles)run_diffsim,solve_ik, sensors, CUDA graphs)Ref: cagataycali/strands-gtc-nvidia#314 | Roadmap: #94
🤖 AI agent response. Strands Agents. Feedback welcome!