@series-inc/rundot-syncplay 6.0.0-rc.2 → 6.0.0-rc.21
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.
- package/README.md +133 -0
- package/core/deterministic-math.d.ts +75 -1
- package/core/native/instance_ledger.hpp +1095 -0
- package/core/native/legacy_checkpoint_ids.hpp +107 -0
- package/core/native/physics/abi.cpp +39 -211
- package/core/native/physics/abi.hpp +2 -6
- package/core/native/physics/articulation.cpp +1434 -0
- package/core/native/physics/articulation.hpp +279 -0
- package/core/native/physics/buoyancy.cpp +1588 -0
- package/core/native/physics/buoyancy.hpp +254 -0
- package/core/native/physics/capsule_triangle.cpp +168 -0
- package/core/native/physics/capsule_triangle.hpp +40 -0
- package/core/native/physics/capsule_triangle_native.inc +291 -0
- package/core/native/physics/certified_sum.hpp +218 -0
- package/core/native/physics/character.cpp +638 -0
- package/core/native/physics/character.hpp +169 -0
- package/core/native/physics/checkpoint_schema.hpp +379 -0
- package/core/native/physics/cloth.cpp +1401 -0
- package/core/native/physics/cloth.hpp +357 -0
- package/core/native/physics/constraint_rows.cpp +363 -2
- package/core/native/physics/constraint_rows.hpp +72 -1
- package/core/native/physics/deformable_query.cpp +1630 -0
- package/core/native/physics/deformable_query.hpp +578 -0
- package/core/native/physics/distance.cpp +1166 -0
- package/core/native/physics/distance.hpp +151 -0
- package/core/native/physics/exact/exact-applied.cpp +101 -0
- package/core/native/physics/exact/exact-applied.hpp +112 -0
- package/core/native/physics/exact/exact-dyadic.cpp +691 -0
- package/core/native/physics/exact/exact-dyadic.hpp +58 -0
- package/core/native/physics/exact/exact-operation.hpp +51 -0
- package/core/native/physics/exact/word-core.hpp +262 -0
- package/core/native/physics/extended_abi.cpp +1242 -0
- package/core/native/physics/extended_abi.hpp +355 -0
- package/core/native/physics/extended_abi_characters.cpp +261 -0
- package/core/native/physics/extended_abi_characters.hpp +434 -0
- package/core/native/physics/extended_abi_core_features.cpp +713 -0
- package/core/native/physics/extended_abi_core_features.hpp +226 -0
- package/core/native/physics/extended_abi_deformables.cpp +448 -0
- package/core/native/physics/extended_abi_deformables.hpp +867 -0
- package/core/native/physics/extended_abi_vehicles.cpp +411 -0
- package/core/native/physics/extended_abi_vehicles.hpp +222 -0
- package/core/native/physics/fracture.cpp +1981 -0
- package/core/native/physics/fracture.hpp +460 -0
- package/core/native/physics/gear.cpp +563 -0
- package/core/native/physics/gear.hpp +158 -0
- package/core/native/physics/geometry_memory.hpp +476 -0
- package/core/native/physics/geometry_store.cpp +547 -0
- package/core/native/physics/geometry_store.hpp +134 -0
- package/core/native/physics/lag_compensation.cpp +1626 -0
- package/core/native/physics/lag_compensation.hpp +405 -0
- package/core/native/physics/mass_properties.cpp +449 -0
- package/core/native/physics/mass_properties.hpp +23 -0
- package/core/native/physics/material_pose.hpp +988 -0
- package/core/native/physics/particles.cpp +1065 -0
- package/core/native/physics/particles.hpp +261 -0
- package/core/native/physics/path_joint.cpp +781 -0
- package/core/native/physics/path_joint.hpp +154 -0
- package/core/native/physics/physics.cpp +13043 -1065
- package/core/native/physics/physics.hpp +184 -8
- package/core/native/physics/planar_deformable.cpp +2433 -0
- package/core/native/physics/planar_deformable.hpp +889 -0
- package/core/native/physics/platformer_2d.cpp +1353 -0
- package/core/native/physics/platformer_2d.hpp +340 -0
- package/core/native/physics/powered_ragdoll.cpp +1100 -0
- package/core/native/physics/powered_ragdoll.hpp +279 -0
- package/core/native/physics/powertrain.cpp +586 -0
- package/core/native/physics/powertrain.hpp +180 -0
- package/core/native/physics/pulley.cpp +311 -0
- package/core/native/physics/pulley.hpp +121 -0
- package/core/native/physics/ragdoll.cpp +586 -0
- package/core/native/physics/ragdoll.hpp +221 -0
- package/core/native/physics/rope.cpp +692 -0
- package/core/native/physics/rope.hpp +215 -0
- package/core/native/physics/rounded_convex.cpp +1229 -0
- package/core/native/physics/rounded_convex.hpp +287 -0
- package/core/native/physics/sdf_geometry.cpp +1821 -0
- package/core/native/physics/sdf_geometry.hpp +474 -0
- package/core/native/physics/soft_body.cpp +1449 -0
- package/core/native/physics/soft_body.hpp +328 -0
- package/core/native/physics/soft_collision.cpp +1862 -0
- package/core/native/physics/soft_collision.hpp +561 -0
- package/core/native/physics/surface_velocity.cpp +366 -0
- package/core/native/physics/surface_velocity.hpp +243 -0
- package/core/native/physics/topology.cpp +357 -39
- package/core/native/physics/topology.hpp +97 -6
- package/core/native/physics/tracks.cpp +1179 -0
- package/core/native/physics/tracks.hpp +404 -0
- package/core/native/physics/vehicle.cpp +629 -0
- package/core/native/physics/vehicle.hpp +191 -0
- package/core/native/physics/voxel_cooking.cpp +1929 -0
- package/core/native/physics/voxel_cooking.hpp +395 -0
- package/core/native/physics/world.cpp +5290 -854
- package/core/native/physics/world.hpp +796 -24
- package/core/native/physics/world_abi.cpp +3840 -306
- package/core/native/physics/world_abi.hpp +530 -10
- package/core/native/physics/world_digest_visitor.hpp +277 -0
- package/core/native/physics/world_strong_digest.hpp +557 -0
- package/core/native/physics2d/ccd.cpp +1302 -0
- package/core/native/physics2d/ccd.hpp +141 -0
- package/core/native/physics2d/checkpoint_memory.hpp +349 -0
- package/core/native/physics2d/clock_primitives.hpp +138 -0
- package/core/native/physics2d/commands.cpp +174 -28
- package/core/native/physics2d/commands.hpp +3 -1
- package/core/native/physics2d/compound.cpp +581 -0
- package/core/native/physics2d/compound.hpp +248 -0
- package/core/native/physics2d/contour.cpp +325 -0
- package/core/native/physics2d/contour.hpp +143 -0
- package/core/native/physics2d/frame_scope.hpp +124 -0
- package/core/native/physics2d/joint_phases.hpp +93 -0
- package/core/native/physics2d/joints.cpp +587 -150
- package/core/native/physics2d/joints.hpp +5 -0
- package/core/native/physics2d/memory_private.hpp +125 -0
- package/core/native/physics2d/owned_abi.cpp +1354 -879
- package/core/native/physics2d/owned_abi.hpp +190 -52
- package/core/native/physics2d/phase_test_hooks.hpp +17 -0
- package/core/native/physics2d/physics2d.cpp +2073 -120
- package/core/native/physics2d/physics2d.hpp +154 -2
- package/core/native/physics2d/queries.cpp +1055 -79
- package/core/native/physics2d/queries.hpp +71 -5
- package/core/native/physics2d/world.cpp +1313 -353
- package/core/native/physics2d/world.hpp +124 -13
- package/core/native/sha256/sha256_compress_unsigned.hpp +68 -0
- package/core/native/sha256/sha256_fips_constants.hpp +24 -0
- package/core/native/sha256/sha256_length.hpp +56 -0
- package/core/native/sha256/sha256_memo.hpp +48 -0
- package/core/native/sha256/sha256_sink.hpp +234 -0
- package/core/physics2d-owned.d.ts +466 -126
- package/core/runtime.d.ts +192 -19
- package/core/scripts/build-native.mjs +34 -0
- package/core/scripts/build-wasm-physics.mjs +272 -23
- package/core/scripts/extended-physics-profile.mjs +634 -0
- package/core/scripts/generate-physics2d-vectors.mjs +59 -0
- package/core/src/kinetix-deterministic-math.d.ts +2 -0
- package/core/src/kinetix-deterministic-math.mjs +513 -27
- package/core/src/kinetix-owned-runtime-adapter.mjs +788 -0
- package/core/src/kinetix-runtime-adapter-utils.mjs +54 -6
- package/core/src/kinetix-runtime-contract.mjs +55 -9
- package/core/src/kinetix-runtime-identity.mjs +12 -1
- package/core/src/kinetix-session-config.mjs +7 -2
- package/core/src/kinetix-state-report.mjs +36 -0
- package/core/src/physics/abi-constants.mjs +5 -4
- package/core/src/physics/articulation.d.mts +194 -0
- package/core/src/physics/articulation.mjs +1141 -0
- package/core/src/physics/buoyancy.d.mts +143 -0
- package/core/src/physics/buoyancy.mjs +268 -0
- package/core/src/physics/cloth.d.mts +314 -0
- package/core/src/physics/cloth.mjs +1156 -0
- package/core/src/physics/deformable-query.d.mts +217 -0
- package/core/src/physics/deformable-query.mjs +1412 -0
- package/core/src/physics/distance.d.mts +160 -0
- package/core/src/physics/distance.mjs +175 -0
- package/core/src/physics/extended-wasm-instance.d.mts +5 -0
- package/core/src/physics/extended-wasm-instance.mjs +48 -0
- package/core/src/physics/feature-api.d.mts +74 -0
- package/core/src/physics/feature-api.mjs +98 -0
- package/core/src/physics/fracture.d.mts +133 -0
- package/core/src/physics/fracture.mjs +1324 -0
- package/core/src/physics/gear.d.mts +585 -0
- package/core/src/physics/gear.mjs +955 -0
- package/core/src/physics/lag-compensation.d.mts +101 -0
- package/core/src/physics/lag-compensation.mjs +1100 -0
- package/core/src/physics/mass-properties.d.mts +114 -0
- package/core/src/physics/mass-properties.mjs +137 -468
- package/core/src/physics/particles.d.mts +177 -0
- package/core/src/physics/particles.mjs +758 -0
- package/core/src/physics/path-joint.d.mts +171 -0
- package/core/src/physics/path-joint.mjs +1231 -0
- package/core/src/physics/physics-extended-wasm-module.generated.mjs +13 -0
- package/core/src/physics/physics-profile-wasm-module.generated.mjs +48 -0
- package/core/src/physics/physics-wasm-module.generated.mjs +34 -5
- package/core/src/physics/powered-ragdoll.d.mts +188 -0
- package/core/src/physics/powered-ragdoll.mjs +1043 -0
- package/core/src/physics/powertrain.d.mts +260 -0
- package/core/src/physics/powertrain.mjs +621 -0
- package/core/src/physics/pulley.d.mts +98 -0
- package/core/src/physics/pulley.mjs +686 -0
- package/core/src/physics/ragdoll.d.mts +289 -0
- package/core/src/physics/ragdoll.mjs +1323 -0
- package/core/src/physics/rope.d.mts +241 -0
- package/core/src/physics/rope.mjs +319 -0
- package/core/src/physics/rounded-convex.d.mts +328 -0
- package/core/src/physics/rounded-convex.mjs +1404 -0
- package/core/src/physics/sdf-geometry.d.mts +117 -0
- package/core/src/physics/sdf-geometry.mjs +1204 -0
- package/core/src/physics/soft-body.d.mts +144 -0
- package/core/src/physics/soft-body.mjs +1285 -0
- package/core/src/physics/soft-collision.d.mts +651 -0
- package/core/src/physics/soft-collision.mjs +1883 -0
- package/core/src/physics/surface-velocity.d.mts +156 -0
- package/core/src/physics/surface-velocity.mjs +722 -0
- package/core/src/physics/tracks.d.mts +411 -0
- package/core/src/physics/tracks.mjs +1074 -0
- package/core/src/physics/vehicle.d.mts +3 -0
- package/core/src/physics/vehicle.mjs +172 -0
- package/core/src/physics/voxel-cooking.d.mts +219 -0
- package/core/src/physics/voxel-cooking.mjs +1499 -0
- package/core/src/physics/voxel-swept-quad.mjs +110 -0
- package/core/src/physics/wasm-instance.mjs +160 -23
- package/core/src/physics/world.d.mts +62 -0
- package/core/src/physics/world.mjs +1947 -152
- package/core/src/physics2d/body-state.mjs +218 -15
- package/core/src/physics2d/collision.d.mts +52 -0
- package/core/src/physics2d/collision.mjs +234 -0
- package/core/src/physics2d/compound.mjs +454 -0
- package/core/src/physics2d/contour-state.mjs +771 -0
- package/core/src/physics2d/feature-api.d.mts +211 -0
- package/core/src/physics2d/feature-api.mjs +3 -0
- package/core/src/physics2d/fluid-state.mjs +145 -0
- package/core/src/physics2d/joint-state.mjs +1 -1
- package/core/src/physics2d/owned-queries.mjs +3 -1
- package/core/src/physics2d/owned-transport.mjs +268 -122
- package/core/src/physics2d/owned-world.mjs +353 -230
- package/core/src/physics2d/particle-fluid.d.mts +152 -0
- package/core/src/physics2d/particle-fluid.mjs +233 -0
- package/core/src/physics2d/physics2d-wasm-module.generated.mjs +27 -10
- package/core/src/physics2d/query-codec.mjs +61 -13
- package/core/src/physics2d/submerged-geometry.d.mts +51 -0
- package/core/src/physics2d/submerged-geometry.mjs +186 -0
- package/core/src/runtime.mjs +23 -0
- package/core/src/shared/bytes.d.mts +2 -0
- package/core/src/shared/bytes.mjs +33 -0
- package/core/src/shared/sha256.d.mts +3 -0
- package/core/src/shared/sha256.mjs +72 -22
- package/core/units.d.ts +50 -0
- package/core/world.d.ts +253 -5
- package/dist/authority-room.d.ts +9 -0
- package/dist/authority-room.js +45 -16
- package/dist/browser.d.ts +6 -5
- package/dist/browser.js +4 -3
- package/dist/cadence.d.ts +7 -0
- package/dist/cadence.js +19 -0
- package/dist/canonical.d.ts +1 -0
- package/dist/canonical.js +3 -0
- package/dist/checksum-policy.d.ts +10 -0
- package/dist/checksum-policy.js +14 -0
- package/dist/collider-cooking-hull.d.ts +18 -0
- package/dist/collider-cooking-hull.js +248 -0
- package/dist/collider-cooking.d.ts +140 -0
- package/dist/collider-cooking.js +794 -0
- package/dist/compat/v5.d.ts +121 -0
- package/dist/compat/v5.js +479 -0
- package/dist/creator.d.ts +7 -6
- package/dist/creator.js +4 -3
- package/dist/game-byte-section.d.ts +36 -0
- package/dist/game-byte-section.js +350 -0
- package/dist/index.d.ts +13 -6
- package/dist/index.js +9 -4
- package/dist/instant-replay.d.ts +27 -2
- package/dist/instant-replay.js +91 -16
- package/dist/lag-compensation3d.js +11 -10
- package/dist/match-log.d.ts +21 -4
- package/dist/match-log.js +92 -9
- package/dist/math.d.ts +2 -0
- package/dist/math.js +1 -0
- package/dist/modules/character-3d.d.ts +16 -1
- package/dist/modules/character-3d.js +42 -5
- package/dist/modules/combat.js +6 -5
- package/dist/movement3d-revision1.d.ts +2 -0
- package/dist/movement3d-revision1.js +973 -0
- package/dist/movement3d.d.ts +53 -3
- package/dist/movement3d.js +917 -247
- package/dist/networked-client.d.ts +15 -0
- package/dist/networked-client.js +378 -105
- package/dist/node.d.ts +3 -2
- package/dist/node.js +2 -1
- package/dist/physics/2d.d.ts +38 -4
- package/dist/physics/2d.js +57 -36
- package/dist/physics/3d.d.ts +755 -111
- package/dist/physics/3d.js +2355 -158
- package/dist/physics/edit-result-graph.d.ts +36 -0
- package/dist/physics/edit-result-graph.js +141 -0
- package/dist/physics/game-codec3d.d.ts +41 -0
- package/dist/physics/game-codec3d.js +544 -0
- package/dist/physics/installed-checkpoint3d.d.ts +13 -0
- package/dist/physics/installed-checkpoint3d.js +120 -0
- package/dist/physics/installed-runtime3d.d.ts +51 -0
- package/dist/physics/installed-runtime3d.js +372 -0
- package/dist/physics/installed-state-commitment3d.d.ts +2 -0
- package/dist/physics/installed-state-commitment3d.js +24 -0
- package/dist/physics/units.d.ts +38 -0
- package/dist/physics/units.js +56 -0
- package/dist/physics/vehicle-state3d.d.ts +93 -0
- package/dist/physics/vehicle-state3d.js +1191 -0
- package/dist/physics/voxel-body-state.d.ts +61 -0
- package/dist/physics/voxel-body-state.js +410 -0
- package/dist/r3f-render-adapter.d.ts +59 -1
- package/dist/r3f-render-adapter.js +137 -2
- package/dist/replay.d.ts +13 -0
- package/dist/replay.js +95 -70
- package/dist/run-room-transport.js +5 -1
- package/dist/runner.d.ts +17 -2
- package/dist/runner.js +472 -84
- package/dist/runtime-cleanup.d.ts +54 -0
- package/dist/runtime-cleanup.js +266 -0
- package/dist/runtime-lease.d.ts +11 -1
- package/dist/runtime-lease.js +23 -10
- package/dist/runtime-room-metadata.d.ts +2 -8
- package/dist/runtime-room-metadata.js +11 -14
- package/dist/runtime-session.d.ts +8 -0
- package/dist/runtime-session.js +222 -58
- package/dist/schema-codegen.js +3 -0
- package/dist/schema-dsl-binary.d.ts +10 -4
- package/dist/schema-dsl-binary.js +375 -76
- package/dist/scratch-pool.d.ts +32 -0
- package/dist/scratch-pool.js +60 -0
- package/dist/sdk-session.d.ts +1 -0
- package/dist/sdk-session.js +4 -0
- package/dist/secret-config.js +2 -60
- package/dist/secret-crypto.js +70 -36
- package/dist/session-snapshot.d.ts +15 -4
- package/dist/session-snapshot.js +35 -33
- package/dist/session-wire.js +14 -22
- package/dist/sparse-set.d.ts +1 -0
- package/dist/sparse-set.js +22 -0
- package/dist/spatial/spatial-grid-3d.d.ts +41 -0
- package/dist/spatial/spatial-grid-3d.js +115 -0
- package/dist/synctest.d.ts +9 -0
- package/dist/synctest.js +106 -17
- package/dist/testing-network.d.ts +2 -0
- package/dist/testing-network.js +122 -18
- package/dist/testing.d.ts +27 -6
- package/dist/testing.js +297 -56
- package/dist/tools/index.d.ts +3 -2
- package/dist/tools/index.js +3 -2
- package/dist/tools/module-certification.d.ts +6 -0
- package/dist/tools/module-certification.js +26 -2
- package/package.json +18 -5
- package/core/scripts/run-box3d-benchmark.mjs +0 -350
- package/core/src/physics/index.mjs +0 -3169
package/dist/testing.js
CHANGED
|
@@ -1,9 +1,82 @@
|
|
|
1
|
-
export { runSyncplaySynctest } from './synctest.js';
|
|
1
|
+
export { runSyncplaySynctest, runSyncplaySynctestAsync } from './synctest.js';
|
|
2
2
|
export { createSimulatedSyncplayMatch } from './testing-network.js';
|
|
3
3
|
export { assertPresentationParity, assertRunnerLifecycle, createSyncplayRunnerHarness, } from './runner-harness.js';
|
|
4
|
-
import { verifyReplay } from './replay.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { verifyReplay, verifyReplayAsync, } from './replay.js';
|
|
5
|
+
import { finalizeWorkOutcome, SyncplayRuntimeLeaseRequiredError, rejectSyncFactoryProduct, } from './runtime-cleanup.js';
|
|
6
|
+
import { runSyncplaySynctest, runSyncplaySynctestAsync, } from './synctest.js';
|
|
7
|
+
import { createSimulatedSyncplayMatch, } from './testing-network.js';
|
|
8
|
+
function guardSyncNetworkRuntimeFactory(factory, syncToolName, asyncToolName) {
|
|
9
|
+
return (identity, sessionConfigBytes) => {
|
|
10
|
+
const result = factory(identity, sessionConfigBytes);
|
|
11
|
+
rejectSyncFactoryProduct(result, syncToolName, asyncToolName);
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function collectSyncDisposal(clients) {
|
|
16
|
+
const syncErrors = [];
|
|
17
|
+
const jobs = [];
|
|
18
|
+
for (const client of clients) {
|
|
19
|
+
try {
|
|
20
|
+
const disposal = client.dispose();
|
|
21
|
+
if (disposal !== undefined)
|
|
22
|
+
jobs.push(() => disposal);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
syncErrors.push(error);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return { syncErrors, jobs };
|
|
29
|
+
}
|
|
30
|
+
function finishSyncAssertion(outcome, clients, syncToolName, asyncToolName) {
|
|
31
|
+
const { syncErrors, jobs } = collectSyncDisposal(clients);
|
|
32
|
+
if (jobs.length === 0)
|
|
33
|
+
return finalizeWorkOutcome(outcome, syncErrors);
|
|
34
|
+
const carrier = !outcome.ok && outcome.error instanceof SyncplayRuntimeLeaseRequiredError
|
|
35
|
+
? outcome.error
|
|
36
|
+
: new SyncplayRuntimeLeaseRequiredError(syncToolName, asyncToolName, {
|
|
37
|
+
jobs,
|
|
38
|
+
cause: outcome.ok ? undefined : outcome.error,
|
|
39
|
+
});
|
|
40
|
+
if (!outcome.ok && carrier === outcome.error) {
|
|
41
|
+
for (const job of jobs)
|
|
42
|
+
carrier.addJob(job);
|
|
43
|
+
}
|
|
44
|
+
if (!outcome.ok && outcome.error !== carrier) {
|
|
45
|
+
return finalizeWorkOutcome(outcome, [carrier, ...syncErrors]);
|
|
46
|
+
}
|
|
47
|
+
return finalizeWorkOutcome(outcome.ok ? { ok: false, caught: true, error: carrier } : outcome, syncErrors);
|
|
48
|
+
}
|
|
49
|
+
async function releaseAttached(error, cleanupErrors) {
|
|
50
|
+
if (error instanceof SyncplayRuntimeLeaseRequiredError) {
|
|
51
|
+
try {
|
|
52
|
+
await error.release();
|
|
53
|
+
}
|
|
54
|
+
catch (caught) {
|
|
55
|
+
cleanupErrors.push(caught);
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (error instanceof AggregateError) {
|
|
60
|
+
for (const inner of error.errors)
|
|
61
|
+
await releaseAttached(inner, cleanupErrors);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function finishAsyncAssertion(outcome, clients) {
|
|
65
|
+
const cleanupErrors = [];
|
|
66
|
+
for (const client of clients) {
|
|
67
|
+
try {
|
|
68
|
+
const disposal = client.dispose();
|
|
69
|
+
if (disposal !== undefined)
|
|
70
|
+
await disposal;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
cleanupErrors.push(error);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (!outcome.ok)
|
|
77
|
+
await releaseAttached(outcome.error, cleanupErrors);
|
|
78
|
+
return finalizeWorkOutcome(outcome, cleanupErrors);
|
|
79
|
+
}
|
|
7
80
|
function fail(phase, frame, expected, actual) {
|
|
8
81
|
throw new Error(`SYNCPLAY_TEST_ASSERTION phase=${phase} frame=${frame} expected=${expected} actual=${actual}`);
|
|
9
82
|
}
|
|
@@ -16,6 +89,15 @@ export function assertDeterministic(config) {
|
|
|
16
89
|
}
|
|
17
90
|
return result;
|
|
18
91
|
}
|
|
92
|
+
export async function assertDeterministicAsync(config) {
|
|
93
|
+
const result = await runSyncplaySynctestAsync(config);
|
|
94
|
+
if (!result.ok) {
|
|
95
|
+
if (result.firstDivergence === undefined)
|
|
96
|
+
fail('synctest', -1, 'ok', 'false-without-coordinate');
|
|
97
|
+
fail(result.firstDivergence.phase, result.firstDivergence.frame, result.firstDivergence.straightChecksum, result.firstDivergence.rollbackChecksum);
|
|
98
|
+
}
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
19
101
|
export function assertReplayVerifies(config) {
|
|
20
102
|
const result = verifyReplay({ ...config, throwOnMismatch: false });
|
|
21
103
|
if (result.firstMismatch !== undefined) {
|
|
@@ -23,26 +105,87 @@ export function assertReplayVerifies(config) {
|
|
|
23
105
|
}
|
|
24
106
|
return result;
|
|
25
107
|
}
|
|
108
|
+
export async function assertReplayVerifiesAsync(config) {
|
|
109
|
+
const result = await verifyReplayAsync({ ...config, throwOnMismatch: false });
|
|
110
|
+
if (result.firstMismatch !== undefined) {
|
|
111
|
+
fail('replay', result.firstMismatch.frame, result.firstMismatch.expectedChecksum, result.firstMismatch.actualChecksum);
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
26
115
|
export function assertTwoClientConvergence(config) {
|
|
27
116
|
if (config.roomConfig.playerCount < 2)
|
|
28
117
|
throw new Error('SYNCPLAY_TEST_CONFIG_INVALID');
|
|
29
118
|
const match = createSimulatedSyncplayMatch({ roomConfig: config.roomConfig, networkSeed: config.networkSeed });
|
|
30
|
-
const peers = [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
119
|
+
const peers = [];
|
|
120
|
+
let outcome;
|
|
121
|
+
try {
|
|
122
|
+
for (let index = 0; index < 2; index += 1) {
|
|
123
|
+
const opts = config.clientOptions(index);
|
|
124
|
+
const guardedOptions = {
|
|
125
|
+
...opts,
|
|
126
|
+
runtimeFactory: guardSyncNetworkRuntimeFactory(opts.runtimeFactory, 'assertTwoClientConvergence', 'assertTwoClientConvergenceAsync'),
|
|
127
|
+
};
|
|
128
|
+
peers.push(match.connect(`client-${index}`, guardedOptions, config.link));
|
|
129
|
+
}
|
|
130
|
+
match.advance(config.steps ?? 120);
|
|
131
|
+
match.settle();
|
|
132
|
+
const appliedThrough = Math.min(...peers.map((peer) => peer.client.appliedThrough));
|
|
133
|
+
if (appliedThrough < 0)
|
|
134
|
+
fail('two-client', appliedThrough, 'confirmed-frame', 'missing');
|
|
135
|
+
const frame = appliedThrough + 1;
|
|
136
|
+
const checksums = peers.map((peer) => peer.client.confirmedStateChecksum(frame));
|
|
137
|
+
if (checksums.some((checksum) => checksum !== checksums[0])) {
|
|
138
|
+
fail('two-client', frame, checksums[0] ?? 'confirmed-frame', checksums[1] ?? 'missing');
|
|
139
|
+
}
|
|
140
|
+
outcome = {
|
|
141
|
+
ok: true,
|
|
142
|
+
caught: false,
|
|
143
|
+
value: Object.freeze({
|
|
144
|
+
frame,
|
|
145
|
+
checksum: checksums[0],
|
|
146
|
+
rollbackCount: peers.reduce((sum, peer) => sum + peer.client.rollbacks, 0),
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
outcome = { ok: false, caught: true, error };
|
|
152
|
+
}
|
|
153
|
+
return finishSyncAssertion(outcome, peers.map((peer) => peer.client), 'assertTwoClientConvergence', 'assertTwoClientConvergenceAsync');
|
|
154
|
+
}
|
|
155
|
+
export async function assertTwoClientConvergenceAsync(config) {
|
|
156
|
+
if (config.roomConfig.playerCount < 2)
|
|
157
|
+
throw new Error('SYNCPLAY_TEST_CONFIG_INVALID');
|
|
158
|
+
const match = createSimulatedSyncplayMatch({ roomConfig: config.roomConfig, networkSeed: config.networkSeed });
|
|
159
|
+
const peers = [];
|
|
160
|
+
let outcome;
|
|
161
|
+
try {
|
|
162
|
+
for (let index = 0; index < 2; index += 1) {
|
|
163
|
+
peers.push(match.connect(`client-${index}`, config.clientOptions(index), config.link));
|
|
164
|
+
}
|
|
165
|
+
await match.advanceAsync(config.steps ?? 120);
|
|
166
|
+
await match.settleAsync();
|
|
167
|
+
const appliedThrough = Math.min(...peers.map((peer) => peer.client.appliedThrough));
|
|
168
|
+
if (appliedThrough < 0)
|
|
169
|
+
fail('two-client', appliedThrough, 'confirmed-frame', 'missing');
|
|
170
|
+
const frame = appliedThrough + 1;
|
|
171
|
+
const checksums = peers.map((peer) => peer.client.confirmedStateChecksum(frame));
|
|
172
|
+
if (checksums.some((checksum) => checksum !== checksums[0])) {
|
|
173
|
+
fail('two-client', frame, checksums[0] ?? 'confirmed-frame', checksums[1] ?? 'missing');
|
|
174
|
+
}
|
|
175
|
+
outcome = {
|
|
176
|
+
ok: true,
|
|
177
|
+
caught: false,
|
|
178
|
+
value: Object.freeze({
|
|
179
|
+
frame,
|
|
180
|
+
checksum: checksums[0],
|
|
181
|
+
rollbackCount: peers.reduce((sum, peer) => sum + peer.client.rollbacks, 0),
|
|
182
|
+
}),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
outcome = { ok: false, caught: true, error };
|
|
187
|
+
}
|
|
188
|
+
return finishAsyncAssertion(outcome, peers.map((peer) => peer.client));
|
|
46
189
|
}
|
|
47
190
|
export function assertLateJoinHydration(config) {
|
|
48
191
|
const initialClientCount = config.initialClientCount ?? Math.max(1, config.roomConfig.playerCount - 1);
|
|
@@ -50,40 +193,138 @@ export function assertLateJoinHydration(config) {
|
|
|
50
193
|
throw new Error('SYNCPLAY_TEST_CONFIG_INVALID');
|
|
51
194
|
}
|
|
52
195
|
const match = createSimulatedSyncplayMatch({ roomConfig: config.roomConfig, networkSeed: config.networkSeed });
|
|
53
|
-
const peers =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
match.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
196
|
+
const peers = [];
|
|
197
|
+
let late;
|
|
198
|
+
let outcome;
|
|
199
|
+
try {
|
|
200
|
+
for (let index = 0; index < initialClientCount; index += 1) {
|
|
201
|
+
const opts = config.clientOptions(index);
|
|
202
|
+
const guardedOptions = {
|
|
203
|
+
...opts,
|
|
204
|
+
runtimeFactory: guardSyncNetworkRuntimeFactory(opts.runtimeFactory, 'assertLateJoinHydration', 'assertLateJoinHydrationAsync'),
|
|
205
|
+
};
|
|
206
|
+
peers.push(match.connect(`client-${index}`, guardedOptions, config.link));
|
|
207
|
+
}
|
|
208
|
+
match.advance(config.beforeJoinSteps ?? 120);
|
|
209
|
+
const storedRoom = match.room.snapshot();
|
|
210
|
+
const storedSnapshot = storedRoom.latestSnapshot;
|
|
211
|
+
if (storedSnapshot === undefined) {
|
|
212
|
+
const diagnostic = storedRoom.lastSnapshotRejection
|
|
213
|
+
? `rejected:${storedRoom.lastSnapshotRejection}`
|
|
214
|
+
: storedRoom.pendingSnapshotTransfer
|
|
215
|
+
? `pending-transfer(donor=${storedRoom.pendingSnapshotTransfer.donorId},elapsed=${storedRoom.pendingSnapshotTransfer.elapsedTicks}ticks)`
|
|
216
|
+
: 'missing';
|
|
217
|
+
fail('late-join-snapshot', match.step, 'stored-snapshot', diagnostic);
|
|
218
|
+
}
|
|
219
|
+
if (storedRoom.earliestRetainedTick !== storedSnapshot.tick) {
|
|
220
|
+
fail('late-join-pruning', storedSnapshot.tick, String(storedSnapshot.tick), String(storedRoom.earliestRetainedTick));
|
|
221
|
+
}
|
|
222
|
+
const lateOpts = config.clientOptions(initialClientCount);
|
|
223
|
+
const guardedLateOptions = {
|
|
224
|
+
...lateOpts,
|
|
225
|
+
runtimeFactory: guardSyncNetworkRuntimeFactory(lateOpts.runtimeFactory, 'assertLateJoinHydration', 'assertLateJoinHydrationAsync'),
|
|
226
|
+
};
|
|
227
|
+
late = match.connect('late-client', guardedLateOptions, config.link);
|
|
228
|
+
const joinBudget = config.afterJoinSteps ?? 60;
|
|
229
|
+
let joinSteps = 0;
|
|
230
|
+
while (late.client.appliedThrough < storedSnapshot.tick && joinSteps < joinBudget) {
|
|
231
|
+
match.advance(1);
|
|
232
|
+
joinSteps += 1;
|
|
233
|
+
}
|
|
234
|
+
const hydratedThrough = late.client.appliedThrough;
|
|
235
|
+
if (hydratedThrough < storedSnapshot.tick) {
|
|
236
|
+
fail('late-join-hydration', hydratedThrough, String(storedSnapshot.tick), String(hydratedThrough));
|
|
237
|
+
}
|
|
238
|
+
match.advance(Math.max(0, joinBudget - joinSteps));
|
|
239
|
+
match.settle();
|
|
240
|
+
const appliedThrough = Math.min(late.client.appliedThrough, ...peers.map((peer) => peer.client.appliedThrough));
|
|
241
|
+
if (appliedThrough < 0)
|
|
242
|
+
fail('late-join', appliedThrough, 'confirmed-frame', 'missing');
|
|
243
|
+
const frame = appliedThrough + 1;
|
|
244
|
+
const expected = peers[0].client.confirmedStateChecksum(frame);
|
|
245
|
+
const actual = late.client.confirmedStateChecksum(frame);
|
|
246
|
+
if (expected !== actual)
|
|
247
|
+
fail('late-join', frame, expected, actual);
|
|
248
|
+
outcome = {
|
|
249
|
+
ok: true,
|
|
250
|
+
caught: false,
|
|
251
|
+
value: Object.freeze({
|
|
252
|
+
frame,
|
|
253
|
+
checksum: actual,
|
|
254
|
+
rollbackCount: late.client.rollbacks,
|
|
255
|
+
hydratedThrough,
|
|
256
|
+
}),
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
outcome = { ok: false, caught: true, error };
|
|
261
|
+
}
|
|
262
|
+
const allClients = [...peers.map((peer) => peer.client), ...(late ? [late.client] : [])];
|
|
263
|
+
return finishSyncAssertion(outcome, allClients, 'assertLateJoinHydration', 'assertLateJoinHydrationAsync');
|
|
264
|
+
}
|
|
265
|
+
export async function assertLateJoinHydrationAsync(config) {
|
|
266
|
+
const initialClientCount = config.initialClientCount ?? Math.max(1, config.roomConfig.playerCount - 1);
|
|
267
|
+
if (initialClientCount < 1 || initialClientCount >= config.roomConfig.playerCount) {
|
|
268
|
+
throw new Error('SYNCPLAY_TEST_CONFIG_INVALID');
|
|
269
|
+
}
|
|
270
|
+
const match = createSimulatedSyncplayMatch({ roomConfig: config.roomConfig, networkSeed: config.networkSeed });
|
|
271
|
+
const peers = [];
|
|
272
|
+
let late;
|
|
273
|
+
let outcome;
|
|
274
|
+
try {
|
|
275
|
+
for (let index = 0; index < initialClientCount; index += 1) {
|
|
276
|
+
peers.push(match.connect(`client-${index}`, config.clientOptions(index), config.link));
|
|
277
|
+
}
|
|
278
|
+
await match.advanceAsync(config.beforeJoinSteps ?? 120);
|
|
279
|
+
const storedRoom = match.room.snapshot();
|
|
280
|
+
const storedSnapshot = storedRoom.latestSnapshot;
|
|
281
|
+
if (storedSnapshot === undefined) {
|
|
282
|
+
const diagnostic = storedRoom.lastSnapshotRejection
|
|
283
|
+
? `rejected:${storedRoom.lastSnapshotRejection}`
|
|
284
|
+
: storedRoom.pendingSnapshotTransfer
|
|
285
|
+
? `pending-transfer(donor=${storedRoom.pendingSnapshotTransfer.donorId},elapsed=${storedRoom.pendingSnapshotTransfer.elapsedTicks}ticks)`
|
|
286
|
+
: 'missing';
|
|
287
|
+
fail('late-join-snapshot', match.step, 'stored-snapshot', diagnostic);
|
|
288
|
+
}
|
|
289
|
+
if (storedRoom.earliestRetainedTick !== storedSnapshot.tick) {
|
|
290
|
+
fail('late-join-pruning', storedSnapshot.tick, String(storedSnapshot.tick), String(storedRoom.earliestRetainedTick));
|
|
291
|
+
}
|
|
292
|
+
late = match.connect('late-client', config.clientOptions(initialClientCount), config.link);
|
|
293
|
+
const joinBudget = config.afterJoinSteps ?? 60;
|
|
294
|
+
let joinSteps = 0;
|
|
295
|
+
while (late.client.appliedThrough < storedSnapshot.tick && joinSteps < joinBudget) {
|
|
296
|
+
await match.advanceAsync(1);
|
|
297
|
+
joinSteps += 1;
|
|
298
|
+
}
|
|
299
|
+
const hydratedThrough = late.client.appliedThrough;
|
|
300
|
+
if (hydratedThrough < storedSnapshot.tick) {
|
|
301
|
+
fail('late-join-hydration', hydratedThrough, String(storedSnapshot.tick), String(hydratedThrough));
|
|
302
|
+
}
|
|
303
|
+
await match.advanceAsync(Math.max(0, joinBudget - joinSteps));
|
|
304
|
+
await match.settleAsync();
|
|
305
|
+
const appliedThrough = Math.min(late.client.appliedThrough, ...peers.map((peer) => peer.client.appliedThrough));
|
|
306
|
+
if (appliedThrough < 0)
|
|
307
|
+
fail('late-join', appliedThrough, 'confirmed-frame', 'missing');
|
|
308
|
+
const frame = appliedThrough + 1;
|
|
309
|
+
const expected = peers[0].client.confirmedStateChecksum(frame);
|
|
310
|
+
const actual = late.client.confirmedStateChecksum(frame);
|
|
311
|
+
if (expected !== actual)
|
|
312
|
+
fail('late-join', frame, expected, actual);
|
|
313
|
+
outcome = {
|
|
314
|
+
ok: true,
|
|
315
|
+
caught: false,
|
|
316
|
+
value: Object.freeze({
|
|
317
|
+
frame,
|
|
318
|
+
checksum: actual,
|
|
319
|
+
rollbackCount: late.client.rollbacks,
|
|
320
|
+
hydratedThrough,
|
|
321
|
+
}),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
outcome = { ok: false, caught: true, error };
|
|
326
|
+
}
|
|
327
|
+
const allClients = [...peers.map((peer) => peer.client), ...(late ? [late.client] : [])];
|
|
328
|
+
return finishAsyncAssertion(outcome, allClients);
|
|
89
329
|
}
|
|
330
|
+
export { SyncplayRuntimeLeaseRequiredError } from './runtime-cleanup.js';
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { checkDeterminism, checkSourceText, collectDeterminismSuppressions, type DeterminismCheckMode, type DeterminismCheckOptions, type DeterminismDiagnostic, type DeterminismParserKind, type DeterminismSeverity, type DeterminismSuppression, } from './static-checker.js';
|
|
2
|
-
export { runSyncplaySynctest, type SyncplaySynctestConfig, type SyncplaySynctestDivergence, type SyncplaySynctestInputFuzz, type SyncplaySynctestPhase, type SyncplaySynctestResult, } from '../synctest.js';
|
|
3
|
-
export { certifyModule, type SyncplayModuleCertificationFailureCode, type SyncplayModuleCertificationFixture, type SyncplayModuleCertificationResult, type SyncplayModuleCertificationStepCase, } from './module-certification.js';
|
|
2
|
+
export { runSyncplaySynctest, runSyncplaySynctestAsync, type SyncplaySynctestConfig, type SyncplaySynctestConfigAsync, type SyncplaySynctestDivergence, type SyncplaySynctestInputFuzz, type SyncplaySynctestPhase, type SyncplaySynctestResult, } from '../synctest.js';
|
|
3
|
+
export { certifyModule, SyncplayModuleCertificationOwnedRuntimeError, type SyncplayModuleCertificationFailureCode, type SyncplayModuleCertificationFixture, type SyncplayModuleCertificationResult, type SyncplayModuleCertificationStepCase, } from './module-certification.js';
|
|
4
|
+
export { SyncplayRuntimeLeaseRequiredError } from '../runtime-cleanup.js';
|
|
4
5
|
export { rundotSyncplayPlugin, createSyncplayViteConfig, withSyncplayViteConfig, formatDiagnostics, type SyncplayPluginOptions, type MinimalVitePlugin, type MinimalVitePluginApply, type MinimalVitePluginEnforce, type MinimalVitePluginEnvironment, type MinimalViteResolvedConfig, type MinimalViteConfig, } from './vite-plugin.js';
|
package/dist/tools/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { checkDeterminism, checkSourceText, collectDeterminismSuppressions, } from './static-checker.js';
|
|
2
|
-
export { runSyncplaySynctest, } from '../synctest.js';
|
|
3
|
-
export { certifyModule, } from './module-certification.js';
|
|
2
|
+
export { runSyncplaySynctest, runSyncplaySynctestAsync, } from '../synctest.js';
|
|
3
|
+
export { certifyModule, SyncplayModuleCertificationOwnedRuntimeError, } from './module-certification.js';
|
|
4
|
+
export { SyncplayRuntimeLeaseRequiredError } from '../runtime-cleanup.js';
|
|
4
5
|
// Determinism-lint Vite plugin (relocated from the game SDK's syncplay/tools).
|
|
5
6
|
export { rundotSyncplayPlugin, createSyncplayViteConfig, withSyncplayViteConfig, formatDiagnostics, } from './vite-plugin.js';
|
|
@@ -38,4 +38,10 @@ export interface SyncplayModuleCertificationResult {
|
|
|
38
38
|
readonly heapDeltaBytesPerStep: number;
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
+
import { SyncplayError } from '../errors.js';
|
|
42
|
+
export declare class SyncplayModuleCertificationOwnedRuntimeError extends SyncplayError {
|
|
43
|
+
constructor(message?: string, options?: {
|
|
44
|
+
readonly cause?: unknown;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
41
47
|
export declare function certifyModule<Slice, Input, Context extends SyncplayModuleStepContext, EventPayload, ModuleProjection, RuntimeState, RuntimeInput, Checkpoint = unknown, RuntimeProjection = RuntimeState>(component: SyncplayModuleDefinition<Slice, Input, Context, EventPayload, ModuleProjection>, fixture: SyncplayModuleCertificationFixture<Slice, Input, Context, EventPayload, ModuleProjection, RuntimeState, RuntimeInput, Checkpoint, RuntimeProjection>): Promise<SyncplayModuleCertificationResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { encodeCanonicalBytes } from '../canonical.js';
|
|
2
|
+
import { ensureDeterministicMathInstalled } from '../math.js';
|
|
2
3
|
import { runSyncplaySynctest } from '../synctest.js';
|
|
3
4
|
import { measureRobustHostP99 } from './host-timing.js';
|
|
4
5
|
import { runDeterminismCheck } from './static-checker.js';
|
|
@@ -9,6 +10,19 @@ const staticFailureCodes = new Set([
|
|
|
9
10
|
'SYNCPLAY_MODULE_CERT_STATIC_RANDOM',
|
|
10
11
|
'SYNCPLAY_MODULE_CERT_STATIC_ITERATION',
|
|
11
12
|
]);
|
|
13
|
+
import { SyncplayError } from '../errors.js';
|
|
14
|
+
import { assertNotOwnedLease, runtimeLeaseRepairError } from '../runtime-cleanup.js';
|
|
15
|
+
export class SyncplayModuleCertificationOwnedRuntimeError extends SyncplayError {
|
|
16
|
+
constructor(message = 'SYNCPLAY_MODULE_CERT_BARE_RUNTIME_REQUIRED: module certification requires bare runtimes. Owned runtime leases cannot be certified; return a bare ProjectionCapableRuntime.', options) {
|
|
17
|
+
super(message, {
|
|
18
|
+
code: 'SYNCPLAY_MODULE_CERT_BARE_RUNTIME_REQUIRED',
|
|
19
|
+
operation: 'certifyModule',
|
|
20
|
+
action: 'Provide a runtime factory that returns bare ProjectionCapableRuntime instead of an owned runtime lease.',
|
|
21
|
+
...options,
|
|
22
|
+
});
|
|
23
|
+
this.name = 'SyncplayModuleCertificationOwnedRuntimeError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
12
26
|
class InvalidCertificationFixtureError extends Error {
|
|
13
27
|
constructor() {
|
|
14
28
|
super('SYNCPLAY_MODULE_CERT_FIXTURE_INVALID');
|
|
@@ -64,7 +78,12 @@ export async function certifyModule(component, fixture) {
|
|
|
64
78
|
const { runtimeFactory, ...synctestConfig } = fixture.synctest;
|
|
65
79
|
const synctest = runSyncplaySynctest({
|
|
66
80
|
...synctestConfig,
|
|
67
|
-
runtimeFactory: (seed) =>
|
|
81
|
+
runtimeFactory: (seed) => {
|
|
82
|
+
ensureDeterministicMathInstalled();
|
|
83
|
+
const runtime = runtimeFactory(component, seed);
|
|
84
|
+
assertNotOwnedLease(runtime, 'certifyModule', 'certifyModule');
|
|
85
|
+
return runtime;
|
|
86
|
+
},
|
|
68
87
|
});
|
|
69
88
|
if (synctest.ok) {
|
|
70
89
|
synctestPhasesPassed = [
|
|
@@ -85,7 +104,12 @@ export async function certifyModule(component, fixture) {
|
|
|
85
104
|
});
|
|
86
105
|
}
|
|
87
106
|
}
|
|
88
|
-
catch {
|
|
107
|
+
catch (error) {
|
|
108
|
+
const repair = runtimeLeaseRepairError(error, 'certifyModule', 'certifyModule');
|
|
109
|
+
if (repair !== undefined)
|
|
110
|
+
throw repair;
|
|
111
|
+
if (error instanceof SyncplayModuleCertificationOwnedRuntimeError)
|
|
112
|
+
throw error;
|
|
89
113
|
failures.push({
|
|
90
114
|
code: 'SYNCPLAY_MODULE_CERT_EXECUTION_ERROR',
|
|
91
115
|
check: 'synctest',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@series-inc/rundot-syncplay",
|
|
3
|
-
"version": "6.0.0-rc.
|
|
3
|
+
"version": "6.0.0-rc.21",
|
|
4
4
|
"description": "Kinetix orchestration, rollback, replay, late-join, and deterministic networking for RUN.game",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
"import": "./dist/browser.js",
|
|
33
33
|
"default": "./dist/browser.js"
|
|
34
34
|
},
|
|
35
|
+
"./compat/v5": {
|
|
36
|
+
"types": "./dist/compat/v5.d.ts",
|
|
37
|
+
"import": "./dist/compat/v5.js",
|
|
38
|
+
"default": "./dist/compat/v5.js"
|
|
39
|
+
},
|
|
35
40
|
"./physics/2d": {
|
|
36
41
|
"types": "./dist/physics/2d.d.ts",
|
|
37
42
|
"import": "./dist/physics/2d.js",
|
|
@@ -195,6 +200,7 @@
|
|
|
195
200
|
"core/render-projection.d.ts",
|
|
196
201
|
"core/render-records.d.ts",
|
|
197
202
|
"core/runtime.d.ts",
|
|
203
|
+
"core/units.d.ts",
|
|
198
204
|
"core/world.d.ts",
|
|
199
205
|
"core/scripts",
|
|
200
206
|
"core/src",
|
|
@@ -207,12 +213,12 @@
|
|
|
207
213
|
],
|
|
208
214
|
"scripts": {
|
|
209
215
|
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
210
|
-
"test": "npm run test:core && npm run test:unit-control && npm run test:entity-registry",
|
|
216
|
+
"test": "npm run test:core && npm run test:capability-restoration && npm run test:unit-control && npm run test:entity-registry",
|
|
211
217
|
"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",
|
|
212
|
-
"test:core": "node --expose-gc --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/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/export-surface.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/math-profile.test.ts tests/movement3d-kcc-unit-contract.test.ts tests/movement3d-static-ground.test.ts tests/state-digest.test.ts",
|
|
218
|
+
"test:core": "node --expose-gc --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/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/export-surface.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/math-profile.test.ts tests/movement3d-kcc-unit-contract.test.ts tests/movement3d-static-ground.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/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/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-state3d.test.ts tests/vehicle-state3d-artifact.test.ts tests/physics-si-rope-gear-powertrain-runtime.test.ts tests/voxel-body-state.test.ts",
|
|
213
219
|
"test:sdk-contract": "node --import tsx --test tests/sdk-runtime-contract.test.ts",
|
|
214
220
|
"test:soak": "tsx --test tests/runtime-soak.test.ts",
|
|
215
|
-
"test:extended": "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",
|
|
221
|
+
"test:extended": "node --expose-gc --import tsx --test tests/performance-primitives.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",
|
|
216
222
|
"test:ci": "npm run build && npm run test",
|
|
217
223
|
"build:native": "node core/scripts/build-native.mjs",
|
|
218
224
|
"build:wasm-physics": "node core/scripts/build-wasm-physics.mjs",
|
|
@@ -245,6 +251,7 @@
|
|
|
245
251
|
"test:rts-module": "node --expose-gc --import tsx --test tests/rts.test.ts tests/rts-certification.test.ts scripts/prove-rts-module.test.mjs",
|
|
246
252
|
"bench:cross-lane": "node core/bench/cross-lane.mjs",
|
|
247
253
|
"test:version-identity": "node scripts/check-published-version-identity.mjs",
|
|
254
|
+
"test:capability-restoration": "node --import tsx --test --test-reporter=tap --test-concurrency=1 tests/canonical-ccd.test.ts tests/canonical-fluids.test.ts",
|
|
248
255
|
"test:docs": "node --import tsx --test scripts/check-doc-examples.test.mjs tests/doc-example-coverage.test.ts && node scripts/check-doc-examples.mjs --check",
|
|
249
256
|
"check:api-deprecations": "node scripts/generate-api-deprecations.mjs --check",
|
|
250
257
|
"test:api": "node --import tsx --test tests/errors.test.ts && npm run check:api-deprecations",
|
|
@@ -254,7 +261,13 @@
|
|
|
254
261
|
"check:physics-api-architecture": "node scripts/check-physics-api-architecture.mjs",
|
|
255
262
|
"test:api-v1-release": "node --test scripts/check-api-v1-release.test.mjs",
|
|
256
263
|
"test:rc1-physics-types": "npm run build && tsc -p tests/rc1-physics-types.tsconfig.json",
|
|
257
|
-
"test:sanitizers": "node scripts/run-native-sanitizers.mjs"
|
|
264
|
+
"test:sanitizers": "node scripts/run-native-sanitizers.mjs",
|
|
265
|
+
"bench:wreck-yard": "node bench/wreck-yard-profile.mjs",
|
|
266
|
+
"test:partner-closure": "node --expose-gc --import tsx --test --test-concurrency=1 tests/physics-saved-checkpoint.test.ts tests/physics-identity-integration.test.ts tests/grab-servo-state.test.ts tests/movement3d-physics-step-ceiling.test.ts tests/physics-motion-mutations.test.ts tests/physics-checkpoint-motion.test.ts tests/physics-edit-atomic.test.ts tests/physics-batch-motion.test.ts tests/movement3d-revision1-baseline.test.ts tests/physics-profile-init.test.ts core/tests/physics-checkpoint-publication.test.mjs tests/physics-edit-result-graph.test.ts core/tests/physics-runtime-controller.test.mjs tests/physics-runtime-attachment.test.ts tests/physics-installed-checkpoint.test.ts tests/physics-installed-runtime.test.ts tests/networked-strong-report.test.ts tests/physics-installed-state-commitment.test.ts tests/game-byte-section.test.ts tests/physics-game-codec3d.test.ts",
|
|
267
|
+
"test:physics-unit-types": "tsc --noEmit --target ES2022 --module NodeNext --moduleResolution NodeNext --strict --skipLibCheck false tests/physics-si-required.fixture.ts tests/physics-si-required-2d.fixture.ts tests/grab-servo-types.fixture.ts tests/physics-unit-quantities.fixture.ts tests/physics-si-2d-helpers.fixture.ts tests/physics-si-3d-features.fixture.ts tests/physics-vehicle-support-types.fixture.ts tests/physics-si-surface.fixture.ts tests/physics-voxel-regions-types.fixture.ts tests/physics-si-pulley.fixture.ts tests/vehicle-state3d-types.fixture.ts tests/physics-motion-mutations-types.fixture.ts tests/physics-si-rope-gear-powertrain.fixture.ts tests/voxel-body-state-types.fixture.ts tests/physics-runtime-controller-types.fixture.ts tests/physics-installed-runtime-types.fixture.ts tests/game-byte-section-types.fixture.ts tests/owned-runtime-report-domain-types.fixture.ts",
|
|
268
|
+
"test:physics-unit-constructors": "node --import tsx --test tests/physics-unit-constructors.test.ts tests/physics-unit-conversions.test.ts",
|
|
269
|
+
"test:vehicle-light-support": "node --import tsx --test tests/vehicle-light-support.test.ts",
|
|
270
|
+
"test:vehicle-revision1": "node --import tsx --test tests/vehicle-revision1-baseline.test.ts"
|
|
258
271
|
},
|
|
259
272
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
260
273
|
"keywords": [
|