@series-inc/rundot-syncplay 6.0.0-rc.7 → 6.0.0-rc.71

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