@threenative/playtest 0.3.0 → 0.3.1
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/dist/{diagnostics-D89qJhf0.d.ts → diagnostics-f8464bJw.d.ts} +279 -14
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2483 -440
- package/dist/protocol.d.ts +270 -2
- package/dist/runner/cli.d.ts +15 -3
- package/dist/runner/cli.js +8311 -2466
- package/dist/runner/index.d.ts +211 -7
- package/dist/runner/index.js +4847 -753
- package/dist/{shared-Ax3-pneQ.d.ts → shared-BGwYk5HG.d.ts} +20 -1
- package/dist/three/index.d.ts +27 -3
- package/dist/three/index.js +358 -7
- package/package.json +20 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlaytestFramePhase, JsonValue, IPlaytestRenderChainObservation } from './protocol.js';
|
|
1
|
+
import { PlaytestFramePhase, JsonValue, IPlaytestRenderChainObservation, IPlaytestSceneObservation, IPlaytestSceneNodesObservation, IPlaytestStartupTimeline } from './protocol.js';
|
|
2
2
|
|
|
3
3
|
type PlaytestTarget = "web" | "desktop" | "bevy";
|
|
4
4
|
type PlaytestInputDelivery = "deterministic" | "focused-dom";
|
|
@@ -16,6 +16,25 @@ interface IPlaytestWheel {
|
|
|
16
16
|
deltaX?: number;
|
|
17
17
|
deltaY: number;
|
|
18
18
|
}
|
|
19
|
+
type IPlaytestResourceWait = {
|
|
20
|
+
equals: unknown;
|
|
21
|
+
gte?: never;
|
|
22
|
+
id: string;
|
|
23
|
+
lte?: never;
|
|
24
|
+
path: string;
|
|
25
|
+
} | {
|
|
26
|
+
equals?: never;
|
|
27
|
+
gte: number;
|
|
28
|
+
id: string;
|
|
29
|
+
lte?: never;
|
|
30
|
+
path: string;
|
|
31
|
+
} | {
|
|
32
|
+
equals?: never;
|
|
33
|
+
gte?: never;
|
|
34
|
+
id: string;
|
|
35
|
+
lte: number;
|
|
36
|
+
path: string;
|
|
37
|
+
};
|
|
19
38
|
interface IPlaytestStep {
|
|
20
39
|
kind?: "aimAt" | "click" | "input" | "wait";
|
|
21
40
|
/** @deprecated Use holdTicks. Fixed-step bridges treat this as a tick alias. */
|
|
@@ -43,8 +62,10 @@ interface IPlaytestStep {
|
|
|
43
62
|
screenshot?: string;
|
|
44
63
|
/** Runner-native aim: yaw/pitch are computed from the sampled subject position. */
|
|
45
64
|
target?: IPlaytestAimTarget;
|
|
65
|
+
timeoutMs?: number;
|
|
46
66
|
/** @deprecated Use waitTicks. Fixed-step bridges treat this as a tick alias. */
|
|
47
67
|
waitFrames?: number;
|
|
68
|
+
waitForResource?: IPlaytestResourceWait;
|
|
48
69
|
waitTicks?: number;
|
|
49
70
|
/** A browser/native wheel sample; negative DOM deltaY is the conventional toward-user gesture. */
|
|
50
71
|
wheel?: IPlaytestWheel;
|
|
@@ -124,6 +145,8 @@ interface IPlaytestPathAssertion {
|
|
|
124
145
|
path?: string;
|
|
125
146
|
textIncludes?: string;
|
|
126
147
|
throughoutSteps?: boolean;
|
|
148
|
+
/** Require a DOM node to occupy pixels above the page at the sampled viewport centre. */
|
|
149
|
+
visible?: boolean;
|
|
127
150
|
}
|
|
128
151
|
interface IPlaytestResourcePathAlternative {
|
|
129
152
|
changed?: boolean;
|
|
@@ -192,6 +215,110 @@ interface IPlaytestOverlayNodeAssertion {
|
|
|
192
215
|
textIncludes?: string;
|
|
193
216
|
visible?: boolean;
|
|
194
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Bounds on the room the game is played in — what a screenshot would have shown, as numbers.
|
|
220
|
+
*
|
|
221
|
+
* Every member fails closed on an unobserved scene: a bridge that does not report `scene.observe`
|
|
222
|
+
* has not reported a well-lit one.
|
|
223
|
+
*/
|
|
224
|
+
interface IPlaytestSceneAssertion {
|
|
225
|
+
allowTrivial?: string;
|
|
226
|
+
/** Fail when the camera's far plane cuts the scene it is pointed at. */
|
|
227
|
+
cameraClearsScene?: boolean;
|
|
228
|
+
/** Fail when a linear fog reaches full colour in front of the scene it is fogging. */
|
|
229
|
+
fogClearsScene?: boolean;
|
|
230
|
+
/** Fail when lit materials are mounted and no light in the scene is visible. */
|
|
231
|
+
litMaterialsAreLit?: boolean;
|
|
232
|
+
/** Floor on how many lights the renderer will actually see. */
|
|
233
|
+
minVisibleLights?: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Bounds on named nodes of the scene graph — the questions a screenshot gets taken for.
|
|
237
|
+
*
|
|
238
|
+
* `scene` bounds the room as a whole: is anything lit, does the fog clear the world. This bounds
|
|
239
|
+
* one object: is the crate where the game says it is, is it inside the camera's frustum, did its
|
|
240
|
+
* texture load, is the character's mesh actually visible once every ancestor's flag is taken into
|
|
241
|
+
* account. Each is a frame-destroying failure that leaves every count healthy.
|
|
242
|
+
*
|
|
243
|
+
* `select` is required and every other member is optional, but an assertion that sets only
|
|
244
|
+
* `select` throws at load: selecting nodes and bounding nothing is the vacuous pass this package
|
|
245
|
+
* refuses. Every bound fails closed — a run whose bridge reported no scene nodes has not reported
|
|
246
|
+
* a visible crate, it has reported nothing.
|
|
247
|
+
*/
|
|
248
|
+
interface IPlaytestSceneNodesAssertion {
|
|
249
|
+
allowTrivial?: string;
|
|
250
|
+
/** Require every matched node to have at least one clip mounted, or none to. */
|
|
251
|
+
animated?: boolean;
|
|
252
|
+
/** Require every matched node's world bounds to intersect the active camera's frustum. */
|
|
253
|
+
inFrustum?: boolean;
|
|
254
|
+
/** Ceiling on how many nodes the selector may match. Zero asserts absence. */
|
|
255
|
+
maxCount?: number;
|
|
256
|
+
/** Floor on how many nodes the selector must match. Defaults to 1 when absent. */
|
|
257
|
+
minCount?: number;
|
|
258
|
+
/** Floor on the summed triangle count of every matched node. */
|
|
259
|
+
minTriangles?: number;
|
|
260
|
+
/** Which nodes to bound. A selector that matches fewer than `minCount` fails. */
|
|
261
|
+
select: IPlaytestSceneNodeSelectorSpec;
|
|
262
|
+
/** Require every bound texture slot on every matched node to carry pixels. */
|
|
263
|
+
texturesLoaded?: boolean;
|
|
264
|
+
/** Require every matched node to be visible with every ancestor visible too. */
|
|
265
|
+
visible?: boolean;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Which nodes an assertion is about. Every present field must match; an absent field does not
|
|
269
|
+
* filter. At least one field is required — a selector that filters nothing selects the whole
|
|
270
|
+
* scene graph and bounds nothing in particular.
|
|
271
|
+
*/
|
|
272
|
+
interface IPlaytestSceneNodeSelectorSpec {
|
|
273
|
+
limit?: number;
|
|
274
|
+
name?: string;
|
|
275
|
+
nameContains?: string;
|
|
276
|
+
pathContains?: string;
|
|
277
|
+
type?: string;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* "It happened **because** of that, and never before it."
|
|
281
|
+
*
|
|
282
|
+
* The one sentence a proof of a physics puzzle actually has to make, and the one this harness
|
|
283
|
+
* could not make. A run could already say *a contact happened* and *the state reads `won`*, and
|
|
284
|
+
* `atSteps` could order them at step boundaries — where a win arriving one tick after the contact
|
|
285
|
+
* and a win arriving 199 ticks later inside the same step are the same observation. That is the
|
|
286
|
+
* signature of a terminal state driven by a timer or a distance check that merely lands near a
|
|
287
|
+
* contact, and it is what a sealed proof exists to refuse.
|
|
288
|
+
*
|
|
289
|
+
* Both sides are tick-stamped by the producer. A run whose contacts or transitions carry no ticks
|
|
290
|
+
* fails closed and names which side was unstamped; it never falls back to step granularity, which
|
|
291
|
+
* is a different measurement wearing the same name.
|
|
292
|
+
*/
|
|
293
|
+
interface IPlaytestCausedByAssertion {
|
|
294
|
+
allowTrivial?: string;
|
|
295
|
+
cause: IPlaytestCauseSpec;
|
|
296
|
+
effect: IPlaytestEffectSpec;
|
|
297
|
+
/**
|
|
298
|
+
* Fail when the effect is ever observed before the first matching cause. This is the frame-one
|
|
299
|
+
* fake win: a goal volume overlapping the floor reports `won` before anything touched it.
|
|
300
|
+
*/
|
|
301
|
+
neverBefore?: boolean;
|
|
302
|
+
/** Ceiling on `effectTick - causeTick`. A win long after the contact was not caused by it. */
|
|
303
|
+
withinTicks?: number;
|
|
304
|
+
}
|
|
305
|
+
/** What must have happened first. */
|
|
306
|
+
interface IPlaytestCauseSpec {
|
|
307
|
+
contact?: {
|
|
308
|
+
entity: string;
|
|
309
|
+
kind?: string;
|
|
310
|
+
with: string;
|
|
311
|
+
};
|
|
312
|
+
/** A published value reaching a given value, named the same way an effect is. */
|
|
313
|
+
transition?: IPlaytestEffectSpec;
|
|
314
|
+
}
|
|
315
|
+
/** The published value whose change is being explained. */
|
|
316
|
+
interface IPlaytestEffectSpec {
|
|
317
|
+
/** `states.<entity>` or `state.<field>`, exactly as the transition log reports it. */
|
|
318
|
+
path: string;
|
|
319
|
+
/** The value the path must reach. */
|
|
320
|
+
becomes: boolean | number | string;
|
|
321
|
+
}
|
|
195
322
|
interface IPlaytestAnimationAssertion {
|
|
196
323
|
advancedFrames?: number;
|
|
197
324
|
allowTrivial?: string;
|
|
@@ -199,6 +326,14 @@ interface IPlaytestAnimationAssertion {
|
|
|
199
326
|
entered?: boolean;
|
|
200
327
|
entity?: string;
|
|
201
328
|
finished?: boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Ceiling on |feet − ground| / ground for the observed clip. A run whose producer reports no
|
|
331
|
+
* stride fails closed: the convention is on by default, so silence is a missing observation,
|
|
332
|
+
* not agreement.
|
|
333
|
+
*/
|
|
334
|
+
maxFootSlide?: number;
|
|
335
|
+
/** Require the stride convention to be applied (`true`) or deliberately overridden (`false`). */
|
|
336
|
+
strideSynced?: boolean;
|
|
202
337
|
}
|
|
203
338
|
interface IPlaytestTagCountAssertion {
|
|
204
339
|
allowTrivial?: string;
|
|
@@ -241,11 +376,29 @@ interface IPlaytestPerformanceAssertion {
|
|
|
241
376
|
maxPhaseMsP95?: Readonly<Partial<Record<PlaytestFramePhase, number>>>;
|
|
242
377
|
}
|
|
243
378
|
interface IPlaytestRenderChainAssertion {
|
|
379
|
+
contributions?: {
|
|
380
|
+
graphOutputChanged: string[];
|
|
381
|
+
};
|
|
244
382
|
tier?: "high" | "medium" | "low" | "off";
|
|
383
|
+
stages?: {
|
|
384
|
+
includes?: string[];
|
|
385
|
+
excludes?: string[];
|
|
386
|
+
/** Ordered subsequence of applied stage ids, not necessarily the complete chain. */
|
|
387
|
+
order?: string[];
|
|
388
|
+
};
|
|
245
389
|
velocity?: {
|
|
246
390
|
maxRejectionFraction: number;
|
|
247
391
|
};
|
|
248
392
|
}
|
|
393
|
+
/** Ceilings on the application's startup milestones, in milliseconds since navigation. */
|
|
394
|
+
interface IPlaytestStartupAssertion {
|
|
395
|
+
/** The start scene's `enter()` returned: a controllable world exists. */
|
|
396
|
+
maxEnteredMs?: number;
|
|
397
|
+
/** First-use compilation settled or its budget expired. */
|
|
398
|
+
maxCompileSettledMs?: number;
|
|
399
|
+
/** `whenReady()` resolved: the world is safe to show. */
|
|
400
|
+
maxReadyMs?: number;
|
|
401
|
+
}
|
|
249
402
|
interface IPlaytestFramebufferCoverageAssertion {
|
|
250
403
|
backdrop: [number, number, number];
|
|
251
404
|
grid?: {
|
|
@@ -258,6 +411,28 @@ interface IPlaytestFramebufferCoverageAssertion {
|
|
|
258
411
|
startStep: string;
|
|
259
412
|
};
|
|
260
413
|
}
|
|
414
|
+
interface IPlaytestVisualRegionTarget {
|
|
415
|
+
id?: string;
|
|
416
|
+
selector?: string;
|
|
417
|
+
}
|
|
418
|
+
interface IPlaytestVisualRegionBounds {
|
|
419
|
+
height: number;
|
|
420
|
+
width: number;
|
|
421
|
+
x: number;
|
|
422
|
+
y: number;
|
|
423
|
+
}
|
|
424
|
+
interface IPlaytestVisualRegionThresholds {
|
|
425
|
+
maxDarkPixelRatio?: number;
|
|
426
|
+
maxLuminance?: number;
|
|
427
|
+
minDarkPixelRatio?: number;
|
|
428
|
+
minNonblankPixelRatio?: number;
|
|
429
|
+
}
|
|
430
|
+
interface IPlaytestVisualStaticRegion extends IPlaytestVisualRegionBounds, IPlaytestVisualRegionThresholds {
|
|
431
|
+
}
|
|
432
|
+
interface IPlaytestVisualElementRegion extends IPlaytestVisualRegionThresholds {
|
|
433
|
+
element: IPlaytestVisualRegionTarget;
|
|
434
|
+
}
|
|
435
|
+
type IPlaytestVisualRegion = IPlaytestVisualStaticRegion | IPlaytestVisualElementRegion;
|
|
261
436
|
interface IPlaytestVisualAssertion {
|
|
262
437
|
entityVisible?: {
|
|
263
438
|
entity: string;
|
|
@@ -269,15 +444,7 @@ interface IPlaytestVisualAssertion {
|
|
|
269
444
|
maxChangedPixelRatio?: number;
|
|
270
445
|
minChangedPixelRatio?: number;
|
|
271
446
|
};
|
|
272
|
-
region?:
|
|
273
|
-
height: number;
|
|
274
|
-
maxLuminance?: number;
|
|
275
|
-
minDarkPixelRatio?: number;
|
|
276
|
-
minNonblankPixelRatio?: number;
|
|
277
|
-
width: number;
|
|
278
|
-
x: number;
|
|
279
|
-
y: number;
|
|
280
|
-
};
|
|
447
|
+
region?: IPlaytestVisualRegion;
|
|
281
448
|
}
|
|
282
449
|
interface IPlaytestAerodynamicsAssertion {
|
|
283
450
|
controls?: Array<{
|
|
@@ -343,12 +510,17 @@ interface IPlaytestScenarioAssertions {
|
|
|
343
510
|
movement?: IPlaytestMovementAssertion;
|
|
344
511
|
occluded?: IPlaytestOccludedAssertion[];
|
|
345
512
|
overlayNodes?: IPlaytestOverlayNodeAssertion[];
|
|
513
|
+
parity?: IPlaytestParityAssertion;
|
|
346
514
|
performance?: IPlaytestPerformanceAssertion;
|
|
347
515
|
renderChain?: IPlaytestRenderChainAssertion;
|
|
348
516
|
reachability?: IPlaytestReachabilityAssertion;
|
|
349
517
|
resources?: IPlaytestResourceAssertion[];
|
|
350
518
|
settled?: IPlaytestSettledAssertion[];
|
|
351
519
|
signals?: IPlaytestSignalAssertion[];
|
|
520
|
+
scene?: IPlaytestSceneAssertion;
|
|
521
|
+
causedBy?: IPlaytestCausedByAssertion[];
|
|
522
|
+
sceneNodes?: IPlaytestSceneNodesAssertion[];
|
|
523
|
+
startup?: IPlaytestStartupAssertion;
|
|
352
524
|
states?: IPlaytestStateAssertion[];
|
|
353
525
|
tags?: IPlaytestTagCountAssertion[];
|
|
354
526
|
visibility?: IPlaytestVisibilityAssertion[];
|
|
@@ -371,6 +543,39 @@ interface IPlaytestParityConfig {
|
|
|
371
543
|
resources?: string[];
|
|
372
544
|
targets?: PlaytestTarget[];
|
|
373
545
|
}
|
|
546
|
+
/** What the parity reference's saved run report yielded, extracted at scenario load. */
|
|
547
|
+
interface IPlaytestParityReference {
|
|
548
|
+
/** Frames per second of the reference run: 1000 ÷ the median frame time of its series. */
|
|
549
|
+
fps: number;
|
|
550
|
+
/** Render-phase p95 of the reference run, when its series carries the phase split. */
|
|
551
|
+
renderP95?: number;
|
|
552
|
+
/** The device the reference run executed on, when it measured one. */
|
|
553
|
+
serial?: string;
|
|
554
|
+
/** The reference run's own thermal verdict, when it measured one. */
|
|
555
|
+
thermallyConfounded?: boolean;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* PRD-222 Tier 2: the same scene on the same device, twice — once in the platform's browser,
|
|
559
|
+
* once on the native host. The assertion lives in the second run of the pair and names the
|
|
560
|
+
* first run's saved report.
|
|
561
|
+
*
|
|
562
|
+
* It proves what the artifacts can prove: the same device (both halves' `deviceMetrics.serial`),
|
|
563
|
+
* a thermally comparable pair, and the directed fps ratio. Which scene the reference ran is the
|
|
564
|
+
* pair protocol the operator owns — the report format carries no scene identity — so this
|
|
565
|
+
* assertion never claims it did.
|
|
566
|
+
*/
|
|
567
|
+
interface IPlaytestParityAssertion {
|
|
568
|
+
/** Floor on nativeFps ÷ webFps. Tier 2's Floor is 0.85; Target 0.95. */
|
|
569
|
+
minFpsRatio: number;
|
|
570
|
+
/** Optional floor on the inverted render-phase p95 ratio; fails closed when either side's series lacks the split. */
|
|
571
|
+
minRenderParity?: number;
|
|
572
|
+
/** Path to the other half's saved run report JSON, resolved against the project. */
|
|
573
|
+
referenceReport: string;
|
|
574
|
+
/** Which side of the pair the reference report is; the directed ratio needs it. */
|
|
575
|
+
referenceSide: "browser" | "native";
|
|
576
|
+
/** Hydrated from the reference report at scenario load; never set by hand. */
|
|
577
|
+
reference?: IPlaytestParityReference;
|
|
578
|
+
}
|
|
374
579
|
interface IPlaytestArtifactRequest {
|
|
375
580
|
console?: boolean;
|
|
376
581
|
contactSheet?: boolean;
|
|
@@ -434,6 +639,8 @@ interface IPlaytestScenario {
|
|
|
434
639
|
acceptanceId?: string;
|
|
435
640
|
artifacts?: IPlaytestArtifactRequest;
|
|
436
641
|
assert?: IPlaytestScenarioAssertions;
|
|
642
|
+
/** Test-only browser seam that makes the renderer's no-adapter boot path deterministic. */
|
|
643
|
+
bootFailure?: "renderer-no-adapter";
|
|
437
644
|
/**
|
|
438
645
|
* Wait for the application to finish its own startup before the first observation. Default
|
|
439
646
|
* true, because a fixed-step run otherwise observes a game that has not finished loading.
|
|
@@ -625,10 +832,19 @@ interface IPlaytestSetupRecord {
|
|
|
625
832
|
kind: "aim" | "entities" | "place" | "resources" | "spawn";
|
|
626
833
|
value: JsonValue;
|
|
627
834
|
}
|
|
628
|
-
/**
|
|
835
|
+
/**
|
|
836
|
+
* Requested overrides next to what actually applied; an unapplied request fails the run.
|
|
837
|
+
*
|
|
838
|
+
* `confirmedBy` says which of those two sentences the evidence supports. `read-back` means the
|
|
839
|
+
* bridge named the ids it applied and `applied` is that answer. `throw-contract` means the bridge
|
|
840
|
+
* resolved without naming anything, so the only evidence is that it did not throw — `applied`
|
|
841
|
+
* mirrors `requested` there, and the field is what stops the report reading as a confirmation it
|
|
842
|
+
* never received.
|
|
843
|
+
*/
|
|
629
844
|
interface IPlaytestSetupApplication {
|
|
630
845
|
applied: IPlaytestSetupRecord[];
|
|
631
846
|
requested: IPlaytestSetupRecord[];
|
|
847
|
+
confirmedBy?: "read-back" | "throw-contract";
|
|
632
848
|
}
|
|
633
849
|
interface IPlaytestTransformSample {
|
|
634
850
|
frame: number;
|
|
@@ -687,6 +903,14 @@ interface IPlaytestReport {
|
|
|
687
903
|
observations?: IPlaytestObservations;
|
|
688
904
|
pathLength?: number;
|
|
689
905
|
setup?: IPlaytestSetupApplication;
|
|
906
|
+
/**
|
|
907
|
+
* The target the run executed on — `browser`, `android`, `desktop`, `ios`.
|
|
908
|
+
*
|
|
909
|
+
* Not the scenario file's `target` field, which the two differ from routinely:
|
|
910
|
+
* `examples/native-smoke/playtests/*.json` say `"target": "web"` and are driven with
|
|
911
|
+
* `--target android`. Evaluators that must know what the lane can observe read this one.
|
|
912
|
+
*/
|
|
913
|
+
target?: string;
|
|
690
914
|
trivialityOptOuts: IPlaytestTrivialityOptOut[];
|
|
691
915
|
}
|
|
692
916
|
|
|
@@ -711,6 +935,14 @@ interface IPlaytestAssertionResult {
|
|
|
711
935
|
id: string;
|
|
712
936
|
pass: boolean;
|
|
713
937
|
}
|
|
938
|
+
interface IPlaytestVisualElementRegionObservation {
|
|
939
|
+
assertionIndex: number;
|
|
940
|
+
bounds?: IPlaytestVisualRegionBounds;
|
|
941
|
+
darkPixelRatio?: number;
|
|
942
|
+
element: IPlaytestVisualRegionTarget;
|
|
943
|
+
nonblankPixelRatio?: number;
|
|
944
|
+
rendered: boolean;
|
|
945
|
+
}
|
|
714
946
|
interface IPlaytestObservations {
|
|
715
947
|
animation?: unknown;
|
|
716
948
|
components?: Record<string, Record<string, {
|
|
@@ -764,11 +996,24 @@ interface IPlaytestObservations {
|
|
|
764
996
|
tick: number;
|
|
765
997
|
}>;
|
|
766
998
|
performanceSeries?: unknown[];
|
|
999
|
+
/** Bounded shader/pipeline creation capture from the engine's renderer boundary. */
|
|
1000
|
+
pipelineCensus?: JsonValue;
|
|
767
1001
|
renderChain?: IPlaytestRenderChainObservation;
|
|
768
1002
|
resources: Record<string, {
|
|
769
1003
|
after?: unknown;
|
|
770
1004
|
before?: unknown;
|
|
771
1005
|
}>;
|
|
1006
|
+
/** Lights, materials, fog, background, camera framing and world extent, as the bridge found them. */
|
|
1007
|
+
scene?: IPlaytestSceneObservation;
|
|
1008
|
+
sceneNodes?: IPlaytestSceneNodesObservation[];
|
|
1009
|
+
/** The startup observation the runner waited on, with the rule it resolved under. */
|
|
1010
|
+
startup?: {
|
|
1011
|
+
compileSettled?: boolean;
|
|
1012
|
+
phase: string;
|
|
1013
|
+
progress: number;
|
|
1014
|
+
rule?: string;
|
|
1015
|
+
timeline?: IPlaytestStartupTimeline;
|
|
1016
|
+
};
|
|
772
1017
|
resourceSeries?: Array<{
|
|
773
1018
|
label: string;
|
|
774
1019
|
snapshots: Record<string, unknown>;
|
|
@@ -792,6 +1037,7 @@ interface IPlaytestObservations {
|
|
|
792
1037
|
};
|
|
793
1038
|
changedPixelRatio?: number;
|
|
794
1039
|
comparisonSource?: string;
|
|
1040
|
+
elementRegions?: IPlaytestVisualElementRegionObservation[];
|
|
795
1041
|
nonblankRegions?: Array<{
|
|
796
1042
|
darkPixelRatio?: number;
|
|
797
1043
|
height: number;
|
|
@@ -804,7 +1050,26 @@ interface IPlaytestObservations {
|
|
|
804
1050
|
runtimeDiagnosticsSeries?: unknown[];
|
|
805
1051
|
};
|
|
806
1052
|
}
|
|
807
|
-
|
|
1053
|
+
/**
|
|
1054
|
+
* The policy the evaluator actually applies, defaults included.
|
|
1055
|
+
*
|
|
1056
|
+
* `target` is the target the run *executed on*, not the scenario file's `target` field — the two
|
|
1057
|
+
* differ routinely, because `examples/native-smoke/playtests/*.json` say `"target": "web"` and are
|
|
1058
|
+
* driven with `--target android`.
|
|
1059
|
+
*
|
|
1060
|
+
* Why the target matters: the three channels default to on, and the evaluator applies that default
|
|
1061
|
+
* on every run. On a device lane the network observation is hardwired empty, so
|
|
1062
|
+
* `noNetworkErrors: true` was compared against an empty array and reported a passing row — a green
|
|
1063
|
+
* computed from evidence the target structurally cannot produce, which is the one thing this
|
|
1064
|
+
* harness exists not to do. The asymmetry was visible in the scenarios too: one that spelled out
|
|
1065
|
+
* `noNetworkErrors: true` failed honestly with `TN_PLAYTEST_UNSUPPORTED_ON_TARGET`, and the same
|
|
1066
|
+
* scenario with the field omitted passed.
|
|
1067
|
+
*
|
|
1068
|
+
* So on a network-blind target the default is **off, with the reason recorded in the policy the
|
|
1069
|
+
* report prints**. An explicit `true` is left exactly as written, because that is a scenario asking
|
|
1070
|
+
* for something the target cannot do, and the runner still fails it by name.
|
|
1071
|
+
*/
|
|
1072
|
+
declare function resolveDiagnosticsPolicy(policy: IPlaytestDiagnosticsAssertion | undefined, target?: string): IPlaytestDiagnosticsPolicy;
|
|
808
1073
|
interface IPlaytestFramebufferCoverageObservation {
|
|
809
1074
|
boundarySource: "scenario-steps" | "video-backdrop-dominance";
|
|
810
1075
|
firstViolation?: {
|
|
@@ -822,7 +1087,7 @@ interface IPlaytestFramebufferCoverageObservation {
|
|
|
822
1087
|
windowStarted: boolean;
|
|
823
1088
|
}
|
|
824
1089
|
|
|
825
|
-
type PlaytestDiagnosticCode = "TN_PLAYTEST_BRIDGE_INCOMPATIBLE" | "TN_PLAYTEST_BRIDGE_CAPABILITY_UNKNOWN" | "TN_PLAYTEST_BRIDGE_MISSING" | "TN_PLAYTEST_BRIDGE_NOT_READY" | "TN_PLAYTEST_CAPTURE_PROVENANCE_MISSING" | "TN_PLAYTEST_CAPABILITY_MISSING" | "TN_PLAYTEST_DEVICE_FAILED" | "TN_PLAYTEST_HOST_EXITED" | "TN_PLAYTEST_MAILBOX_POLL_STALLED" | "TN_PLAYTEST_OBSERVATION_UNAVAILABLE" | "TN_PLAYTEST_OPERATION_TIMEOUT" | "TN_PLAYTEST_PAGE_CRASHED" | "TN_PLAYTEST_PAGE_NAVIGATED" | "TN_PLAYTEST_PAYLOAD_TOO_LARGE" | "TN_PLAYTEST_SERVER_FAILED" | "TN_PLAYTEST_SETUP_UNAPPLIED" | "TN_PLAYTEST_STARTUP_ABORTED" | "TN_PLAYTEST_STARTUP_NOT_READY" | "TN_PLAYTEST_UNSUPPORTED_ON_TARGET";
|
|
1090
|
+
type PlaytestDiagnosticCode = "TN_PLAYTEST_BRIDGE_INCOMPATIBLE" | "TN_PLAYTEST_BRIDGE_CAPABILITY_UNKNOWN" | "TN_PLAYTEST_BRIDGE_MISSING" | "TN_PLAYTEST_BRIDGE_NOT_READY" | "TN_PLAYTEST_CAPTURE_PROVENANCE_MISSING" | "TN_PLAYTEST_CAPABILITY_MISSING" | "TN_PLAYTEST_DEVICE_FAILED" | "TN_PLAYTEST_HOST_EXITED" | "TN_PLAYTEST_MAILBOX_POLL_STALLED" | "TN_PLAYTEST_OBSERVATION_UNAVAILABLE" | "TN_PLAYTEST_OPERATION_TIMEOUT" | "TN_PLAYTEST_PAGE_CRASHED" | "TN_PLAYTEST_PAGE_NAVIGATED" | "TN_PLAYTEST_PAYLOAD_TOO_LARGE" | "TN_PLAYTEST_SERVER_FAILED" | "TN_PLAYTEST_SETUP_UNAPPLIED" | "TN_PLAYTEST_STARTUP_ABORTED" | "TN_PLAYTEST_STARTUP_HOST_EXITED" | "TN_PLAYTEST_STARTUP_NOT_READY" | "TN_PLAYTEST_UNSUPPORTED_ON_TARGET";
|
|
826
1091
|
interface IPlaytestProtocolDiagnostic {
|
|
827
1092
|
capability?: string;
|
|
828
1093
|
code: PlaytestDiagnosticCode;
|
|
@@ -838,4 +1103,4 @@ declare function playtestDiagnostic(code: PlaytestDiagnosticCode, message: strin
|
|
|
838
1103
|
nextCommand?: string;
|
|
839
1104
|
}): IPlaytestProtocolDiagnostic;
|
|
840
1105
|
|
|
841
|
-
export { type
|
|
1106
|
+
export { type IPlaytestSetupRecord as A, type IPlaytestSignalAssertion as B, type IPlaytestStartupAssertion as C, DEVICE_METRICS_CADENCE_MS as D, type IPlaytestTrivialityOptOut as E, type IPlaytestVisualAssertion as F, type IPlaytestVisualElementRegion as G, HOT_START_TEMPERATURE_C as H, type IPlaytestStep as I, type IPlaytestVisualElementRegionObservation as J, type IPlaytestVisualRegion as K, type IPlaytestVisualRegionBounds as L, type IPlaytestVisualRegionTarget as M, type IPlaytestWheel as N, type IPlaytestWorldRuntimeAssertion as O, type PlaytestTarget as P, type PlaytestDeviceMeasurement as Q, type PlaytestDevicePowerRails as R, type PlaytestVec3 as S, parseDeviceBattery as T, parseDeviceCurrent as U, parseDevicePowerRails as V, parseDeviceThermal as W, playtestDiagnostic as X, resolveDiagnosticsPolicy as Y, summarizeDeviceMetrics as Z, type IPlaytestScenarioDiagnostic as a, type IPlaytestScenario as b, type IPlaytestReport as c, type IPlaytestAssertionResult as d, type IPlaytestDiagnostic as e, DEVICE_METRICS_MAX_SAMPLES as f, DeviceMetricsError as g, DeviceMetricsRecorder as h, type IPlaytestArtifactRequest as i, type IPlaytestCaptureProvenance as j, type IPlaytestDeviceBattery as k, type IPlaytestDeviceMetricsObservation as l, type IPlaytestDeviceMetricsSample as m, type IPlaytestDeviceMetricsVerdict as n, type IPlaytestDeviceThermal as o, type IPlaytestDiagnosticsPolicy as p, type IPlaytestFramebufferCoverageAssertion as q, type IPlaytestFramebufferCoverageObservation as r, type IPlaytestObservations as s, type IPlaytestPathAssertion as t, type IPlaytestPerformanceAssertion as u, type IPlaytestPointer as v, type IPlaytestProtocolDiagnostic as w, type IPlaytestRenderChainAssertion as x, type IPlaytestResourceWait as y, type IPlaytestSetupApplication as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as IPlaytestStep, a as IPlaytestScenarioDiagnostic, b as IPlaytestScenario, P as PlaytestTarget, c as IPlaytestReport, d as IPlaytestAssertionResult, e as IPlaytestDiagnostic } from './diagnostics-
|
|
2
|
-
export { D as DEVICE_METRICS_CADENCE_MS, f as DEVICE_METRICS_MAX_SAMPLES, g as DeviceMetricsError, h as DeviceMetricsRecorder, H as HOT_START_TEMPERATURE_C, i as IPlaytestArtifactRequest, j as IPlaytestCaptureProvenance, k as IPlaytestDeviceBattery, l as IPlaytestDeviceMetricsObservation, m as IPlaytestDeviceMetricsSample, n as IPlaytestDeviceMetricsVerdict, o as IPlaytestDeviceThermal, p as IPlaytestDiagnosticsPolicy, q as IPlaytestFramebufferCoverageAssertion, r as IPlaytestFramebufferCoverageObservation, s as IPlaytestObservations, t as IPlaytestPathAssertion, u as IPlaytestPerformanceAssertion, v as IPlaytestPointer, w as IPlaytestProtocolDiagnostic, x as IPlaytestRenderChainAssertion, y as
|
|
3
|
-
export { IPlaytestBridgeDescription, IPlaytestBridgeReady, IPlaytestBridgeV1, IPlaytestContactObservation, IPlaytestDeviceRequest, IPlaytestDeviceResponse, IPlaytestGameplayObservation, IPlaytestObservationSnapshot, IPlaytestPerformanceObservation, IPlaytestRenderChainObservation, IPlaytestRuntimeDiagnosticsSample, IPlaytestSampleRequest, IPlaytestSetupRequest, IPlaytestStartupObservation, IPlaytestWorldObservation, IPlaytestWorldRuntimeObservation, JsonValue, PLAYTEST_ADVANCE_TICK_BUDGET_MS, PLAYTEST_BRIDGE_GLOBAL, PLAYTEST_FROZEN_MARKER, PLAYTEST_PROTOCOL_LIMITS, PLAYTEST_PROTOCOL_VERSION, PLAYTEST_STARTUP_COMPILE_BUDGET_MS, PLAYTEST_STARTUP_READY_TIMEOUT_MS, assertJsonSafe, jsonByteLength } from './protocol.js';
|
|
1
|
+
import { I as IPlaytestStep, a as IPlaytestScenarioDiagnostic, b as IPlaytestScenario, P as PlaytestTarget, c as IPlaytestReport, d as IPlaytestAssertionResult, e as IPlaytestDiagnostic } from './diagnostics-f8464bJw.js';
|
|
2
|
+
export { D as DEVICE_METRICS_CADENCE_MS, f as DEVICE_METRICS_MAX_SAMPLES, g as DeviceMetricsError, h as DeviceMetricsRecorder, H as HOT_START_TEMPERATURE_C, i as IPlaytestArtifactRequest, j as IPlaytestCaptureProvenance, k as IPlaytestDeviceBattery, l as IPlaytestDeviceMetricsObservation, m as IPlaytestDeviceMetricsSample, n as IPlaytestDeviceMetricsVerdict, o as IPlaytestDeviceThermal, p as IPlaytestDiagnosticsPolicy, q as IPlaytestFramebufferCoverageAssertion, r as IPlaytestFramebufferCoverageObservation, s as IPlaytestObservations, t as IPlaytestPathAssertion, u as IPlaytestPerformanceAssertion, v as IPlaytestPointer, w as IPlaytestProtocolDiagnostic, x as IPlaytestRenderChainAssertion, y as IPlaytestResourceWait, z as IPlaytestSetupApplication, A as IPlaytestSetupRecord, B as IPlaytestSignalAssertion, C as IPlaytestStartupAssertion, E as IPlaytestTrivialityOptOut, F as IPlaytestVisualAssertion, G as IPlaytestVisualElementRegion, J as IPlaytestVisualElementRegionObservation, K as IPlaytestVisualRegion, L as IPlaytestVisualRegionBounds, M as IPlaytestVisualRegionTarget, N as IPlaytestWheel, O as IPlaytestWorldRuntimeAssertion, Q as PlaytestDeviceMeasurement, R as PlaytestDevicePowerRails, S as PlaytestVec3, T as parseDeviceBattery, U as parseDeviceCurrent, V as parseDevicePowerRails, W as parseDeviceThermal, X as playtestDiagnostic, Y as resolveDiagnosticsPolicy, Z as summarizeDeviceMetrics } from './diagnostics-f8464bJw.js';
|
|
3
|
+
export { IPlaytestBridgeDescription, IPlaytestBridgeReady, IPlaytestBridgeV1, IPlaytestCameraObservation, IPlaytestContactObservation, IPlaytestDeviceRequest, IPlaytestDeviceResponse, IPlaytestFogObservation, IPlaytestGameplayObservation, IPlaytestLightObservation, IPlaytestObservationSnapshot, IPlaytestPerformanceObservation, IPlaytestRenderChainObservation, IPlaytestRuntimeDiagnosticsSample, IPlaytestSampleRequest, IPlaytestSceneObservation, IPlaytestSetupConfirmation, IPlaytestSetupRequest, IPlaytestStartupObservation, IPlaytestStartupTimeline, IPlaytestStrideObservation, IPlaytestWorldObservation, IPlaytestWorldRuntimeObservation, JsonValue, PLAYTEST_ADVANCE_TICK_BUDGET_MS, PLAYTEST_BRIDGE_GLOBAL, PLAYTEST_FROZEN_MARKER, PLAYTEST_PROTOCOL_LIMITS, PLAYTEST_PROTOCOL_VERSION, PLAYTEST_STARTUP_COMPILE_BUDGET_MS, PLAYTEST_STARTUP_READY_TIMEOUT_MS, assertJsonSafe, jsonByteLength } from './protocol.js';
|
|
4
4
|
|
|
5
|
-
type PlaytestCapability = "browser.canvas" | "browser.console" | "browser.dom" | "browser.input" | "browser.network" | "browser.screenshot" | "browser.trace" | "camera.observe" | "device.metrics" | "entity.bounds" | "entity.observe" | "entity.setup" | "runtime.animation" | "runtime.audio" | "runtime.components" | "runtime.contacts" | "runtime.diagnostics" | "runtime.events" | "runtime.fixedStep" | "runtime.physics" | "runtime.performance" | "runtime.renderChain" | "runtime.resources" | "runtime.startup" | "runtime.state" | "runtime.tags" | "runtime.ui" | "runtime.world";
|
|
5
|
+
type PlaytestCapability = "browser.canvas" | "browser.console" | "browser.dom" | "browser.input" | "browser.network" | "browser.screenshot" | "browser.trace" | "camera.observe" | "device.metrics" | "entity.bounds" | "entity.observe" | "entity.setup" | "runtime.animation" | "runtime.audio" | "runtime.components" | "runtime.contacts" | "runtime.diagnostics" | "runtime.events" | "runtime.fixedStep" | "runtime.physics" | "runtime.performance" | "runtime.pipelineCensus" | "runtime.renderChain" | "runtime.resources" | "runtime.startup" | "runtime.state" | "runtime.tags" | "runtime.transitions" | "runtime.ui" | "runtime.world" | "scene.nodes" | "scene.observe";
|
|
6
6
|
interface IPlaytestCapabilityDescriptor {
|
|
7
7
|
description: string;
|
|
8
8
|
name: PlaytestCapability;
|
|
@@ -44,7 +44,7 @@ interface IPlaytestAssertionSchemaEntry {
|
|
|
44
44
|
trivialityRationale: string;
|
|
45
45
|
}
|
|
46
46
|
declare const PLAYTEST_ASSERTION_REGISTRY: readonly IPlaytestAssertionSchemaEntry[];
|
|
47
|
-
declare function requiredPlaytestCapabilities(scenario: IPlaytestScenario): PlaytestCapability[];
|
|
47
|
+
declare function requiredPlaytestCapabilities(scenario: IPlaytestScenario, target?: string): PlaytestCapability[];
|
|
48
48
|
|
|
49
49
|
declare function evaluateRichPlaytestAssertions(input: {
|
|
50
50
|
report: IPlaytestReport;
|