From a56f2f935260aec31555662b772a92d0ae6540c1 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Wed, 4 Nov 2026 00:24:47 +0400 Subject: [PATCH] Assert the soak's heap slope over the second half of the run and report the warm-up slope beside it Under the soak workload V8's compiled code and the layers' caches grow for about 250 switches and then the heap is flat (121.4, 121.7, 120.4, 119.1 MiB after 250 to 400 switches), so a line fitted from switch 20 measured the warm-up. Over the second half the threshold stays 10 KiB per switch; the run before the layer effect fix measures 19 KiB there. --- scripts/qa-strict-soak.mjs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/qa-strict-soak.mjs b/scripts/qa-strict-soak.mjs index d5d3ffbd9..1373a85be 100644 --- a/scripts/qa-strict-soak.mjs +++ b/scripts/qa-strict-soak.mjs @@ -17,7 +17,11 @@ // With --assert (the long run), after the warm-up (switch 20): live WebGL // objects per engine context grow by at most 0.1 per switch (least-squares // slope over the checkpoints) and by at most 64 overall; no new WebGL -// context; JS heap slope at most 10 KiB per switch; no new document; the +// context; JS heap slope at most 10 KiB per switch over the second half of +// the run (the first half is reported too: V8's compiled code and the +// layers' caches grow for about 250 switches under this workload, then the +// heap is flat, while a retained object per switch keeps growing); no new +// document; the // webglcontextlost/restored listener counts on both engine canvases stay as // they were (each canvas keeps its webglcontextlost listener). // @@ -345,12 +349,17 @@ if (strictMode) { pass: last.webgl.length === first.webgl.length, }); const heap = late.map((c) => [c.swap, c.heapMiB * 1024]); + const steady = heap.filter(([swap]) => swap >= swaps / 2); + assert.ok(steady.length >= 2, 'enough checkpoints in the second half'); checks.push({ - check: 'JS heap KiB per switch', - slopePerSwap: Math.round(slope(heap) * 100) / 100, - fromMiB: first.heapMiB, + check: 'JS heap KiB per switch, second half', + slopePerSwap: Math.round(slope(steady) * 100) / 100, + fromSwitch: steady[0][0], + fromMiB: Math.round((steady[0][1] / 1024) * 100) / 100, toMiB: last.heapMiB, - pass: slope(heap) <= 10, + warmUpSlopePerSwap: Math.round(slope(heap) * 100) / 100, + warmUpFromMiB: first.heapMiB, + pass: slope(steady) <= 10, }); checks.push({ check: 'documents',