Checks GPU↔CPU parity and a 64-tick round trip. The actual pass or fail appears in the status above.
Mathematical mechanics and invariants
Integer state
Sᵢ = (xᵢ, yᵢ, zᵢ, pᵢₓ, pᵢᵧ, pᵢ𝓏) ∈ ℤ⁶
Each particle occupies eight signed 32-bit words: three position coordinates, three momenta, and padding. Precision is an explicit integer scale.
Reversible kick and drift
Kₙ : p' = p + F(x; coeff[n])
D : x' = x + trunc(p' / 256)
Uₙ = D ∘ Kₙ
Uₙ⁻¹ = Kₙ⁻¹ ∘ D⁻¹
The kick depends only on unchanged integer positions. Reverse drift restores those positions first, then the exact same force is subtracted.
Smooth dynamic-contact force (V2)
The old integer coefficient makes small strengths inactive until rounding reaches one entire unit, followed by a full-displacement impulse. Smooth V2 uses a signed Q14 radial coefficient, finite-range taper, and saturating strength response:
error = clamp(r² - rest², -rest², rest²)
fade = clamp(256(R²-r²)/(R²-rest²), 0, 256)
raw = trunc(error · strength · fade / (4 rest²))
gain = clamp(trunc(raw · 16/(16+strength)), -2048, 2048)
Δpᵢⱼ = trunc(gain · (xⱼ-xᵢ) / 16384)
The fade is 256 within the contact radius if that radius is no greater than the rest length. Integer impulses are equal-and-opposite for each pair; rewind subtracts the same position-derived force. Total linear momentum and exact reverse are preserved, without a claim of exact energy conservation.
Smooth central bonds (V2)
Permanent bonded edges have their own Q14 response. The signed radial error is quantized at 1/256, then converted into fractional central momentum impulses using a strength-compressed coefficient. Each directed bond has its equal-and-opposite counterpart. Strength 1 produces a small response instead of no force, while higher values are less abrupt. The legacy integer-coefficient law remains available for comparison.
1/96 coordinate precision increases the position and momentum resolution. It does not by itself fix the force law's low-strength dead zone; both improvements can be used independently.
Coefficient history
Live coefficients are recorded by tick. Rewind uses the historical settings that produced each state rather than the most recent slider values.
Flocking with hidden state
Antisymmetric integer shears exchange visible and auxiliary momenta. Cohesion and separation are position-dependent kicks. Flocking uses only mutual interactions.
Linear particles can instead receive an optional uniform negative-Y gravity kick, reversed exactly after inverse drift.
Reversible collisions
For each particle, identify the nearest particle within the collision radius using the integer coordinates. Two particles interact only when they select one another; stable particle IDs resolve ties. Each disjoint pair exchanges its complete integer momentum vector. The pairing is determined by positions alone, so exchanging the momenta a second time at the same positions restores the original state exactly. Rewind applies this exchange first, before reversing drift and forces. This is a reversible equal-mass momentum-exchange demonstration, not a normal-only hard-sphere collision response.
Collision highlighting
A separate GPU pass marks current mutual contacts and reflective-wall impacts. The renderer briefly enlarges marked particles and returns them to their original size. Highlighting changes no physics state, collision radius, or momentum.
These springs are not the E8 scheduled lattice transport system, which has its own separate demonstration. Exact rewind is not by itself a claim of physical energy conservation.