Skip to content

Commit 33096f3

Browse files
larsgebclaude
andcommitted
Fix nbody_step() call in CI smoke test
pos_mass is (N,4) [x,y,z,mass] and velocities is (N,4); there is no separate mass array or G argument. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e404b8b commit 33096f3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ jobs:
9797
img = metal.mandelbrot(ctx, 128, 128, -2.0, 1.0, -1.5, 1.5, 256)
9898
assert img.shape == (128, 128), "mandelbrot shape wrong"
9999
100-
# N-body (one step)
101-
pos = np.random.rand(64, 2).astype(np.float32)
102-
vel = np.zeros((64, 2), dtype=np.float32)
103-
mass = np.ones(64, dtype=np.float32)
104-
pos2, vel2 = metal.nbody_step(ctx, pos, vel, mass, dt=0.01, G=1.0, softening=0.1)
105-
assert pos2.shape == pos.shape, "nbody_step shape wrong"
100+
# N-body (one step) — pos_mass: (N,4) [x,y,z,mass], velocities: (N,4)
101+
pos_mass = np.random.rand(64, 4).astype(np.float32)
102+
pos_mass[:, 3] = 1.0 # mass column
103+
vel = np.zeros((64, 4), dtype=np.float32)
104+
pos2, vel2 = metal.nbody_step(ctx, pos_mass, vel, dt=0.01, softening=0.1)
105+
assert pos2.shape == (64, 4), f"nbody_step shape wrong: {pos2.shape}"
106106
107107
# Elastic wave (small grid, few steps)
108108
nx, nz = 50, 50

0 commit comments

Comments
 (0)