@series-inc/rundot-syncplay 5.26.0-beta.1 → 5.26.0-beta.3

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 (47) hide show
  1. package/README.md +17 -0
  2. package/core/authoring.d.ts +5 -17
  3. package/core/deterministic-stdlib.d.ts +0 -15
  4. package/core/index.d.ts +4 -33
  5. package/core/native/deterministic_math.hpp +4 -3
  6. package/core/native/fixed_math.cpp +741 -0
  7. package/core/native/fixed_math.hpp +111 -0
  8. package/core/native/kinetix-native-main.cpp +227 -88
  9. package/core/native/mobile/box3d_probe_scenario.cpp +101 -0
  10. package/core/native/mobile/box3d_probe_scenario.hpp +25 -0
  11. package/core/native/mobile/syncplay_native_probe.cpp +83 -0
  12. package/core/native/mobile/syncplay_native_probe_abi.h +41 -0
  13. package/core/physics.d.ts +48 -0
  14. package/core/scripts/build-mobile-native.mjs +99 -0
  15. package/core/scripts/build-native.mjs +15 -1
  16. package/core/scripts/build-wasm-fixed-math.mjs +58 -0
  17. package/core/scripts/preflight.mjs +4 -9
  18. package/core/scripts/run-box3d-benchmark.mjs +22 -124
  19. package/core/src/index.mjs +0 -3
  20. package/core/src/kinetix-baker.mjs +0 -92
  21. package/core/src/kinetix-deterministic-stdlib.mjs +0 -36
  22. package/core/src/kinetix-native-product.mjs +5 -3
  23. package/core/src/kinetix-product-contract.mjs +4 -3
  24. package/core/src/kinetix-project-compiler.mjs +2 -7
  25. package/core/src/physics/box3d-probe.mjs +171 -0
  26. package/core/src/physics/index.mjs +156 -19
  27. package/core/src/physics/physics-wasm-module.generated.mjs +3 -3
  28. package/dist/browser.d.ts +1 -0
  29. package/dist/browser.js +1 -0
  30. package/dist/creator.d.ts +1 -0
  31. package/dist/creator.js +1 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/movement3d.d.ts +9 -0
  35. package/dist/movement3d.js +185 -24
  36. package/dist/physics3d-heightfield.d.ts +10 -0
  37. package/dist/physics3d-heightfield.js +33 -0
  38. package/dist/physics3d-hull.d.ts +14 -0
  39. package/dist/physics3d-hull.js +45 -0
  40. package/dist/physics3d.js +28 -1
  41. package/dist/tools/index.d.ts +0 -2
  42. package/dist/tools/index.js +0 -1
  43. package/package.json +9 -6
  44. package/core/src/kinetix-authoring.mjs +0 -69
  45. package/core/src/kinetix-legacy-profile-contracts.mjs +0 -69
  46. package/dist/prediction-culling.d.ts +0 -34
  47. package/dist/prediction-culling.js +0 -200
package/README.md CHANGED
@@ -23,6 +23,23 @@ late join, secrets, and transport.
23
23
  | Inputs, prediction, confirmation, rollback policy, replay log, late join, secrets, transport | Syncplay |
24
24
  | Rendering/interpolation/effects | Presentation adapters outside authoritative state |
25
25
 
26
+ ## External monorepos
27
+
28
+ Pin an **exact** published version. Fold that version string into
29
+ `deterministicVersion` when deriving a custom runtime identity, so a silent
30
+ dependency float cannot keep the same engine hash.
31
+
32
+ | Subpath | Role |
33
+ |---------|------|
34
+ | `/core/runtime` | `createInstalledRuntimeAdapter`, identity helpers |
35
+ | `/core/physics` | WASM physics (`initPhysics`, …) — reference solver |
36
+ | `/` or `/browser` | KCC, runner, session, **TypeScript** physics — the solver `stepDeterministicKcc3D` collides against |
37
+ | `/testing` | Simulated multi-peer / synctest |
38
+ | `/node` | Authority room helpers (not for browser bundles) |
39
+
40
+ Do not deep-import `@series-inc/rundot-syncplay/core/src/**`. Do not put a
41
+ non-deterministic third-party engine inside a checksummed step.
42
+
26
43
  There is one session factory:
27
44
 
28
45
  ```ts
@@ -1,4 +1,8 @@
1
- export type KinetixInstalledProfileName = 'deterministic-f64' | 'fixed-1000-3d';
1
+ // Types-only entrypoint. The declarative `defineKinetixProject` lane it used to
2
+ // carry was removed with the engine-owned numeric profiles it validated; games
3
+ // build simulations with `createInstalledRuntimeAdapter` +
4
+ // `deriveCustomRuntimeIdentity` instead. Session-config schema types stay here
5
+ // because game runtimes declare their match configuration with them.
2
6
 
3
7
  export type KinetixSessionField =
4
8
  | { type: 'string'; maxBytes: number; required?: boolean }
@@ -12,19 +16,3 @@ export interface KinetixSessionConfigSchema {
12
16
  maxBytes: number;
13
17
  fields: Readonly<Record<string, KinetixSessionField>>;
14
18
  }
15
-
16
- export interface KinetixProjectDeclaration {
17
- id: string;
18
- installedProfile: KinetixInstalledProfileName;
19
- tickRate: 10 | 20 | 30 | 60;
20
- inputSchema: Readonly<Record<string, unknown>>;
21
- sessionConfigSchema: KinetixSessionConfigSchema;
22
- mechanics: readonly Readonly<Record<string, unknown>>[];
23
- components: readonly Readonly<Record<string, unknown>>[];
24
- systems: readonly Readonly<Record<string, unknown>>[];
25
- presentationBindings: readonly Readonly<Record<string, unknown>>[];
26
- }
27
-
28
- export function defineKinetixProject<const Project extends KinetixProjectDeclaration>(
29
- project: Project,
30
- ): Readonly<Project>;
@@ -84,19 +84,6 @@ export interface DeterministicMathApi {
84
84
  clamp(value: number, min: number, max: number): number;
85
85
  }
86
86
 
87
- export interface FixedTurnsMathApi {
88
- readonly ONE: number;
89
- F(value: number): number;
90
- mul(a: number, b: number): number;
91
- div(a: number, b: number): number;
92
- clamp(value: number, min: number, max: number): number;
93
- fabs(value: number): number;
94
- fsign(value: number): number;
95
- lerp(a: number, b: number, t: number): number;
96
- fsin(turns: number): number;
97
- fcos(turns: number): number;
98
- }
99
-
100
87
  export interface DeterministicRandomSnapshot {
101
88
  readonly state: number;
102
89
  }
@@ -107,8 +94,6 @@ export function createDeterministicMath(
107
94
  maxFixed?: number,
108
95
  ): DeterministicMathApi;
109
96
 
110
- export function createFixedTurnsMath(scale: number): FixedTurnsMathApi;
111
-
112
97
  export class DeterministicRandom {
113
98
  state: number;
114
99
  constructor(seed: number);
package/core/index.d.ts CHANGED
@@ -80,11 +80,9 @@ export type {
80
80
  KinetixPlatformerLevelErrorCode,
81
81
  KinetixRuntimeModuleManifestEntry,
82
82
  } from './runtime';
83
- export { defineKinetixProject } from './authoring';
84
- export type { KinetixProjectDeclaration, KinetixSessionConfigSchema } from './authoring';
83
+ export type { KinetixSessionConfigSchema } from './authoring';
85
84
  export {
86
85
  createDeterministicMath,
87
- createFixedTurnsMath,
88
86
  DeterministicRandom,
89
87
  } from './deterministic-stdlib';
90
88
  export {
@@ -145,15 +143,11 @@ export type {
145
143
  DeterministicRandomSnapshot,
146
144
  DeterministicVec2,
147
145
  DeterministicVec3,
148
- FixedTurnsMathApi,
149
146
  } from './deterministic-stdlib';
150
147
 
151
- export type KinetixTargetProfile = 'deterministic-f64' | 'fixed-1000-3d';
152
-
153
148
  export interface KinetixCompileInput {
154
149
  projectRoot: string;
155
150
  expectedCommit: string;
156
- targetProfile: KinetixTargetProfile;
157
151
  }
158
152
 
159
153
  export interface KinetixDiagnostic {
@@ -180,7 +174,7 @@ export interface KinetixCompiled {
180
174
 
181
175
  export interface KinetixRuntimeContract {
182
176
  readonly tickRate: 10 | 20 | 30 | 60;
183
- readonly targetProfile: KinetixTargetProfile;
177
+ readonly targetProfile: string;
184
178
  readonly numericProfile: string;
185
179
  readonly deterministicAbi: string;
186
180
  readonly deterministicVersion: string;
@@ -263,7 +257,6 @@ export function compileKinetixProject(input: KinetixCompileInput): KinetixCompil
263
257
  export function compileTrustedKinetixSource(input: {
264
258
  sourceRoot: string;
265
259
  expectedCommit: string;
266
- targetProfile: KinetixTargetProfile;
267
260
  classifyInstalledBranches?: boolean;
268
261
  }): KinetixCompiled;
269
262
  export function kinetixCanonicalSourceDigest(sourceRoot: string): string;
@@ -274,27 +267,6 @@ export function bakeKinetixEnvelope(
274
267
  ): KinetixBakeResult;
275
268
  export type KinetixRuntimeModuleDeclaration = import('./runtime').KinetixRuntimeModuleManifestEntry;
276
269
 
277
- export interface KinetixBakeOptions {
278
- /**
279
- * Canonical manifest of the installed runtime's implementation modules,
280
- * sorted by path. Folded into the simulation payload (and so into
281
- * engineIdentityHash), binding the custom step implementation to the signed
282
- * product. Build with kinetixRuntimeModuleManifest.
283
- */
284
- runtimeModules?: readonly KinetixRuntimeModuleDeclaration[];
285
- /** Emitted as manifest.auxiliaryAssets; bound into engineIdentityHash when non-empty. */
286
- auxiliaryAssets?: readonly { name: string; digest: string; byteLength: number }[];
287
- }
288
-
289
- export function bakeKinetixProjectDefinition(
290
- project: import('./authoring').KinetixProjectDeclaration,
291
- options?: KinetixBakeOptions,
292
- ): {
293
- products: KinetixProducts;
294
- runtimeIdentity: import('./runtime').KinetixRuntimeIdentity;
295
- contentDigest: string;
296
- };
297
-
298
270
  /** Node-only build-time helper: hashes module files into a sorted canonical manifest. */
299
271
  export function kinetixRuntimeModuleManifest(
300
272
  sourceRoot: string,
@@ -351,8 +323,8 @@ export interface CustomRuntimeIdentityOptions {
351
323
  * folding its `runtimeModules` manifest (and optional `auxiliaryAssets` /
352
324
  * `sessionConfigSchema` / `deterministicAbi`) into `engineIdentityHash` the same
353
325
  * canonical way `deriveKinetixRuntimeIdentity` does. The supported path for
354
- * custom `createInstalledRuntimeAdapter` runtimes, which cannot go through the
355
- * profile-locked `defineKinetixProject` baker.
326
+ * custom `createInstalledRuntimeAdapter` runtimes. It replaces the removed
327
+ * profile-locked declarative baker.
356
328
  */
357
329
  export function deriveCustomRuntimeIdentity(
358
330
  options: CustomRuntimeIdentityOptions,
@@ -383,7 +355,6 @@ export function compileStableKinetixProducts(input: KinetixCompileInput): Kineti
383
355
  export function compileStableKinetixProductsFromTrustedSource(input: {
384
356
  sourceRoot: string;
385
357
  expectedCommit: string;
386
- targetProfile: KinetixTargetProfile;
387
358
  }): KinetixCompilation;
388
359
 
389
360
  /** Builds the portable C++ core and returns the binary path. */
@@ -1,8 +1,9 @@
1
1
  // Deterministic-f64 math for the component runtime: C++ transliteration of the
2
2
  // fdlibm-style JS shim (kinetix-deterministic-math.mjs). Every function must be
3
- // bit-identical to the JS implementation for all finite inputs verified by the
4
- // parity battery (deterministic-f64-battery.mjs vs
5
- // deterministic-math-battery-main.cpp).
3
+ // bit-identical to the JS implementation — gated by
4
+ // core/tests/js-cpp-parity.test.mjs against the --math-vectors mode in
5
+ // core/native/kinetix-native-main.cpp. NaN is compared canonically; its payload
6
+ // is architecture-defined.
6
7
  //
7
8
  // Compile with FMA contraction disabled (-ffp-contract=off): the algorithms
8
9
  // depend on exact IEEE double rounding of each written operation.