Repository navigation
Upgrade ODE, correct robot contacts and accelerate dense physics - #3
Merged
Merged
Conversation
fred-huang122
marked this pull request as ready for review
November 1, 2026 03:41
Pin double-precision ODE 0.16.6, isolate per-world schedulers, retain opt-in helpers, correct cylinder inertia and ball-ground resistance, and derive conservative collision masks including the chassis hull. Keep automated physics, trajectory, concurrency and chassis regressions plus a reusable benchmark. Retain concise setup/defaults documentation. Keep local research, raw data, plots and one-off analysis tools out of the branch history; their previous state is preserved locally. Runtime, build and retained test inputs are byte-for-byte identical to the validated ODE implementation. Native Apple Silicon packaging and macOS 15/26 download checks remain unchanged.
fred-huang122
force-pushed
the
perf/ode-0.16.6-integration
branch
from
November 1, 2026 04:43
18c76f4 to
95e1270
Compare
Attach the sphere directly to the chassis and preserve the old combined mass and inertia, removing one body and fixed joint per robot. Add dynamic pair and six-a-side penetration checks and reject solver errors. Isolate the kinematic hull fixture from driving/rolling constraints and synchronize window exposure in its rendering check.
Use native double-precision triangular solves and dot products for kernels with at least 64 entries: Accelerate on macOS and optional single-threaded OpenBLAS elsewhere. Keep scalar fallback and direct ODE stepping. Add pinned-kernel, residual, stride, concurrent-call and fallback regressions, and reproducible dependency patching.
Read row-major factors directly in four-row AVX2 solves to avoid BLAS packing and dispatch overhead. Detect CPU support at runtime and retain existing BLAS, Accelerate and scalar fallbacks. Keep contact geometry, materials and physics substeps unchanged; extend residual/reference checks through 1025 rows and report triangular dispatch.
The live pushing case contains three independent contact groups and exceeds the serial frame budget despite faster matrix kernels. Use up to three helpers on large multicore games while retaining serial stepping for small worlds and explicit overrides. Keep collision detection, the direct solver and substeps unchanged. Publish actual worker counts in snapshots and test startup, rebuilds, overrides and shutdown through the real controller.
This was referenced Nov 2, 2026
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.
Upgrade grSim to double-precision ODE 0.16.6, correct robot-shell contacts, and keep the tested 6 v 6 sustained-pushing workload running in real time on the available CPU cores.
The direct solver, five substeps, contact geometry, materials and tolerances are unchanged by the performance work. ODE parallelizes complete independent contact islands; it does not split contacts between interacting robots. Live pushing profiling found three independent 24-body groups. Cold live pushing can exceed the serial budget even when the warmer fixed-step benchmark fits, so the app now selects the already-supported island workers automatically.
The CPU profile originally spent 79.9% of user cycles inside OpenBLAS; the direct vector kernels reduce that share to 11.8%. Five shuffled timing rounds, 300 measured ticks after 60 warmup ticks, twelve Parsian robots on Division B, Ryzen 9 7945HX. Both sides use accurate shell contacts; this table isolates the math change with explicit worker counts. OPENBLAS_NUM_THREADS=1 controls library startup for both processes.
Serial pushing math takes 30% less time; all five trials meet the 16.67 ms tick budget. Forcing serial mode can still lag in the cold live-app workload.
With the same GPU fix on both app builds (#4), three paired default-mode RTX 4060 trials give:
The old serial default accumulated 1.86–5.52 seconds of backlog and suppressed drawing under the existing backlog policy. The new default reports three helpers and finishes pushing trials with 6.54–8.71 ms backlog. The render policy and clock rate are unchanged. Existing workloads were left running; GPU use with grSim closed ranged 14–66%, so small FPS differences are workload-dependent. Crowd ratios above 1 can include backlog recovery.
Validation:
Profiling data, reports, private-access harnesses and rejected prototypes remain outside Git. README/INSTALL contain reusable setup and policy guidance. Helper scheduling may change floating-point trajectories; use the explicit serial override for reproducible comparisons. The Mac package remains ad-hoc signed; hosted graphics checks use Apple Software Renderer and do not measure physical Mac GPU throughput.
Verified Apple Silicon ODE app, macOS 15 or later.