Kamino#
SolverKamino simulates constrained rigid multi-body
systems in maximal coordinates. It is designed for mechanical assemblies with
kinematic loops, under- or overactuation, joint limits, hard frictional
contacts, and restitutive impacts.
Unlike the other maximal-coordinate solvers, Kamino focuses on constrained rigid mechanical assemblies rather than particle or deformable simulation. Kamino is currently in BETA 1, and Newton users are discouraged from depending on it. Evaluate it only when kinematic loops and hard contact constraints are primary requirements and an experimental solver is acceptable.
Experimental
SolverKamino is experimental. Its public API,
behavior, feature support, performance, and implementation may change
without prior notice.
See the SolverKamino API reference for construction
and configuration details. Runnable workflows are available in the
Kamino examples.
Body acceleration#
Kamino populates body_qdd when
BODY_QDD is requested
through observables(). Values are
center-of-mass spatial accelerations in the world frame, with linear
acceleration followed by angular acceleration. For a step of duration dt,
Kamino reports the discrete step average (body_qd_out - body_qd_in) / dt.
Consequently, a contact impact reports its velocity impulse divided by dt
rather than a continuous midpoint acceleration.
Choosing a dynamics solver#
Kamino provides three forward-dynamics backends:
"padmm"(default): proximal ADMM, dense Jacobians/dynamics, and the Euler integrator. It is the slower, more robust option because it solves equality and inequality constraints together."scc"(opt-in): Split Constraint Coupling (SCC), formerly known as DVI, with projected dual iterations, sparse Jacobians, dense dynamics, dense blocked Cholesky bilateral solves, and the Euler integrator. It is generally faster, but approximates the coupled problem by alternating between a direct solve for equality constraints and projected iterations for inequality constraints. As a rule of thumb, SCC solves inequality constraints less accurately than PADMM, particularly as the number of active inequalities grows. Dual preconditioning is not supported."lox"(opt-in, experimental): a primal splitting method. Like SCC, it alternates between solving for equality constraints (and smooth dynamics in general) and solving for inequality constraints; however, in LOX the split is performed at the velocity level, and ADMM is used to reach a consensus.
Select the backend when constructing the configuration so dependent defaults initialize consistently:
config = newton.solvers.SolverKamino.Config(dynamics_solver="scc")
solver = newton.solvers.SolverKamino(model, config=config)
Deprecated since version 1.9: dynamics_solver="dvi" and config.dvi remain supported aliases for
dynamics_solver="scc" and config.scc for at least one full minor
release cycle. Using either alias emits NewtonDeprecationWarning.
They are eligible for removal in Newton 1.10.
SCC is best suited to performance-sensitive rigid mechanisms with relatively
few active contacts; PADMM remains the safer and more broadly validated choice.
Set sparse_jacobian=False for fully dense SCC, or set
sparse_dynamics=True to use sparse dynamics with the Conjugate Residual
solver.
Python SCC configurations default to "LLTBRCM" for the bilateral joint
solve. Select "LDL" explicitly to use the block-sparse factorization of the reordered matrix
as \(L D L^T\), storing unit-lower \(L\) separately from the scalar
diagonal \(D\). It stores only joint
blocks and symbolic fill, supports CPU and CUDA execution, and reuses its
factorization across unilateral iterations. Numeric factorization uses no
square roots or numerical pivoting and requires positive-definite systems.
It applies to both dense and sparse SCC dynamics.
Solves apply \(L^{-1}\), \(D^{-1}\), and \(L^{-T}\) in sequence. Compact Schur responses use \(D^{-1/2} L^{-1}\) so that their Gram product continues to represent the inverse bilateral operator.
LDL supports the source DVI solver’s two block reorderings:
MECA (default) selects the pivot creating the fewest new fill edges.
RCM applies Reverse Cuthill-McKee to the block graph.
Both preserve each joint’s row group. Ordering, exact symbolic fill, and allocation happen during setup and are reused by subsequent numeric solves. To select RCM while retaining the LDL factorization:
config.scc.bilateral_solver_type = "LDL"
config.scc.bilateral_solver_kwargs = {"ordering": "rcm"} # or "meca"
"LLTB" remains available for dense blocked Cholesky, and "LLTBRCM"
selects its existing RCM-reordered semi-sparse Cholesky variant.
For large sparse systems, the latter can cache its permutation and run
parallel factorization:
config.scc.bilateral_solver_kwargs = {
"block_size": 32,
"reuse_permutation": True,
"parallel_factorization": True,
}
The cached permutation remains mathematically valid when matrix values or
sparsity change and is recomputed automatically if the active dimension
changes. To factor dense tiles without reordering, set
config.scc.bilateral_solver_type = "LLTB".
The level-scheduled sparse backend can incur more launch overhead on small systems or long chains, so benchmark representative workloads when choosing between these backends.
Dense PADMM can also select the backend and ordering:
config.dynamics.linear_solver_type = "LDL"
config.dynamics.linear_solver_kwargs = {"ordering": "rcm"} # or "meca"
Its changing contact rows use an implicit complete block pattern and dense
factor storage, so this mode does not provide the joint topology’s
sparse-storage savings. Symbolic metadata is linear in the number of worlds,
and numeric factorization visits active rows rather than reserved contact
capacity. Sparse PADMM continues to require an
iterative linear solver; "LDL" is not supported with sparse PADMM.
All six Kamino examples accept --ldl --ldl-ordering meca and
--ldl --ldl-ordering rcm. This selects LDL for the SCC bilateral solver or
the dense PADMM linear solver. An explicit --ldl-ordering also selects LDL;
--ldl alone uses MECA.
The DR Legs and earworm SCC examples retain their LLTBRCM defaults. The
shared H1 and G1 robot examples also accept these options with
--solver kamino, retain their LLTBRCM defaults, and expose
--bilateral-solver-type {LDL,LLTB,LLTBRCM} for comparisons. For example:
uv run -m newton.examples kamino_robot_dr_legs --dynamics-solver scc --ldl --ldl-ordering rcm --viewer null --num-frames 120 --test
uv run -m newton.examples kamino_basic_fourbar --ldl --ldl-ordering meca --viewer null --num-frames 120 --test
uv run -m newton.examples robot_h1 --solver kamino --ldl-ordering rcm --viewer null --num-frames 500 --test
The shared pendulum, joints, URDF, ANYmal D, and Allegro hand examples also
accept these options with --solver kamino and retain their LLTBRCM
defaults. LDL options raise an error with another physics solver, sparse
PADMM, or an explicitly selected LLT backend. Selecting an ordering never
silently overrides an explicit --bilateral-solver-type LLTBRCM or
--linear-solver-type LLTB.
PADMM closed kinematic loops#
Closed kinematic loops make some joint constraints redundant. By default,
PADMM handles them with three settings of config.padmm:
detect_redundant_kinematicsdrops the redundant kinematic joint rows of models with closed loops, by a pivoted Cholesky elimination of the joint block, andreuse_redundant_kinematics_setrepeats the elimination only in the worlds where the dropped rows fail a check.unpenalized_bilateral_rowsremoves the ALM penalty from the bilateral joint rows.dual_residual_mode="delassus"measures the dual residual as the change of constraint velocity, which ignores impulse drift along the null space of the Delassus matrix (see Inspecting terminal status).
With the iterative linear solvers "CR" and "CRF" of
config.dynamics.linear_solver_type, which sparse dynamics always uses, the
three settings are turned off
and PADMM keeps its standard handling of redundant constraints. These solvers
never factorize the singular Delassus matrix, and are more accurate without them.
The internal stress of a loop is then carried by the kept rows rather than
split with minimum norm, so reported joint reactions can change when the
dropped rows change at a singular configuration; the motion does not. The
elimination runs on one thread block per world, which is slow for a single
world with thousands of kinematic joint rows. Such models can set
detect_redundant_kinematics = False, together with
unpenalized_bilateral_rows = False if their joints are redundant.
SCC unilateral subsolvers#
SCC offers two subsolvers for bounded joint rows, limits, and contacts:
PGS (default) uses projected Gauss-Seidel updates with less work per iteration, making it a simple choice for modest contact problems.
APGD offers a faster convergence rate for each frozen-correction quadratic problem, at the cost of objective-gradient evaluations and an inner backtracking loop. CUDA execution requires conditional-graph support.
Both support dense and sparse operators and bilateral Schur elimination.
See the SolverKamino configuration reference for
subsolver selection and iteration controls.
Configuring Kamino from USD#
SCC scene settings require newton-usd-schemas 0.8.0 or newer.
Call register_custom_attributes() on the
ModelBuilder before add_usd() to read
the NewtonKaminoSceneAPI and NewtonKaminoSccSceneAPI settings from a USD
PhysicsScene. SolverKamino(model) and SolverKamino.Config.from_model()
apply them: an authored value takes precedence over the keyword fallbacks passed
to from_model(), and a config passed to the solver is used unchanged. SCC
tuning is read only when SCC is selected. SCC ignores the scene’s
preconditioning setting.
Applying NewtonKaminoSccSceneAPI alone selects SCC and supplies the
"lltb" bilateral factorization fallback. An authored bilateral solver
token takes precedence, followed by the factorization in any Python scc
configuration passed to from_model(). Author
newton:kamino:scc:bilateral:numericalSolver = "lltbrcm" to select the
same factorization as the Python default.
Constraint recovery and material compliance#
PADMM and SCC share the constraint settings in config.constraints. Each
constraint group has a global recovery time and speed cap. Bilateral joints
remain rigid; contacts and joint limits can opt into an implicit spring-damper
law using model stiffness and damping.
config = newton.solvers.SolverKamino.Config(dynamics_solver="scc")
config.constraints.joint_recovery_time = 0.01
config.constraints.joint_recovery_speed = 0.05
config.constraints.contact_compliance = True
config.constraints.contact_recovery_time = None # Derive c / k per contact.
config.constraints.contact_recovery_speed = 0.5
config.constraints.limit_compliance = True
config.constraints.limit_recovery_time = None # Derive c / k per joint DoF.
config.constraints.limit_recovery_speed = 0.5
solver = newton.solvers.SolverKamino(model, config=config)
Recovery times are in seconds. joint_recovery_speed supplies one numerical
cap for all bilateral rows; limit_recovery_speed does the same for all
limit rows. Each cap is in m/s for linear rows and rad/s for angular rows.
The contact cap is in m/s. Caps apply independently to each constraint row. Their default is
infinity (unlimited); zero disables positional recovery while retaining the
velocity constraint and any physical compliance. They do not cap restitution,
motor targets, or body velocities. These settings are configured before solver
construction.
For step size \(h\), positive stiffness \(k\), damping \(c\), and signed constraint violation \(\phi\), backward Euler gives
With integrator="moreau", constraints are evaluated at the midpoint and the
remaining pose update spans \(h/2\). For compliant rows the coefficients are
The impulse still spans the full timestep \(h\). These coefficients enforce
the spring-damper law at the end of the step using the linearized constraint
position. Moreau requires use_collision_detector=True so contacts are
evaluated at the midpoint. The existing fallback to Euler for external contacts
also uses Euler compliance coefficients. Hard-row recovery retains its existing
full-step coefficients under either integrator.
The solver adds \(E\) to the physical constraint operator and adds the
capped bias \(b\) to the constraint velocity. A global
contact_recovery_time or limit_recovery_time overrides \(\tau\)
and therefore sets the effective damping to \(k\tau\) in both terms.
With no override, the solver uses the model damping. Once the recovery cap is
active, the law differs from the uncapped linear spring-damper. Numerical
regularization and ADMM proximal penalties remain separate from \(E\).
Contact stiffness/damping come from positive
rigid_contact_stiffness and the corresponding
rigid_contact_damping when supplied. Otherwise, they
are the arithmetic means of shape_material_ke and
shape_material_kd of the two shapes. This fallback also
works with Kamino’s internal collision pipeline. Only the contact normal
receives compliance; tangential rows retain the Coulomb friction law.
The normal spring impulse contributes fully to the friction load, including in
SCC’s PGS solver. Its hard-contact stabilization exclusion does not apply to
physical spring forces.
Compliant contacts obtain bounce from their spring-damper and ignore the
material restitution coefficient.
Limits use joint_limit_ke and
joint_limit_kd of their joint DoF. Limit detection is
unchanged. Non-positive or infinite stiffness retains the hard law for either family;
this interface does not represent a pure damper with zero stiffness. The
per-DOF drive gains and passive damping are independent of structural joint
recovery and are not reused for it.
The speed cap and recovery time apply to penetration or violated limits. Speculative contacts retain the positive-gap closing allowance \(\max(\phi,0)/h\); the cap does not slow approach before contact. Contact dead zones and the existing hard-contact restitution rules remain in effect.
Compatibility#
By default, compliance is disabled, recovery times are None, and caps are
unlimited. Existing configurations retain their dimensionless alpha
(joints), beta (limits), and gamma (contacts) recovery fractions. Hard
rows without a recovery-time override continue to use \(s\phi/h\) for
their corresponding legacy fraction \(s\). An explicit recovery time
takes precedence. At a given timestep, the equivalent time is
\(\tau=h(1/s-1)\) for \(s>0\); this conversion changes with timestep.
For example, a fraction of 0.01 at 240 Hz corresponds to 0.4125 s.
For a zero fraction, set the corresponding recovery time and recovery-speed
cap to zero.
This conversion preserves rigid-row recovery. Enabling finite stiffness can
introduce elastic deflection or bounce, so material gains must suit the intended
motion rather than reproduce rigid-contact trajectories exactly.
The shared recovery/compliance settings currently support PADMM and SCC.
LOX rejects non-default values for these new settings and retains its existing
config.lox.contact_compliance option and recovery controls.
LOX’s option uses only positive per-contact stiffness; it does not fall back to
shape materials, and its internal-pipeline contacts remain hard. PADMM and SCC
reject config.lox.contact_compliance=True with guidance to use the shared
option. Switching between these options can therefore change which contacts
are compliant even when the model materials are unchanged.
LOX unilateral projection#
LOX projects contacts, joint limits, and joint friction with mass-split
sweeps. config.lox.gauss_seidel_max_colors selects the sweep: one gives a
fully parallel Jacobi sweep, and larger values process up to that many
approximate constraint colors sequentially. config.lox.projection_acceleration
optionally accelerates the resulting map:
"none"runs plain sweeps."nesterov"(default) applies restarted Nesterov extrapolation after every sweep but the last, for either the Jacobi or the colored map."anderson"applies one safeguarded Anderson direction after every sweep, for either the Jacobi or the colored map.
Both carry their state, the Nesterov momentum and reaction history or the
Anderson direction, across the splitting iterations of one step. Nesterov applies
the extrapolation of the last sweep of a splitting iteration at the start of
the next projection, so that each projection still returns a sweep output. Set
projection_acceleration_recycle=False to restart it at every splitting
iteration.
LOX regularizes the local contact solves with
config.lox.contact_proximal_regularization (default 0.01), scaling their
Delassus diagonals by one plus this value. The contact law retains its mechanical
response, so converged solutions retain the hard-contact fixed point. For rigid
contacts without spatial friction, the first splitting iterations
(contact_proximal_warmstart_window) center the proximal term on
contact_proximal_warmstart_scale (default 0.9) times the warm-start
reaction. Later iterations center it on the current reaction. Set
contact_proximal_regularization=0.0 to disable both terms.
LOX contact extensions#
Enable these features through config.lox after selecting
dynamics_solver="lox". They are disabled by default, except spatial
friction, which follows the shapes’ friction modes.
contact_compliance=Trueturns contacts with a positive per-contact stiffnessk[N/m] (newton.Contacts.rigid_contact_stiffness) into implicit spring-dampers, with the dampingd[N s/m] ofnewton.Contacts.rigid_contact_damping. They add1 / (dt (k dt + d))to the normal contact operator and recover the fractionk dt / (k dt + d)of existing penetration per step. Their bounce comes from the spring-damper, so they ignore restitution. Contacts without a positive stiffness, and contacts detected by Kamino’s own collision pipelines, remain hard.newton.CollisionPipelineprovides per-contact stiffness only for hydroelastic contacts.contact_implicit_restitution=Truedecides the restitution of speculative impacts inside each local contact update, from its current reaction-free normal velocity, which better preserves energy in speculative impacts. Restitution applies either way: by default, the bounce target is fixed at the beginning of the step.Spatial friction applies the shape
mu_torsionalandmu_rollingcoefficients, both in metres, on contacts whosefriction_modeenables torsional or rolling friction. It is enabled automatically when any shape uses such a mode. Sliding, torsion, and rolling share one elliptic friction budget. Contacts with zero angular coefficients retain the classical 3D contact solve. Kamino’s primitive collision pipeline provides no angular coefficients. Thecontact_spatial_frictionoption, which enabled spatial friction on every contact, is deprecated.
Heterogeneous worlds#
Kamino supports solving, in a single batch, worlds in a model that differ in bodies, joints, and contact capacity. While arbitrarily different worlds are supported, Kamino targets worlds that are small variations of the same problem, for example the same robot with different payloads, terrain, or optional parts. As world dimensions diverge, memory and throughput resources are increasingly wasted.
More specifically, dense quantities (constraint Jacobians, Delassus matrices, and their factorizations) are stored with one row per world, sized for the largest world, and per-world kernels are launched over grids sized by the largest world. This design has the following consequences:
Memory: every world reserves dense storage for the largest world. Delassus matrices and their factors grow quadratically with the number of constraints, so a few large worlds among many small ones can multiply the dense memory footprint.
Throughput: threads assigned to the unused part of a smaller world stay idle, so a single large world slows down the whole batch.
If worlds differ substantially, for example a few large mechanisms among many small ones, consider simulating each group with its own model and solver.
The dense storage row of each world is limited to 231 bytes by the
32-bit array strides of Warp, which bounds a single world’s dense Delassus
matrix to about 23,000 constraints. Larger worlds raise an error during
solver construction; for these, consider sparse Jacobians and dynamics
(sparse_jacobian=True and sparse_dynamics=True).
D6 joints#
SCC, LOX, and PADMM support D6 joints authored with
newton.ModelBuilder.add_joint_d6() or imported from USD. A D6 joint
has zero to three linear axes and zero to three angular axes. Each family
must consist of unit-length, mutually orthogonal axes. Both families must
use the same orthonormal frame, so every linear axis must be parallel or
perpendicular to every angular axis. Either direction along a frame axis
is allowed. Omitted degrees of freedom are locked.
On models with D6 joints, issue ModelFlags.JOINT_PROPERTIES notifications
outside CUDA graph capture so Kamino can validate axis updates.
Coordinates and rates follow the authored order, with linear components first (meters and meters per second), then angular components (radians and radians per second). Angular coordinates are intrinsic angles applied in order about successive rotated axes. Two angular axes give universal-joint rotation and three give gimbal rotation.
Each active axis supports position limits, direct effort, implicit drives, effort limits, armature, damping, and Coulomb friction. With three angular axes, individual Euler rates become indeterminate at gimbal lock. Kamino uses the minimum-norm rate split at float32 rank loss and the exact coordinate derivative at regular poses.
Use use_fk_solver=False (the default) for general D6 layouts. The
optional Kamino forward-kinematics solver supports D6 layouts that map to
its specialized joints: fixed, prismatic, revolute, same-axis cylindrical,
universal, right-handed Cartesian, and three-axis gimbal. Newton’s
newton.eval_fk() can initialize articulated D6 body states for any
supported D6 layout.
Rod joints#
All dynamics backends support JointType.ROD joints between rigid bodies,
as built by newton.ModelBuilder.add_joint_rod(). Each
rod DOF with nonzero stiffness or damping adds an implicit dynamic constraint on
one rod strain: shear and stretch along the axes of the joint frame on the
parent body, then bend and twist. The rest pose
of each rod is its structural rest, newton.Model.joint_rest_q: its
translation sets the rest shear and stretch, and its rotation sets the rest bend
and twist. Builders store zero translation, so the anchors coincide at rest
unless joint_rest_q is edited. The constraints are linearized at the beginning
of each time step. LOX additionally adds the rotational stiffness of the rod tension
acting at each segment’s lever arm, which keeps light segments under high tension
stable at large time steps. Rod joints require zero armature, joint damping, and joint
friction, unbounded joint limits, no target mode, and use_fk_solver=False.
Inspecting terminal status#
After each step, status provides one
device-resident terminal status record per world. PADMM and SCC both provide
converged, iterations, r_p, r_d, and r_c fields. Their
residual definitions are backend-specific:
PADMM: Let
xandybe the current preconditioned impulse iterates,x_prevandy_prevtheir previous values,Pthe diagonal dual preconditioner, andetaandrhothe proximal and penalty parameters.r_p = ||P (x - y)||_infis the primal consensus residual [N·s or N·m·s].r_d = ||P^-1 D (x - x_prev)||_infis the change of constraint velocity between iterates [m/s or rad/s], withDthe preconditioned Delassus matrix. Withdual_residual_mode="standard"or an iterative linear solver, it is instead the ADMM dual residualr_d = ||P^-1 (eta (x - x_prev) + rho_i (y - y_prev))||_inf, withrho_ithe penalty of each row, which is zero on unpenalized bilateral joint rows.r_cis the maximum absolute impulse-velocity inner product over inequality blocks [J]. ThePfactors convert the first two residuals from solver scaling to physical constraint units.SCC: With physical impulse
lambdaand augmented constraint velocityv,r_pis the maximum infinity-norm projection distance of unilateral impulses from the nonnegative limit cone or Coulomb contact cone [N·s or N·m·s].r_dis the maximum of the corresponding velocity distance from the dual cone and the bilateral velocity violation [m/s or rad/s].r_c = max |lambda_k dot v_k|is the maximum inequality complementarity violation [J].LOX:
convergedanditerationsreport LOX’s native splitting termination state. With body twistsvof the smooth solve andpof the unilateral projection, and the splitting body weightW,r_p = ||W (v - p)||_infis the consensus residual [N·s or N·m·s] andr_d = ||v - v_prev||_infis the last change of the smooth solution [m/s or rad/s].r_cis the squared maximum Delassus-scaled natural-map residual of the joint-friction, limit, and contact rows under their contact law [J], which measures feasibility and complementarity together. These residuals do not require solution metrics; they are NaN before a solve and for failed worlds. LOX additionally reportsfailed; a world that is neither converged nor failed reached the iteration limit and uses its last projected iterate. A failed world stays failed until it is reset, for example withsolver.reset(..., world_mask=...). Until then, LOX skips its solve, and its bodies keep their input velocity, without gravity, joint or contact forces, so checkfailedto detect and reset these worlds.
These are absolute maxima: no backend divides them by a reference norm, constraint count, or tolerance. Additional fields are not portable between backends.
status = solver.status
assert status.device == model.device
assert status.shape == (model.world_count,)
# Host inspection is explicit and synchronizes the device-to-host copy.
status_host = status.numpy()
unconverged_worlds = (~status_host["converged"].astype(bool)).nonzero()[0]
Terminal status is always maintained. collect_solver_info=True enables
additional solver diagnostics and adds runtime and memory overhead; it is not
required to access status.
Actuation and forward kinematics#
Kamino dynamics routes actuation independently for each joint DoF. A DoF can use explicit effort, unbounded implicit PD, or effort-limited implicit PD; passive armature, damping, and Coulomb friction are likewise configured per DoF. Implicit-PD target modes require a non-zero applicable gain: velocity mode requires derivative gain, while position-based modes require proportional or derivative gain. Coulomb friction supports all non-free joint types, while joint dynamics and implicit PD support revolute, prismatic, and D6 joints.
The forward-kinematics solver still partitions each joint as entirely passive
or entirely actuated. Different non-passive target modes are allowed within a
joint, but mixing passive and actuated DoFs within one joint is not yet
supported. The fk_actuation_flag model attribute provides an explicit
joint-level override for this FK partition.