@threenative/playtest 0.3.9 → 0.3.11
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/protocol.d.ts +2 -0
- package/dist/runner/cli.js +7 -1
- package/dist/runner/index.js +7 -1
- package/package.json +4 -4
package/dist/protocol.d.ts
CHANGED
|
@@ -558,6 +558,8 @@ interface IPlaytestFramePassSample {
|
|
|
558
558
|
interface IPlaytestRuntimeDiagnosticsSample {
|
|
559
559
|
drawCalls?: number;
|
|
560
560
|
frameMs: number;
|
|
561
|
+
/** The frame's number in this run, when the engine counts them. */
|
|
562
|
+
sequence?: number;
|
|
561
563
|
/**
|
|
562
564
|
* Supplied by an engine that measures its own frame — `@threenative/core` fills it from the
|
|
563
565
|
* frame budget. Absent for a plain Three.js bridge.
|
package/dist/runner/cli.js
CHANGED
|
@@ -16915,6 +16915,12 @@ var SOFTWARE_DEVICE_LOSS = /TN_DEVICE_LOST|TN_WASM_DEVICE_LOST|WebGPU Device Los
|
|
|
16915
16915
|
function isSoftwareDeviceLossEntry(entry) {
|
|
16916
16916
|
return (entry.type === "error" || entry.type === "assert" || entry.type === "pageerror") && SOFTWARE_DEVICE_LOSS.test(entry.text);
|
|
16917
16917
|
}
|
|
16918
|
+
function framesAfterBaseline(before, after) {
|
|
16919
|
+
if (after === void 0 || before === void 0) return after ?? before;
|
|
16920
|
+
const baseline = before.at(-1)?.sequence;
|
|
16921
|
+
if (baseline === void 0 || before === after) return after;
|
|
16922
|
+
return after.filter(({ sequence }) => sequence === void 0 || sequence > baseline);
|
|
16923
|
+
}
|
|
16918
16924
|
function buildReport(config, scenario, beforeSnapshot, afterSnapshot, consoleEntries, networkEntries, pathLength = void 0, hud = {}, runtimeReady = true, visual = void 0, labeledSamples = [], framebufferCoverage = void 0, capture = void 0, captureFailure = void 0, movementSamples = [], setup = void 0, deviceMetrics = void 0, movementBaselineSnapshot = void 0, startup = void 0, deviceLifecycle = void 0, tone = void 0, footSlip = void 0, sightLine = void 0, hudAudit = void 0) {
|
|
16919
16925
|
const movementSample = isAnonymousMovementScenario(scenario) ? observedMovementSample(movementSamples) : void 0;
|
|
16920
16926
|
const entity = scenario.assert?.movement?.entity ?? scenario.subject ?? movementSample?.entity ?? "";
|
|
@@ -16935,7 +16941,7 @@ function buildReport(config, scenario, beforeSnapshot, afterSnapshot, consoleEnt
|
|
|
16935
16941
|
}
|
|
16936
16942
|
const movementDelta = beforePosition === void 0 || afterPosition === void 0 ? void 0 : subtract(afterPosition, beforePosition);
|
|
16937
16943
|
const distance = movementDelta === void 0 ? 0 : length(movementDelta);
|
|
16938
|
-
const performanceSeries = scenario.assert?.performance === void 0 && scenario.assert?.parity === void 0 ? void 0 :
|
|
16944
|
+
const performanceSeries = scenario.assert?.performance === void 0 && scenario.assert?.parity === void 0 ? void 0 : framesAfterBaseline(beforeSnapshot?.runtimeDiagnosticsSeries, afterSnapshot?.runtimeDiagnosticsSeries);
|
|
16939
16945
|
const softwareAdapter = capture?.rendererKind === "webgpu" ? softwareAdapterName(capture.adapter) : void 0;
|
|
16940
16946
|
const softwareLane = config.allowSoftwareAdapter === true && softwareAdapter !== void 0;
|
|
16941
16947
|
const deviceLossEntries = softwareLane ? consoleEntries.filter(isSoftwareDeviceLossEntry) : [];
|
package/dist/runner/index.js
CHANGED
|
@@ -14484,6 +14484,12 @@ var SOFTWARE_DEVICE_LOSS = /TN_DEVICE_LOST|TN_WASM_DEVICE_LOST|WebGPU Device Los
|
|
|
14484
14484
|
function isSoftwareDeviceLossEntry(entry) {
|
|
14485
14485
|
return (entry.type === "error" || entry.type === "assert" || entry.type === "pageerror") && SOFTWARE_DEVICE_LOSS.test(entry.text);
|
|
14486
14486
|
}
|
|
14487
|
+
function framesAfterBaseline(before, after) {
|
|
14488
|
+
if (after === void 0 || before === void 0) return after ?? before;
|
|
14489
|
+
const baseline = before.at(-1)?.sequence;
|
|
14490
|
+
if (baseline === void 0 || before === after) return after;
|
|
14491
|
+
return after.filter(({ sequence }) => sequence === void 0 || sequence > baseline);
|
|
14492
|
+
}
|
|
14487
14493
|
function buildReport(config, scenario, beforeSnapshot, afterSnapshot, consoleEntries, networkEntries, pathLength = void 0, hud = {}, runtimeReady = true, visual = void 0, labeledSamples = [], framebufferCoverage = void 0, capture = void 0, captureFailure = void 0, movementSamples = [], setup = void 0, deviceMetrics = void 0, movementBaselineSnapshot = void 0, startup = void 0, deviceLifecycle = void 0, tone = void 0, footSlip = void 0, sightLine = void 0, hudAudit = void 0) {
|
|
14488
14494
|
const movementSample = isAnonymousMovementScenario(scenario) ? observedMovementSample(movementSamples) : void 0;
|
|
14489
14495
|
const entity = scenario.assert?.movement?.entity ?? scenario.subject ?? movementSample?.entity ?? "";
|
|
@@ -14504,7 +14510,7 @@ function buildReport(config, scenario, beforeSnapshot, afterSnapshot, consoleEnt
|
|
|
14504
14510
|
}
|
|
14505
14511
|
const movementDelta = beforePosition === void 0 || afterPosition === void 0 ? void 0 : subtract(afterPosition, beforePosition);
|
|
14506
14512
|
const distance = movementDelta === void 0 ? 0 : length(movementDelta);
|
|
14507
|
-
const performanceSeries = scenario.assert?.performance === void 0 && scenario.assert?.parity === void 0 ? void 0 :
|
|
14513
|
+
const performanceSeries = scenario.assert?.performance === void 0 && scenario.assert?.parity === void 0 ? void 0 : framesAfterBaseline(beforeSnapshot?.runtimeDiagnosticsSeries, afterSnapshot?.runtimeDiagnosticsSeries);
|
|
14508
14514
|
const softwareAdapter = capture?.rendererKind === "webgpu" ? softwareAdapterName(capture.adapter) : void 0;
|
|
14509
14515
|
const softwareLane = config.allowSoftwareAdapter === true && softwareAdapter !== void 0;
|
|
14510
14516
|
const deviceLossEntries = softwareLane ? consoleEntries.filter(isSoftwareDeviceLossEntry) : [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenative/playtest",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Scenario-driven playtest harness for Three.js games. Runs on plain Three.js with zero ThreeNative dependencies.",
|
|
6
6
|
"keywords": [
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"playwright": ">=1.60.0 <2",
|
|
67
|
-
"three": ">=0.
|
|
67
|
+
"three": ">=0.187.0 <0.188.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"playwright": {
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/pngjs": "6.0.5",
|
|
79
|
-
"@types/three": "0.
|
|
79
|
+
"@types/three": "0.187.0",
|
|
80
80
|
"playwright": "1.62.1",
|
|
81
81
|
"publint": "0.3.22",
|
|
82
|
-
"three": "0.
|
|
82
|
+
"three": "0.187.0",
|
|
83
83
|
"tsup": "8.5.1",
|
|
84
84
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
85
85
|
"@typescript/native": "npm:typescript@7.0.2"
|