From bceb096e83de34e4bc23c34f8b3e2e1e4caae98f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 28 Sep 2026 06:11:23 +0000 Subject: [PATCH] fix(performance): report slack usage only for entries that have slack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A wall-clock measurement above `value` but within `value × toleranceRatio` fell into the slack branch and was reported as using "slack", conflating timing tolerance with counter slack. Only entries with `slack` report it now. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0166PWobUjpoiWt8E9bBdsCs --- tools/performance/check-journey-ratchet.mjs | 2 +- tools/performance/check-journey-ratchet.test.mjs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/performance/check-journey-ratchet.mjs b/tools/performance/check-journey-ratchet.mjs index c9c08d1e4..b03bd70eb 100644 --- a/tools/performance/check-journey-ratchet.mjs +++ b/tools/performance/check-journey-ratchet.mjs @@ -188,7 +188,7 @@ export function compareToBaselines({ baselines, summary, only = [] }) { result.failures.push( `${label}: ${formatNumber(measured)}${unit} exceeds ${limitText} by ${formatNumber(measured - limit)}${unit}. Bring the value back down; baselines only move down. If the growth is a deliberate trade-off, raise the baseline in ${DEFAULT_BASELINES_PATH}, make the case in the PR, and ask a maintainer to add the ${BASELINE_INCREASE_LABEL} label.` ); - } else if (measured > entry.value) { + } else if (entry.slack && measured > entry.value) { result.passed.push( `${label}: ${formatNumber(measured)}${unit} within ${limitText}; uses ${formatNumber(measured - entry.value)} of ${formatNumber(limit - entry.value)}${unit} slack.` ); diff --git a/tools/performance/check-journey-ratchet.test.mjs b/tools/performance/check-journey-ratchet.test.mjs index ea13a0ec9..dd3a44cf7 100644 --- a/tools/performance/check-journey-ratchet.test.mjs +++ b/tools/performance/check-journey-ratchet.test.mjs @@ -155,8 +155,9 @@ test('wall-clock entries fail only above value × toleranceRatio', () => { assert.deepEqual(within.failures, []); assert.match( within.passed[1], - /1,250 ms within 1,250 \(baseline 1,000 × 1\.25\)/ + /1,250 ms within 1,250 \(baseline 1,000 × 1\.25\)\.$/ ); + assert.doesNotMatch(within.passed[1], /slack/); const above = compareToBaselines({ baselines,