Every topology command and set_pinned now end in rederive_topology, which checks pinned_meets_tether on the components it derives
before writing any lane and refuses whole (INVALID_ARGUMENT), the command backing its lanes out. This closes the create_distances join
(lodur:finding:cut-ymir-particle-pinning-dormant.s3.tether-by-distance-join). component_pinned and component_tethered are gone;
set_pinned derives through TOPO_PINNED. Tests: Soul's three doors refused bit-unchanged against a twin world, a pin in a tethered
component, and random command sequences over 8 seeds holding the invariant after every accepted command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The anchor was re-derived as the lowest live non-TETHER lane at every topology command, so an attach into a lower free lane changed which attachment a pinned particle is drawn from. rederive_active now holds a pinned particle's anchor, the view exposes it as particle_anchor, and the lane-order refusal is deleted. A TETHER whose distance component holds a pinned particle is refused, the mirror of set_pinned's component_tethered.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every step walk visits a command-time list instead of scanning every lane for live; the step reads w (inverse mass, 0 for a pinned lane) and never inv_mass. Nothing can pin yet, so each list is every live lane in lane order and w is inv_mass bit for bit: the determinism hashes are unedited.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ymir_particles_attach takes n descs: validate all, FULL when fewer than n lanes are free, lowest lanes by cursor into lane_list, one TOPO_FULL, every lane backed out on a refusal. ymir_box3d_soa_attach checks each desc's removed body. YMIR_ATTACH_FLAG_ONE_WAY (4): end_w is 0 and end_push books nothing, refused on STATIC (the known-bit mask extended, no bump for the bit). C#: Box3DSoaAttachmentDesc public with a constructor, Attach(span, handles), ExpectedAbi 17.
Follow-up ymir-flesh-contact-s1-lows: the walk_half source-text pin becomes a behavioural scene (0.400 shipped, 24.4 with the skip removed); the retired-shape table write asserts its room in Debug; the full Debug Soa suite ran to completion (220/220).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
held_by's scan of every attachment is replaced by held_start/held_count/held_body, derived in rederive_topology; limb_body names the body of a particle's lowest LIMB attachment and body_contacts skips every body sharing that body's limb-tree root (the proxy root is the parent lane followed to its end). No ABI change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A current-generation handle to a tombstone is refused by destroy_joint
and remove_body (the kind gates), and a tombstone's stable id 0 does not
block an add; live particles run the substeps past a removed lane and
its write lanes are cleared, not checked; 200 single-removal steps in a
two-lane world each name the removed toucher, so the retired table is
cleared every step (Soul mutants M01, M29, M20, M17, M14, M25).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each refusal stands alone: a box named only by an attachment, an anchor
named only by an attachment, an anchor named only by a sensor. Pins the
attachment loop in ymir_particles_release_body and that remove_body
runs the reference check for anchors (Soul mutants M10, M11).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RemoveBody runs between steps, so Ymir's call order was not at fault: a
body destroyed after its last step enlarged its proxy, while it was the
only buffered move, left its tree ancestors flagged enlarged and
b3UpdateBroadPhasePairs returned before the rebuild that clears them, so
the next solve aborted in Debug validation (dynamic_tree.c:1081). The
fork now rebuilds on that path (DestroyEnlargedProxyTest).
Add_and_remove_churn_keeps_the_world_valid: 12 seeds of add/remove churn
on a floor; aborts the Debug test host at ebe346a, passes at c790839.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BodyRemoved and JointRemoved facts are written by remove_body and destroy_joint into pending arrays and published by the next step in removal order. A removed body's shape goes into a retired table so the End touch facts it caused name its old lane and stable id; the c3 skip of invalid shapes is gone. C# spans Facts.BodiesRemoved and JointsRemoved.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Body kind REMOVED, body_generation/body_removed_at, body slot reuse (twin of the joint slot), free_body_slots, remove_body(lane, generation): refused whole while a live attachment or sensor names the body; else wet patches go (ymir_particles_release_body, no Box3D call), joints naming it retire, Box3D destroys it, the lane tombstones. Every per-body loop skips REMOVED; attach, sensors, add_joint and parent refuse a removed lane. Box3DSoaBodyHandle returned by every Add* body helper. A removed body's shape ends a touch only by skipping it here; the next commit names it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Joint desc force_threshold/torque_threshold (+inf = never, NaN or negative refused, +inf handed to Box3D as FLT_MAX), set_joint_thresholds, joint lanes constraint_force/torque xyz (JOINT_FLOAT_LANES 15 -> 21), joint user data lane + 1, and overload facts drained from b3World_GetJointEvents after each step. A threshold is a sensor: nothing is removed on it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ymir_soa_retire_joint is the only b3DestroyJoint; destroy_joint takes any live joint kind with the slot's generation. The motor-only gate is gone. Lane state is the tombstone rule: kind REMOVED, bodies -1, every lane 0, generation + 1.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bodies and fluid still meet such a particle. The new bit extends YMIR_PHASE_VALID and is refused with FLUID; no ABI bump (lodur:ruling:ymir-new-flag-value-no-abi-bump).
grid_sort takes its mask as a parameter; build_grid sizes grid_mask from the member count; the fluid grid keeps the full table.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Skin_on_a_bone_holds_under_pour_and_drop: 30 skin particles on a welded capsule, 7x7x7 fluid or 4x4x4 solid load, 3 s at 4 substeps, 60 and 120 Hz.
Stretch bound 0.0346 (shipped 0.0214, Ma and Mc 0.0559), place bound 1.29e-3 (shipped zero reading, Ma and Mc 0.331), nothing inside the bone.
The corner-pinned sheet stays the documented loose-cloth limit (ruling ymir-sheet-sieve-at-budget-substeps). No native change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
create_sensors, remove(SENSOR), free_slots(SENSOR) and sensor lanes; ymir_particles_end writes sensor_liquid_volume before its no-live-particle return. A sensor moves nothing; a world with none steps byte for byte as ABI 14.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
wet_mu no longer scans every wet lane: rederive_wet builds the live body patches sorted by body
then centre x with each body's box and largest radius, so a point outside the body's box is a
constant check and a point inside binary-searches the x window; the lowest lane still wins.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Wet world settles liquid under a box at rest; its recycled contact now takes the patch's
friction (lodur:ruling:wet-friction-on-recycled-contacts). Abi8, Pile and Fluid, which settle
nothing, are unmoved. The fork at 2a43fae reproduces the old Wet hashes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Solid particles take the lowest live patch's wet friction under the point (and their own
particle_wet_mu); fluid particles keep their material mu. Body-body contact installs the
fork's per-contact hook, which only lowers the mixed friction. destroy re-derives the wet
lanes when a destroyed solid takes patches, so rederive_wet has three callers.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ABI 13. support_body (the highest body lane touched) and support_particle (the
first listed solid that touches) are cleared to -1 for each live fluid lane
after prediction and written by body_contacts and the fluid-solid contact pass;
create and destroy write -1. Resting on fluid alone reads -1 on both. The step
writes them and no pass reads them: the pins (Abi8, Pile, Fluid) do not move.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fluid_cost_line ran the scene without fluid once and each viscosity once, so its
increment moved 0.3 ms run to run. Each (n, viscosity) now runs nine interleaved
pairs (the order alternating) and prints the median increment and its
interquartile range. Printed, not asserted. No behaviour change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Column mean bound 0.0907 (ruling ymir-column-mean-bound-order-noise): Md claims it; Mk is claimed by KERNEL_REACH (table of 512 buckets so a shared
bucket cannot hide the miss), Mf by floor penetration and through count, Mo by the overflow asserts; Mx and Mu unclaimed. Fluid_cost_line prints
bytes per lane. docs/soa-world.md: two sorts with fluid live, kernel cell, CSR lists under the fluid capacity, fluid-solid contact, cost readings.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ymir_particle_capacities and Box3DSoaParticleCapacities gain fluid (last, 0 default); the lists are CSR rows (nbr_start, nbr_count) in an arena of
fluid * 96 entries, 0 bytes without fluid; a batch of fluid past the capacity returns FULL before a lane is taken. No-fluid worlds carve 28 bytes
a lane instead of 388. Hashes unmoved.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
build_grid sorts the non-fluid lanes at 2 rmax; fluid_density rebuilds the tables over every live lane at 4 rfmax, copies position, inverse mass and
phase in sorted order, and walks each fluid row's deduplicated buckets with a branchless distance filter into a row buffer (128). Fluid-solid contact
is a count-and-move pass over the lists after pass B. FluidHashes re-pinned once here: sorted rows and kernel-cell bucket order and the moved contact
change every pair sum. ColumnMean re-derived over twelve bucket orders by lodur:ruling:ymir-column-mean-bound-order-noise (worst 0.0178, Md 0.4625, bound 0.0907).
Abi8Hashes and PileHashes unmoved.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
512 fluid still +3.0 to +3.4 ms against the 1.0 target; per-phase readings in the docs; per-tick lists and cell-sorted copies stay parked.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Mr (rings forced 1) claims KERNEL_REACH (0 vs 2.53e-3) and the floor (0.258); Md (fluid pairs from both rows) claims column mean (0.467 vs 0.0133), floor and the column max; Mo (capacity 8) overflows 597364 / 25823 / 28049 against 0. Existing bounds keep their values (midpoints would rise).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The flat offset loop paid three integer divisions per cell (125 cells at equal radii): pass A read 4.9 ms a tick at 512, 2.9 with the loops. Order and hashes unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
build_grid's cell is 2 rmax always; fluid_rings = ceil(2 (rfmax + rmax) / 2 rmax) derives the kernel reach over it. Pass A walks
(2R+1)^3 cells and writes each fluid row's list (96 slots, overflow counted in fluid_overflow); pass B and XSPH read only the lists;
walk_half serves contacts only. Spec order (1) rings, (2) lists is one commit: rings without lists leave pass B blind to 4 r pairs.
FluidHashes re-pinned (pair order and accumulation change); Abi8Hashes and PileHashes unmoved.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Particle_source_rules: create_particles names TOPO_ISOLATED and not TOPO_FULL, destroy_particles names both (M6a, create
runs FULL, now fails without timing); the substep gate regex follows the viscous-material gate. A lone solid particle with
a tether attachment makes no tether lane (0 before, 0 attached, 0 after destroy): destroy_particles' attachment term in
`held` is dead and goes, with 'or attachment' in its comment; the test pins the absence. Column max keeps 1.5 and is
recorded as claiming no mutant (Mc1 lambda halved 1.2116, Mc2 no self term 1.3340 against shipped 1.3440). docs/soa-world.md
Fluid bullet: inverse-mass lambda, XSPH skip, the held-floor claim; Not done: the sheet sieve at 4 substeps.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>