Skip to content

Kinematic speculation (#167) and Aether 0.798.0 - #168

Merged
nicolas-maman merged 3 commits into
mainfrom
aether-0.798
Oct 9, 2026
Merged

nicolas-maman merged 3 commits into
mainfrom
aether-0.798

Conversation

@nicolas-maman

Copy link
Copy Markdown
Collaborator

Closes #167. Also moves the pin to Aether 0.798.0, the latest release. aeb stays at v0.325, its latest.

#167: a fast kinematic body's first frame

A kinematic body travelling past the 2 cm speculative distance in a step finds slow bodies already inside it on the next step. At 7 m/s that's 8.3 cm. Box3D e77352c does the same.

WorldDef.enable_kinematic_speculation and physics_world.enable_kinematic_speculation / is_kinematic_speculation_enabled fix this as an extension. The setting is off by default, so the reference's results and the golden trace are unchanged.

With it on:

  • Reach. A contact with a kinematic body keeps speculative points out to the pair's travel over the coming step: the speculative distance, plus the relative speed and each body's angular speed times its extent, times dt. The speculative constraint then brings the slow body up to speed in the step where the gap closes.
  • How the reach gets there. The manifold, triangle and mesh contact functions read a per-worker speculative distance, which the collide pass sets per contact. It defaults to the constant, so every other path computes the same bits.
  • Bounds. A kinematic body's fat bounds cover its next step's sweep, so the pair exists in time past the bounds' margin. Its shapes' own bounds stay where they are.
  • Events. Begin-touch events with a kinematic body come as early as its speculative points do.
  • Recording and snapshots. The setter is recorded (recording minor version 2) and the snapshot carries the setting (snapshot version 4).

Measured (test_edge_cases.ae, the deepest frame of each strike)

strike off (the reference's) on
ball at 7 m/s (kinematic_plow's scene) 8.3 cm (6 cm or more checked) under 1 cm
box at 7 m/s under 1 cm
capsule at 7 m/s under 1 cm
ball at 20 m/s (33 cm a step) over 10 cm under 1 cm
ball swatted by a paddle spinning at 12 rad/s 3 cm or more within 1.5 cm
ball a kinematic mesh rises into at 7 m/s under 1 cm

The spinning case keeps a little depth because a turning face's approach is linearized over each substep. A pile with no kinematic body steps to the same bits with the setting on or off.

Other changes

  • The every-opcode recording test counts the new op.
  • The snapshot test runs its scene with the setting on and loads with a def that has it off, checking the setting comes back.
  • triangle_manifold and mesh_contact lose their restated SPECULATIVE_DISTANCE, which nothing reads any more.

Tested

The latest release (a sandbox fix; nothing aephysics uses changed). The
whole gate passes on it, the golden trace bit for bit.
WorldDef.enable_kinematic_speculation, off by default so the reference's
results and the golden trace stay: a contact with a kinematic body keeps
speculative points out to the pair's travel over the step (the speculative
distance plus the relative speed and each body's angular speed times its
extent, times dt), the manifold functions reading a per-worker
speculative distance the collide pass sets per contact; and a kinematic
body's fat bounds cover its next step's sweep, so the pair exists in time.
A ball, a box and a capsule struck at 7 m/s are under 1 cm deep at the
strike (8.3 cm without), a ball at 20 m/s too; a spinning paddle within
1.5 cm; a kinematic mesh's triangles reach out too. Recorded (minor
version 2) and carried by the snapshot (version 4).
…h blocks

Each worker's speculative distance (#167) is the seventh, made with the
rest on the module's first use and kept for the program.
@nicolas-maman
nicolas-maman merged commit 081f8c4 into main Oct 9, 2026
2 checks passed
@nicolas-maman
nicolas-maman deleted the aether-0.798 branch October 9, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A kinematic body travelling past the speculative distance in a step finds slow dynamic bodies already inside it: a strike's first frame

1 participant