Repository navigation
Toward Box3D in every category: float plain ball joints, profiling and bench fixes - #234
Merged
Merged
Conversation
…l names none Since Aether 0.937.0 (aether#3779) ae build adds --param inline-unit-growth=100 to an optimising build whose project names no budget, and aether.toml names none. profile.sh compiled the generated C with aether.toml's flags alone, so its program kept mul_quat and make_matrix_from_quat out of line where the shipped one inlines them, and its profiles showed calls the real program never makes.
…ence does The user's call (2026-11-23): joint maths in float like Box3D, the spherical joint first, kept only if it wins. A ball joint with no spring, motor, limits or lock (a chain's, the joint grid's) now warm starts and solves its point in single precision, as b3WarmStartSphericalJoint and b3SolveSphericalJoint do: the anchors and the centres' offset narrowed in the prepare (anchor_a, anchor_b, delta_center_f), the body states and inertias as they are kept (single precision already, so no widening), the 3x3 point mass and its solve in floats (point_mass_matrix_f, solve3_f). The impulse is kept in double but always holds a single's value. A joint with any angular row keeps the double solve for now. Joint grid, pinned, best and median of 5 against main: 10.52 / 10.77 to 10.20 / 10.35 ms a step, Box3D 10.15 / 10.36: level with the reference where it was 1.05x behind. The golden trace and the human figure (whose joints all have limits) are unchanged. test_joint_solver's plain-point check asserted an impulse greater than zero on a point already satisfied: it passed on rounding's 1e-46 in double and is exactly zero in single precision. The cube now slides as well as turns before the solve, so the point carries a real impulse, and the warm start's expected velocity is the single-precision product. JOINT_DATA_BYTES 744; SNAPSHOT_VERSION 12.
…s ours do suite_box3d and physics_world_box3d printed a step's milliseconds to three decimals: large world's 0.0094 ms read as 0.009 and 0.0096 as 0.010, coarser than the difference being measured against aephysics' step (printed in full). Six decimals now, and the total to three.
…nd both print the solver stages per step A scene whose setup outweighs its steps (large world's million static bodies) can now be profiled over its steps: AEPHYSICS_BENCH_STEPS=n runs every scene n steps in suite.ae and suite_box3d.c alike. Both print a stages line (solve, transforms, refit, sleep islands, sensors) beside the pairs and collide phases, so a gap can be placed by stage: large world's 6% is the solve (6.5 to 7.5 us a step against Box3D's 5.8 to 6.3), its spheres landing on several floor boxes each.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress from the loop to beat Box3D in every benchmark category.
ae build's inlining budget. Without it, profiles showed out-of-line maths calls the shipped program never makes.Tried and reverted, no measurable gain: Box3D's body-frame normals in the wide contact solve; a float mesh query.
Waiting on Aether: #3815 (lane min/max as minps, convex pile); #3849 (
@inline, for the contact solver's gather_bodies, about 5% of sleep and the pyramids); #3852 (std.math sqrt inlined, about 3% of trees25).SNAPSHOT_VERSION 12 (JointSim's spherical data grew).