Skip to content

Commit fa9f94e

Browse files
committed
fix: update prepare clears table before rebuild; exclude budget breaches from within-budget note
- pair.mjs: prepare() for update now clears the table to 0 rows before ensureState rebuilds it, so the waitForFunction transition from 0→1000 is meaningful even when the table already has 1000 rows from a prior sample. - pr-report.mjs: over-budget rows are excluded from the 'within budget' headline note so a metric cannot be reported as both exceeding its budget and growing within it.
1 parent 1e5e09d commit fa9f94e

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎benchmarks/js-framework/pair.mjs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,11 @@ const parityFor = (op, repeat) => {
175175
// freshly built rows instead.
176176
async function prepare(page, op) {
177177
if (op.name === 'update') {
178-
await page.evaluate(() => document.getElementById('run').click());
179-
await page.waitForFunction(() => document.querySelectorAll('tbody tr').length === 1000, null, {
178+
await page.evaluate(() => {
179+
const btn = document.getElementById('clear');
180+
if (btn) btn.click();
181+
});
182+
await page.waitForFunction(() => document.querySelectorAll('tbody tr').length === 0, {
180183
timeout: 5000,
181184
});
182185
}

‎benchmarks/pr-report.mjs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ export function analyzeReport({
255255
if (SUITE_INFO[suite]?.workGate && larger.length) {
256256
failures.push(`❌ ${suite}: ${larger.length} work counter(s) increased`);
257257
} else if (larger.length) {
258-
notes.push(`🔴 ${suite}: ${larger.length} value(s) increased within budget`);
258+
const breachSet = new Set(breaches.map((b) => `${b.target}\0${b.op}`));
259+
const withinBudget = larger.filter((row) => !breachSet.has(`${row.target}\0${row.op}`));
260+
if (withinBudget.length) {
261+
notes.push(`🔴 ${suite}: ${withinBudget.length} value(s) increased within budget`);
262+
}
259263
}
260264
const slower = timing.filter((row) => row.verdict === 'slower').length;
261265
if (slower) notes.push(`🟡 ${suite}: ${slower} timed operation(s) slower beyond ±3%`);

0 commit comments

Comments
 (0)