test: stabilize Optimize overhead benchmark

Use paired ABBA/BAAB batches for the p95 gate and accept the complete 104-frame Linux golden artifact. The four new #276 scenes were visually reviewed; every existing scene passed, and the nine byte changes contain zero pixels above their comparison threshold.

Issue: #276
User-Visible: no
Release: v1.67.0-beta.8
Baseline-Reviewed: https://github.com/Matysh/houseplan-card/actions/runs/32684802336
This commit is contained in:
Sergey Matyunin
2026-08-24 06:19:13 +03:00
parent b5519e997b
commit ff2f2063cf
14 changed files with 30 additions and 18 deletions
+15 -7
View File
@@ -6,7 +6,8 @@ import { makeLargeHouseFixture, LARGE_HOUSE_COUNTS } from './fixtures/large-hous
import { optimizePlans } from '../test-build/plan-optimizer.js';
const WARMUPS = 5;
const SAMPLES = 40;
const SAMPLES = 20;
const BATCH_SIZE = 10;
const RELATIVE_OVERHEAD = 0.15;
const ABSOLUTE_OVERHEAD_MS = 25;
@@ -24,9 +25,11 @@ const baseline = () => optimizePlans(fixture.config, {}, {}, {
const candidate = () => optimizePlans(fixture.config, {});
const timed = (operation) => {
const start = performance.now();
const result = operation();
if (!result || !result.report) throw new Error('Optimize candidate returned no report');
return performance.now() - start;
for (let index = 0; index < BATCH_SIZE; index++) {
const result = operation();
if (!result || !result.report) throw new Error('Optimize candidate returned no report');
}
return (performance.now() - start) / BATCH_SIZE;
};
for (let index = 0; index < WARMUPS; index++) {
baseline();
@@ -37,11 +40,15 @@ const baselineTimes = [];
const candidateTimes = [];
const overheadTimes = [];
for (let index = 0; index < SAMPLES; index++) {
// ABBA/BAAB cancels first-order clock drift and balances cache/GC order;
// batching then averages timer noise before the paired p95 is computed.
const candidateFirst = index % 2 === 1;
const first = timed(candidateFirst ? candidate : baseline);
const second = timed(candidateFirst ? baseline : candidate);
const baselineMs = candidateFirst ? second : first;
const candidateMs = candidateFirst ? first : second;
const third = timed(candidateFirst ? baseline : candidate);
const fourth = timed(candidateFirst ? candidate : baseline);
const baselineMs = candidateFirst ? (second + third) / 2 : (first + fourth) / 2;
const candidateMs = candidateFirst ? (first + fourth) / 2 : (second + third) / 2;
baselineTimes.push(baselineMs);
candidateTimes.push(candidateMs);
overheadTimes.push(candidateMs - baselineMs);
@@ -60,7 +67,7 @@ const summary = (values) => ({
const baselineSummary = summary(baselineTimes);
const candidateSummary = summary(candidateTimes);
const overheadSummary = summary(overheadTimes);
const measuredOverheadP95 = Math.max(0, candidateSummary.p95 - baselineSummary.p95);
const measuredOverheadP95 = Math.max(0, overheadSummary.p95);
const relativeP95 = measuredOverheadP95
/ Math.max(baselineSummary.p95, Number.EPSILON);
const pass = measuredOverheadP95 <= ABSOLUTE_OVERHEAD_MS
@@ -70,6 +77,7 @@ const report = {
fixture: LARGE_HOUSE_COUNTS,
warmups: WARMUPS,
samples: SAMPLES,
batchSize: BATCH_SIZE,
baseline: baselineSummary,
candidate: candidateSummary,
pairedOverhead: overheadSummary,
+15 -11
View File
@@ -1,10 +1,14 @@
{
"schema": 1,
"matrixVersion": 41,
"acceptedAt": "2026-08-23T23:38:00.874Z",
"sourceFingerprint": "af1824af6205db2cc22c067d7d406998166849eee896a0cd159977d7f76d1235",
"matrixVersion": 42,
"acceptedAt": "2026-08-24T03:17:51.035Z",
"sourceFingerprint": "5fddc45f204ffa2beae5854ebacbecb589e921f86c402693a3c5d756c4e4b4ef",
"chromium": "151.0.7922.34",
"scenarios": {
"coincident-partition-before-dark": "c0e38cfff096725cf1eb5dc91e005b2af983172d04e6573075db635275cabca3",
"coincident-partition-thin-dark": "3a33ebf94e6c19b0079cf66975180817146d68ae97d1f9ff4a26711f4ca54903",
"coincident-partition-thick-dark": "33f9296e765f4ea9922cb3b13d11b50306709ba4fcf3114d351eda1833399870",
"coincident-partition-virtual-dark": "84969a05c442549dac0bcbb7e507ee77967e42f75d0fdf3c8e8fbe2170c65834",
"split-corner-wall-before-dark": "3176dc67f54d5309f87c94e1077b4f69eb1db9f660469fbf97953038323430f3",
"split-corner-wall-thin-dark": "17e49394c300887bb5349bf477292571e96e209c9515db6853348883d95a1422",
"split-corner-wall-thick-dark": "309b8fe8a206f4f3fc50f6a27fc762a933f245b778e7b1f9a6348b66f39b2c39",
@@ -17,10 +21,10 @@
"isometric-large-warm-remount-dark": "d76e3334bf80bff265b1e8aa6770c5eff5df6fbfebeb4703b04d048c4252eb68",
"geometry-view-dark-fit": "30985326ad907fac4b93f848860e5b6c7737f24e8281706c3f69a189477f932f",
"geometry-view-light-fit": "310cca616bf1fc5fda4f1e8d58e80ddf2fe2662d088829e22eef7b9e6b5ddd93",
"room-label-parity-view-dark": "fa19d34b1a44093af124542194b6aaca66640b795daba4a2657a7f48bb18b94b",
"room-label-parity-plan-dark": "cf6427a4310be09e92a83d77c976a9543b83d095132f374f24b99f1f22456aaf",
"room-label-parity-view-dark": "7f1da43466a13f82a7595dddabe6938ed974debfb14c8f40e729e273a53ac4ff",
"room-label-parity-plan-dark": "5f976d5743d68a27b594e1a5ddf45e5ad3708f5c703409e5cefb7c96d3048096",
"room-label-parity-view-light": "ee3d303fb2b329c356a4354d355c29694130a38d4812ffbfefbe861f5d3f9860",
"room-label-parity-plan-light": "66074416944e8b6f37b1d9afd89d417b1fb3d351819fbc67aa619ca230a64da5",
"room-label-parity-plan-light": "d32b538499a031d4310b243cc9ef43610f6cd67aabfde7cd01b59c88b0363ec5",
"washer-active-cycle-dark": "d74a646bc71b8d6d0d5b09e6862b4846b0e369da2520afa76d5b3d601c832a15",
"washer-idle-cycle-dark": "f7fae5c2f6856a3df5bd3f3028fcf829ef0039c7b43c91c27ac86d25626e8d66",
"day-cycle-dawn-dark": "b01d9add378afb47912da10f6327d43177d4bbb0b42cb4323395fd01bf2fe8f5",
@@ -28,7 +32,7 @@
"day-cycle-dusk-dark": "a856187898fc425a48dd165f5ec01f0f50b78043b382f708dbffd810bfdbf043",
"day-cycle-night-dark": "b863260250d739fd369140356e195a64d3ac58478ab2c1e43415abd8f96a7fbd",
"geometry-plan-editor-dark": "a1ca4219a1e7b2c4749b72edad87cd0bdee793390cd6efe972aca1d41d0d2478",
"space-tab-drop-before-light": "86d8159ac6191980f2ac91b137c3947219da45fef81bc2b358442958eda9d0f8",
"space-tab-drop-before-light": "1a53fe6b18454361ac7fd9e8845641646f8ce761aea2963334a44542d42b3aa0",
"space-tab-drop-after-dark": "e5a77296c14ebbef95fd434739abd20d8089db7a311242aaea5a0f242baf000c",
"plan-snap-endpoint-light": "78225caf0522f69c294b299212a717260c31e9620bdefdc970dc84730ae06e17",
"plan-snap-line-gaps-dark": "61bac139592fd292a8e9ded541dc4b98912779f415f371108c2d99a18c7d9d57",
@@ -37,7 +41,7 @@
"wall-junctions-view-dark": "7b859c4f25f8a5dd4fca64d5b2f7aa64b65845fabbe83bc2388c2f99d29f71b1",
"junction-patch-resilience-plan-dark": "5dac2f2f81c801b0d9b1c0ee786f1f531906c80ddeec36f9c91b524468c13608",
"junction-patch-resilience-view-dark": "efe6e3ebd0e08e936bfa79886d5f55185198cf770a5d2473160cf2335be46340",
"multiwall-junction-bevel-view-dark": "d31c7455fcde451714c7387e1b8cbe1d89536a6affa5eb8ff379f2da81d5f441",
"multiwall-junction-bevel-view-dark": "70f7f0e7c60beb33853fc26445b6901d48299c2c92ddc41f6e1e2cfb4cac2320",
"orthogonal-strip-cell-5-view-dark": "9b8e4bd22cbf1a82ff48f052822967c61179290a3234ae48ef547642329b5a90",
"orthogonal-strip-cell-1-view-dark": "44e245db41ab9a4e575cefbf7656055dba7e27fc62c2b1215445517a9ea81386",
"wall-key-roundtrip-view-dark": "28895aa02eb995f976b26a2d2b3675954611641b60910f40427b15a95ef53e3e",
@@ -91,16 +95,16 @@
"toggle-entity-dialog-desktop-en": "f4924466de5e134c2d1f2456ff0c05f8aa8106f6b06398e87a263e3c536f16ea",
"toggle-entity-dialog-mobile-ru": "7d3aecd318c6c0774dd3ce1c21c0fafb1ae2be23cebed6f548fbf8bd11ab2f62",
"device-help-popover-light-ru": "add3275d74ced358a184ec9f864c83735f1196e2bff7d75fb3e12160cb85bfaf",
"decor-color-popover-mobile-ru": "fcdd138e396654e3517927c27d2062663c61860e8b9903471fa44651a4cbdefd",
"decor-color-popover-mobile-ru": "51725859afc6a1e2d1b2ae8be270ab584608901623ef7e2d283b6b195644fd16",
"decor-color-popover-desktop-en": "0a33f2a4ad6614bccbce45fbda1eaa505551e479b1eaada28ddcaf435a83f74f",
"general-color-popover-desktop-en": "91c3b7ebae5146c62d172d1ce10ae9e375ed955f23e9dc860976373a334d8be5",
"device-ripple-color-popover-mobile-ru": "3ab12c339106004c76fe3c7741d242269e157c40ddfa29afd8f13b445b0a7023",
"space-room-color-popover-desktop-ru": "a7b2c78d8b178eb1947937f9aebe2b02d67a0f6fed3b2a69a7bf0d7e24df50ac",
"space-room-color-popover-desktop-ru": "d66d068a1b403f88a5bd3c57f4a9e55c336767c533ddfe3ae251cc4f9da40a74",
"backup-full-preview-desktop-en": "252f4f687f188645f0b22a49f03c63725aefc6bda5ff2e930a33b8ac729544a8",
"backup-plan-only-export-desktop-en": "e31f7709e60f1f6488a703b9089cd44e158691f3808a2be48323772c27e4847d",
"backup-space-preview-mobile-ru": "698e81b952a26e50b60d2ec85321c43035ff4376a5a348eeed39726804cead78",
"optimize-preflight-dialog-dark-en": "835ec4af63c8d06e3dee07e123b64a857442a71d8a64216bba9b8c72db6c56ad",
"optimize-preflight-dialog-light-ru": "c747271ba6de5ecf8e5262772535787a9c567cee5c171567c73c53484d724b71",
"optimize-preflight-dialog-light-ru": "de43f205fdf16d290603543a02ced9492d1b5a35e089fa6023c98efdf32ed7c3",
"optimize-orphan-references-dark-en": "ce2116ffefd64e6b38921c3afd2a5d9bd9329e8a2aec102eb42a032d23a7d000",
"optimize-orphan-references-light-ru": "5a4152df98a34e724b25c0d331fd691fa63eaba753bd4a9c5b173a454c148ecd",
"card-editor-invalid-default-floor-light-en": "dbf251ece014cfee252e0dcb2d7c00eda66aa4b5bd125e4c83e248d4319d24b3",
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 KiB

After

Width:  |  Height:  |  Size: 325 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 KiB

After

Width:  |  Height:  |  Size: 356 KiB