From 3fae64f975d420e8200b8ed7f7c037a6954c3a95 Mon Sep 17 00:00:00 2001 From: Orkuncakilkaya Date: Sun, 27 Sep 2026 02:02:56 +0300 Subject: [PATCH] fix(physics): Jolt's own pair and contact limits (65536 / 20480) rather than the body count's, and a temporary allocator that falls back to the heap - a valley of 60,000 still trunks aborted its first step with a moving body in it Co-Authored-By: Claude Opus 5.5 --- .../ludic.physics/lib/macos-arm64/libludicjolt.dylib | 4 ++-- packages/ludic.physics/native/shim/jph_shim.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/ludic.physics/lib/macos-arm64/libludicjolt.dylib b/packages/ludic.physics/lib/macos-arm64/libludicjolt.dylib index 3dd4778a..6830f514 100755 --- a/packages/ludic.physics/lib/macos-arm64/libludicjolt.dylib +++ b/packages/ludic.physics/lib/macos-arm64/libludicjolt.dylib @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2191f0eb04f4bd5553495ae94f16c668377b98beea1a90bcc1847b43ee1a24bf -size 1160768 +oid sha256:203b9c83905942e8da10d3e0a1dfe82949360dfa134b5b43c90113fc2e9acae7 +size 1161200 diff --git a/packages/ludic.physics/native/shim/jph_shim.cpp b/packages/ludic.physics/native/shim/jph_shim.cpp index f3eba11a..4346538f 100644 --- a/packages/ludic.physics/native/shim/jph_shim.cpp +++ b/packages/ludic.physics/native/shim/jph_shim.cpp @@ -90,12 +90,15 @@ public: }; struct World { + // pairs and contacts are for what MOVES: a valley of sixty thousand still trunks makes none + // between them, so these are Jolt's own sizes, not the body count's; the temporary memory falls + // back to the heap rather than aborting a step World(int max_bodies, int threads) - : temp(16 * 1024 * 1024), jobs(cMaxPhysicsJobs, cMaxPhysicsBarriers, threads) { - sys.Init(max_bodies, 0, max_bodies, max_bodies * 4, bpl, ovb, olp); + : temp(32 * 1024 * 1024), jobs(cMaxPhysicsJobs, cMaxPhysicsBarriers, threads) { + sys.Init(max_bodies, 0, 65536, 20480, bpl, ovb, olp); sys.SetContactListener(&contacts); } - TempAllocatorImpl temp; + TempAllocatorImplWithMallocFallback temp; JobSystemThreadPool jobs; BPLayers bpl; ObjVsBP ovb;