@threenative/playtest 0.3.12 → 0.3.13

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.
@@ -1,3 +1,14 @@
1
+ declare const CONSOLE_MARKER: {
2
+ readonly bridgeCensus: "TN_BRIDGE_CENSUS";
3
+ readonly frameBudget: "TN_FRAME_BUDGET";
4
+ readonly frameHitch: "TN_FRAME_HITCH";
5
+ readonly hostGap: "TN_HOST_GAP";
6
+ readonly playerFrame: "TN_PLAYER_FRAME";
7
+ readonly presentsTick: "TN_PRESENTS_TICK";
8
+ readonly projection: "TN_PROJECTION";
9
+ readonly slowPhase: "TN_SLOW_PHASE";
10
+ };
11
+
1
12
  declare const PLAYTEST_BRIDGE_GLOBAL = "__THREENATIVE_PLAYTEST_BRIDGE__";
2
13
  declare const PLAYTEST_PROTOCOL_VERSION: 1;
3
14
  /**
@@ -681,5 +692,66 @@ declare function jsonByteLength(value: JsonValue): number;
681
692
  * @example assertJsonSafe(snapshot, "$.components");
682
693
  */
683
694
  declare function assertJsonSafe(value: unknown, path?: string): asserts value is JsonValue;
695
+ interface IPerfSummary {
696
+ readonly mean: number;
697
+ readonly p50: number;
698
+ readonly p95: number;
699
+ }
700
+ /**
701
+ * One pass's submissions in a window, as the runtime reported them.
702
+ *
703
+ * `triangles` is three's CPU figure — `instanceCount * count / 3` per draw, and an indirect batch's
704
+ * `count` is its merged geometry's capacity, so a streamed world reads in the hundreds of millions.
705
+ * `gpuTriangles` is what the kernel selected, which is the number to bound work against.
706
+ */
707
+ interface IPerfPassJson extends IPassJson {
708
+ readonly triangles?: IPerfSummary;
709
+ readonly gpuTriangles?: number;
710
+ }
711
+ /** What the window's frames were drawn at, when the loop reported it. */
712
+ interface IFrameSurfaceJson {
713
+ /** Present only when the runtime measured whether asynchronous pipeline compilation remained active. */
714
+ readonly compiling?: boolean;
715
+ readonly resolutionScale: number;
716
+ readonly scaleSource: string;
717
+ readonly sampleCount: number;
718
+ readonly drawingBufferWidth: number;
719
+ readonly drawingBufferHeight: number;
720
+ readonly atFloor?: boolean;
721
+ }
722
+ /**
723
+ * One render pass's submissions, as `packages/core/src/render-pass-budget.ts` reports them.
724
+ *
725
+ * `drawsBySource` is PRD-494's per-origin split of the main pass's draws: the frame-level counts sum
726
+ * to `draws`, so the percentiles of two different sources need not, and the line below is read as
727
+ * "which origin owns the pass", not as arithmetic.
728
+ */
729
+ interface IPassJson {
730
+ readonly draws?: IPerfSummary;
731
+ readonly drawsBySource?: Readonly<Record<string, IPerfSummary>>;
732
+ readonly frames?: number;
733
+ }
734
+ interface IFrameBudgetWindowJson {
735
+ /**
736
+ * The loop's cadence. It is the display's where the loop presents every frame — the web, via rAF —
737
+ * and is inflated by the presentation-cap ratio where it does not, so prefer
738
+ * {@link presentedFps} whenever the engine reports it.
739
+ */
740
+ readonly fps: number;
741
+ readonly frames: number;
742
+ readonly frame?: IPerfSummary;
743
+ readonly hitches: number;
744
+ readonly phases?: Readonly<Record<string, IPerfSummary>>;
745
+ /** Frames that reached the display in this window, when the host can count them. */
746
+ readonly presents?: number;
747
+ /** The rate those presents imply, over the window's own duration. */
748
+ readonly presentedFps?: number;
749
+ readonly surface?: IFrameSurfaceJson;
750
+ /** GPU milliseconds from `timestamp-query`, absent when the adapter has none. */
751
+ readonly gpuMs?: number;
752
+ /** Per-pass draws and triangles, absent on a runtime that measured no passes. */
753
+ readonly passes?: Readonly<Record<string, IPerfPassJson>>;
754
+ readonly window: number;
755
+ }
684
756
 
685
- export { type IPlaytestAdvanceResult, type IPlaytestAnimationObservation, type IPlaytestBridgeDescription, type IPlaytestBridgeHost, type IPlaytestBridgeReady, type IPlaytestBridgeV1, type IPlaytestCameraObservation, type IPlaytestContactObservation, type IPlaytestDeviceRequest, type IPlaytestDeviceResponse, type IPlaytestEntityObservation, type IPlaytestEntityTransform, type IPlaytestFogObservation, type IPlaytestFramePassSample, type IPlaytestGameplayObservation, type IPlaytestGeometryCaptureRequest, type IPlaytestLightObservation, type IPlaytestObservationSnapshot, type IPlaytestPerformanceObservation, type IPlaytestRenderChainObservation, type IPlaytestRuntimeDiagnosticsSample, type IPlaytestSampleRequest, type IPlaytestSceneNodeMaterial, type IPlaytestSceneNodeObservation, type IPlaytestSceneNodeSelector, type IPlaytestSceneNodesObservation, type IPlaytestSceneObservation, type IPlaytestSetupConfirmation, type IPlaytestSetupRequest, type IPlaytestSightLineObservation, type IPlaytestStartupCoverObservation, type IPlaytestStartupObservation, type IPlaytestStartupOffscreenBytes, type IPlaytestStartupTimeline, type IPlaytestStrideObservation, type IPlaytestTagObservation, type IPlaytestTransitionObservation, type IPlaytestWorldObservation, type IPlaytestWorldRuntimeObservation, type JsonPrimitive, type JsonValue, PLAYTEST_ADVANCE_TICK_BUDGET_MS, PLAYTEST_BRIDGE_GLOBAL, PLAYTEST_CLOCK_GLOBAL, PLAYTEST_FRAME_BUDGET_PHASES, PLAYTEST_FRAME_PASS_KINDS, PLAYTEST_FROZEN_MARKER, PLAYTEST_PROTOCOL_LIMITS, PLAYTEST_PROTOCOL_VERSION, PLAYTEST_STARTUP_COMPILE_BUDGET_MS, PLAYTEST_STARTUP_READY_TIMEOUT_MS, type PlaytestClockMode, type PlaytestFramePassKind, type PlaytestFramePhase, type PlaytestFramePhaseSample, assertJsonSafe, jsonByteLength, requestedPlaytestClockMode };
757
+ export { CONSOLE_MARKER, type IFrameBudgetWindowJson, type IFrameSurfaceJson, type IPassJson, type IPerfPassJson, type IPerfSummary, type IPlaytestAdvanceResult, type IPlaytestAnimationObservation, type IPlaytestBridgeDescription, type IPlaytestBridgeHost, type IPlaytestBridgeReady, type IPlaytestBridgeV1, type IPlaytestCameraObservation, type IPlaytestContactObservation, type IPlaytestDeviceRequest, type IPlaytestDeviceResponse, type IPlaytestEntityObservation, type IPlaytestEntityTransform, type IPlaytestFogObservation, type IPlaytestFramePassSample, type IPlaytestGameplayObservation, type IPlaytestGeometryCaptureRequest, type IPlaytestLightObservation, type IPlaytestObservationSnapshot, type IPlaytestPerformanceObservation, type IPlaytestRenderChainObservation, type IPlaytestRuntimeDiagnosticsSample, type IPlaytestSampleRequest, type IPlaytestSceneNodeMaterial, type IPlaytestSceneNodeObservation, type IPlaytestSceneNodeSelector, type IPlaytestSceneNodesObservation, type IPlaytestSceneObservation, type IPlaytestSetupConfirmation, type IPlaytestSetupRequest, type IPlaytestSightLineObservation, type IPlaytestStartupCoverObservation, type IPlaytestStartupObservation, type IPlaytestStartupOffscreenBytes, type IPlaytestStartupTimeline, type IPlaytestStrideObservation, type IPlaytestTagObservation, type IPlaytestTransitionObservation, type IPlaytestWorldObservation, type IPlaytestWorldRuntimeObservation, type JsonPrimitive, type JsonValue, PLAYTEST_ADVANCE_TICK_BUDGET_MS, PLAYTEST_BRIDGE_GLOBAL, PLAYTEST_CLOCK_GLOBAL, PLAYTEST_FRAME_BUDGET_PHASES, PLAYTEST_FRAME_PASS_KINDS, PLAYTEST_FROZEN_MARKER, PLAYTEST_PROTOCOL_LIMITS, PLAYTEST_PROTOCOL_VERSION, PLAYTEST_STARTUP_COMPILE_BUDGET_MS, PLAYTEST_STARTUP_READY_TIMEOUT_MS, type PlaytestClockMode, type PlaytestFramePassKind, type PlaytestFramePhase, type PlaytestFramePhaseSample, assertJsonSafe, jsonByteLength, requestedPlaytestClockMode };
package/dist/protocol.js CHANGED
@@ -1,4 +1,16 @@
1
1
  #!/usr/bin/env node
2
+ // src/generated/console-markers.ts
3
+ var CONSOLE_MARKER = {
4
+ bridgeCensus: "TN_BRIDGE_CENSUS",
5
+ frameBudget: "TN_FRAME_BUDGET",
6
+ frameHitch: "TN_FRAME_HITCH",
7
+ hostGap: "TN_HOST_GAP",
8
+ playerFrame: "TN_PLAYER_FRAME",
9
+ presentsTick: "TN_PRESENTS_TICK",
10
+ projection: "TN_PROJECTION",
11
+ slowPhase: "TN_SLOW_PHASE"
12
+ };
13
+
2
14
  // src/protocol.ts
3
15
  var PLAYTEST_BRIDGE_GLOBAL = "__THREENATIVE_PLAYTEST_BRIDGE__";
4
16
  var PLAYTEST_PROTOCOL_VERSION = 1;
@@ -49,4 +61,4 @@ function assertJsonSafe(value, path = "$") {
49
61
  throw new TypeError(`${path} must be JSON-safe.`);
50
62
  }
51
63
 
52
- export { PLAYTEST_ADVANCE_TICK_BUDGET_MS, PLAYTEST_BRIDGE_GLOBAL, PLAYTEST_CLOCK_GLOBAL, PLAYTEST_FRAME_BUDGET_PHASES, PLAYTEST_FRAME_PASS_KINDS, PLAYTEST_FROZEN_MARKER, PLAYTEST_PROTOCOL_LIMITS, PLAYTEST_PROTOCOL_VERSION, PLAYTEST_STARTUP_COMPILE_BUDGET_MS, PLAYTEST_STARTUP_READY_TIMEOUT_MS, assertJsonSafe, jsonByteLength, requestedPlaytestClockMode };
64
+ export { CONSOLE_MARKER, PLAYTEST_ADVANCE_TICK_BUDGET_MS, PLAYTEST_BRIDGE_GLOBAL, PLAYTEST_CLOCK_GLOBAL, PLAYTEST_FRAME_BUDGET_PHASES, PLAYTEST_FRAME_PASS_KINDS, PLAYTEST_FROZEN_MARKER, PLAYTEST_PROTOCOL_LIMITS, PLAYTEST_PROTOCOL_VERSION, PLAYTEST_STARTUP_COMPILE_BUDGET_MS, PLAYTEST_STARTUP_READY_TIMEOUT_MS, assertJsonSafe, jsonByteLength, requestedPlaytestClockMode };
@@ -1,8 +1,8 @@
1
- import { I as IStandalonePlaytestConfig, a as IStandalonePlaytestReport } from '../shared-D52a_m0V.js';
2
- import '../schema-base-C2pIQ165.js';
1
+ import { I as IStandalonePlaytestConfig, a as IStandalonePlaytestReport } from '../shared-CRg0jlDU.js';
2
+ import '../schema-base-D8wNuOLE.js';
3
3
  import '../protocol.js';
4
4
  import 'playwright';
5
- import '../diagnostics-BPaaU6JB.js';
5
+ import '../diagnostics-0g-Uyvds.js';
6
6
 
7
7
  interface IRunnerDiagnostic {
8
8
  code: string;