@series-inc/rundot-syncplay 6.0.0-rc.8 → 6.0.0-rc.80

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 (358) hide show
  1. package/README.md +209 -4
  2. package/bench/wreck-yard-sleeping-contacts.json +855 -0
  3. package/core/deterministic-math.d.ts +75 -1
  4. package/core/deterministic-stdlib.d.ts +21 -1
  5. package/core/native/fixed_math.cpp +161 -0
  6. package/core/native/fixed_math.hpp +12 -0
  7. package/core/native/instance_ledger.hpp +1095 -0
  8. package/core/native/kinetix-native-main.cpp +42 -4
  9. package/core/native/legacy_checkpoint_ids.hpp +107 -0
  10. package/core/native/mobile/box3d_probe_scenario.cpp +2 -2
  11. package/core/native/physics/abi.cpp +42 -8
  12. package/core/native/physics/abi.hpp +2 -0
  13. package/core/native/physics/articulation.cpp +3 -2
  14. package/core/native/physics/buoyancy.cpp +732 -26
  15. package/core/native/physics/buoyancy.hpp +56 -0
  16. package/core/native/physics/capsule_triangle_native.inc +121 -45
  17. package/core/native/physics/certified_sum.hpp +218 -0
  18. package/core/native/physics/character.cpp +5 -4
  19. package/core/native/physics/checkpoint_schema.hpp +436 -0
  20. package/core/native/physics/cloth.cpp +2 -1
  21. package/core/native/physics/constraint_rows.cpp +975 -269
  22. package/core/native/physics/constraint_rows.hpp +146 -19
  23. package/core/native/physics/contact_material_store.cpp +803 -0
  24. package/core/native/physics/contact_material_store.hpp +315 -0
  25. package/core/native/physics/deterministic_composite_math.hpp +50 -0
  26. package/core/native/physics/exact/exact-applied.hpp +57 -1
  27. package/core/native/physics/exact/word-core.hpp +1 -0
  28. package/core/native/physics/extended_abi.cpp +90 -5
  29. package/core/native/physics/extended_abi.hpp +31 -0
  30. package/core/native/physics/gear.cpp +7 -1
  31. package/core/native/physics/geometry_memory.hpp +435 -11
  32. package/core/native/physics/geometry_store.cpp +771 -33
  33. package/core/native/physics/geometry_store.hpp +148 -2
  34. package/core/native/physics/hull_cook.hpp +122 -0
  35. package/core/native/physics/hull_cook.inc +1214 -0
  36. package/core/native/physics/hull_manifold.inc +661 -0
  37. package/core/native/physics/lag_compensation.cpp +4 -3
  38. package/core/native/physics/mass_properties.cpp +49 -181
  39. package/core/native/physics/mass_properties.hpp +11 -0
  40. package/core/native/physics/material_pose.hpp +627 -336
  41. package/core/native/physics/particles.cpp +9 -8
  42. package/core/native/physics/path_joint.cpp +4 -3
  43. package/core/native/physics/physics.cpp +21272 -16002
  44. package/core/native/physics/physics.hpp +869 -42
  45. package/core/native/physics/planar_deformable.cpp +9 -8
  46. package/core/native/physics/platformer_2d.cpp +11 -10
  47. package/core/native/physics/powered_ragdoll.cpp +11 -7
  48. package/core/native/physics/ragdoll.cpp +6 -5
  49. package/core/native/physics/ragdoll.hpp +6 -4
  50. package/core/native/physics/rope.cpp +4 -3
  51. package/core/native/physics/sdf_geometry.cpp +17 -16
  52. package/core/native/physics/soft_collision.cpp +45 -21
  53. package/core/native/physics/surface_velocity.cpp +817 -13
  54. package/core/native/physics/surface_velocity.hpp +283 -67
  55. package/core/native/physics/surface_velocity_math.hpp +91 -0
  56. package/core/native/physics/topology.cpp +174 -4
  57. package/core/native/physics/topology.hpp +48 -1
  58. package/core/native/physics/tracks.cpp +11 -10
  59. package/core/native/physics/voxel_cooking.cpp +2 -1
  60. package/core/native/physics/world.cpp +9043 -655
  61. package/core/native/physics/world.hpp +1471 -22
  62. package/core/native/physics/world_abi.cpp +5635 -788
  63. package/core/native/physics/world_abi.hpp +791 -10
  64. package/core/native/physics/world_digest_visitor.hpp +353 -0
  65. package/core/native/physics/world_strong_digest.hpp +640 -0
  66. package/core/native/physics2d/ccd.cpp +137 -8
  67. package/core/native/physics2d/checkpoint_memory.hpp +349 -0
  68. package/core/native/physics2d/commands.cpp +163 -25
  69. package/core/native/physics2d/commands.hpp +2 -0
  70. package/core/native/physics2d/contour.cpp +325 -0
  71. package/core/native/physics2d/contour.hpp +143 -0
  72. package/core/native/physics2d/joints.cpp +14 -23
  73. package/core/native/physics2d/memory_private.hpp +125 -0
  74. package/core/native/physics2d/owned_abi.cpp +1351 -898
  75. package/core/native/physics2d/owned_abi.hpp +177 -44
  76. package/core/native/physics2d/physics2d.cpp +1133 -59
  77. package/core/native/physics2d/physics2d.hpp +86 -1
  78. package/core/native/physics2d/queries.cpp +1046 -77
  79. package/core/native/physics2d/queries.hpp +62 -4
  80. package/core/native/physics2d/world.cpp +982 -357
  81. package/core/native/physics2d/world.hpp +109 -11
  82. package/core/native/sha256/sha256_compress_unsigned.hpp +68 -0
  83. package/core/native/sha256/sha256_fips_constants.hpp +24 -0
  84. package/core/native/sha256/sha256_length.hpp +56 -0
  85. package/core/native/sha256/sha256_memo.hpp +48 -0
  86. package/core/native/sha256/sha256_sink.hpp +234 -0
  87. package/core/physics2d-owned.d.ts +327 -154
  88. package/core/runtime.d.ts +208 -19
  89. package/core/scripts/build-native.mjs +20 -0
  90. package/core/scripts/build-wasm-physics.mjs +220 -38
  91. package/core/scripts/extended-physics-profile.mjs +13 -0
  92. package/core/scripts/generate-physics2d-vectors.mjs +59 -0
  93. package/core/src/engine-math.d.mts +23 -0
  94. package/core/src/engine-math.mjs +1060 -0
  95. package/core/src/kinetix-deterministic-math.d.ts +2 -0
  96. package/core/src/kinetix-deterministic-math.mjs +583 -27
  97. package/core/src/kinetix-deterministic-stdlib.mjs +120 -0
  98. package/core/src/kinetix-owned-runtime-adapter.mjs +789 -0
  99. package/core/src/kinetix-runtime-adapter-utils.mjs +46 -3
  100. package/core/src/kinetix-runtime-contract.mjs +55 -9
  101. package/core/src/kinetix-runtime-identity.mjs +12 -1
  102. package/core/src/kinetix-state-report.mjs +36 -0
  103. package/core/src/physics/abi-constants.mjs +5 -3
  104. package/core/src/physics/articulation.mjs +2 -15
  105. package/core/src/physics/box3d-probe.mjs +8 -18
  106. package/core/src/physics/buoyancy.d.mts +132 -59
  107. package/core/src/physics/cloth.mjs +2 -17
  108. package/core/src/physics/deformable-query.mjs +2 -17
  109. package/core/src/physics/distance.d.mts +160 -7
  110. package/core/src/physics/feature-api.d.mts +15 -585
  111. package/core/src/physics/feature-api.mjs +3 -0
  112. package/core/src/physics/fracture.mjs +2 -17
  113. package/core/src/physics/gear.d.mts +544 -301
  114. package/core/src/physics/gear.mjs +4 -18
  115. package/core/src/physics/hull-cook.d.mts +23 -0
  116. package/core/src/physics/hull-cook.mjs +39 -0
  117. package/core/src/physics/lag-compensation.mjs +2 -17
  118. package/core/src/physics/mass-properties.d.mts +114 -3
  119. package/core/src/physics/particles.mjs +4 -16
  120. package/core/src/physics/path-joint.mjs +6 -18
  121. package/core/src/physics/physics-extended-wasm-module.generated.mjs +1 -5
  122. package/core/src/physics/physics-profile-wasm-module.generated.mjs +58 -0
  123. package/core/src/physics/physics-profile.wasm +0 -0
  124. package/core/src/physics/physics-wasm-module.generated.mjs +44 -6
  125. package/core/src/physics/physics.wasm +0 -0
  126. package/core/src/physics/powered-ragdoll.mjs +2 -17
  127. package/core/src/physics/powertrain.d.mts +256 -226
  128. package/core/src/physics/powertrain.mjs +2 -15
  129. package/core/src/physics/profile.d.mts +2 -0
  130. package/core/src/physics/profile.mjs +14 -0
  131. package/core/src/physics/pulley.d.mts +92 -349
  132. package/core/src/physics/pulley.mjs +2 -15
  133. package/core/src/physics/ragdoll.mjs +9 -21
  134. package/core/src/physics/rope.d.mts +230 -29
  135. package/core/src/physics/rope.mjs +3 -2
  136. package/core/src/physics/rounded-convex.mjs +2 -17
  137. package/core/src/physics/sdf-geometry.mjs +2 -17
  138. package/core/src/physics/soft-body.mjs +2 -17
  139. package/core/src/physics/soft-collision.mjs +2 -17
  140. package/core/src/physics/surface-velocity.d.mts +194 -196
  141. package/core/src/physics/surface-velocity.mjs +918 -135
  142. package/core/src/physics/tracks.mjs +2 -15
  143. package/core/src/physics/voxel-cooking.d.mts +35 -19
  144. package/core/src/physics/voxel-cooking.mjs +68 -9
  145. package/core/src/physics/voxel-swept-quad.mjs +110 -0
  146. package/core/src/physics/wasm-instance.mjs +166 -37
  147. package/core/src/physics/world.d.mts +190 -0
  148. package/core/src/physics/world.mjs +3384 -331
  149. package/core/src/physics2d/body-state.mjs +45 -5
  150. package/core/src/physics2d/collision.d.mts +13 -11
  151. package/core/src/physics2d/collision.mjs +39 -3
  152. package/core/src/physics2d/compound.mjs +4 -2
  153. package/core/src/physics2d/contour-state.mjs +773 -0
  154. package/core/src/physics2d/feature-api.d.mts +207 -1
  155. package/core/src/physics2d/owned-queries.mjs +3 -1
  156. package/core/src/physics2d/owned-transport.mjs +245 -113
  157. package/core/src/physics2d/owned-world.mjs +202 -62
  158. package/core/src/physics2d/particle-fluid.d.mts +139 -30
  159. package/core/src/physics2d/particle-fluid.mjs +67 -31
  160. package/core/src/physics2d/physics2d-wasm-module.generated.mjs +28 -8
  161. package/core/src/physics2d/physics2d.wasm +0 -0
  162. package/core/src/physics2d/query-codec.mjs +40 -6
  163. package/core/src/physics2d/submerged-geometry.d.mts +35 -16
  164. package/core/src/physics2d/wasm-instance.mjs +9 -13
  165. package/core/src/runtime.mjs +23 -0
  166. package/core/src/shared/bytes.d.mts +2 -0
  167. package/core/src/shared/bytes.mjs +33 -0
  168. package/core/src/shared/sha256.d.mts +3 -0
  169. package/core/src/shared/sha256.mjs +157 -55
  170. package/core/src/shared/wasm-artifact.d.mts +9 -0
  171. package/core/src/shared/wasm-artifact.mjs +185 -0
  172. package/core/units.d.ts +50 -0
  173. package/core/world.d.ts +452 -5
  174. package/dist/api-deprecations.generated.d.ts +24 -0
  175. package/dist/api-deprecations.generated.js +24 -0
  176. package/dist/authority-room.d.ts +249 -3
  177. package/dist/authority-room.js +1607 -77
  178. package/dist/browser.d.ts +11 -6
  179. package/dist/browser.js +6 -4
  180. package/dist/canonical.d.ts +14 -0
  181. package/dist/canonical.js +82 -3
  182. package/dist/checksum-policy.d.ts +10 -0
  183. package/dist/checksum-policy.js +14 -0
  184. package/dist/collider-preparation.d.ts +31 -0
  185. package/dist/collider-preparation.js +507 -0
  186. package/dist/compat/v5.d.ts +5 -1
  187. package/dist/compat/v5.js +52 -9
  188. package/dist/creator.d.ts +10 -6
  189. package/dist/creator.js +5 -3
  190. package/dist/dev-authority-room.js +17 -40
  191. package/dist/engine-runtime.js +5 -8
  192. package/dist/extensions/hub/airlock.d.ts +153 -0
  193. package/dist/extensions/hub/airlock.js +500 -0
  194. package/dist/extensions/hub/contracts.d.ts +369 -0
  195. package/dist/extensions/hub/contracts.js +106 -0
  196. package/dist/extensions/hub/exfil.d.ts +54 -0
  197. package/dist/extensions/hub/exfil.js +110 -0
  198. package/dist/extensions/hub/handoff.d.ts +84 -0
  199. package/dist/extensions/hub/handoff.js +161 -0
  200. package/dist/extensions/hub/index.d.ts +12 -0
  201. package/dist/extensions/hub/index.js +12 -0
  202. package/dist/extensions/hub/inventory.d.ts +86 -0
  203. package/dist/extensions/hub/inventory.js +288 -0
  204. package/dist/extensions/hub/party.d.ts +43 -0
  205. package/dist/extensions/hub/party.js +58 -0
  206. package/dist/extensions/hub/plugin.d.ts +23 -0
  207. package/dist/extensions/hub/plugin.js +37 -0
  208. package/dist/extensions/hub/settlement.d.ts +42 -0
  209. package/dist/extensions/hub/settlement.js +121 -0
  210. package/dist/game-byte-section.d.ts +36 -0
  211. package/dist/game-byte-section.js +350 -0
  212. package/dist/index.d.ts +25 -12
  213. package/dist/index.js +21 -7
  214. package/dist/input-authority.d.ts +33 -1
  215. package/dist/input-authority.js +291 -30
  216. package/dist/instant-replay.d.ts +27 -2
  217. package/dist/instant-replay.js +91 -16
  218. package/dist/lag-compensation3d.js +81 -24
  219. package/dist/match-log.d.ts +41 -5
  220. package/dist/match-log.js +95 -9
  221. package/dist/math.d.ts +23 -1
  222. package/dist/math.js +120 -0
  223. package/dist/modules/character-3d.d.ts +16 -1
  224. package/dist/modules/character-3d.js +42 -5
  225. package/dist/modules/combat.js +6 -5
  226. package/dist/modules/extraction.d.ts +148 -0
  227. package/dist/modules/extraction.js +345 -0
  228. package/dist/modules/physical-assembly.d.ts +154 -0
  229. package/dist/modules/physical-assembly.js +897 -0
  230. package/dist/modules/rts.js +13 -2
  231. package/dist/movement3d-common.d.ts +57 -0
  232. package/dist/movement3d-common.js +218 -0
  233. package/dist/movement3d-revision1.d.ts +2 -0
  234. package/dist/movement3d-revision1.js +973 -0
  235. package/dist/movement3d-revision3.d.ts +2 -0
  236. package/dist/movement3d-revision3.js +844 -0
  237. package/dist/movement3d.d.ts +106 -3
  238. package/dist/movement3d.js +1305 -484
  239. package/dist/navmesh.d.ts +32 -0
  240. package/dist/navmesh.js +238 -0
  241. package/dist/networked-client.d.ts +93 -1
  242. package/dist/networked-client.js +1019 -195
  243. package/dist/node.d.ts +4 -2
  244. package/dist/node.js +3 -1
  245. package/dist/noise.d.ts +9 -0
  246. package/dist/noise.js +82 -0
  247. package/dist/ownership-audit.d.ts +25 -0
  248. package/dist/ownership-audit.js +103 -0
  249. package/dist/periodic-domain.d.ts +10 -0
  250. package/dist/periodic-domain.js +13 -0
  251. package/dist/physics/2d.d.ts +19 -4
  252. package/dist/physics/2d.js +31 -6
  253. package/dist/physics/3d/assembly-bridge.d.ts +19 -0
  254. package/dist/physics/3d/assembly-bridge.js +238 -0
  255. package/dist/physics/3d/profile.d.ts +2 -0
  256. package/dist/physics/3d/profile.js +2 -0
  257. package/dist/physics/3d.d.ts +2110 -283
  258. package/dist/physics/3d.js +10210 -517
  259. package/dist/physics/body-forces3d.d.ts +69 -0
  260. package/dist/physics/body-forces3d.js +396 -0
  261. package/dist/physics/contact-materials3d.d.ts +435 -0
  262. package/dist/physics/contact-materials3d.js +776 -0
  263. package/dist/physics/debug-overlay3d.d.ts +117 -0
  264. package/dist/physics/debug-overlay3d.js +563 -0
  265. package/dist/physics/edit-result-graph.d.ts +36 -0
  266. package/dist/physics/edit-result-graph.js +141 -0
  267. package/dist/physics/game-codec3d.d.ts +41 -0
  268. package/dist/physics/game-codec3d.js +544 -0
  269. package/dist/physics/hot-path-stats3d.d.ts +8 -0
  270. package/dist/physics/hot-path-stats3d.js +3 -0
  271. package/dist/physics/installed-checkpoint3d.d.ts +13 -0
  272. package/dist/physics/installed-checkpoint3d.js +120 -0
  273. package/dist/physics/installed-runtime3d.d.ts +56 -0
  274. package/dist/physics/installed-runtime3d.js +394 -0
  275. package/dist/physics/installed-state-commitment3d.d.ts +2 -0
  276. package/dist/physics/installed-state-commitment3d.js +24 -0
  277. package/dist/physics/portal-far-rows3d.d.ts +31 -0
  278. package/dist/physics/portal-far-rows3d.js +134 -0
  279. package/dist/physics/portal-render3d.d.ts +328 -0
  280. package/dist/physics/portal-render3d.js +751 -0
  281. package/dist/physics/shape-mass3d.d.ts +134 -0
  282. package/dist/physics/shape-mass3d.js +527 -0
  283. package/dist/physics/units.d.ts +103 -0
  284. package/dist/physics/units.js +142 -0
  285. package/dist/physics/vehicle-state2d.d.ts +104 -0
  286. package/dist/physics/vehicle-state2d.js +758 -0
  287. package/dist/physics/vehicle-state3d.d.ts +103 -0
  288. package/dist/physics/vehicle-state3d.js +1803 -0
  289. package/dist/physics/voxel-body-state.d.ts +61 -0
  290. package/dist/physics/voxel-body-state.js +410 -0
  291. package/dist/plugins/index.d.ts +27 -0
  292. package/dist/plugins/index.js +114 -0
  293. package/dist/plugins/types.d.ts +34 -0
  294. package/dist/plugins/types.js +5 -0
  295. package/dist/presentation-ik.d.ts +44 -0
  296. package/dist/presentation-ik.js +154 -0
  297. package/dist/r3f-render-adapter.d.ts +37 -1
  298. package/dist/r3f-render-adapter.js +99 -0
  299. package/dist/replay.d.ts +13 -0
  300. package/dist/replay.js +98 -70
  301. package/dist/rooms-config-keys.d.ts +1 -1
  302. package/dist/rooms-config-keys.js +1 -0
  303. package/dist/run-room-transport.d.ts +1 -0
  304. package/dist/run-room-transport.js +20 -1
  305. package/dist/runner.d.ts +49 -1
  306. package/dist/runner.js +508 -90
  307. package/dist/runtime-cleanup.d.ts +54 -0
  308. package/dist/runtime-cleanup.js +266 -0
  309. package/dist/runtime-lease.d.ts +11 -1
  310. package/dist/runtime-lease.js +23 -10
  311. package/dist/runtime-room-metadata.d.ts +5 -8
  312. package/dist/runtime-room-metadata.js +10 -15
  313. package/dist/runtime-session.d.ts +49 -3
  314. package/dist/runtime-session.js +324 -64
  315. package/dist/schema-codegen.js +3 -0
  316. package/dist/schema-dsl-binary.d.ts +10 -4
  317. package/dist/schema-dsl-binary.js +375 -76
  318. package/dist/sdk-session.d.ts +7 -1
  319. package/dist/sdk-session.js +13 -1
  320. package/dist/seat-control.d.ts +148 -0
  321. package/dist/seat-control.js +543 -0
  322. package/dist/secret-authority.d.ts +19 -4
  323. package/dist/secret-authority.js +290 -36
  324. package/dist/secret-client.d.ts +2 -1
  325. package/dist/secret-client.js +73 -26
  326. package/dist/secret-config.d.ts +1 -1
  327. package/dist/secret-config.js +40 -93
  328. package/dist/secret-crypto.js +70 -36
  329. package/dist/secret-protocol.d.ts +3 -0
  330. package/dist/secret-protocol.js +14 -7
  331. package/dist/session-promotion.d.ts +19 -1
  332. package/dist/session-promotion.js +37 -6
  333. package/dist/session-snapshot.d.ts +19 -4
  334. package/dist/session-snapshot.js +75 -45
  335. package/dist/session-wire.d.ts +33 -1
  336. package/dist/session-wire.js +143 -36
  337. package/dist/sorted-free-id.d.ts +1 -0
  338. package/dist/sorted-free-id.js +38 -0
  339. package/dist/spatial/spatial-grid-3d.d.ts +5 -1
  340. package/dist/spatial/spatial-grid-3d.js +105 -3
  341. package/dist/synctest.d.ts +9 -0
  342. package/dist/synctest.js +106 -17
  343. package/dist/testing-network.d.ts +2 -0
  344. package/dist/testing-network.js +123 -19
  345. package/dist/testing.d.ts +27 -6
  346. package/dist/testing.js +297 -56
  347. package/dist/tools/index.d.ts +3 -2
  348. package/dist/tools/index.js +3 -2
  349. package/dist/tools/module-certification.d.ts +6 -0
  350. package/dist/tools/module-certification.js +27 -2
  351. package/dist/tools/static-checker.js +9 -2
  352. package/dist/tools/vite-plugin.d.ts +12 -0
  353. package/dist/tools/vite-plugin.js +17 -1
  354. package/dist/types.d.ts +14 -0
  355. package/extensions/hub/package.json +1 -0
  356. package/hub/package.json +1 -0
  357. package/package.json +87 -8
  358. package/plugins/package.json +1 -0
package/README.md CHANGED
@@ -6,6 +6,68 @@ and `/physics/3d`. Both physics APIs use the canonical C++ core compiled to
6
6
  WASM. Syncplay owns inputs, prediction, confirmation, rollback policy, replay
7
7
  logs, late join, secrets, and transport.
8
8
 
9
+ ## Periodic math and presentation
10
+
11
+ The root entry provides periodic fixed math, value noise, fBm, render helpers,
12
+ and an optional periodic xz point grid. `createPhysicsWorld3D({ periodicDomain })`
13
+ adds periodic raycasts, overlaps, and shape casts with an `image` on each hit.
14
+ The domain is flat. These utilities do not add globe curvature or contact
15
+ across a seam. Every peer of a periodic world needs the same domain and native
16
+ world ABI 19. Read the [periodic-space guide](docs/periodic-space.md) for units,
17
+ limits, and examples.
18
+
19
+ ## Physics profiling
20
+
21
+ Normal physics initialization loads the production WASM artifact. Game builds
22
+ that use the normal entries do not include the named profiling artifact.
23
+
24
+ Profiling is an explicit build option. Register its loader before initialization:
25
+
26
+ ```ts
27
+ import { initPhysics3D } from '@series-inc/rundot-syncplay/physics/3d';
28
+ import { registerPhysicsProfileArtifact } from '@series-inc/rundot-syncplay/physics/3d/profile';
29
+
30
+ registerPhysicsProfileArtifact();
31
+ await initPhysics3D({ artifact: 'profile' });
32
+ ```
33
+
34
+ Migration: existing calls with `artifact: 'profile'` need the new import and
35
+ registration call. Registration is idempotent. Importing the entry alone does
36
+ not register the loader. Registration does not select or initialize an artifact.
37
+ The same registration works before low-level core initialization. It cannot
38
+ switch an initialized production instance to profiling.
39
+
40
+ The profiling entry keeps the named WASM file in the game build. Keep it out of
41
+ release imports to exclude that file. The npm package still includes both
42
+ artifacts. Profiling uses the same simulation source and digest rules.
43
+
44
+ ## Physics WASM files
45
+
46
+ Each artifact ships as a binary file beside its generated metadata module:
47
+ `core/src/physics/physics.wasm`, `core/src/physics/physics-profile.wasm`, and
48
+ `core/src/physics2d/physics2d.wasm`. The loader resolves the file with
49
+ `new URL('./<name>.wasm', import.meta.url)`, reads it (Node reads the file,
50
+ browsers and workers fetch it), and verifies it before use: the WASM magic
51
+ number, SHA-256 equal to `wasmSha256` in the metadata, and an empty import list.
52
+ Any mismatch stops initialization with a `KINETIX_WASM_*` error. There is no
53
+ base64 copy in JavaScript and no fallback.
54
+
55
+ Vite builds copy the file. Vite dev needs
56
+ `optimizeDeps.exclude: ['@series-inc/rundot-syncplay']`, which
57
+ `rundotSyncplayPlugin()` adds. Other bundlers must copy the referenced `.wasm`
58
+ files beside the output chunks. In a browser, synchronous physics calls need an
59
+ earlier `await initPhysics3D()`; Node can load synchronously.
60
+
61
+ ## Dynamic seat control & player-keyed secrets
62
+
63
+ Syncplay supports deterministic dynamic seating across any valid simulation capacity X via `deterministic.seatPolicy`:
64
+ - Transitions S1 through S6 govern empty, bot, and human controller states.
65
+ - Policy fields include `recycleVacatedSeats`, `allowHumanClaimBot` (enabling human takeover of bot seats for S3), `onHumanLeave` (`'empty' | 'bot'`), and `initialBotSlots`. Retained owners can always reclaim their own seats without `allowHumanClaimBot`.
66
+ - Controller leases are authority-issued and room-scoped (`claimId`, `botLeaseId`, `controlEpoch`).
67
+ - Private secret holdings (cards, items, secret roles, and choices) are strictly bound to authenticated `playerId` and `claimId`.
68
+ - Unconsumed holdings are permanently revoked when a human releases a recyclable seat (`recycleVacatedSeats: true`).
69
+ - A successor player occupying a vacated seat never inherits prior items, secret values, or roles.
70
+
9
71
  ## Installation
10
72
 
11
73
  Install the RUN SDK and Syncplay in the game project. Syncplay uses the
@@ -450,7 +512,7 @@ frame, and disagreeing checksums.
450
512
 
451
513
  ## Physics API v1
452
514
 
453
- Syncplay RC1 has one public TypeScript API for each physics dimension. Import
515
+ Syncplay has one public TypeScript API for each physics dimension. Import
454
516
  2D physics from `@series-inc/rundot-syncplay/physics/2d`. Import 3D physics from
455
517
  `@series-inc/rundot-syncplay/physics/3d`. Do not import a raw physics adapter
456
518
  from `/core`.
@@ -459,6 +521,44 @@ Call `initPhysics2D()` or `initPhysics3D()` before world creation. Create an
459
521
  owned world with `createPhysicsWorld2D()` or `createPhysicsWorld3D()`. Each
460
522
  world provides fixed stepping, atomic edits, retained queries, opaque native
461
523
  checkpoints, portable checkpoint bytes, a state digest, and explicit disposal.
524
+ The 2D engine supports circle, box, capsule, polygon, segment, chain, piecewise
525
+ contour loops, and circular quadrant arcs with the free-side collision rule and
526
+ strict deterministic query tie-ordering.
527
+
528
+ Store logical body IDs in checkpointed game state. A hit has `bodyId`. A
529
+ contact has `bodyA` and `bodyB`. Keep an application `Map` from these `bigint`
530
+ IDs to entities. Each contact then uses `entities.get(contact.bodyA)` and
531
+ `entities.get(contact.bodyB)`. It requires no body-name scan.
532
+
533
+ Resolve a fresh handle with `world.resolveBody(id)` after a restore. Old
534
+ handles are stale. Transfer IDs as decimal strings if the game codec does not
535
+ support `bigint`. Convert them with `BigInt(text)`, never `Number(text)`.
536
+ Rebuild the lookup from the restored game state before processing contacts.
537
+ Physics checkpoints do not contain the application's entity table. Transfer
538
+ and restore both parts of the same frame.
539
+
540
+ ### Grab servo revision 2
541
+
542
+ Set `behaviorRevision: 2` to use gravity compensation, target velocity,
543
+ angular damping, and the corrected local anchor. Revision 2 rotates the local
544
+ anchor with the body orientation. Existing calls use revision 1.
545
+
546
+ Use `createGrabServoState3D()` and `stepGrabServo3D()` for explicit game state.
547
+ Store the returned state with the physics checkpoint. The object wrapper
548
+ provides `capture()` and `restore()` for the same state. Restore both parts of
549
+ the same frame. The servo resolves the body ID after a physics restore.
550
+
551
+ Force and acceleration limits apply to the total force in revision 2.
552
+ This includes gravity compensation. Torque limits apply to total torque.
553
+ One scale applies to all three components. A limit can reduce compensation,
554
+ so the body can fall. The default force limit is 1000 N. A 150 kg body under
555
+ 9.81 m/s² gravity requires more than this limit to hold its position.
556
+ Choose limits for the body's mass and gravity. A binding limit cannot promise
557
+ position holding. Revision 1 keeps its earlier acceleration-limit rule.
558
+
559
+ Include the helper revision in canonical session configuration and the game
560
+ deterministic version. Store targets, tuning, force limits, release state,
561
+ and body IDs in checkpointed game state.
462
562
 
463
563
  The TypeScript facade does not contain a second solver. Both dimensions run in
464
564
  the canonical C++ core compiled to WASM. The internal solver algorithm, state
@@ -466,12 +566,117 @@ layout, WASM boundary, schedule, and checkpoint representation can change when
466
566
  a complete benchmark proves a faster design. Each replacement must keep the
467
567
  public contract, deterministic results, rollback controls, and bounded memory.
468
568
 
469
- RC1 starts a new physics numeric epoch. Do not load a beta physics checkpoint
470
- or replay into an RC1 world. Change the game deterministic version. Start new
471
- rollback, replay, and late-join history.
569
+ Version 6.0.0-rc.78 uses one Box3D engine for every 3D world and physics ABI 25.
570
+ Do not restore a checkpoint or load a replay from rc.77 or older. Those builds
571
+ use physics ABI 24 or earlier, and the world profile check rejects them. Every
572
+ peer in a match must use rc.78 or later. Change the game deterministic version,
573
+ record golden digests again, and start new rollback, replay, and late-join history.
472
574
 
473
575
  Read the [2D guide](https://github.com/series-ai/venus/blob/develop/packages/sdk-docs/rundot-developer-platform/api/SYNCPLAY-PHYSICS-2D.md),
474
576
  the [3D guide](https://github.com/series-ai/venus/blob/develop/packages/sdk-docs/rundot-developer-platform/api/SYNCPLAY-PHYSICS.md), and
475
577
  the [RC1 migration helper](https://github.com/series-ai/venus/blob/develop/packages/sdk-docs/rundot-developer-platform/api/SYNCPLAY-RC1-MIGRATION.md).
476
578
  Physical-phone performance remains a release gate. Do not infer phone results
477
579
  from desktop measurements.
580
+
581
+ Restore the physics world before you restore a grab servo state. Revision 2 accepts
582
+ an active state whose body was removed in the same tick. Its next step changes
583
+ the state to `released` with reason `body-removed`. That step applies no force.
584
+ `isBroken()` reads the current condition. It does not change the captured state.
585
+
586
+ Revision 1 keeps its body handle until you restore the servo state. A physics
587
+ restore makes the old handle stale. Restore both states before the next step.
588
+
589
+ ### SI types
590
+
591
+ Use the SI constructors for each quantity: `meters()` for positions,
592
+ `kilograms()` for mass, `metersPerSecond()` for linear velocity, and
593
+ `newtons()` for force. Use `perSecond()` for a damping rate. Use
594
+ `frameVelocity()` and `frameGravity()` for frame quantities. Each constructor
595
+ keeps the bits of a finite input. It rejects NaN and infinity. Some body input
596
+ fields accept a plain number as well. The type of each field states which form
597
+ it takes. Revision 1 helper behavior remains selected by default.
598
+
599
+ For the character controller (`stepDeterministicKcc3D`), set `behaviorRevision: 3`
600
+ to recover from contact penetration after a landing.
601
+ This revision includes slope clearance for dynamic supports. It keeps the
602
+ revision 1 result shape and uses required checksums by default. Revision 1
603
+ remains the default. Revision 2 keeps its support state and portal movement.
604
+
605
+ New helper behavior requires an explicit revision selection.
606
+
607
+ ### Shape-preserving body changes
608
+
609
+ Use `world.setBodyTransform(idOrHandle, { position, orientation })` to change a pose.
610
+ Use `meters()` for each position component.
611
+ The world normalizes the quaternion.
612
+ The operation keeps the shape, mass, inertia, logical ID, and velocities.
613
+ An identical normalized pose preserves sleep and the mutation revision.
614
+ A changed pose wakes the affected dynamic joint group.
615
+
616
+ Use `world.setBodyLinearDamping(idOrHandle, damping)` to change linear damping.
617
+ The value is a rate in 1/s, built with `perSecond(value)`. Each substep of length
618
+ `h` multiplies the velocity by `1 / (1 + h × damping)`. The default is 0 (no
619
+ damping). `setBodyAngularDamping` and `setBodyDamping` use the same unit. To
620
+ convert an old per-tick keep fraction k at tick rate R, use (1 / k - 1) * R.
621
+ The operation preserves sleep.
622
+ Use `world.wakeBody(idOrHandle)` to wake a dynamic body without a velocity change.
623
+ Resolve a new handle after a checkpoint restore, or use the logical ID.
624
+
625
+ ### Batch motion output
626
+
627
+ `world.writeBodyMotionInto(poses, velocities, ids, status, teleports?)` returns the body
628
+ count, mutation `revision`, and `restoreEpoch`. The optional `teleports` output is a
629
+ `Uint32Array` of teleport counters, one per body, at least as long as the body count.
630
+ Use `Float64Array` for poses and velocities.
631
+ Use `BigUint64Array` for logical IDs.
632
+ Use `Uint8Array` for status.
633
+ The output orders bodies by ascending logical ID.
634
+
635
+ Each pose has seven values: x, y, z, qx, qy, qz, qw.
636
+ Each velocity has six values: vx, vy, vz, wx, wy, wz.
637
+ Positions use meters.
638
+ Linear velocities use meters per second.
639
+ Angular velocities use radians per second.
640
+ Quaternion components have no unit.
641
+
642
+ Status bits 0 and 1 contain the body kind: static 0, dynamic 1, or kinematic 2.
643
+ Bit 2 means trigger.
644
+ Bit 3 means sensor.
645
+ Bit 4 means sleeping.
646
+ Bit 5 means angular motion is enabled.
647
+ The operation checks all buffers before it writes a value.
648
+ It preserves the unused output suffix.
649
+
650
+
651
+ Engine RPM values use `turnsPerMinute(value)`.
652
+ The powertrain reverse-gear check takes `metersPerSecond(value)`.
653
+ These constructors preserve finite values and reject NaN and infinity.
654
+
655
+ The 2D particle emitter preserves a supplied particle ID.
656
+ An omitted ID or zero requests the next automatic ID.
657
+ A supplied ID must be unique and from 1 through 4294967294.
658
+ Particle records stay in increasing ID order.
659
+
660
+ `createVoxelBody3D` creates a native body and immutable voxel state.
661
+ Store the returned state in the captured game state.
662
+ `carveVoxelBody3D` stages a cut and publishes one body edit after cooking succeeds.
663
+ Use its returned state for the next cut.
664
+ `paintVoxelBody3D` changes material IDs and keeps the same collision children.
665
+ `hydrateVoxelBodyState3D` checks the stored partition against the restored native body.
666
+ It does not replace that partition with a full cook.
667
+
668
+ Body-level sphere, capsule, and swept-quad regions use body-local meters.
669
+ Box regions use integer cell indices.
670
+ The body API accounts for `originOffset` in SI regions.
671
+ Occupancy must contain only zero and one.
672
+ Each occupied cell keeps its initial mass when a cut removes other cells.
673
+ A cut preserves the velocity of retained material when the center of mass changes.
674
+ Locked velocity components stay zero.
675
+
676
+ A removed voxel state keeps only its body ID, format, revision, and removed status.
677
+ Hydration checks that its revision is positive and its body ID is absent.
678
+ This absence check does not prove which world first allocated the removed ID.
679
+
680
+ `voxelBodyDigest3D(state)` returns the cached SHA-256 content digest. Creation, edits, and hydration compute this digest once per immutable root. Repeated reads do not scan cells or cooked children. The digest includes the body ID, revision, dimensions, occupancy, materials, child IDs and descriptors, next ID, cell mass, origin offset, and child limit. Hydrate a copied or decoded root before you read its digest or use it in carve, paint, or remove. These operations accept only roots registered by this module instance. If two package copies load, hydrate the root in the receiving copy.
681
+
682
+ Pass the current voxel root to each edit. Native validation detects differences in geometry and mass. It cannot detect a stale root that differs only in paint. Keep the returned root in canonical game state. Use that root for each later cut, paint, or removal.