Commit graph

79 commits

Author SHA1 Message Date
Meta Vens
a28318ccbb tests, docs: restore the sheet (5 s, 5%) and attached-end (1e-4 m) bounds, momentum floor comment, islands in soa-world.md
h2's loosened bounds are reverted. Momentum stays at 5e-4 with the measured float32 reason. The corner-group sheet is read at 8 s
(it still rings at 5 s: 1.10% under at 5 s, within 0.2% from 6 s). Docs describe islands, the parent gate, geodesic bounds, the
pair rule and counts, and drop the nearest-only text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:43:20 +01:00
Meta Vens
ca237bb0af particles: tether to the nearest point of each particle's two nearest islands (Kim 2012), no static-static pair tethers
Replaces the multi-source one-tether-per-particle derivation. A tether island is a maximal set of tether particles joined by
live distances; each non-tether particle is held to the nearest point of its two nearest islands by rest path, written per
island in lane order behind a parent gate (float ties at rank 2). A pair tether is derived only when a body is among its two
attachments (end_w is 0 at a static end). Tests: two-island derivation (rope, star, 9-rope) and the two-corner-group sheet
(read at 8 s: the sheet rings at 5 s). Pile hashes re-pinned: the pile's tether set changes with the rule; two runs agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:42:47 +01:00
Meta Vens
d95cde3047 docs: nearest-tether derivation, contact walk, bend limit readings at 4/8/32 substeps, TETHER at both ends for heavy holds, mass-ratio drift, test list
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 21:08:45 +01:00
Meta Vens
c2f905452c Particles: contact walks half the neighbourhood, one tether per particle to its nearest tether point, contact skips every attached body, large batches do not allocate; behaviour tests for gravity z, proxy rotation, flags, pair tether, refused attach, tie-break
Pair contact finds each pair once (own cell plus 13 forward cells) instead of from both ends: 1.91 -> 1.46 ms on 16 ropes x 48 (native, 4 substeps). Tethers: a multi-source Dijkstra gives each particle one tether to its nearest TETHER attachment (Kim 2012); a pair of tether points keeps its pair tether behind a route of booking lanes. The skip_body lane is gone: held_by scans the attachments on contact. Pile hashes re-pinned (tether lanes and contact sum order changed).
2026-11-24 21:05:56 +01:00
Meta Vens
d9a60f52c1 tests: readings, a filter test that fails without the filter, cost line with and without the sheet, a warmed allocation probe
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:26:04 +01:00
Meta Vens
f62dea38af docs: the particle graph contract, tests and not-done; name gamecult/step-normal-impulse for fb719c4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:21:24 +01:00
Meta Vens
5de7e05814 Particles become a constraint graph: chain surface deleted, phased particle lanes and typed constraint lanes with derived tethers and hard-limit bends (ABI 10)
The chain lanes, chain commands and exports, PARTICLE_PARTICLE attachments, chain-order implicit constraints,
the per-particle contact average and the chain-order tension sweep are gone in the same commit as the graph
that replaces them: the module, its exports, its binding and its tests do not build apart.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 20:21:24 +01:00
Meta Vens
9ffc3cc21b docs: the in-substep coupling, the sensors and the fork's callback
Rewrite the particle section for r2: why a post-step correction fails, the substep order, the
sensor definitions, the new tests; drop the split-impulse paragraph and the Not-done lines on
tension, cancel/restore and two-attachment direction; the box3d pin is the substep-callback
commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:27:02 +01:00
Meta Vens
761e4c1568 SoA particle tests: the coupling's behaviour, sensors and release
Chain_holds_a_70kg_body is tightened (speed, stretch and impulse per tick over 1 s to 5 s);
Top_link_tension_reads_the_load runs at 1, 5, 20 and 70 kg; new tests pin momentum and apex
of a throw, the snap, the pendulum and spin, release in the step, the impulse lane equal to
what Box3D applied, friction on a slope, the tethers, the attached end and a world with no
awake body; the cost line prints a 1-body and a 40-body scene.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:22:17 +01:00
Meta Vens
66179d68b4 SoA particles r2: chains couple to bodies inside Box3D's substep
Delete the post-step coupling (carry, cancel/restore, hard_impulse, k_body and
end_force_scale, add_link_load and tension_diff, ymir_soa_apply_particle_impulses,
ymir_particles_step) and replace it with begin, substep and end. The substep runs in
Box3D's new substep callback (extern/box3d moves to the fork's substep-callback commit),
after the biased solve and before positions integrate: each proxy takes the body's pose
at the substep's start and its solved velocity, every correction is lambda / h^2 and
returns to the body as a velocity change there, and Box3D integrates the body to where
the constraint put it. Particle-body contacts run last in each substep. Link tension is
read by momentum balance from the structural impulses past each link.

The deletion and its replacement share one commit: the step cannot build without both.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 04:18:58 +01:00
Meta Vens
5a383c4d5e docs: the SoA particle contract, determinism rules, tests and what is not done
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:01:34 +01:00
Meta Vens
73d43637f1 SoA particles: coupling that settles, and the cut's behaviour tests
A body tied to a chain gets its inbound velocity cancelled after the step and the
position error returned as an impulse applied before the next step (a post-step
impulse alone rings at six ticks and cannot read still). Tests: hang, 70 kg hold,
box drag, bodies per kind, overload, split, lane reuse, byte determinism (serial and
eight concurrent worlds), no allocation, cost line, refusals, source negatives.
Top-link tension test is skipped: the sensor misreads heavy loads (see report).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 02:00:12 +01:00
Meta Vens
a4e7139188 SoA particles: chains, attachments and the particle phase in the world step, ABI 9
ymir_particles.c (no Box3D) solves XPBD chains with long-range tethers and two-way
coupling to body proxies; soa.c gathers the proxies after Box3D's step, runs the phase
and applies the returned impulses. A world with no particle capacity is byte-identical
to ABI 8 (pinned hashes pass). Managed surface and lanes added; no behaviour tests yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 01:48:20 +01:00
Meta Vens
fb77d15a94 SoA tests: pin the ABI 8 scene's bytes before any particle code
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 01:36:37 +01:00
Meta Vens
5104b176a1 SoA joint origin test: body A translated and rotated, 240 steps, B's anchor restored
The origin-lane test put body A at identity and could not tell the stored local offset
from the world anchor (Soul finding test-blind-local-vs-world). A is now created
translated and rotated; the lane must equal the world anchor at creation and A's current
pose applied to the creation-time local offset after an impulse and 240 steps (1e-4),
and stay within 0.05 m of B's own anchor point. Storing the world anchor in
joint_local_origin_a now fails this test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 04:29:34 +01:00
Meta Vens
037c9da9c2 SoA joint origin lanes: world position of the joint frame origin on body A, ABI 8
The view published each joint's frame orientation but not its origin; a client cannot
infer the anchor from geometry. joint_origin_x/y/z (lanes 12-14, appended) are body A's
transform applied to the frame origin kept at add_joint, refreshed every step. Destroyed
joints read 0 through the existing tombstone clear.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 04:22:36 +01:00
Meta Vens
be21de1959 SoA impulse tests reach the overflow solver and a swung arm; docs: the lane is a sum of magnitudes
A big sphere with 60 small ones converging has more contacts than graph colours, so Box3D's
scalar overflow path runs: the big lane equals the sum of the small lanes, each its own
momentum change, at restitution 0 and 0.5. A swung arm (ApplyImpulse launches) into a
frictionless slab is exact. The docs say the lane sums magnitudes and is the weight at
rest only on average.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 03:22:09 +01:00
Meta Vens
e856403e27 SoA impulse tests: each hit reads its own pair among the slab's contacts; a hit step always checks the hit's value
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:59:32 +01:00
Meta Vens
c5e4e34825 docs: SoA contact impulse, the Box3D fork and how to rebase it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:57:48 +01:00
Meta Vens
99f1d0bfaf SoA world: exact per-step contact impulse per body and per hit; ABI 7
contact_impulse (N s) replaces last_substep_force in the same lane slot: the sum of
Box3D's stepNormalImpulse over the body's touching manifold points, the normal impulse
contacts delivered over the whole step. The hit fact's impulse replaces impulse_estimate in
the same slot: the same sum over the manifold of the hit's shape pair. The approach-speed
formula (ymir_soa_hit_impulse) and the last-sub-step scaling are gone, with the tests that
pinned their estimates; the new tests check the lane and the hit against momentum change
per step on a jointed forearm (5 kg ball, 0.3 g BB, arm onto a slab), drops, rest and two
free bodies. Build id names the fork commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:57:48 +01:00
Meta Vens
72e9d3e71e Box3D submodule moves to the GameCult fork with stepNormalImpulse
extern/box3d now points at https://eureka.gamecult.org/forge/GameCult/box3d, branch
gamecult/step-normal-impulse (upstream 8441b4a plus the step-impulse field and a static
assert that RELAX_ITERATIONS is 1). Nothing reads the new field yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:57:48 +01:00
Meta Vens
6c90bd10f7 docs: SoA world ABI number in the intro
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:41:47 +01:00
Meta Vens
e530b9b97d docs: SoA joint handles and generations, ABI 6, anchor creation followed by a validating joint
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:41:43 +01:00
Meta Vens
55d0e0f0bd SoA world: joint handles carry a slot generation; ABI 6
DestroyJoint takes (lane, generation) and refuses a stale handle, so a repeated
release cannot destroy a later grab in a reused slot. The ABI number moves to 6
so an old and a new native/managed pair fail closed at construction. Fixes Soul
s2 findings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:41:42 +01:00
Meta Vens
2f78cfa8f5 docs: SoA grab release, anchor hold, tombstoned joint lanes, ray starting inside a shape
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:28:48 +01:00
Meta Vens
83ea2b8fa4 SoA world: release a grab (destroy_joint tombstones), anchors hold still after arriving
destroy_joint releases a motor joint only; its lane reads Removed and is reused
after a step has passed. free_joint_slots lets a caller check before adding an
anchor. After every step anchor velocity is zeroed so a skipped frame flings
nothing. Fixes Soul s1 findings (no release, anchor keeps moving).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:28:47 +01:00
Meta Vens
6edf5d671c SoA grab tests: an anchor reaches its target within the very next step
Kills the mutant that stretched the target time step.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:11:46 +01:00
Meta Vens
586361ad67 SoA grab tests: the angular spring follows the anchor's rotation, and off leaves the body free
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:07:15 +01:00
Meta Vens
cec6d0d464 docs: SoA world grab anchors, motor joint, impulses and ray, ABI 5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:02:14 +01:00
Meta Vens
7efcefc8a0 SoA world: kinematic anchors, motor joint spring, point impulses, closest-hit ray (ABI 5)
Anchor body kind (kinematic, no shape) with set_anchor_target; Motor joint kind
with position springs bounded by max force and torque, taking the slot of the
joint desc's reserved float; apply_impulse at a world point; cast_ray_closest.
Ymir executes the commands and decides nothing about grabbing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 02:02:14 +01:00
Meta Vens
e4cf4cd444 SoA hit impulse estimate: honest limits, two-body and threshold tests, fact element-size guard
ImpulseEstimate is documented as exact for a centre-to-centre hit between
free bodies, over-counting when one collision yields several hit facts and
undercounting for jointed bodies; never a bound. Tests: two free spheres at
mass ratios 1:1, 1:10, 10:1 with restitution 0 and 0.5, and a hit below the
restitution threshold that must not bounce. The ABI handshake now checks the
touch and hit fact element sizes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 01:52:47 +01:00
Meta Vens
5c35a40ccf SoA: contact force lane renamed LastSubstepForce; hit facts carry an impulse estimate
Box3D exposes no whole-step normal impulse: normalImpulse is the last
sub-step and totalNormalImpulse is a solve plus relax mixture, so no lane
built from them is true on an impact step. The per-body lane is renamed
LastSubstepForce and documented as a resting load only. Impact severity is
the hit fact's ImpulseEstimate, v (1 + e) / (1/mA + 1/mB), checked against
the ball's momentum change at 60 and 240 Hz, 1 and 4 sub-steps, restitution
0 and 0.5. Also pins that dropped counters reset each step.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 01:37:21 +01:00
Meta Vens
a614477d68 docs: SoA world contact facts, contact lanes and ABI 4
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 01:09:55 +01:00
Meta Vens
5a4cde33ae SoA contact force reads the final sub-step impulse; contact fact tests
totalNormalImpulse accumulates the accumulated impulse once per solve and
once per relax pass, so a resting body read twice its weight. ContactForce
is now normalImpulse * sub_steps / dt, which reads the weight at rest.
Tests cover drop begin/hit, lift end, resting force, materials, one-step
lifetime, overflow counting, per-step determinism and zero allocation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 01:09:44 +01:00
Meta Vens
d54e14cc50 SoA world reports per-step contact facts and per-body contact lanes (ABI 4)
Every shape is created with contact and hit events on; the body's user data
is lane + 1. After each step the world rewrites begin, end and hit fact
buffers (lanes and stable ids resolved, fixed capacity, per-kind dropped
counters) and the ContactForce (totalNormalImpulse / dt), ContactCount and
MaterialId lanes. Body desc gains material_id; create takes fact_capacity
and hit_threshold. No allocation inside the step.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 01:07:20 +01:00
Meta Vens
8be057a4b1 SoA add_body publishes only the size components its kind uses
Soul low finding on cut-ymir-shape-lanes.s1: a direct native caller could
publish nonzero unused components, contradicting the docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 01:03:03 +01:00
Meta Vens
617beec1dc SoA world publishes each body's shape size as read-only lanes (ABI 3)
Size0/1/2 sit beside Kind, written once in add_body, never touched by step,
so a renderer draws every body from one source.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 00:51:05 +01:00
Meta Vens
0b0321aa00 SoA docs: concurrency line matches the lock; concurrent stepping is not known to race, not promised; 128-world limit
Soul low findings on db09805.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:20:07 +01:00
Meta Vens
db09805aba Serialize Box3D world create and destroy behind one process-wide lock
b3CreateWorld/b3DestroyWorld scan and rewrite Box3D's global world pool with
no synchronization; concurrent creation crashed the host (0xC000001D). All
five call sites (SoA world, retained session, pair step, torque lifetime) now
go through one lock owned by ymir_box3d.c (SRWLOCK on Windows, pthread mutex
elsewhere). Adds a multi-thread create/step/dispose test, which aborts the
test host without the lock; drops the serial-test assembly attribute.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 21:11:08 +01:00
Meta Vens
fbc1530fa5 Uniform native output path across generators; default view refuses with a clear error; span-lifetime docs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 20:55:25 +01:00
Meta Vens
e6a1e4ad02 Scope PREFIX to MinGW; views refuse lane access after dispose; document lifetime limits
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 20:51:04 +01:00
Meta Vens
eb30cac65b Box3D SoA world is public; drop Lodur friend grants; MinGW emits ymir_box3d.dll
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-19 20:43:55 +01:00
7ba31c30fc Merge pull request 'SoA world: joints, force/torque lanes, capsules and boxes' (#2) from nibu/soa-joints into main 2026-11-10 17:14:35 +00:00
78786670eb Merge pull request 'Headless 3D SoA world over Box3D, state read in place' (#1) from nibu/soa-world into main 2026-11-10 17:13:58 +00:00
Nibu
ea7b3f3d7f soa-world doc: rolling resistance in the descriptor
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 04:08:18 +00:00
Nibu
b96ad34b0b SoA world: rolling resistance on the body descriptor
A bare sphere or capsule rolls on without it, so a fallen head never settles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 04:07:38 +00:00
Nibu
02276363fc Ymir.Box3D: let Lodur.Body.Ymir see the SoA world until Ymir.Core has a public surface
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 03:56:51 +00:00
Nibu
8bb0d0b1de SoA world: joints, force/torque write lanes, capsules and boxes, parent/limb lanes
ABI 2. One body descriptor replaces add_sphere/add_static_box (kinds: sphere, capsule, box, static box).
Revolute, spherical and weld joints created from a world anchor and axis, with joint state lanes (angle,
frame A orientation, relative rotation, relative angular velocity). Per-body force and torque write lanes,
applied before the step then cleared; non-finite values refuse the step. Parent and limb index lanes.
Tests run serially: concurrent b3CreateWorld aborts the host.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 03:55:49 +00:00
7d9f1b57a1 Headless 3D SoA world over Box3D, read in place
New native object ymir_box3d_soa (ABI 1): gravity, free rotation, spheres and static boxes,
one worker, state copied once per step into contiguous lanes that a caller reads in place.
Managed Box3DSoaWorld/Box3DSoaView expose the lanes as spans. The planar retained session is
unchanged. Tests: fall and rest, in-place reads, bit-for-bit repeat runs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 18:54:20 +00:00
Meta Vens
8d02b1ecbb Merge readme-front-door: README opens with value, problem, entry points, live versus planned 2026-10-22 20:08:33 +02:00