@series-inc/rundot-syncplay 6.0.0-rc.81 → 6.0.0-rc.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +1 -1
  2. package/core/src/physics/physics-profile-wasm-module.generated.mjs +1 -1
  3. package/core/src/physics/physics-wasm-module.generated.mjs +1 -1
  4. package/core/src/physics2d/physics2d-wasm-module.generated.mjs +1 -1
  5. package/package.json +14 -3
  6. package/third_party/box3d/LICENSE +21 -0
  7. package/third_party/box3d/PROVENANCE.md +192 -0
  8. package/third_party/box3d/UPSTREAM.json +20 -0
  9. package/third_party/box3d/port/c-sources.txt +54 -0
  10. package/third_party/box3d/port/syncplay-sources.txt +7 -0
  11. package/third_party/box3d/port/test-sources.txt +36 -0
  12. package/third_party/box3d/scripts/box3d-profile.mjs +185 -0
  13. package/third_party/box3d/tree/include/box3d/base.h +206 -0
  14. package/third_party/box3d/tree/include/box3d/box3d.h +1968 -0
  15. package/third_party/box3d/tree/include/box3d/collision.h +692 -0
  16. package/third_party/box3d/tree/include/box3d/config.h +33 -0
  17. package/third_party/box3d/tree/include/box3d/constants.h +146 -0
  18. package/third_party/box3d/tree/include/box3d/id.h +179 -0
  19. package/third_party/box3d/tree/include/box3d/math_functions.h +1220 -0
  20. package/third_party/box3d/tree/include/box3d/types.h +3251 -0
  21. package/third_party/box3d/tree/src/CMakeLists.txt +324 -0
  22. package/third_party/box3d/tree/src/aabb.c +176 -0
  23. package/third_party/box3d/tree/src/aabb.h +80 -0
  24. package/third_party/box3d/tree/src/algorithm.h +19 -0
  25. package/third_party/box3d/tree/src/arena_allocator.c +178 -0
  26. package/third_party/box3d/tree/src/arena_allocator.h +114 -0
  27. package/third_party/box3d/tree/src/bitset.c +66 -0
  28. package/third_party/box3d/tree/src/bitset.h +67 -0
  29. package/third_party/box3d/tree/src/block_allocator.c +95 -0
  30. package/third_party/box3d/tree/src/block_allocator.h +36 -0
  31. package/third_party/box3d/tree/src/body.c +2729 -0
  32. package/third_party/box3d/tree/src/body.h +303 -0
  33. package/third_party/box3d/tree/src/box3d.natvis +147 -0
  34. package/third_party/box3d/tree/src/box3d.pc.in +11 -0
  35. package/third_party/box3d/tree/src/broad_phase.c +823 -0
  36. package/third_party/box3d/tree/src/broad_phase.h +66 -0
  37. package/third_party/box3d/tree/src/capsule.c +385 -0
  38. package/third_party/box3d/tree/src/compound.c +1208 -0
  39. package/third_party/box3d/tree/src/compound.h +25 -0
  40. package/third_party/box3d/tree/src/constraint_graph.c +328 -0
  41. package/third_party/box3d/tree/src/constraint_graph.h +79 -0
  42. package/third_party/box3d/tree/src/contact.c +912 -0
  43. package/third_party/box3d/tree/src/contact.h +194 -0
  44. package/third_party/box3d/tree/src/contact_solver.c +1237 -0
  45. package/third_party/box3d/tree/src/contact_solver.h +122 -0
  46. package/third_party/box3d/tree/src/contact_solver_wide.inl +1670 -0
  47. package/third_party/box3d/tree/src/container.h +185 -0
  48. package/third_party/box3d/tree/src/convex_manifold.c +1602 -0
  49. package/third_party/box3d/tree/src/convex_manifold_wide.inl +825 -0
  50. package/third_party/box3d/tree/src/core.c +303 -0
  51. package/third_party/box3d/tree/src/core.h +189 -0
  52. package/third_party/box3d/tree/src/ctz.h +134 -0
  53. package/third_party/box3d/tree/src/distance.c +1954 -0
  54. package/third_party/box3d/tree/src/distance_joint.c +585 -0
  55. package/third_party/box3d/tree/src/dynamic_tree.c +2525 -0
  56. package/third_party/box3d/tree/src/dynamic_tree.h +113 -0
  57. package/third_party/box3d/tree/src/height_field.c +1629 -0
  58. package/third_party/box3d/tree/src/hull.c +3226 -0
  59. package/third_party/box3d/tree/src/hull.h +30 -0
  60. package/third_party/box3d/tree/src/id_pool.c +73 -0
  61. package/third_party/box3d/tree/src/id_pool.h +34 -0
  62. package/third_party/box3d/tree/src/island.c +735 -0
  63. package/third_party/box3d/tree/src/island.h +101 -0
  64. package/third_party/box3d/tree/src/joint.c +2324 -0
  65. package/third_party/box3d/tree/src/joint.h +661 -0
  66. package/third_party/box3d/tree/src/manifold.c +196 -0
  67. package/third_party/box3d/tree/src/manifold.h +92 -0
  68. package/third_party/box3d/tree/src/math_functions.c +616 -0
  69. package/third_party/box3d/tree/src/math_internal.h +471 -0
  70. package/third_party/box3d/tree/src/mesh.c +2481 -0
  71. package/third_party/box3d/tree/src/mesh_contact.c +1338 -0
  72. package/third_party/box3d/tree/src/motor_joint.c +420 -0
  73. package/third_party/box3d/tree/src/mover.c +70 -0
  74. package/third_party/box3d/tree/src/mover_joint.c +288 -0
  75. package/third_party/box3d/tree/src/name_cache.c +155 -0
  76. package/third_party/box3d/tree/src/name_cache.h +42 -0
  77. package/third_party/box3d/tree/src/parallel_for.c +138 -0
  78. package/third_party/box3d/tree/src/parallel_for.h +23 -0
  79. package/third_party/box3d/tree/src/parallel_joint.c +254 -0
  80. package/third_party/box3d/tree/src/physics_world.c +4429 -0
  81. package/third_party/box3d/tree/src/physics_world.h +369 -0
  82. package/third_party/box3d/tree/src/platform.h +165 -0
  83. package/third_party/box3d/tree/src/pogo_joint.c +451 -0
  84. package/third_party/box3d/tree/src/prismatic_joint.c +720 -0
  85. package/third_party/box3d/tree/src/qsort.h +186 -0
  86. package/third_party/box3d/tree/src/rapidhash.h +568 -0
  87. package/third_party/box3d/tree/src/recording.c +1250 -0
  88. package/third_party/box3d/tree/src/recording.h +390 -0
  89. package/third_party/box3d/tree/src/recording_ops.inl +254 -0
  90. package/third_party/box3d/tree/src/replay.c +3791 -0
  91. package/third_party/box3d/tree/src/replay.h +286 -0
  92. package/third_party/box3d/tree/src/revolute_joint.c +672 -0
  93. package/third_party/box3d/tree/src/scheduler.c +198 -0
  94. package/third_party/box3d/tree/src/scheduler.h +15 -0
  95. package/third_party/box3d/tree/src/sensor.c +451 -0
  96. package/third_party/box3d/tree/src/sensor.h +41 -0
  97. package/third_party/box3d/tree/src/shape.c +2448 -0
  98. package/third_party/box3d/tree/src/shape.h +206 -0
  99. package/third_party/box3d/tree/src/simd.c +310 -0
  100. package/third_party/box3d/tree/src/simd.h +401 -0
  101. package/third_party/box3d/tree/src/simd_avx2.h +208 -0
  102. package/third_party/box3d/tree/src/simd_neon.h +265 -0
  103. package/third_party/box3d/tree/src/simd_scalar.h +286 -0
  104. package/third_party/box3d/tree/src/simd_sse2.h +411 -0
  105. package/third_party/box3d/tree/src/simd_wide.h +67 -0
  106. package/third_party/box3d/tree/src/six_dof_joint.c +1257 -0
  107. package/third_party/box3d/tree/src/solver.c +2380 -0
  108. package/third_party/box3d/tree/src/solver.h +314 -0
  109. package/third_party/box3d/tree/src/solver_set.c +682 -0
  110. package/third_party/box3d/tree/src/solver_set.h +67 -0
  111. package/third_party/box3d/tree/src/sphere.c +247 -0
  112. package/third_party/box3d/tree/src/spherical_joint.c +738 -0
  113. package/third_party/box3d/tree/src/syncplay_contact.c +186 -0
  114. package/third_party/box3d/tree/src/syncplay_contact.h +97 -0
  115. package/third_party/box3d/tree/src/syncplay_digest.c +24 -0
  116. package/third_party/box3d/tree/src/syncplay_digest.h +31 -0
  117. package/third_party/box3d/tree/src/syncplay_impact.c +67 -0
  118. package/third_party/box3d/tree/src/syncplay_impact.h +71 -0
  119. package/third_party/box3d/tree/src/syncplay_six_dof.h +103 -0
  120. package/third_party/box3d/tree/src/syncplay_snapshot.c +937 -0
  121. package/third_party/box3d/tree/src/syncplay_snapshot.h +266 -0
  122. package/third_party/box3d/tree/src/table.c +238 -0
  123. package/third_party/box3d/tree/src/table.h +74 -0
  124. package/third_party/box3d/tree/src/timer.c +834 -0
  125. package/third_party/box3d/tree/src/triangle_manifold.c +1334 -0
  126. package/third_party/box3d/tree/src/types.c +159 -0
  127. package/third_party/box3d/tree/src/verstable.h +2069 -0
  128. package/third_party/box3d/tree/src/weld_joint.c +304 -0
  129. package/third_party/box3d/tree/src/wheel_joint.c +1124 -0
  130. package/third_party/box3d/tree/src/wide4.c +6 -0
  131. package/third_party/box3d/tree/src/wide8.c +23 -0
  132. package/third_party/box3d/tree/src/world_snapshot.c +1739 -0
  133. package/third_party/box3d/tree/src/world_snapshot.h +21 -0
  134. package/third_party/lzma/README.md +29 -0
  135. package/third_party/lzma/src/7zTypes.h +600 -0
  136. package/third_party/lzma/src/Alloc.c +774 -0
  137. package/third_party/lzma/src/Alloc.h +76 -0
  138. package/third_party/lzma/src/Compiler.h +287 -0
  139. package/third_party/lzma/src/CpuArch.c +970 -0
  140. package/third_party/lzma/src/CpuArch.h +719 -0
  141. package/third_party/lzma/src/LzFind.c +1746 -0
  142. package/third_party/lzma/src/LzFind.h +160 -0
  143. package/third_party/lzma/src/LzHash.h +34 -0
  144. package/third_party/lzma/src/LzmaDec.c +1367 -0
  145. package/third_party/lzma/src/LzmaDec.h +237 -0
  146. package/third_party/lzma/src/LzmaEnc.c +3154 -0
  147. package/third_party/lzma/src/LzmaEnc.h +85 -0
  148. package/third_party/lzma/src/LzmaLib.c +42 -0
  149. package/third_party/lzma/src/LzmaLib.h +138 -0
  150. package/third_party/lzma/src/Precomp.h +127 -0
package/README.md CHANGED
@@ -566,7 +566,7 @@ layout, WASM boundary, schedule, and checkpoint representation can change when
566
566
  a complete benchmark proves a faster design. Each replacement must keep the
567
567
  public contract, deterministic results, rollback controls, and bounded memory.
568
568
 
569
- Version 6.0.0-rc.81 runs 3D physics on the soft-step engine, with physics ABI 26
569
+ Version 6.0.0-rc.82 (the same physics as 6.0.0-rc.81) runs 3D physics on the soft-step engine, with physics ABI 26
570
570
  and digest algorithm revision 4. A world with a mesh above 512 triangles or a
571
571
  heightfield above 2,048 triangles still runs on the public solver.
572
572
  `world.rigidRouteState?.()` tells which route the next step uses.
@@ -36,7 +36,7 @@ export const physicsProfileWasmMetadata = Object.freeze({
36
36
  "sourceHash": "c8092674594a3c00b3a1048b02908cb336058534205f1b1d921dfda41b281ca5",
37
37
  "wasmSha256": "f08bddbc71c520ba0d7394b0fc33a38673cbeaffa00a079fe8d960941cd46105",
38
38
  "artifact": "profile",
39
- "packageVersion": "6.0.0-rc.81",
39
+ "packageVersion": "6.0.0-rc.82",
40
40
  "compilerFlags": [
41
41
  "-std=c++20",
42
42
  "-O3",
@@ -36,7 +36,7 @@ export const physicsWasmMetadata = Object.freeze({
36
36
  "sourceHash": "0474ca45874e19504dbfbcc660d1ceb0c4de98581f5d9db3de7ec52336a65c7e",
37
37
  "wasmSha256": "29f5ee181a1b958577a76211015bd08dbbdfed9c074c15a40cf725430895baae",
38
38
  "artifact": "production",
39
- "packageVersion": "6.0.0-rc.81",
39
+ "packageVersion": "6.0.0-rc.82",
40
40
  "compilerFlags": [
41
41
  "-std=c++20",
42
42
  "-O3",
@@ -50,7 +50,7 @@ export const physics2dWasmMetadata = Object.freeze({
50
50
  "sourceHash": "c982f7b72b0494c8892d40b5fbf1a67ac94a7f20dea1f160abb888f4ccb313c0",
51
51
  "wasmSha256": "49cb90541deed40f5fff1015bb578e13ec9a793d51931c1227e3e5a11bbfa3f7",
52
52
  "artifact": "production",
53
- "packageVersion": "6.0.0-rc.81",
53
+ "packageVersion": "6.0.0-rc.82",
54
54
  "compilerFlags": [
55
55
  "-std=c++20",
56
56
  "-O3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@series-inc/rundot-syncplay",
3
- "version": "6.0.0-rc.81",
3
+ "version": "6.0.0-rc.82",
4
4
  "description": "Kinetix orchestration, rollback, replay, late-join, and deterministic networking for RUN.game",
5
5
  "repository": {
6
6
  "type": "git",
@@ -240,7 +240,18 @@
240
240
  "extensions",
241
241
  "hub",
242
242
  "plugins",
243
- "bench/wreck-yard-sleeping-contacts.json"
243
+ "bench/wreck-yard-sleeping-contacts.json",
244
+ "third_party/box3d/LICENSE",
245
+ "third_party/box3d/PROVENANCE.md",
246
+ "third_party/box3d/UPSTREAM.json",
247
+ "third_party/box3d/port/c-sources.txt",
248
+ "third_party/box3d/port/syncplay-sources.txt",
249
+ "third_party/box3d/port/test-sources.txt",
250
+ "third_party/box3d/scripts/box3d-profile.mjs",
251
+ "third_party/box3d/tree/include",
252
+ "third_party/box3d/tree/src",
253
+ "third_party/lzma/README.md",
254
+ "third_party/lzma/src"
244
255
  ],
245
256
  "sideEffects": [
246
257
  "./core/scripts/emit-product-digests.mjs",
@@ -250,7 +261,7 @@
250
261
  "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
251
262
  "test": "npm run test:core && npm run test:capability-restoration && npm run test:unit-control && npm run test:entity-registry",
252
263
  "test:module-promotion": "node --expose-gc --import tsx --test tests/module-promotion.test.ts tests/module-docs.test.ts tests/module-bundle-budget.test.ts scripts/prove-module-promotion.test.mjs scripts/lib/proof-source-closure.test.mjs",
253
- "test:core": "node --expose-gc --experimental-test-module-mocks --import tsx --test --test-concurrency=1 tests/canonical.test.ts tests/canonical-portability.test.ts tests/runtime-session.test.ts tests/kinetix-runtime-session.test.ts tests/runtime-support.test.ts tests/runtime-guards.test.ts tests/r3f-render-adapter.test.ts tests/snapshot-cost.test.ts tests/sdkSession.test.ts tests/input-authority.test.ts tests/session-wire.test.ts tests/runtime-room-metadata.test.ts tests/session-snapshot.test.ts tests/authority-room.test.ts tests/networked-client-snapshot.test.ts tests/runner.test.ts tests/testing.test.ts tests/browser-session.test.ts tests/secret-config.test.ts tests/secret-protocol.test.ts tests/secret-authority.test.ts tests/secret-client.test.ts tests/secret-holder-release.test.ts tests/seat-control-parity.test.ts tests/seat-control.test.ts tests/seat-control-runtime.test.ts tests/late-join-checksum.test.ts tests/late-join-input-backfill.test.ts tests/replay-scoring.test.ts tests/bot-backfill.test.ts tests/latency-simulation.test.ts tests/production-input-budget.test.ts tests/time-sync.test.ts tests/match-log.test.ts tests/spectator.test.ts tests/synctest.test.ts tests/instant-replay.test.ts tests/session-promotion.test.ts tests/entrypoints.test.ts tests/physics-profile-bundle.test.ts tests/physics-profile-init.test.ts tests/export-surface.test.ts tests/creator-facing-names.test.ts tests/module-seam.test.ts tests/module-contract-portability.test.ts tests/module-identity.test.ts tests/module-corpus.test.ts tests/component-model.test.ts tests/component-model-rollback.test.ts tests/component-model-integration.test.ts tests/actors-ai.test.ts tests/character-3d.test.ts tests/character-3d-certification.test.ts tests/combat-modules.test.ts tests/combat-modules-integration.test.ts tests/firearm.test.ts tests/gameplay-effects.test.ts tests/spatial-interaction.test.ts tests/stats-abilities.test.ts tests/inventory-equipment.test.ts tests/inventory-equipment-certification.test.ts tests/platformer-2d.test.ts tests/platformer-2d-certification.test.ts tests/module-promotion.test.ts tests/module-docs.test.ts tests/module-bundle-budget.test.ts tests/published-side-effects.test.ts tests/host-timing.test.ts tests/test-manifest.test.ts tests/coarse-region.test.ts tests/input-codec.test.ts tests/command-ingress.test.ts tests/session-reconfigure.test.ts tests/prediction-mode.test.ts tests/ephemeral-channel.test.ts tests/runner-surface.test.ts tests/runner-harness.test.ts tests/effects-adapter-bounds.test.ts tests/simulated-match-secrets.test.ts tests/run-glue-surface.test.mjs core/tests/core-boundary.test.mjs tests/math-core-parity.test.ts tests/periodic-math.test.ts tests/periodic-noise.test.ts tests/periodic-render.test.ts tests/periodic-grid.test.ts tests/physics-periodic-queries.test.ts tests/math-profile.test.ts tests/movement3d-kcc-unit-contract.test.ts tests/movement3d-static-ground.test.ts tests/physical-assembly.test.ts tests/physical-assembly-determinism.test.ts tests/physical-assembly-certification.test.ts tests/physical-assembly-multiplayer.test.ts tests/state-digest.test.ts tests/large-blob-state.test.ts tests/math-installation-order.test.ts tests/networked-blob-state.test.ts tests/networked-checksum-burst.test.ts tests/networked-runtime-commit.test.ts tests/physics-helper-motion-reads.test.ts tests/physics-unit-conversions.test.ts tests/portal-physics.test.ts tests/physics-checkpoint-capacity.test.ts tests/runner-cleanup.test.ts tests/runtime-release-outcome.test.ts tests/session-checkpoint-budget.test.ts tests/session-owned-cleanup.test.ts tests/history-retention-memory.test.ts tests/mobile-settings-recovery.test.ts tests/confirmed-frame-budget.test.ts tests/tool-owned-adapter.test.ts tests/tool-runtime-lifetime.test.ts tests/movement3d-revision1-baseline.test.ts tests/movement3d-revision1-corpus.test.ts tests/legacy-query-revision1-corpus.test.ts tests/physics-support-boundary.test.ts tests/kcc-corpus-encoding.test.ts tests/voxel-swept-quad-paint.test.ts tests/physics-support-artifact.test.ts tests/movement3d-revision1-binding.test.ts tests/physics-si-pulley-runtime.test.ts tests/vehicle-2d.test.ts tests/vehicle-2d-rollback.test.ts tests/vehicle-state3d.test.ts tests/vehicle-state3d-artifact.test.ts tests/partner-rc22-codecs-units.test.ts tests/vehicle-acceptance-matrix.test.ts tests/vehicle-loose-debris.test.ts tests/partner-tarball-closure.test.ts tests/physics-si-rope-gear-powertrain-runtime.test.ts tests/voxel-body-state.test.ts tests/voxel-carve-cell-sizes.test.ts tests/wreck-yard-d-features.test.ts tests/wreck-yard-regression.test.ts tests/wreck-yard-rc33-gaps.test.ts tests/wreck-yard-rc55-findings.test.ts tests/wreck-yard-rc59-findings.test.ts tests/wreck-yard-rc60-findings.test.ts tests/wreck-yard-rc62-findings.test.ts tests/stack-solver-momentum.test.ts tests/vite-plugin-wasm.test.ts tests/portal-parity-ratchet.test.ts tests/solver-storage-memory-guard.test.ts tests/query-index-parity.test.ts tests/query-index-maintenance.test.ts tests/query-index-churn.test.ts tests/query-index-drift.test.ts tests/query-index-rollback.test.ts tests/portal-render3d.test.ts tests/portal-view-budget.test.ts tests/portal-queries-inside.test.ts tests/portal-render-state.test.ts tests/portal-host-walls.test.ts tests/portal-queries.test.ts tests/portal-placement.test.ts tests/portal-proxies.test.ts tests/portal-a7.test.ts tests/portal-review.test.ts tests/portal-physics-gaps.test.ts tests/extraction.test.ts tests/plugin-lifecycle.test.ts tests/core-zero-io-boundary.test.ts tests/movement3d-revision3-standing.test.mjs tests/movement3d-revision3-recovery.test.mjs tests/coop-shaped-offline.test.ts tests/physics-debug-overlay.test.ts tests/collider-preparation.test.ts tests/navmesh-geometry-cooking.test.ts tests/presentation-ik.test.ts tests/lag-compensation-history.test.ts tests/js-hotpath-regression.test.ts tests/physics-materials-boundary.test.ts tests/physics-materials.test.ts tests/portal-moved-only-tracking.test.ts tests/starved-client-own-input.test.ts tests/connected-catchup-input.test.ts tests/engine-native-math.test.ts tests/body-activity-counts.test.ts tests/physics-wake-on-remove.test.ts tests/box3d-host-filter-ccd.test.ts tests/box3d-public-kcc-vehicle-route.test.ts tests/box3d-sleep-restore-identity.test.ts tests/box3d-support-substep-route.test.ts tests/box3d-backend-contact-materials.test.ts tests/box3d-backend-filter-rules.test.ts tests/box3d-backend-joint-records.test.ts tests/box3d-backend-six-dof.test.ts tests/box3d-checkpoint-continuation.test.ts tests/box3d-deformable-checkpoint.test.ts tests/box3d-deformable-cloth.test.ts tests/box3d-deformable-fracture.test.ts tests/box3d-deformable-particles.test.ts tests/box3d-deformable-rope.test.ts tests/box3d-deformable-sdf.test.ts tests/box3d-deformable-soft-body.test.ts tests/box3d-deformable-integrity.test.ts tests/box3d-deformable-world-registry.test.ts tests/box3d-support-rollback.test.ts tests/box3d-rollback-replay-sweep.test.ts tests/box3d-read-purity.test.ts tests/box3d-restore-forced-sleep.test.ts tests/box3d-wake-digest.test.ts tests/portal-slice-route.test.ts tests/box3d-multi-world-independence.test.ts tests/box3d-on-demand-contacts.test.ts tests/box3d-portal-clone-queries.test.ts tests/box3d-dense-ids-after-removal.test.ts tests/box3d-joint-read-restore.test.ts tests/box3d-joint-read-frame.test.ts tests/box3d-joint-reaction-getters.test.ts tests/box3d-recreated-body-events.test.ts tests/box3d-end-on-removal.test.ts tests/box3d-sensor-shape-pairs.test.ts tests/box3d-event-capacity.test.ts tests/box3d-shared-shape-events.test.ts tests/box3d-adapter-stay-rows.test.ts tests/box3d-step-reads-checked.test.ts tests/box3d-edit-keeps-sleep-time.test.ts tests/donor-transfer-pacing.test.ts tests/box3d-restore-exact-state.test.ts tests/box3d-failed-step-atomic.test.ts tests/box3d-failed-step-post-publication.test.ts tests/box3d-support-read-purity.test.ts tests/box3d-portal-step-exclusions.test.ts tests/box3d-filter-flags-after-removal.test.ts tests/physics-replace-body-key.test.ts tests/box3d-portal-clone-filters.test.ts tests/box3d-portal-plan-ids.test.ts tests/box3d-recreated-pair-closure.test.ts tests/box3d-edit-net-shape-events.test.ts tests/box3d-restored-world-options.test.ts tests/checkpoint-latest-frame-inputs.test.ts tests/frame-bound-reads.test.mjs tests/physics-edit-call-order.test.ts",
264
+ "test:core": "node --expose-gc --experimental-test-module-mocks --import tsx --test --test-concurrency=1 tests/canonical.test.ts tests/canonical-portability.test.ts tests/runtime-session.test.ts tests/kinetix-runtime-session.test.ts tests/runtime-support.test.ts tests/runtime-guards.test.ts tests/r3f-render-adapter.test.ts tests/snapshot-cost.test.ts tests/sdkSession.test.ts tests/input-authority.test.ts tests/session-wire.test.ts tests/runtime-room-metadata.test.ts tests/session-snapshot.test.ts tests/authority-room.test.ts tests/networked-client-snapshot.test.ts tests/runner.test.ts tests/testing.test.ts tests/browser-session.test.ts tests/secret-config.test.ts tests/secret-protocol.test.ts tests/secret-authority.test.ts tests/secret-client.test.ts tests/secret-holder-release.test.ts tests/seat-control-parity.test.ts tests/seat-control.test.ts tests/seat-control-runtime.test.ts tests/late-join-checksum.test.ts tests/late-join-input-backfill.test.ts tests/replay-scoring.test.ts tests/bot-backfill.test.ts tests/latency-simulation.test.ts tests/production-input-budget.test.ts tests/time-sync.test.ts tests/match-log.test.ts tests/spectator.test.ts tests/synctest.test.ts tests/instant-replay.test.ts tests/session-promotion.test.ts tests/entrypoints.test.ts tests/physics-profile-bundle.test.ts tests/physics-profile-init.test.ts tests/export-surface.test.ts tests/creator-facing-names.test.ts tests/module-seam.test.ts tests/module-contract-portability.test.ts tests/module-identity.test.ts tests/module-corpus.test.ts tests/component-model.test.ts tests/component-model-rollback.test.ts tests/component-model-integration.test.ts tests/actors-ai.test.ts tests/character-3d.test.ts tests/character-3d-certification.test.ts tests/combat-modules.test.ts tests/combat-modules-integration.test.ts tests/firearm.test.ts tests/gameplay-effects.test.ts tests/spatial-interaction.test.ts tests/stats-abilities.test.ts tests/inventory-equipment.test.ts tests/inventory-equipment-certification.test.ts tests/platformer-2d.test.ts tests/platformer-2d-certification.test.ts tests/module-promotion.test.ts tests/module-docs.test.ts tests/module-bundle-budget.test.ts tests/published-side-effects.test.ts tests/host-timing.test.ts tests/test-manifest.test.ts tests/coarse-region.test.ts tests/input-codec.test.ts tests/command-ingress.test.ts tests/session-reconfigure.test.ts tests/prediction-mode.test.ts tests/ephemeral-channel.test.ts tests/runner-surface.test.ts tests/runner-harness.test.ts tests/effects-adapter-bounds.test.ts tests/simulated-match-secrets.test.ts tests/run-glue-surface.test.mjs core/tests/core-boundary.test.mjs tests/math-core-parity.test.ts tests/periodic-math.test.ts tests/periodic-noise.test.ts tests/periodic-render.test.ts tests/periodic-grid.test.ts tests/physics-periodic-queries.test.ts tests/math-profile.test.ts tests/movement3d-kcc-unit-contract.test.ts tests/movement3d-static-ground.test.ts tests/physical-assembly.test.ts tests/physical-assembly-determinism.test.ts tests/physical-assembly-certification.test.ts tests/physical-assembly-multiplayer.test.ts tests/state-digest.test.ts tests/large-blob-state.test.ts tests/math-installation-order.test.ts tests/networked-blob-state.test.ts tests/networked-checksum-burst.test.ts tests/networked-runtime-commit.test.ts tests/physics-helper-motion-reads.test.ts tests/physics-unit-conversions.test.ts tests/portal-physics.test.ts tests/physics-checkpoint-capacity.test.ts tests/runner-cleanup.test.ts tests/runtime-release-outcome.test.ts tests/session-checkpoint-budget.test.ts tests/session-owned-cleanup.test.ts tests/history-retention-memory.test.ts tests/mobile-settings-recovery.test.ts tests/confirmed-frame-budget.test.ts tests/tool-owned-adapter.test.ts tests/tool-runtime-lifetime.test.ts tests/movement3d-revision1-baseline.test.ts tests/movement3d-revision1-corpus.test.ts tests/legacy-query-revision1-corpus.test.ts tests/physics-support-boundary.test.ts tests/kcc-corpus-encoding.test.ts tests/voxel-swept-quad-paint.test.ts tests/physics-support-artifact.test.ts tests/movement3d-revision1-binding.test.ts tests/physics-si-pulley-runtime.test.ts tests/vehicle-2d.test.ts tests/vehicle-2d-rollback.test.ts tests/vehicle-state3d.test.ts tests/vehicle-state3d-artifact.test.ts tests/partner-rc22-codecs-units.test.ts tests/vehicle-acceptance-matrix.test.ts tests/vehicle-loose-debris.test.ts tests/partner-tarball-closure.test.ts tests/packed-exports.test.ts tests/physics-si-rope-gear-powertrain-runtime.test.ts tests/voxel-body-state.test.ts tests/voxel-carve-cell-sizes.test.ts tests/wreck-yard-d-features.test.ts tests/wreck-yard-regression.test.ts tests/wreck-yard-rc33-gaps.test.ts tests/wreck-yard-rc55-findings.test.ts tests/wreck-yard-rc59-findings.test.ts tests/wreck-yard-rc60-findings.test.ts tests/wreck-yard-rc62-findings.test.ts tests/stack-solver-momentum.test.ts tests/vite-plugin-wasm.test.ts tests/portal-parity-ratchet.test.ts tests/solver-storage-memory-guard.test.ts tests/query-index-parity.test.ts tests/query-index-maintenance.test.ts tests/query-index-churn.test.ts tests/query-index-drift.test.ts tests/query-index-rollback.test.ts tests/portal-render3d.test.ts tests/portal-view-budget.test.ts tests/portal-queries-inside.test.ts tests/portal-render-state.test.ts tests/portal-host-walls.test.ts tests/portal-queries.test.ts tests/portal-placement.test.ts tests/portal-proxies.test.ts tests/portal-a7.test.ts tests/portal-review.test.ts tests/portal-physics-gaps.test.ts tests/extraction.test.ts tests/plugin-lifecycle.test.ts tests/core-zero-io-boundary.test.ts tests/movement3d-revision3-standing.test.mjs tests/movement3d-revision3-recovery.test.mjs tests/coop-shaped-offline.test.ts tests/physics-debug-overlay.test.ts tests/collider-preparation.test.ts tests/navmesh-geometry-cooking.test.ts tests/presentation-ik.test.ts tests/lag-compensation-history.test.ts tests/js-hotpath-regression.test.ts tests/physics-materials-boundary.test.ts tests/physics-materials.test.ts tests/portal-moved-only-tracking.test.ts tests/starved-client-own-input.test.ts tests/connected-catchup-input.test.ts tests/engine-native-math.test.ts tests/body-activity-counts.test.ts tests/physics-wake-on-remove.test.ts tests/box3d-host-filter-ccd.test.ts tests/box3d-public-kcc-vehicle-route.test.ts tests/box3d-sleep-restore-identity.test.ts tests/box3d-support-substep-route.test.ts tests/box3d-backend-contact-materials.test.ts tests/box3d-backend-filter-rules.test.ts tests/box3d-backend-joint-records.test.ts tests/box3d-backend-six-dof.test.ts tests/box3d-checkpoint-continuation.test.ts tests/box3d-deformable-checkpoint.test.ts tests/box3d-deformable-cloth.test.ts tests/box3d-deformable-fracture.test.ts tests/box3d-deformable-particles.test.ts tests/box3d-deformable-rope.test.ts tests/box3d-deformable-sdf.test.ts tests/box3d-deformable-soft-body.test.ts tests/box3d-deformable-integrity.test.ts tests/box3d-deformable-world-registry.test.ts tests/box3d-support-rollback.test.ts tests/box3d-rollback-replay-sweep.test.ts tests/box3d-read-purity.test.ts tests/box3d-restore-forced-sleep.test.ts tests/box3d-wake-digest.test.ts tests/portal-slice-route.test.ts tests/box3d-multi-world-independence.test.ts tests/box3d-on-demand-contacts.test.ts tests/box3d-portal-clone-queries.test.ts tests/box3d-dense-ids-after-removal.test.ts tests/box3d-joint-read-restore.test.ts tests/box3d-joint-read-frame.test.ts tests/box3d-joint-reaction-getters.test.ts tests/box3d-recreated-body-events.test.ts tests/box3d-end-on-removal.test.ts tests/box3d-sensor-shape-pairs.test.ts tests/box3d-event-capacity.test.ts tests/box3d-shared-shape-events.test.ts tests/box3d-adapter-stay-rows.test.ts tests/box3d-step-reads-checked.test.ts tests/box3d-edit-keeps-sleep-time.test.ts tests/donor-transfer-pacing.test.ts tests/box3d-restore-exact-state.test.ts tests/box3d-failed-step-atomic.test.ts tests/box3d-failed-step-post-publication.test.ts tests/box3d-support-read-purity.test.ts tests/box3d-portal-step-exclusions.test.ts tests/box3d-filter-flags-after-removal.test.ts tests/physics-replace-body-key.test.ts tests/box3d-portal-clone-filters.test.ts tests/box3d-portal-plan-ids.test.ts tests/box3d-recreated-pair-closure.test.ts tests/box3d-edit-net-shape-events.test.ts tests/box3d-restored-world-options.test.ts tests/checkpoint-latest-frame-inputs.test.ts tests/frame-bound-reads.test.mjs tests/physics-edit-call-order.test.ts",
254
265
  "test:sdk-contract": "node --import tsx --test tests/sdk-runtime-contract.test.ts",
255
266
  "test:soak": "tsx --test tests/runtime-soak.test.ts",
256
267
  "test:extended": "node --expose-gc --import tsx --test --test-concurrency=1 tests/performance-primitives.test.ts tests/js-hotpath-perf-guard.test.ts tests/portal-straddler-mesh-cost.test.ts tests/active-voxel-stack.test.ts && tsx --test tests/animation.test.ts tests/asset-cooking.test.ts tests/backend-proof-checksum-vectors.test.ts tests/bot-documents.test.ts tests/bot-primitives.test.ts tests/collision.test.ts tests/command-timeline.test.ts tests/config-bundle.test.ts tests/deterministic-primitives.test.ts tests/ecs-lite.test.ts tests/effects-adapter.test.ts tests/engine-runtime.test.ts tests/errors.test.ts tests/events.test.ts tests/input-button.test.ts tests/load-128-players.test.ts tests/math.test.ts tests/movement.test.ts tests/movement3d.test.ts tests/multiclient-authority.test.ts tests/navigation.test.ts tests/noise.test.ts tests/physics3d-geometry-limits.test.ts tests/physics3d-shared.test.ts tests/physics3d-static-memoization.test.ts tests/random.test.ts tests/rollback-history.test.ts tests/schema-artifacts.test.ts tests/schema-codegen.test.ts tests/schema-dsl-binary.test.ts tests/schema.test.ts tests/signals.test.ts tests/sparse-set.test.ts tests/static-checker.test.ts tests/system-lifecycle.test.ts tests/wire-canonical-sentinels.test.ts tests/ws-frame.test.ts tests/wreck-yard-defects.test.ts tests/wreck-yard-performance-harness.test.ts tests/wreck-yard-partner-verification-rc15.test.ts tests/yawed-crate-stack-settling.test.ts tests/tilted-crate-stack-settling.test.ts tests/query-index-cost.test.ts tests/wreck-yard-vehicle-batch.test.ts tests/engine-runtime-free-list.test.ts",
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Erin Catto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,192 @@
1
+ # Provenance: Box3D binary64 fork
2
+
3
+ This tree is a binary64 copy of upstream Box3D at a fixed commit. It is not the upstream large-world
4
+ mode. `BOX3D_DOUBLE_PRECISION` stays undefined, so the C ABI keeps its names and its widths.
5
+
6
+ | Item | Value |
7
+ |---|---|
8
+ | Remote | `https://github.com/erincatto/box3d.git` |
9
+ | Commit | `336263320469e5e9febfe18697ab562488f7e97a` (`3362633`) |
10
+ | License | MIT, `LICENSE`, verbatim, never edited |
11
+ | Upstream tree digest (`include/ src/ shared/ test/`) | `4e9e1e940918f1e2b260a58528fac26bea019b27a1738840707cea72f61c157d` |
12
+ | Generated tree digest | `6e97619d70da836416d88b6296491ad5c785d9fac6861c1c97c1c5c0e91ad136` (UPSTREAM.json `generatedTreeSha256`) |
13
+ | Port script | `port/port_f64.py` |
14
+ | Hand edits | `port/hand-edits-f64.patch` |
15
+ | Flags version | `v1` (see `scripts/box3d-profile.mjs`) |
16
+
17
+ The digest rule is one rule: sha256 over the sorted list of (relative path, `0x00`, file bytes,
18
+ `0x00`). `scripts/box3d-profile.mjs` implements it, and `port/port-manifest.sha256` records every
19
+ file plus the tree digest.
20
+
21
+ ## How the tree is made
22
+
23
+ 1. Clone the pin and check out the commit in detached mode.
24
+ 2. Copy `include/`, `src/`, `shared/`, and `test/`.
25
+ 3. Run `python3 port/port_f64.py <tree> --apply`.
26
+ 4. Apply `port/hand-edits-f64.patch` with `patch -p1 -d <tree>/src`.
27
+ 5. Compare the tree digest with `UPSTREAM.json.generatedTreeSha256`.
28
+
29
+ `npm run check:box3d-clean-room` runs all five steps against the network and fails on any differing
30
+ byte. `npm run check:box3d-manifest` runs the hash checks only and needs no network.
31
+
32
+ ## 1. Mechanical port (`port_f64.py`)
33
+
34
+ The script rewrites `src/`, `include/`, `shared/`, and `test/` except the SIMD headers that the
35
+ scalar build does not compile (`simd_sse2.h`, `simd_avx2.h`, `simd_neon.h`). Measured counts on this
36
+ port:
37
+
38
+ | Change | Count |
39
+ |---|---|
40
+ | Float literal with `f`/`F` suffix | 9142 |
41
+ | libm call with `f` suffix (`sqrtf`, ...) | 142 |
42
+ | `float` type word | 3807 |
43
+ | Files changed | 104 |
44
+
45
+ Deliberate rule: `FLT_EPSILON`, `FLT_MIN`, and `FLT_MAX` keep their float32 values. Box3D uses them
46
+ as tolerances, and a tolerance is a rule, not a precision. The `epsilonW` site in
47
+ `contact_solver_wide.inl` keeps the float value for the same reason. It costs 4.0e-10 against a
48
+ binary64 reference.
49
+
50
+ The script does not touch strings, so a file format that says `%f` needs a hand edit (see 2.3).
51
+
52
+ ## 2. Hand edits (`port/hand-edits-f64.patch`)
53
+
54
+ ### 2.1 Re-measured layout asserts
55
+
56
+ `compound.c`, `contact_solver_wide.inl`, `dynamic_tree.c`, `hull.c`, and `recording.c` assert the
57
+ size and the offset of internal structs. A double field moves every later field, so each assert
58
+ carries the value measured in the binary64 layout. The asserts stay: a later layout change still
59
+ fails the build.
60
+
61
+ ### 2.2 Float32 wire format, kept on purpose
62
+
63
+ The recording, replay, and name-cache formats are 4-byte float fields upstream. The port script
64
+ widened the C types, so the memcpy sites would read 4 bytes of a double. The hand edit rounds to a
65
+ `float` first and keeps the 4-byte width in these places:
66
+
67
+ - `recording.c`: `b3RecW_F32`, `B3_HASH_FLOAT`, and the header `lengthScale`.
68
+ - `recording.h`: the position hash of the 4-byte build path, and `lengthScale` as `float`.
69
+ - `replay.c`: `b3RecR_F32`, `b3RecF32Differs`, and `recordedDt`.
70
+
71
+ The consequence is recorded, not hidden: `NameCacheTest` and `RecordingTest` fail because a float32
72
+ round trip does not reproduce a binary64 state hash. See `port/KNOWN-FAILURES.md`.
73
+
74
+ ### 2.3 File reader format strings
75
+
76
+ `height_field.c` reads doubles with `%lf`. The port widened the destination type, and `%f` would
77
+ store a float into a double slot.
78
+
79
+ ### 2.4 `BOX3D_NO_FILE_IO`: no host services
80
+
81
+ The plan requires a WASM build with zero imports. A module that calls `printf`, `clock_gettime`,
82
+ fopen`, `sched_yield`, or pthread gets an import, so those calls are guarded:
83
+
84
+ | File | Guard |
85
+ |---|---|
86
+ | `core.c` | The default assert and log handlers print nothing. An adapter installs `b3SetAssertFcn` and `b3SetLogFcn` before the first world. |
87
+ | `height_field.c` | `b3DumpHeightData` and `b3LoadHeightField` do nothing and return NULL. |
88
+ | `dynamic_tree.c` | `b3DynamicTree_Save` and `b3DynamicTree_Load` do nothing and return an empty tree. |
89
+ | `timer.c` | The whole host block is replaced by a one-worker block: ticks return 0, yield and sleep do nothing, mutex and semaphore calls do nothing, and `b3CreateThread` asserts and returns NULL. |
90
+
91
+ `b3Hash` in `timer.c` stays outside the guard: it is a pure function and the engine needs it.
92
+
93
+ The WASM build and both counter artifacts define `BOX3D_NO_FILE_IO`. The native upstream test build
94
+ does not, so `HeightFieldTest`, `DynamicTreeTest`, `DeterminismTest`, and the replay tests keep their
95
+ host calls and run for real.
96
+
97
+ A profile that returns 0 ticks loses the step profile numbers only. No profile field enters a
98
+ digest.
99
+
100
+ ## 3. Departures and open items
101
+
102
+ - `BOX3D_DOUBLE_PRECISION` stays undefined. The macro renames `b3CreateWorld` and changes the ABI.
103
+ `verify-link.mjs` fails on any artifact that carries `b3CreateWorldDoublePrecision`.
104
+ - `b3Atan2` keeps the float-rounded minimax coefficients (`1.57079637`). This is the cause of the
105
+ `MathTest` failure. Widening the coefficients changes results, so the determinism matrix must be
106
+ re-run in the same change (plan section 9, item 1).
107
+ - The world registry (`b3_worlds[128]`, `b3_worldCount`) is process-global. Two Syncplay registries
108
+ share it. Syncplay's `kMaxHandles` is 64, so the cap is not hit.
109
+ - The scheduler creates `workerCount - 1` threads. The adapter must set `workerCount = 1`. The
110
+ counter build blocks the thread API at compile time for the same reason.
111
+ - The port does not add an `extern "C"` wrapper. `base.h` already defines `B3_API` as `extern "C"`
112
+ under `__cplusplus`, and a wrapper would hide a real mismatch.
113
+
114
+ - `solver_set.c` `b3TrySleepIsland` (in `port/syncplay-f64.patch`): `body->bodyMoveIndex` is a
115
+ reference into the move events of the last step. The fork marks the event only when the index is
116
+ in the array and the event holds this body, and then clears the index in all cases. Upstream
117
+ asserts on the index. A world from `b3DeserializeIntoShell` has the indices of the image and an
118
+ empty event array, so a forced sleep of an awake body before its first step failed the assert (and
119
+ without asserts wrote out of the array). `b3Body_Disable` and `b3Body_SetType` keep the index of an
120
+ older step in the same way. A step that does not fail the assert gives the same result as before.
121
+
122
+ - `body.c` `b3Body_GetSleepTime`, `b3Body_SetSleepTime` (in `port/syncplay-f64.patch`, next to the
123
+ fork's `b3Body_ResetSleepTimer`): read and write `b3Body::sleepTime`. Syncplay builds a new native
124
+ world from the public state for an edit that it cannot apply in place, and it gives each body that
125
+ the edit did not change the sleep time that the body had in the old world. Upstream has no getter
126
+ or setter. The functions change no other state and no solver path calls them.
127
+
128
+ - `syncplay_snapshot.c` `syncplay_body_touch_request`, `body.h` `b3_syncplayTouchRequest`, and two
129
+ calls in `physics_world.c` `b3World_Step` (in `port/syncplay-f64.patch`). Box3D makes the contact of
130
+ two bodies that are not awake in the disabled set (`contact.c` `b3CreateContact`), and the narrow
131
+ phase does not update it until a body wakes. A world that Syncplay builds again from the public
132
+ state creates a sleeping body asleep, so its sleeping island had no touching contact, and the next
133
+ wake started every resting pair again. The request marks such a body. The next step wakes the
134
+ solver set of each marked body after the pair update (`b3WakeSolverSet`), runs the narrow phase as
135
+ usual, and before the solver puts each island of marked bodies back to sleep (`b3TrySleepIsland`)
136
+ with the sleep time that each body had. An island that also holds an unmarked awake body stays
137
+ awake, as `b3LinkContact` wakes a sleeping island that an awake body touches. The mark is a
138
+ transient body flag (`b3_bodyTransientFlags`), so the body sim and the body state never carry it.
139
+ A step without a marked body runs as upstream.
140
+
141
+ - `wheel_joint.c`, `prismatic_joint.c`, `spherical_joint.c` joint force and torque getters, and the
142
+ wheel substep impulse record (`joint.c` `b3JointKindRecordsSubstepImpulse`), in
143
+ `port/syncplay-f64.patch` (added 2026-11-12). The getters now give the impulses that the warm
144
+ start of each kind applies to body B. Upstream `b3GetWheelJointForce` put the suspension impulse
145
+ on the z-axis of frame A (the suspension axis is its x-axis), added `lowerSuspensionLimit` (a
146
+ length) in place of the lower limit impulse, and added the upper limit impulse with the wrong sign;
147
+ `b3GetWheelJointTorque` gave only the spin impulse. `b3GetPrismaticJointForce` put the axial
148
+ impulse on the z-axis and added the upper limit impulse with the wrong sign, and
149
+ `b3GetPrismaticJointTorque` rotated the world-space angular impulse again by the frame of body A.
150
+ `b3GetSphericalJointTorque` added the swing impulse with the wrong sign and put the twist impulse
151
+ on the z-axis of body B in place of the twist Jacobian. The wheel now records the impulse of each
152
+ row of each substep, as the other scalar-axis kinds do, so its step reaction is the force and the
153
+ couple that it applied. The solver paths do not change: the step result of a world is the same.
154
+ - **Read-only torque getters** (`parallel_joint.c`, `revolute_joint.c`), one more layer of
155
+ `port/syncplay-f64.patch` (added 2026-11-12). Upstream `b3GetParallelJointTorque` and
156
+ `b3GetRevoluteJointTorque` wrote the perp axes into the joint when a read called them. The getters
157
+ now keep the axes in local values. The prepare step sets the axes of the solver before each use, so
158
+ the step result of a world does not change.
159
+ - **Custom-filtering flag getter** (`syncplay_contact.c`, `syncplay_contact.h`
160
+ `syncplay_shape_custom_filtering`), one more layer of `port/syncplay-f64.patch` (added 2026-11-12).
161
+ Box3D keeps `b3ShapeDef::enableCustomFiltering` in the shape flags and has no getter. The adapter
162
+ reads the flag of each shape of a world (`syncplay_adapter_custom_filter_shapes`), so a world that a
163
+ canonical image restored knows the flags that the image carries. The getter only reads, so the step
164
+ result of a world does not change.
165
+ - **Checked allocation** (`core.c`, `physics_world.c`, `syncplay_snapshot.c`, `syncplay_snapshot.h`), one more
166
+ layer of `port/syncplay-f64.patch` (added 2026-11-13). Upstream `b3Alloc` returns the null result of the
167
+ allocator after an assert that does not stop, and every caller writes through it (for example
168
+ `b3CreateRecording`). `b3Alloc` now calls the handler of `syncplay_set_allocation_failure` for a null result;
169
+ the handler must not return (the adapter throws `std::bad_alloc` through the C frames, which have unwind tables),
170
+ and without a handler the process aborts. `syncplay_world_unlock` clears the lock of a world whose call the throw
171
+ left. `b3DestroyWorld` frees the arrays of the solver sets without `b3FreeId`, whose free list can grow and so
172
+ allocate in a teardown. An allocation that succeeds takes the same path as before, so the step result of a world
173
+ does not change.
174
+
175
+ ## 4. Not in the tree yet
176
+
177
+ These are plan items for later tasks, and their absence is deliberate:
178
+
179
+ - `port/test-overrides.patch`: the binary64 golden for `DeterminismTest` and `test_f64_wire.c` for
180
+ `NameCacheTest` and `RecordingTest`. `UPSTREAM.json.testOverridesSha256` is `null` until it exists.
181
+ The four upstream failures stay visible in the meantime.
182
+ - `port/syncplay-f64.patch`: the fork-internal snapshot, digest, pointer scan, and allocator context
183
+ C files. They arrive with the adapter and the checkpoint work.
184
+
185
+ ## 5. Evidence of this tree
186
+
187
+ | Check | Result |
188
+ |---|---|
189
+ | `node third_party/box3d/scripts/rebuild-check.mjs --verify-manifest` | 167 files match, tree digest matches |
190
+ | `node third_party/box3d/scripts/rebuild-check.mjs --clean-room` | byte-exact rebuild from the pin |
191
+ | `node third_party/box3d/scripts/run-upstream-tests.mjs` | 24 pass, 4 known failures |
192
+ | `node third_party/box3d/scripts/verify-link.mjs <counter artifacts>` | include gate passes, no foreign global, no `pthread_create`, no double-precision symbol, zero WASM imports |
@@ -0,0 +1,20 @@
1
+ {
2
+ "remote": "https://github.com/erincatto/box3d.git",
3
+ "commit": "336263320469e5e9febfe18697ab562488f7e97a",
4
+ "commitShort": "3362633",
5
+ "license": "MIT",
6
+ "licenseFile": "LICENSE",
7
+ "upstreamTreeSha256": "4e9e1e940918f1e2b260a58528fac26bea019b27a1738840707cea72f61c157d",
8
+ "portScriptSha256": "7b2fd6c955e2c4d7e4ba3bedc230023714f54ac03dbe838f58fe0e0567f6be32",
9
+ "handEditsSha256": "d5ca970fc5b0ba9e563874f6dc9fb2a9cc9c357752ae7c5d79e4efe78258e810",
10
+ "syncplayPatchSha256": "d79ef392671328699806ad9765052896e908ac01c6fbcef6ca48f9e5328e76e0",
11
+ "testOverridesSha256": null,
12
+ "generatedTreeSha256": "6e97619d70da836416d88b6296491ad5c785d9fac6861c1c97c1c5c0e91ad136",
13
+ "flagsVersion": "v1",
14
+ "knownFailures": [
15
+ "DeterminismTest",
16
+ "MathTest",
17
+ "NameCacheTest",
18
+ "RecordingTest"
19
+ ]
20
+ }
@@ -0,0 +1,54 @@
1
+ aabb.c
2
+ arena_allocator.c
3
+ bitset.c
4
+ block_allocator.c
5
+ body.c
6
+ broad_phase.c
7
+ capsule.c
8
+ compound.c
9
+ constraint_graph.c
10
+ contact_solver.c
11
+ contact.c
12
+ convex_manifold.c
13
+ core.c
14
+ distance_joint.c
15
+ distance.c
16
+ dynamic_tree.c
17
+ height_field.c
18
+ hull.c
19
+ id_pool.c
20
+ island.c
21
+ joint.c
22
+ manifold.c
23
+ math_functions.c
24
+ mesh_contact.c
25
+ mesh.c
26
+ motor_joint.c
27
+ mover.c
28
+ mover_joint.c
29
+ name_cache.c
30
+ parallel_for.c
31
+ parallel_joint.c
32
+ physics_world.c
33
+ pogo_joint.c
34
+ prismatic_joint.c
35
+ recording.c
36
+ replay.c
37
+ revolute_joint.c
38
+ scheduler.c
39
+ sensor.c
40
+ shape.c
41
+ simd.c
42
+ solver_set.c
43
+ solver.c
44
+ sphere.c
45
+ spherical_joint.c
46
+ table.c
47
+ timer.c
48
+ triangle_manifold.c
49
+ types.c
50
+ weld_joint.c
51
+ wheel_joint.c
52
+ wide4.c
53
+ wide8.c
54
+ world_snapshot.c
@@ -0,0 +1,7 @@
1
+ # Syncplay fork additions. These files are not upstream. They are added by
2
+ # port/syncplay-f64.patch and they link into the library after the upstream list.
3
+ syncplay_digest.c
4
+ syncplay_snapshot.c
5
+ syncplay_contact.c
6
+ syncplay_impact.c
7
+ six_dof_joint.c
@@ -0,0 +1,36 @@
1
+ main.c
2
+ test_allocator.c
3
+ test_bitset.c
4
+ test_body.c
5
+ test_body_query.c
6
+ test_broad_phase.c
7
+ test_collision.c
8
+ test_compound.c
9
+ test_container.c
10
+ test_determinism.c
11
+ test_distance.c
12
+ test_dynamic_tree.c
13
+ test_hash.c
14
+ test_height_field.c
15
+ test_hull.c
16
+ test_id.c
17
+ test_joint.c
18
+ test_large_world.c
19
+ test_manifold.c
20
+ test_math.c
21
+ test_mesh.c
22
+ test_mover.c
23
+ test_name_cache.c
24
+ test_recording.c
25
+ test_restitution.c
26
+ test_sat.c
27
+ test_shape.c
28
+ test_table.c
29
+ test_world.c
30
+ benchmarks.c
31
+ determinism.c
32
+ human.c
33
+ overflow_color.c
34
+ sat_benchmark.c
35
+ stability.c
36
+ utils.c
@@ -0,0 +1,185 @@
1
+ // Single source of truth for the Box3D binary64 fork: source list, flags, and source hash.
2
+ //
3
+ // The native build (packages/syncplay/core/scripts/build-native.mjs), the WASM build
4
+ // (packages/syncplay/core/scripts/build-wasm-physics.mjs), the fork checks, and the determinism
5
+ // matrix tool import this module. A second copy of the source list or the flags is a defect.
6
+ //
7
+ // The plan is .plans/box3d-core-port.md, section 2 and section 5.
8
+ import { createHash } from 'node:crypto';
9
+ import { readFileSync, readdirSync, statSync } from 'node:fs';
10
+ import { join, relative } from 'node:path';
11
+
12
+ export const FORK_ROOT = join(import.meta.dirname, '..');
13
+ export const TREE_DIR = join(FORK_ROOT, 'tree');
14
+ export const INCLUDE_DIR = join(TREE_DIR, 'include');
15
+ export const INTERNAL_INCLUDE_DIR = join(TREE_DIR, 'src');
16
+ export const TEST_DIR = join(TREE_DIR, 'test');
17
+ export const SHARED_DIR = join(TREE_DIR, 'shared');
18
+ export const PORT_DIR = join(FORK_ROOT, 'port');
19
+ export const SCRIPTS_DIR = join(FORK_ROOT, 'scripts');
20
+ export const COUNTER_SMOKE_SOURCE = join(SCRIPTS_DIR, 'counter-smoke.c');
21
+
22
+ export const UPSTREAM = Object.freeze(JSON.parse(readFileSync(join(FORK_ROOT, 'UPSTREAM.json'), 'utf8')));
23
+
24
+ // The upstream tree directories, in digest order.
25
+ export const UPSTREAM_TREE_DIRECTORIES = Object.freeze(['include', 'src', 'shared', 'test']);
26
+
27
+ function readSourceList(name) {
28
+ return readFileSync(join(PORT_DIR, name), 'utf8')
29
+ .split('\n')
30
+ .map((line) => line.trim())
31
+ .filter((line) => line.length > 0 && line.startsWith('#') === false);
32
+ }
33
+
34
+ // The 54 .c files that link into the library. They are the upstream CMake list.
35
+ export const C_SOURCES = Object.freeze(readSourceList('c-sources.txt'));
36
+ // The Syncplay fork additions. They are not upstream files, so they have their own list.
37
+ export const SYNCPLAY_SOURCES = Object.freeze(readSourceList('syncplay-sources.txt'));
38
+ // Everything that links into the library, upstream first, then the fork additions.
39
+ export const ALL_C_SOURCES = Object.freeze([...C_SOURCES, ...SYNCPLAY_SOURCES]);
40
+ // main.c, the 28 named tests, and the shared harness helpers.
41
+ export const TEST_SOURCES = Object.freeze(readSourceList('test-sources.txt'));
42
+
43
+ // The 28 named upstream tests, in the order main.c runs them. A missing name fails the gate.
44
+ export const TEST_NAMES = Object.freeze([
45
+ 'AllocatorTest', 'BitTest', 'BodyTest', 'BodyQueryTest', 'BroadPhaseTest', 'CollisionTest',
46
+ 'CompoundTest', 'ContainerTest', 'DeterminismTest', 'DistanceTest', 'DynamicTreeTest', 'HashTest',
47
+ 'HeightFieldTest', 'HullTest', 'IdTest', 'JointTest', 'LargeWorldTest', 'ManifoldTest', 'MathTest',
48
+ 'MeshTest', 'MoverTest', 'NameCacheTest', 'RecordingTest', 'RestitutionTest', 'SeparatingAxisTest',
49
+ 'ShapeTest', 'TableTest', 'WorldTest',
50
+ ]);
51
+
52
+ // Plan section 5.1. -ffp-contract=off is load-bearing: it forbids FMA fusion. Do not add
53
+ // -fno-strict-aliasing: Box3D puns through memcpy, and the flag would change codegen.
54
+ export const NATIVE_FLAGS = Object.freeze([
55
+ '-std=gnu17',
56
+ '-O3',
57
+ '-DNDEBUG',
58
+ '-ffp-contract=off',
59
+ '-fno-fast-math',
60
+ '-fno-unsafe-math-optimizations',
61
+ '-fno-finite-math-only',
62
+ '-fno-reciprocal-math',
63
+ '-DBOX3D_DISABLE_SIMD',
64
+ '-fvisibility=hidden',
65
+ ]);
66
+
67
+ // The counter build removes host services (file, clock, thread, mutex, semaphore) so that a
68
+ // link gate can prove no thread and no import reaches the artifact. The upstream test build
69
+ // does not set this macro, so every native test keeps its host calls.
70
+ export const COUNTER_NATIVE_FLAGS = Object.freeze([...NATIVE_FLAGS, '-DBOX3D_NO_FILE_IO']);
71
+
72
+ // Plan section 5.2. -mno-simd128 keeps the module scalar, and BOX3D_NO_FILE_IO guards the
73
+ // file, clock, yield, sleep, and thread calls.
74
+ export const WASM_FLAGS = Object.freeze([
75
+ '-std=gnu17',
76
+ '-O3',
77
+ '-DNDEBUG',
78
+ '-ffp-contract=off',
79
+ '-fno-fast-math',
80
+ '-fno-unsafe-math-optimizations',
81
+ '-fno-finite-math-only',
82
+ '-fno-reciprocal-math',
83
+ '-DBOX3D_DISABLE_SIMD',
84
+ '-DBOX3D_NO_FILE_IO',
85
+ '-fno-exceptions',
86
+ '-fno-rtti',
87
+ '-mno-simd128',
88
+ ]);
89
+
90
+ // The link flags of plan section 5.2. The zero-import check runs on every artifact these make.
91
+ export const WASM_LINK_FLAGS = Object.freeze([
92
+ '--no-entry',
93
+ '-sSTANDALONE_WASM=1',
94
+ '-sALLOW_MEMORY_GROWTH=1',
95
+ '-sABORTING_MALLOC=0',
96
+ '-sERROR_ON_UNDEFINED_SYMBOLS=1',
97
+ '-sSTACK_SIZE=1048576',
98
+ '--stack-first',
99
+ ]);
100
+
101
+ // The counter module exports only allocation, the smoke entry, and the calls the smoke uses.
102
+ export const WASM_COUNTER_EXPORTS = Object.freeze([
103
+ '_malloc', '_free', '_syncplayBox3dCounterSmoke', '_b3CreateWorld', '_b3DestroyWorld',
104
+ '_b3World_Step', '_b3GetWorldCount',
105
+ ]);
106
+
107
+ // The include path of the library sources. Only fork-internal C files use the src/ headers.
108
+ export function includeFlags() {
109
+ return [`-I${INCLUDE_DIR}`, `-I${INTERNAL_INCLUDE_DIR}`];
110
+ }
111
+
112
+ // Digest rule of plan section 2: sha256 over sorted (relative path, 0x00, bytes, 0x00).
113
+ // Do not invent a second rule.
114
+ export function treeDigest(dir = TREE_DIR) {
115
+ const hash = createHash('sha256');
116
+ const walk = (path) => {
117
+ for (const name of readdirSync(path).sort()) {
118
+ const entry = join(path, name);
119
+ const stats = statSync(entry);
120
+ if (stats.isDirectory()) {
121
+ walk(entry);
122
+ } else if (stats.isFile()) {
123
+ hash.update(relative(dir, entry));
124
+ hash.update('\0');
125
+ hash.update(readFileSync(entry));
126
+ hash.update('\0');
127
+ }
128
+ }
129
+ };
130
+ walk(dir);
131
+ return hash.digest('hex');
132
+ }
133
+
134
+ // Digest over the four upstream directories, with paths relative to the given root.
135
+ export function upstreamTreeDigest(root) {
136
+ const hash = createHash('sha256');
137
+ const walk = (path, base) => {
138
+ for (const name of readdirSync(path).sort()) {
139
+ const entry = join(path, name);
140
+ const stats = statSync(entry);
141
+ if (stats.isDirectory()) {
142
+ walk(entry, base);
143
+ } else if (stats.isFile()) {
144
+ hash.update(relative(base, entry));
145
+ hash.update('\0');
146
+ hash.update(readFileSync(entry));
147
+ hash.update('\0');
148
+ }
149
+ }
150
+ };
151
+ for (const name of UPSTREAM_TREE_DIRECTORIES) walk(join(root, name), root);
152
+ return hash.digest('hex');
153
+ }
154
+
155
+ // The digest a build fingerprint records. It covers the tree, the compiled source bytes, and
156
+ // the flags, so a flag change or a source change makes a new artifact identity.
157
+ export function sourceHash() {
158
+ const hash = createHash('sha256');
159
+ hash.update(JSON.stringify({
160
+ pin: UPSTREAM.commit,
161
+ flagsVersion: UPSTREAM.flagsVersion,
162
+ nativeFlags: NATIVE_FLAGS,
163
+ wasmFlags: WASM_FLAGS,
164
+ treeSha256: treeDigest(),
165
+ }));
166
+ hash.update('\0');
167
+ for (const name of ALL_C_SOURCES) {
168
+ hash.update(name);
169
+ hash.update('\0');
170
+ hash.update(readFileSync(join(INTERNAL_INCLUDE_DIR, name)));
171
+ hash.update('\0');
172
+ }
173
+ return hash.digest('hex');
174
+ }
175
+
176
+ // The identity every artifact record carries.
177
+ export function forkIdentity() {
178
+ return Object.freeze({
179
+ pin: UPSTREAM.commit,
180
+ pinShort: UPSTREAM.commitShort,
181
+ flagsVersion: UPSTREAM.flagsVersion,
182
+ treeSha256: treeDigest(),
183
+ sourceHash: sourceHash(),
184
+ });
185
+ }