| CollisionManifold |
Ran ran on a synthesized input · constructed an object; no result was computed |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("c4d71922afef391f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, CollisionManifold: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
import numpy as np
# Construct valid arguments for CollisionManifold dataclass
ARGS = {
"normal": jnp.array([1.0, 0.0, 0.0, 0.0]),
"penetration": 0.05,
"collision_point": jnp.array([0.5, 1.2, 2.1, 3.3]),
"active": True,
"acc_impulse_normal": 0.1,
"acc_impulse_tangent": 0.02,
"restitution_velocity_target": jnp.array([0.0, 0.1, 0.2, 0.3]),
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type CollisionManifold — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CollisionManifold output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| Joint |
Ran ran on a synthesized input · constructed an object; no result was computed |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("94edda67873cb84a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Joint: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
import numpy as np
ARGS = {
"a_index": 0,
"b_index": 1,
"a_relative_pos": jnp.array([1.0, 2.0, 3.0, 4.0]),
"b_relative_pos": jnp.array([5.0, 6.0, 7.0, 8.0]),
"global_position": jnp.array([0.5, 1.5, 2.5, 3.5]),
"active": True,
"acc_impulse": jnp.array([0.1, 0.2, 0.3, 0.4]),
"acc_r_impulse": jnp.array([0.05, 0.15, 0.25, 0.35]),
"motor_speed": 5.0,
"motor_power": 10.0,
"motor_on": True,
"motor_has_joint_limits": True,
"min_rotation": -1.5708,
"max_rotation": 1.5708,
"is_fixed_joint": False,
"rotation": 0.785,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Joint — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Joint output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| RigidBody |
Ran ran on a synthesized input · constructed an object; no result was computed |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("7d72c868e25d3fe1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, RigidBody: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
ARGS = {
"position": jnp.array([1.0, 2.0]),
"rotation": 0.5,
"velocity": jnp.array([0.1, 0.2]),
"angular_velocity": 0.05,
"inverse_mass": 0.5,
"inverse_inertia": 0.25,
"friction": 0.3,
"restitution": 0.8,
"collision_mode": 1,
"active": True,
"n_vertices": 4,
"vertices": jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
"radius": 0.5,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type RigidBody — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RigidBody output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| SimParams |
Ran ran on a synthesized input · constructed an object; no result was computed |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("b2fe077eb4ab29bc") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, SimParams: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from flax import struct
ARGS = {
"dt": 1 / 60,
"slop": 0.01,
"baumgarte_coefficient_joints_v": 2.0,
"baumgarte_coefficient_joints_p": 0.7,
"baumgarte_coefficient_fjoint_av": 2.0,
"baumgarte_coefficient_rjoint_limit_av": 5.0,
"baumgarte_coefficient_collision": 0.2,
"joint_stiffness": 0.6,
"clip_position": 15,
"clip_velocity": 100,
"clip_angular_velocity": 50,
"base_motor_speed": 6.0,
"base_motor_power": 900.0,
"base_thruster_power": 10.0,
"motor_decay_coefficient": 0.1,
"motor_joint_limit": 0.1,
"base_friction": 0.4,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type SimParams — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SimParams output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| StaticSimParams |
Ran ran on a synthesized input · constructed an object; no result was computed |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("a4f645240883f386") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, StaticSimParams: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from flax import struct
torch.manual_seed(0)
ARGS = {
"num_polygons": 12,
"num_circles": 12,
"num_joints": 12,
"num_thrusters": 12,
"max_polygon_vertices": 4,
"num_solver_iterations": 10,
"solver_batch_size": 16,
"do_warm_starting": True,
"num_static_fixated_polys": 4,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type StaticSimParams — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a StaticSimParams output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| Thruster |
Ran ran on a synthesized input · constructed an object; no result was computed |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("2336ad395d05d388") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Thruster: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
import numpy as np
ARGS = {
"object_index": 0,
"relative_position": jnp.array([1.0, 2.0, 3.0, 4.0]),
"rotation": 0.785,
"power": 100.0,
"global_position": jnp.array([5.0, 6.0, 7.0, 8.0]),
"active": jnp.array(True),
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Thruster — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Thruster output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _calc_normals |
Ran ran, honoured the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("ffba1b89ed7b3dbb") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import numpy as np
# Analyze the function:
# - matrix: used with jnp.matmul(mat, v), so needs to be a 2D array
# - next_vert: used in subtraction (next_vert - vert), needs matching shape to vert
# - vert: used in subtraction, needs matching shape to next_vert
# All are vmapped or used in vmap context, suggesting batch dimensions
# Create small test data
batch_size = 2
vert_dim = 4
# matrix: 2D array for matmul with vectors of size vert_dim
# Shape should be (vert_dim, vert_dim) to support matmul with delta vectors
matrix = jnp.array(np.random.randn(vert_dim, vert_dim), dtype=jnp.float32)
# next_vert: shape (batch_size, vert_dim) - batch of vertices
next_vert = jnp.array(np.random.randn(batch_size, vert_dim), dtype=jnp.float32)
# vert: shape (batch_size, vert_dim) - batch of vertices
vert = jnp.array(np.random.randn(batch_size, vert_dim), dtype=jnp.float32)
ARGS = {
"matrix": matrix,
"next_vert": next_vert,
"vert": vert,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| _calc_relative_velocity |
Ran ran, violated the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("9d034cff62cb5d7a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
import numpy as np
def sv_cross(x, v):
return jnp.array([-x * v[1], x * v[0]])
def _calc_relative_velocity(v1, com1, av1, v2, com2, av2, cpoint, normal):
av = v1 + sv_cross(av1, cpoint - com1)
bv = v2 + sv_cross(av2, cpoint - com2)
vn = jnp.dot(bv - av, normal)
return vn
# Create small arrays for testing
v1 = jnp.array([1.0, 2.0])
com1 = jnp.array([0.5, 0.5])
av1 = 0.1
v2 = jnp.array([3.0, 4.0])
com2 = jnp.array([1.5, 1.5])
av2 = 0.2
cpoint = jnp.array([2.0, 2.0])
normal = jnp.array([1.0, 0.0])
ARGS = {
"v1": v1,
"com1": com1,
"av1": av1,
"v2": v2,
"com2": com2,
"av2": av2,
"cpoint": cpoint,
"normal": normal,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| apply_motor |
Ran ran, honoured the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("784a8433f936cdc1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class Joint:
a_index: int
b_index: int
a_relative_pos: jnp.ndarray
b_relative_pos: jnp.ndarray
global_position: jnp.ndarray
active: bool
acc_impulse: jnp.ndarray
acc_r_impulse: jnp.ndarray
motor_speed: float
motor_power: float
motor_on: bool
motor_has_joint_limits: bool
min_rotation: float
max_rotation: float
is_fixed_joint: bool
rotation: float
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
@struct.dataclass
class SimParams:
dt: float = 1 / 60
slop: float = 0.01
baumgarte_coefficient_joints_v: float = 2.0
baumgarte_coefficient_joints_p: float = 0.7
baumgarte_coefficient_fjoint_av: float = 2.0
baumgarte_coefficient_rjoint_limit_av: float = 5.0
baumgarte_coefficient_collision: float = 0.2
joint_stiffness: float = 0.6
clip_position: float = 15
clip_velocity: float = 100
clip_angular_velocity: float = 50
base_motor_speed: float = 6.0
base_motor_power: float = 900.0
base_thruster_power: float = 10.0
motor_decay_coefficient: float = 0.1
motor_joint_limit: float = 0.1
base_friction: float = 0.4
# Create RigidBody instances
body_a = RigidBody(
position=jnp.array([0.0, 0.0]),
rotation=0.0,
velocity=jnp.array([1.0, 0.5]),
angular_velocity=0.1,
inverse_mass=0.5,
inverse_inertia=0.2,
friction=0.4,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 1.0], [1.0, 1.0], [1.0, 0.0], [0.0, 0.0]]),
radius=0.0
)
body_b = RigidBody(
position=jnp.array([5.0, 5.0]),
rotation=0.5,
velocity=jnp.array([-0.5, 1.0]),
angular_velocity=-0.05,
inverse_mass=0.3,
inverse_inertia=0.15,
friction=0.3,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=3,
vertices=jnp.array([[0.0, 1.0], [1.0, 0.0], [-1.0, 0.0]]),
radius=0.0
)
# Create Joint instance
joint = Joint(
a_index=0,
b_index=1,
a_relative_pos=jnp.array([0.5, 0.5]),
b_relative_pos=jnp.array([-0.5, -0.5]),
global_position=jnp.array([2.5, 2.5]),
active=True,
acc_impulse=jnp.array([0.0, 0.0]),
acc_r_impulse=jnp.array([0.0]),
motor_speed=5.0,
motor_power=850.0,
motor_on=True,
motor_has_joint_limits=False,
min_rotation=-1.57,
max_rotation=1.57,
is_fixed_joint=False,
rotation=0.0
)
# Create SimParams instance
sim_params = SimParams()
# Motor action value
motor_action = 0.5
ARGS = {
"a": body_a,
"b": body_b,
"joint": joint,
"motor_action": motor_action,
"sim_params": sim_params
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| calc_nrr |
Ran ran, honoured the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("41526b77e7ab9774") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from flax import struct
@struct.dataclass
class StaticSimParams:
num_polygons: int = 12
num_circles: int = 12
num_joints: int = 12
num_thrusters: int = 12
max_polygon_vertices: int = 4
num_solver_iterations: int = 10
solver_batch_size: int = 16
do_warm_starting: bool = True
num_static_fixated_polys: int = 4
def calc_nrr(static_sim_params: StaticSimParams):
nrr_all = static_sim_params.num_polygons * (static_sim_params.num_polygons - 1) // 2
nrr_sf = static_sim_params.num_static_fixated_polys * (static_sim_params.num_static_fixated_polys - 1) // 2
nrr = nrr_all - nrr_sf
return nrr
# Create a StaticSimParams instance with default or custom values
static_sim_params = StaticSimParams(
num_polygons=12,
num_circles=12,
num_joints=12,
num_thrusters=12,
max_polygon_vertices=4,
num_solver_iterations=10,
solver_batch_size=16,
do_warm_starting=True,
num_static_fixated_polys=4
)
ARGS = {
"static_sim_params": static_sim_params
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| find_axis_of_least_penetration |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("ebcbd3a6aec7b749") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import math
from flax import struct
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
# Create rigid body A (a square polygon)
a = RigidBody(
position=jnp.array([0.0, 0.0]),
rotation=0.0,
velocity=jnp.array([0.0, 0.0]),
angular_velocity=0.0,
inverse_mass=1.0,
inverse_inertia=1.0,
friction=0.5,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[-1.0, -1.0], [1.0, -1.0], [1.0, 1.0], [-1.0, 1.0]]),
radius=0.0
)
# Create rigid body B (another square polygon)
b = RigidBody(
position=jnp.array([2.0, 2.0]),
rotation=math.pi / 4.0,
velocity=jnp.array([1.0, 0.0]),
angular_velocity=0.1,
inverse_mass=1.0,
inverse_inertia=1.0,
friction=0.3,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[-0.5, -0.5], [0.5, -0.5], [0.5, 0.5], [-0.5, 0.5]]),
radius=0.0
)
ARGS = {
"a": a,
"b": b
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| generate_manifold_circle_circle |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("3c0891f5996e6469") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned CollisionManifold. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class CollisionManifold:
normal: jnp.ndarray
penetration: float
collision_point: jnp.ndarray
active: bool
acc_impulse_normal: float
acc_impulse_tangent: float
restitution_velocity_target: jnp.ndarray
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
a = RigidBody(
position=jnp.array([0.0, 0.0]),
rotation=0.0,
velocity=jnp.array([1.0, 0.0]),
angular_velocity=0.0,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.3,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=0,
vertices=jnp.array([]),
radius=1.0
)
b = RigidBody(
position=jnp.array([1.5, 0.0]),
rotation=0.0,
velocity=jnp.array([-1.0, 0.0]),
angular_velocity=0.0,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.3,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=0,
vertices=jnp.array([]),
radius=1.0
)
ws_manifold = CollisionManifold(
normal=jnp.array([1.0, 0.0]),
penetration=0.0,
collision_point=jnp.array([0.0, 0.0]),
active=False,
acc_impulse_normal=0.0,
acc_impulse_tangent=0.0,
restitution_velocity_target=jnp.array([0.0, 0.0])
)
ARGS = {
"a": a,
"b": b,
"ws_manifold": ws_manifold
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type CollisionManifold — a CollisionManifold output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CollisionManifold output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| generate_manifold_circle_polygon |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("65a4ee7460d349a3") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned CollisionManifold. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class CollisionManifold:
normal: jnp.ndarray
penetration: float
collision_point: jnp.ndarray
active: bool
acc_impulse_normal: float
acc_impulse_tangent: float
restitution_velocity_target: jnp.ndarray
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
def rmat(angle):
c = jnp.cos(angle)
s = jnp.sin(angle)
return jnp.array([[c, -s], [s, c]])
def sv_cross(x, v):
return jnp.array([-x * v[1], x * v[0]])
def should_collide(a, b):
return (a.collision_mode == 2) | (b.collision_mode == 2) | (a.collision_mode * b.collision_mode > 0)
def zero_to_one(x):
return jax.lax.select(x == 0, jnp.ones_like(x), x)
# Create a circle RigidBody
circle = RigidBody(
position=jnp.array([1.0, 2.0]),
rotation=0.5,
velocity=jnp.array([0.1, 0.2]),
angular_velocity=0.05,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.3,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=0,
vertices=jnp.array([]),
radius=0.5
)
# Create a polygon RigidBody (quadrilateral)
polygon = RigidBody(
position=jnp.array([0.0, 0.0]),
rotation=0.1,
velocity=jnp.array([0.0, 0.0]),
angular_velocity=0.0,
inverse_mass=0.5,
inverse_inertia=0.25,
friction=0.2,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([
[-1.0, -1.0],
[1.0, -1.0],
[1.0, 1.0],
[-1.0, 1.0]
]),
radius=0.0
)
# Create a CollisionManifold
ws_manifold = CollisionManifold(
normal=jnp.array([1.0, 0.0]),
penetration=0.1,
collision_point=jnp.array([0.5, 0.5]),
active=False,
acc_impulse_normal=0.0,
acc_impulse_tangent=0.0,
restitution_velocity_target=jnp.array([0.0, 0.0])
)
ARGS = {
"circle": circle,
"polygon": polygon,
"ws_manifold": ws_manifold
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type CollisionManifold — a CollisionManifold output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CollisionManifold output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_global_joint_position |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("80bbe3a004dd200e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
# Create two RigidBody instances
rigid_body_a = RigidBody(
position=jnp.array([1.0, 2.0]),
rotation=0.5,
velocity=jnp.array([0.1, 0.2]),
angular_velocity=0.05,
inverse_mass=0.5,
inverse_inertia=0.1,
friction=0.3,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
radius=0.5
)
rigid_body_b = RigidBody(
position=jnp.array([3.0, 4.0]),
rotation=0.3,
velocity=jnp.array([0.2, 0.1]),
angular_velocity=0.02,
inverse_mass=0.25,
inverse_inertia=0.05,
friction=0.4,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=3,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [0.5, 1.0]]),
radius=0.3
)
# Create relative position vectors
a_relative_pos = jnp.array([0.5, 0.5])
b_relative_pos = jnp.array([0.3, 0.7])
ARGS = {
"a": rigid_body_a,
"b": rigid_body_b,
"a_relative_pos": a_relative_pos,
"b_relative_pos": b_relative_pos,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_pairwise_interaction_indices |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("135e1f257da96d04") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class StaticSimParams:
num_polygons: int = 12
num_circles: int = 12
num_joints: int = 12
num_thrusters: int = 12
max_polygon_vertices: int = 4
num_solver_iterations: int = 10
solver_batch_size: int = 16
do_warm_starting: bool = True
num_static_fixated_polys: int = 4
# Create a small instance with reduced sizes for testing
static_sim_params = StaticSimParams(
num_polygons=4,
num_circles=3,
num_joints=2,
num_thrusters=2,
max_polygon_vertices=4,
num_solver_iterations=5,
solver_batch_size=8,
do_warm_starting=True,
num_static_fixated_polys=1
)
ARGS = {
"static_sim_params": static_sim_params
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| make_impulse_warm_starting_fn |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("7711865e3a2be371") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class CollisionManifold:
normal: jnp.ndarray
penetration: float
collision_point: jnp.ndarray
active: bool
acc_impulse_normal: float
acc_impulse_tangent: float
restitution_velocity_target: jnp.ndarray
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
@struct.dataclass
class SimState:
polygon: object
circle: object
collision_matrix: jnp.ndarray
@struct.dataclass
class PolygonState:
velocity: jnp.ndarray
angular_velocity: jnp.ndarray
class StaticSimParams:
def __init__(self, num_polygons):
self.num_polygons = num_polygons
num_polygons = 3
num_circles = 2
n_manifolds = 4
static_sim_params = StaticSimParams(num_polygons=num_polygons)
shape1_poly = True
shape2_poly = True
index_pairs = jnp.array([
[0, 1],
[1, 0],
[0, 2],
[2, 1],
], dtype=jnp.int32)
collision_matrix = jnp.ones((num_polygons + num_circles, num_polygons + num_circles), dtype=jnp.bool_)
polygon_velocities = jnp.ones((num_polygons, 2), dtype=jnp.float32)
polygon_angular_velocities = jnp.ones((num_polygons,), dtype=jnp.float32)
polygon_state = PolygonState(
velocity=polygon_velocities,
angular_velocity=polygon_angular_velocities
)
state = SimState(
polygon=polygon_state,
circle=polygon_state,
collision_matrix=collision_matrix
)
manifolds = CollisionManifold(
normal=jnp.array([[1.0, 0.0], [0.0, 1.0], [1.0, 1.0], [0.5, 0.5]], dtype=jnp.float32),
penetration=jnp.array([0.1, 0.2, 0.15, 0.05], dtype=jnp.float32),
collision_point=jnp.array([[0.5, 0.5], [1.0, 1.0], [0.0, 0.0], [0.3, 0.7]], dtype=jnp.float32),
active=jnp.array([True, True, True, False], dtype=jnp.bool_),
acc_impulse_normal=jnp.array([0.01, 0.02, 0.015, 0.005], dtype=jnp.float32),
acc_impulse_tangent=jnp.array([0.001, 0.002, 0.0015, 0.0005], dtype=jnp.float32),
restitution_velocity_target=jnp.array([[0.1, 0.2], [0.2, 0.1], [0.0, 0.0], [0.05, 0.05]], dtype=jnp.float32)
)
ARGS = {
"static_sim_params": static_sim_params,
"shape1_poly": shape1_poly,
"shape2_poly": shape2_poly,
"n_manifolds": n_manifolds,
"index_pairs": index_pairs,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| resolve_collision |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("b7d1f6c9760a0659") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class CollisionManifold:
normal: jnp.ndarray
penetration: float
collision_point: jnp.ndarray
active: bool
acc_impulse_normal: float
acc_impulse_tangent: float
restitution_velocity_target: jnp.ndarray
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
@struct.dataclass
class SimParams:
dt: float = 1 / 60
slop: float = 0.01
baumgarte_coefficient_joints_v: float = 2.0
baumgarte_coefficient_joints_p: float = 0.7
baumgarte_coefficient_fjoint_av: float = 2.0
baumgarte_coefficient_rjoint_limit_av: float = 5.0
baumgarte_coefficient_collision: float = 0.2
joint_stiffness: float = 0.6
clip_position: float = 15
clip_velocity: float = 100
clip_angular_velocity: float = 50
base_motor_speed: float = 6.0
base_motor_power: float = 900.0
base_thruster_power: float = 10.0
motor_decay_coefficient: float = 0.1
motor_joint_limit: float = 0.1
base_friction: float = 0.4
# Create RigidBody instances
a = RigidBody(
position=jnp.array([0.0, 0.0]),
rotation=0.0,
velocity=jnp.array([1.0, 0.0]),
angular_velocity=0.1,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.4,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
radius=0.5
)
b = RigidBody(
position=jnp.array([2.0, 0.0]),
rotation=0.0,
velocity=jnp.array([-1.0, 0.0]),
angular_velocity=-0.1,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.3,
restitution=0.7,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
radius=0.5
)
# Create CollisionManifold instance
collision_manifold = CollisionManifold(
normal=jnp.array([1.0, 0.0]),
penetration=0.05,
collision_point=jnp.array([1.5, 0.0]),
active=True,
acc_impulse_normal=0.0,
acc_impulse_tangent=0.0,
restitution_velocity_target=jnp.array([0.0, 0.0])
)
# Create SimParams instance
sim_params = SimParams()
# Create ARGS dictionary
ARGS = {
"a": a,
"b": b,
"collision_manifold": collision_manifold,
"does_collide": True,
"sim_params": sim_params
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| resolve_joint_warm_start |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("cdbad98fd56af8d8") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class Joint:
a_index: int
b_index: int
a_relative_pos: jnp.ndarray
b_relative_pos: jnp.ndarray
global_position: jnp.ndarray
active: bool
acc_impulse: jnp.ndarray
acc_r_impulse: jnp.ndarray
motor_speed: float
motor_power: float
motor_on: bool
motor_has_joint_limits: bool
min_rotation: float
max_rotation: float
is_fixed_joint: bool
rotation: float
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
# Create RigidBody a
a = RigidBody(
position=jnp.array([1.0, 2.0]),
rotation=0.5,
velocity=jnp.array([0.1, 0.2]),
angular_velocity=0.05,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.3,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
radius=0.5
)
# Create RigidBody b
b = RigidBody(
position=jnp.array([3.0, 4.0]),
rotation=0.3,
velocity=jnp.array([0.05, 0.1]),
angular_velocity=0.02,
inverse_mass=0.5,
inverse_inertia=0.25,
friction=0.2,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=3,
vertices=jnp.array([[0.0, 0.0], [0.5, 0.0], [0.25, 0.5]]),
radius=0.3
)
# Create Joint
joint = Joint(
a_index=0,
b_index=1,
a_relative_pos=jnp.array([0.2, 0.3]),
b_relative_pos=jnp.array([0.1, 0.15]),
global_position=jnp.array([2.0, 3.0]),
active=True,
acc_impulse=jnp.array([0.01, 0.02]),
acc_r_impulse=0.005,
motor_speed=1.5,
motor_power=10.0,
motor_on=True,
motor_has_joint_limits=False,
min_rotation=-3.14,
max_rotation=3.14,
is_fixed_joint=False,
rotation=0.0
)
ARGS = {
"a": a,
"b": b,
"joint": joint
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| resolve_warm_starting_impulse |
Ran ran; our contract draft was wrong, not the code |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("9a0ecc9db778deab") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class CollisionManifold:
normal: jnp.ndarray
penetration: float
collision_point: jnp.ndarray
active: bool
acc_impulse_normal: float
acc_impulse_tangent: float
restitution_velocity_target: jnp.ndarray
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
# Create RigidBody a
a = RigidBody(
position=jnp.array([0.0, 0.0]),
rotation=0.0,
velocity=jnp.array([1.0, 0.0]),
angular_velocity=0.1,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.3,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
radius=0.0
)
# Create RigidBody b
b = RigidBody(
position=jnp.array([2.0, 0.0]),
rotation=0.0,
velocity=jnp.array([-1.0, 0.0]),
angular_velocity=-0.1,
inverse_mass=0.5,
inverse_inertia=0.25,
friction=0.2,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
radius=0.0
)
# Create CollisionManifold m
m = CollisionManifold(
normal=jnp.array([1.0, 0.0]),
penetration=0.1,
collision_point=jnp.array([1.0, 0.5]),
active=True,
acc_impulse_normal=0.5,
acc_impulse_tangent=0.1,
restitution_velocity_target=jnp.array([0.0, 0.0])
)
# does_collide parameter
does_collide = True
ARGS = {
"a": a,
"b": b,
"m": m,
"does_collide": does_collide
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| rmat |
Ran ran, honoured the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("714fc19192991565") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 2, dtype family float, shape (2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
# The function rmat takes an angle parameter and returns a 2D rotation matrix
# The angle can be a scalar or array-like value that jnp.cos and jnp.sin can handle
angle = jnp.array(0.5) # A scalar angle in radians
ARGS = {
"angle": angle
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| should_collide |
Ran ran, violated the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("6ce0d2878c4c5281") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
from flax import struct
@struct.dataclass
class RigidBody:
position: jnp.ndarray
rotation: float
velocity: jnp.ndarray
angular_velocity: float
inverse_mass: float
inverse_inertia: float
friction: float
restitution: float
collision_mode: int
active: bool
n_vertices: int
vertices: jnp.ndarray
radius: float
def should_collide(a: RigidBody, b: RigidBody):
return (a.collision_mode == 2) | (b.collision_mode == 2) | (a.collision_mode * b.collision_mode > 0)
# Create two RigidBody instances for testing
rigid_body_a = RigidBody(
position=jnp.array([1.0, 2.0]),
rotation=0.5,
velocity=jnp.array([0.1, 0.2]),
angular_velocity=0.05,
inverse_mass=1.0,
inverse_inertia=0.5,
friction=0.3,
restitution=0.8,
collision_mode=1,
active=True,
n_vertices=4,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]),
radius=0.5
)
rigid_body_b = RigidBody(
position=jnp.array([3.0, 4.0]),
rotation=1.0,
velocity=jnp.array([0.2, 0.3]),
angular_velocity=0.1,
inverse_mass=2.0,
inverse_inertia=1.0,
friction=0.4,
restitution=0.6,
collision_mode=1,
active=True,
n_vertices=3,
vertices=jnp.array([[0.0, 0.0], [1.0, 0.0], [0.5, 1.0]]),
radius=0.7
)
ARGS = {
'a': rigid_body_a,
'b': rigid_body_b
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| sv_cross |
Ran ran, violated the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("46ad6ff4db64620e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
import numpy as np
def sv_cross(x, v):
return jnp.array([-x * v[1], x * v[0]])
# Construct valid arguments
x = 5.0 # scalar value
v = jnp.array([2.0, 3.0]) # 2-element array
ARGS = {
"x": x,
"v": v
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| vs_cross |
Ran ran, violated the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("a24736ffedb47a18") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax.numpy as jnp
import numpy as np
# Analyze the function:
# vs_cross(v, x) takes two parameters:
# - v: used with indexing v[0] and v[1], so needs at least 2 elements
# - x: used in multiplication with v[1] and v[0], so should be a scalar or array
# Create v as a small array with 2 elements
v = jnp.array([2.0, 3.0])
# Create x as a scalar value
x = 5.0
ARGS = {
"v": v,
"x": x
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| zero_to_one |
Ran ran, honoured the contract we drafted |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("3038aa560a19a42a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
# Create a simple JAX array with some zeros and non-zero values
x = jnp.array([[0, 1, 2, 0],
[3, 0, 4, 5]], dtype=jnp.float32)
ARGS = {
"x": x
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| PhysicsEngine |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("97e3860ee069aba1") How it ran |
| SimState |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("2d49e5e9470c5ce8") How it ran |
| clip_state |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("10c35bf536161db1") How it ran |
| generate_manifolds_polygon_polygon |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("57ea80bce05796b0") How it ran |
| make_impulse_resolver_fn |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("dc4cdaab20067ae4") How it ran |
| make_joint_resolver_fn |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("382494b973220020") How it ran |
| make_joint_warm_starting_fn |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("205c6f151e79ea13") How it ran |
| resolve_joint |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("ad789cd91688f897") How it ran |
| select_shape |
Not yet run unverified (harvested, no recorded run) |
michaeltmatthews/jax2d/jax2d/engine.py code served (permissive licence) · get_code("db22eb5a43e3f2d1") How it ran |