js-sequential-impulse-rigidbody-stack
The solution is complete and verified. Here's what I did:
A complete 2D sequential-impulse rigid-body physics engine in ~/sim.js (broadphase via a uniform spatial grid, SAT + reference/incident-edge manifold generation, warm-started iterative solver with restitution + Coulomb friction cone, island-based sleeping via union-find), plus a verification harness in ~/run.js, and a self-contained writeup in ~/solution.md.
topY + hy. A dropped body otherwise falls through it forever.process.argv argument is at index 2, not 1.node run.js both)# Evidence - Problem class: js-sequential-impulse-rigidbody-stack - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-09-04T16:49:22.095Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Implement a 2D rigid-body physics core using sequential-impulse contact resolution: broadphase via a uniform spatial grid, manifold generation for convex polygons (SAT plus reference-edge clipping), a warm-started iterative solver with restitution and a Coulomb friction cone, and island-based sleeping. Build a 40x20 wall of boxes resting on a static ground plane under gravity and hold it stable for 20 simulated seconds at a fixed 60 Hz timestep: the wall must not collapse (no box may lose contact with the layer beneath it by more than one row) and total kinetic energy must decay monotonically after the initial settle. Additionally, a pyramid of 15 dynamic boxes dropped from height must come to rest with zero jitter (per-body position drift under 0.01 px over 5 seconds of settled simulation).", "environment": "node20", "language": "js", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "js-sequential-impulse-rigidbody-stack", "provider": "openrouter", "solved_at": "2026-09-04T16:49:22.095Z", "version": "20"}The solution is complete and verified. Here's what I did:
A complete 2D sequential-impulse rigid-body physics engine in ~/sim.js (broadphase via a uniform spatial grid, SAT + reference/incident-edge manifold generation, warm-started iterative solver with restitution + Coulomb friction cone, island-based sleeping via union-find), plus a verification harness in ~/run.js, and a self-contained writeup in ~/solution.md.
topY + hy. A dropped body otherwise falls through it forever.process.argv argument is at index 2, not 1.node run.js both)# Evidence - Problem class: js-sequential-impulse-rigidbody-stack - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-09-04T16:49:22.095Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Implement a 2D rigid-body physics core using sequential-impulse contact resolution: broadphase via a uniform spatial grid, manifold generation for convex polygons (SAT plus reference-edge clipping), a warm-started iterative solver with restitution and a Coulomb friction cone, and island-based sleeping. Build a 40x20 wall of boxes resting on a static ground plane under gravity and hold it stable for 20 simulated seconds at a fixed 60 Hz timestep: the wall must not collapse (no box may lose contact with the layer beneath it by more than one row) and total kinetic energy must decay monotonically after the initial settle. Additionally, a pyramid of 15 dynamic boxes dropped from height must come to rest with zero jitter (per-body position drift under 0.01 px over 5 seconds of settled simulation).", "environment": "node20", "language": "js", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "js-sequential-impulse-rigidbody-stack", "provider": "openrouter", "solved_at": "2026-09-04T16:49:22.095Z", "version": "20"}