GVS Warp Integration API¶
Integration API
SoRoMoX users should call the public GVS kinematics and dynamics methods.
The symbols on this page are intended for packages that reuse the GVS
kinematics, dynamics, or actuation pipelines with preallocated Warp
buffers.
Batch layouts and naming¶
| Entry points | Input layout |
|---|---|
homogeneous_*_kernel |
One *Data struct passed directly, referencing a rectangular batch with common structural dimensions and coordinate layout. |
launch_homogeneous_* |
Array arguments at the JAX boundary; the launcher assembles the shared struct and launches the homogeneous kernel. |
packed_*_kernel |
Per-world *Data structs and an INT32 work map; each world may have its own structure and parameters. Most maps use (world_index, local_index, 0); chain projection uses entry ranges as described below. |
launch_packed_mixed_chain |
Packed descriptors and prepared chain/projection work maps; selects CPU inline assembly or CUDA sweep plus parallel projection. |
*_at |
Shared numerical functions with explicit indices into the supplied array views. |
Values can vary by world when their arrays carry a world axis. Other inputs are shared: for example, homogeneous cell kernels share bases and geometry, and homogeneous chain kernels share weighted masses and gravity. Each symbol documents its sharing rules, indexing and launch dimensions. Callers retain all referenced arrays. Packed descriptors may share matching model arrays.
The same struct type serves both kernel families. A homogeneous kernel receives
one struct whose batched fields span all E worlds. A packed kernel receives an
array of these structs, each containing one world's views (E = 1). Homogeneous
kernels compute indices directly from the launch grid; packed kernels select a
descriptor through the work map.
Native callers can bind a struct once and reuse it while its array views remain valid. Assign fields on the host before launching, and keep the referenced arrays alive throughout CUDA graph use. Updating array contents preserves the binding; replacing an allocation requires rebinding the field and recapturing graphs that use the old allocation.
Packed chain dynamics¶
Use launch_packed_mixed_chain for CPU or CUDA dynamics on identical or
heterogeneous models. Prepare GVSMixedChainData descriptors once. Create the
chain work array with make_packed_chain_sweep_work(velocity_counts, block_dim)
and the projection work array with
make_packed_chain_projection_work(velocity_counts) and dtype=wp.vec3i;
counts include floating-base velocities. For subset evaluation, select the
same worlds in both work maps.
Keep all referenced arrays alive, including during CUDA graph replay. Set each
descriptor's lanes_per_block[0] to the launch block size: one for CPU, or a
multiple of 32 through 256 for CUDA (default 64). The projection map may be
None on CPU. The generated API reference below describes each buffer.
Linear-threadlike actuation¶
GVSThreadlikeOperands.from_model(robot) exposes the ordered built-in linear
routing data together with interior body quadrature, link strain bases and
reference strains, pre-scaled link bases, physical quadrature coordinates and
weights, segment spans, and link-local/global coordinate maps.
GVSThreadlikeShapes specifies the shared caller-owned strain workspace
(E, S, Q, 6), matrix output (E, D, A), and fused-force output (E, D).
The exact launch sequences are:
launch_homogeneous_gvs_threadlike_actuation_matrix(...)prepares every quadrature strain once in(E, S, Q, 6), then integrates and writes every matrix entry.launch_homogeneous_gvs_threadlike_actuation_force(...)prepares the same workspace, appliescoordinate_scale[path] * controls[e, path], and reduces paths directly into(E, D). CUDA uses one 128-lane block per environment and segment; Warp CPU uses a scalar-coordinate kernel.
Both second stages explicitly write inactive paths and joint-only coordinates as zero, so neither sequence requires a separate output-clear launch. Matrix and force calls may reuse the same strain workspace when they do not overlap.
Floating-point inputs, workspaces, and outputs are FP64; coordinate maps and
path spans are INT32. Callers own and retain all Warp views and buffers.
Neither launcher allocates, calls JAX, synchronizes, or transfers data, and
both two-launch sequences may be captured in a CUDA graph. Environment,
segment, link-DOF, quadrature, and path dimensions remain runtime-shaped. The
normalization test is exactly
norm > global_eps; a collapsed tangent contributes zero, matching JAX.
soromox.execution.warp.gvs
¶
Public Warp-native GVS kinematics and dynamics building blocks.
The kernels and launch functions in this module operate entirely on
warp.array objects. They do not require JAX and do not allocate output
buffers, making them suitable for external CUDA-graph-capturable integrators
such as a Newton solver. Callers own the buffers and must preserve the shapes,
dtypes, coordinate maps, and launch ordering described by each function.
Soromox system users should normally call :meth:GVS.dynamics_terms
<soromox.systems.GVS.dynamics_terms> or :meth:GVS.forward_dynamics
<soromox.systems.GVS.forward_dynamics> instead. The lower-level API is intended
for integration packages that need to compose the kinematics and dynamics
pipelines inside a larger Warp-native simulation loop.
__getattr__
¶
Load a public GVS Warp symbol without making Warp a core dependency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Attribute requested from this package. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The public operand type, kernel, or launch function named by |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If |
ImportError
|
If a kernel is requested without |
__dir__
¶
Include lazily exported Warp symbols in interactive discovery.
Returns:
| Type | Description |
|---|---|
list[str]
|
Sorted module globals and public lazy exports. |