From 13259e76b5ed50ccc92006fa7e6720c664aceb42 Mon Sep 17 00:00:00 2001 From: Carla Severe Date: Wed, 17 Jun 2026 17:33:59 -0700 Subject: [PATCH 1/3] mannWhitney: drive Sig column from bootstrap CI The Sig column, its filter, its sort, and the expanded-row alert now all read from a single precomputed bootstrap (BCa) CI on the difference of medians, replacing the Mann-Whitney p-value's `interpretation` string as the source of truth. --- .../CompareResults/ResultsTable.test.tsx | 246 +++++++++--------- .../CompareResults/RevisionRow.test.tsx | 43 --- .../SubtestsResultsView.test.tsx | 60 ++--- .../SubtestsRevisionRow.test.tsx | 6 +- .../OverTimeResultsView.test.tsx.snap | 60 ++++- .../__snapshots__/ResultsTable.test.tsx.snap | 183 +++++++++---- .../__snapshots__/ResultsView.test.tsx.snap | 86 +++--- .../SubtestsResultsView.test.tsx.snap | 135 +--------- src/common/constants.ts | 4 +- src/common/testVersions/mannWhitney.tsx | 69 +++-- .../CompareResults/PValCliffsDeltaComp.tsx | 16 +- src/components/CompareResults/loader.ts | 21 ++ .../CompareResults/overTimeLoader.ts | 13 + .../CompareResults/subtestsLoader.ts | 13 +- .../CompareResults/subtestsOverTimeLoader.tsx | 10 +- src/types/state.ts | 4 + 16 files changed, 529 insertions(+), 440 deletions(-) diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx index c663ada1d..4f0e558d9 100644 --- a/src/__tests__/CompareResults/ResultsTable.test.tsx +++ b/src/__tests__/CompareResults/ResultsTable.test.tsx @@ -722,9 +722,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ' rev: devilrabbit', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -748,11 +748,11 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); @@ -762,9 +762,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'linux', 'android', 'ios'], @@ -775,11 +775,11 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -788,8 +788,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios'], @@ -798,9 +798,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios', 'linux'], @@ -809,11 +809,11 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', 'Select all values'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -821,9 +821,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /macOS/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -833,8 +833,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -844,7 +844,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Select only.*Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['android'], @@ -883,9 +883,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -894,8 +894,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /No changes/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement', 'regression'], @@ -904,7 +904,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -914,8 +914,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -925,9 +925,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -935,7 +935,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Select only.*Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -944,7 +944,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Select only.*Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement'], @@ -961,7 +961,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', ]); const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({ @@ -997,25 +997,25 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', + ' - Windows 10, -, , 1.2, -, 99.00 %', ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Windows 10, -, , 2, , 98.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', + ' - Windows 10, -, , 2, -, 98.00 %', ' - Windows 10, -2.401 %, , 2, , 48.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', + ' - Windows 10, -, , 0.8, -, 99.00 %', ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', ]); // It should have the "descending" SVG. @@ -1028,26 +1028,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Windows 10, -, , 2, , 98.00 %', + ' - Windows 10, -, , 2, -, 98.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', + ' - Windows 10, -, , 1.2, -, 99.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', + ' - Windows 10, -, , 0.8, -, 99.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -1060,28 +1060,28 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio }); await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'a11yr aria.html opt e10s fission stylo webrender', - ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - Windows 10, -, , 2, , 98.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', + ' rev: spam', + ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', + ' - Windows 10, -, , 0.8, -, 99.00 %', + 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', + ' - Windows 10, -, , 1.2, -, 99.00 %', + ' rev: tictactoe', + ' - Windows 10, -2.401 %, , 2, , 48.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', + ' - Windows 10, -, , 2, -, 98.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1093,26 +1093,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', + ' - Windows 10, -, , -, -, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Windows 10, -, , -, , 100.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', ' rev: tictactoe', + ' - Windows 10, -, , 0.8, -, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', + ' - Windows 10, -, , 1.2, -, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', ' rev: tictactoe', + ' - Windows 10, -, , 2, -, 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Windows 10, -, , 2, , 98.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1127,25 +1127,25 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , -, , 100.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Windows 10, -, , -, -, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 0.8, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', + ' - Windows 10, -, , 0.8, -, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , 1.2, , 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', + ' - Windows 10, -, , 1.2, -, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 2, , 98.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', + ' - Windows 10, -, , 2, -, 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', ' - Windows 10, -2.401 %, , 2, , 48.00 %', ]); @@ -1159,25 +1159,25 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', - ' - Windows 10, -, , -, , 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Windows 10, -, , -, -, 100.00 %', ' rev: tictactoe', ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %', - ' - Windows 10, -, , 0.8, , 99.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', + ' - Windows 10, -, , 0.8, -, 99.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Windows 10, -, , 1.2, , 99.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', + ' - Windows 10, -, , 1.2, -, 99.00 %', ' rev: tictactoe', ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %', - ' - Windows 10, -, , 2, , 98.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', + ' - Windows 10, -, , 2, -, 98.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); // It should be persisted in the URL diff --git a/src/__tests__/CompareResults/RevisionRow.test.tsx b/src/__tests__/CompareResults/RevisionRow.test.tsx index ae86e4950..887545ff0 100644 --- a/src/__tests__/CompareResults/RevisionRow.test.tsx +++ b/src/__tests__/CompareResults/RevisionRow.test.tsx @@ -281,49 +281,6 @@ describe('Expanded row', () => { expect(cliffsDeltaHeader).toBeInTheDocument(); }); - it('should display mann_whitney_test.interpretation for significance for mann-whitney-u testVersion', async () => { - const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); - const { testCompareMannWhitneyData: rowData } = getTestData(); - - renderWithRoute( - , - ); - - const expandRowButton = await screen.findByTestId(/ExpandMoreIcon/); - await user.click(expandRowButton); - - const notSignificant = await screen.findAllByText(/Not significant/); - expect(notSignificant[0]).toBeInTheDocument(); - }); - - it('should handle empty mann_whitney_test.interpretation for significance for mann-whitney-u testVersion', async () => { - const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); - const { testCompareMannWhitneyData: rowData } = getTestData(); - const resultNoInterpretation = { ...rowData[0], mann_whitney_test: null }; - renderWithRoute( - , - ); - - const expandRowButton = await screen.findByTestId(/ExpandMoreIcon/); - await user.click(expandRowButton); - const emptySignificant = await screen.findAllByText(/-/); - expect(emptySignificant[0]).toBeInTheDocument(); - }); - it('should display median diff and 95% CI alerts when base/new runs are present', async () => { const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); const { testCompareMannWhitneyData: rowData } = getTestData(); diff --git a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx index 87e1b9081..212640cdb 100644 --- a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx +++ b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx @@ -528,9 +528,9 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Initial view (alphabetical ordered, even if "sort by subtests" isn't specified expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', ]); @@ -542,10 +542,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort descending await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', ]); @@ -558,10 +558,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -574,11 +574,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( }); await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', ]); // It should have the "no sort" SVG. expect(deltaButton).toMatchSnapshot(); @@ -590,10 +590,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort by Significance ascending await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', ]); expectParameterToHaveValue('sort', 'significance|asc'); @@ -605,10 +605,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await user.click(effectButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', ]); // It should have the "descending" SVG. @@ -619,10 +619,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort by Effect Size ascending await user.click(effectButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'improvement.html: 0.963 %, -0.05, , 50.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', ]); expectParameterToHaveValue('sort', 'effects|asc'); @@ -633,10 +633,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', - 'regression.html: 1.135 %, 0.12, , 25.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', ]); // It should have the "ascending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -646,10 +646,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting({ extraParameters: 'sort=delta' }); await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', ]); // It should have the "descending" SVG. @@ -659,10 +659,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( it('initializes the sort from the URL at load time for a descending sort', async () => { await setupForSorting({ extraParameters: 'sort=delta|desc' }); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, , 25.00%', - 'improvement.html: 0.963 %, -0.05, , 50.00%', + 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'improvement.html: 0.963 %, -0.05, -, 50.00%', 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, , 60.00%', + 'dhtml.html: 1.135 %, 0.02, -, 60.00%', 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', ]); // It should have the "descending" SVG. diff --git a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx index d8941e030..adfbf5770 100644 --- a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx +++ b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx @@ -193,8 +193,12 @@ describe('SubtestsRevisionRow Component', () => { const effects = roles[7]?.childNodes[0]; expect(effects).toHaveTextContent('60.00%'); + // The fixture runs don't yield a CI that excludes 0 once precomputed by + // the loader, so this row renders the "-" placeholder. This test mounts + // the row directly without the loader, leaving bootstrapCi undefined, + // which also falls back to "-". Either way: no icon is rendered. const significanceCell = roles[8]; - expect(significanceCell?.querySelector('svg')).not.toBeNull(); + expect(significanceCell).toHaveTextContent('-'); const cliffs_delta = roles[6]?.childNodes[1]; expect(cliffs_delta).toHaveTextContent('0.02'); diff --git a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap index dbd059e14..78d7450be 100644 --- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap @@ -824,7 +824,20 @@ exports[`Results View The table should match snapshot and other elements should class="significance cell" role="cell" > - - +
- - +
- - +
- - +
- - +
- - +
- - +
- - +
- - +
- - +
- + -
- - +
- - +
- - - Significance (p-value) - - - - - - - Significance (p-value) - - - - - - +
- - +
- - +
- - +
- + -
- + -
- + -
- + -
- + -
- + -
- + -
- + -
- + -
= 2 && newRuns.length >= 2 + ? bootstrapMedianDiffCI(baseRuns, newRuns) + : null; + } +} + export const mannWhitneyStrategy = { getColumns(isSubtestTable: boolean): TableConfig { const platformConfig = isSubtestTable @@ -231,16 +254,26 @@ export const mannWhitneyStrategy = { }, ], matchesFunction(result: MannWhitneyResultsItem, valueKey: string) { - return result.mann_whitney_test?.interpretation === valueKey; + // Significance comes from the precomputed bootstrap CI (see + // precomputeMannWhitneyCI above). + // Missing CI ⇒ treat as not-significant. + const isSig = result.bootstrapCi?.significant ?? false; + return (isSig ? 'significant' : 'not significant') === valueKey; }, sortFunction( resultA: MannWhitneyResultsItem, resultB: MannWhitneyResultsItem, ) { - return ( - Math.abs(resultA.mann_whitney_test?.pvalue ?? 0) - - Math.abs(resultB.mann_whitney_test?.pvalue ?? 0) - ); + // ASC semantics — useTableSort swaps args for DESC. So in DESC mode + // this produces "significant first, then |medianDiff| desc"; in ASC + // mode the inverse. Significance is the primary key, magnitude the + // tie-breaker so the biggest changes float to the top of each group. + const sigA = resultA.bootstrapCi?.significant ?? false; + const sigB = resultB.bootstrapCi?.significant ?? false; + if (sigA !== sigB) return sigA ? 1 : -1; + const magA = Math.abs(resultA.bootstrapCi?.medianDiff ?? 0); + const magB = Math.abs(resultB.bootstrapCi?.medianDiff ?? 0); + return magA - magB; }, }, @@ -267,9 +300,9 @@ export const mannWhitneyStrategy = { const { test, cliffs_delta, - mann_whitney_test, cles, direction_of_change, + bootstrapCi, base_measurement_unit: baseUnit, new_measurement_unit: newUnit, base_app: baseApp, @@ -363,7 +396,7 @@ export const mannWhitneyStrategy = { {clesVal ? `${clesVal}% ` : '-'}
- {mann_whitney_test?.interpretation === 'significant' ? ( + {bootstrapCi?.significant ? ( ) : ( '-' @@ -403,17 +436,19 @@ export const mannWhitneyStrategy = { mann_whitney_u_cles: '', }; const { cliffs_delta, cliffs_interpretation } = mwResult; - const pValue = mwResult.mann_whitney_test?.pvalue; - const p_value_cles = mwResult.mann_whitney_test?.interpretation - ? capitalize(mwResult.mann_whitney_test.interpretation) - : ''; + // Prefer the precomputed CI populated by the loader. Fall back to an + // inline compute for backwards compatibility (e.g. tests that mount the + // strategy without going through a loader, or stale results without the + // field). const baseRuns = mwResult.base_runs ?? []; const newRuns = mwResult.new_runs ?? []; const ci = - baseRuns.length > 0 && newRuns.length > 0 - ? bootstrapMedianDiffCI(baseRuns, newRuns) - : null; + mwResult.bootstrapCi !== undefined + ? mwResult.bootstrapCi + : baseRuns.length > 0 && newRuns.length > 0 + ? bootstrapMedianDiffCI(baseRuns, newRuns) + : null; const rawUnit = mwResult.base_measurement_unit ?? mwResult.new_measurement_unit ?? 'ms'; const { fmt, displayUnit } = ci @@ -453,8 +488,6 @@ export const mannWhitneyStrategy = { @@ -483,8 +516,8 @@ export const mannWhitneyStrategy = { const { cliffs_delta, direction_of_change, - mann_whitney_test, cles, + bootstrapCi, base_standard_stats, new_standard_stats, } = result as MannWhitneyResultsItem; @@ -551,7 +584,7 @@ export const mannWhitneyStrategy = { {clesValue}
- {mann_whitney_test?.interpretation === 'significant' ? ( + {bootstrapCi?.significant ? ( ) : ( '-' diff --git a/src/components/CompareResults/PValCliffsDeltaComp.tsx b/src/components/CompareResults/PValCliffsDeltaComp.tsx index a430b63ac..9465d825f 100644 --- a/src/components/CompareResults/PValCliffsDeltaComp.tsx +++ b/src/components/CompareResults/PValCliffsDeltaComp.tsx @@ -5,21 +5,12 @@ import { capitalize } from '../../utils/helpers'; interface PValCliffsDeltaCompProps { cliffs_delta: number; cliffs_interpretation: string; - pValue: number | undefined | null; - p_value_cles: string; cles: number | string; cles_direction: string; } function PValCliffsDeltaComp(props: PValCliffsDeltaCompProps) { - const { - cliffs_delta, - cliffs_interpretation, - pValue, - p_value_cles, - cles, - cles_direction, - } = props; + const { cliffs_delta, cliffs_interpretation, cles, cles_direction } = props; return ( - - Significance (p-value) - {pValue} - {p_value_cles} - CLES {cles} diff --git a/src/components/CompareResults/loader.ts b/src/components/CompareResults/loader.ts index 06916b6e6..81fc998d1 100644 --- a/src/components/CompareResults/loader.ts +++ b/src/components/CompareResults/loader.ts @@ -4,6 +4,7 @@ import { compareView, MANN_WHITNEY_U, } from '../../common/constants'; +import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchCompareResults, fetchFakeCompareResults, @@ -12,6 +13,7 @@ import { import { Changeset, CombinedResultsItemType, + MannWhitneyResultsItem, Repository, } from '../../types/state'; import { FakeCommitHash, Framework, TestVersion } from '../../types/types'; @@ -197,6 +199,13 @@ export async function loader({ request }: { request: Request }) { const useFakeData = url.searchParams.has('fakedata'); if (useFakeData) { const results = await fetchAllFakeCompareResults(); + // Fake results are Mann-Whitney shaped; precompute the CI per row so the + // Sig column behaves the same way as it would on real backend data. + for (const oneRevsResults of results) { + precomputeMannWhitneyCI( + oneRevsResults as unknown as MannWhitneyResultsItem[], + ); + } // They're all based on the same rev const baseRev = results[0][0].base_rev; // And the same repository @@ -292,6 +301,18 @@ export async function getComparisonInformation( replicates, testVersion, silvermanKDEEnabled, + }).then((results) => { + // Precompute the bootstrap CI per row when the data is Mann-Whitney — + // the Sig column sorts/filters on it and the expanded-row alert reads it + // too, so doing the heavy BCa [see src/utils/bootstrap-ci.ts#L163-L203] work once here avoids per-render thrashing. + if (testVersion === MANN_WHITNEY_U) { + for (const oneRevsResults of results) { + precomputeMannWhitneyCI( + oneRevsResults as unknown as MannWhitneyResultsItem[], + ); + } + } + return results; }); // TODO what happens if there's no result? diff --git a/src/components/CompareResults/overTimeLoader.ts b/src/components/CompareResults/overTimeLoader.ts index 206d04d04..d4704c8b4 100644 --- a/src/components/CompareResults/overTimeLoader.ts +++ b/src/components/CompareResults/overTimeLoader.ts @@ -5,6 +5,7 @@ import { compareOverTimeView, MANN_WHITNEY_U, } from '../../common/constants'; +import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchCompareOverTimeResults, memoizedFetchRevisionForRepository, @@ -12,6 +13,7 @@ import { import { Changeset, CombinedResultsItemType, + MannWhitneyResultsItem, Repository, } from '../../types/state'; import { Framework, TestVersion, TimeRange } from '../../types/types'; @@ -228,6 +230,17 @@ export async function loader({ request }: { request: Request }) { replicates, testVersion, silvermanKDEEnabled, + }).then((results) => { + // Same precompute as the main loader so the Sig column has a precomputed + // CI to sort/filter on without recomputing per render. + if (testVersion === MANN_WHITNEY_U) { + for (const oneRevsResults of results) { + precomputeMannWhitneyCI( + oneRevsResults as unknown as MannWhitneyResultsItem[], + ); + } + } + return results; }); const newRevsInfoPromises = newRevs.map((newRev, i) => diff --git a/src/components/CompareResults/subtestsLoader.ts b/src/components/CompareResults/subtestsLoader.ts index 2e381b7ea..bff1098ab 100644 --- a/src/components/CompareResults/subtestsLoader.ts +++ b/src/components/CompareResults/subtestsLoader.ts @@ -1,6 +1,7 @@ import { repoMap, frameworks, MANN_WHITNEY_U } from '../../common/constants'; +import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchSubtestsCompareResults } from '../../logic/treeherder'; -import { Repository } from '../../types/state'; +import { MannWhitneyResultsItem, Repository } from '../../types/state'; import { Framework, TestVersion } from '../../types/types'; // This function checks and sanitizes the input values, then returns values that @@ -186,6 +187,16 @@ export function loader({ request }: { request: Request }) { replicates, testVersion, silvermanKDEEnabled, + }).then((subtestResults) => { + // Precompute the bootstrap CI for the Sig column when these are + // Mann-Whitney results. Subtests return a flat array (one entry per + // subtest), not the per-revision nesting the main loader has. + if (testVersion === MANN_WHITNEY_U) { + precomputeMannWhitneyCI( + subtestResults as unknown as MannWhitneyResultsItem[], + ); + } + return subtestResults; }); return { diff --git a/src/components/CompareResults/subtestsOverTimeLoader.tsx b/src/components/CompareResults/subtestsOverTimeLoader.tsx index 906926b21..a9edd4b9f 100644 --- a/src/components/CompareResults/subtestsOverTimeLoader.tsx +++ b/src/components/CompareResults/subtestsOverTimeLoader.tsx @@ -4,8 +4,9 @@ import { timeRanges, MANN_WHITNEY_U, } from '../../common/constants'; +import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchSubtestsCompareOverTimeResults } from '../../logic/treeherder'; -import { Repository } from '../../types/state'; +import { MannWhitneyResultsItem, Repository } from '../../types/state'; import { Framework, TestVersion, TimeRange } from '../../types/types'; // This function checks and sanitizes the input values, then returns values that @@ -212,6 +213,13 @@ export function loader({ request }: { request: Request }) { replicates, testVersion, silvermanKDEEnabled, + }).then((subtestResults) => { + if (testVersion === MANN_WHITNEY_U) { + precomputeMannWhitneyCI( + subtestResults as unknown as MannWhitneyResultsItem[], + ); + } + return subtestResults; }); return { diff --git a/src/types/state.ts b/src/types/state.ts index 2091e09ef..b37182295 100644 --- a/src/types/state.ts +++ b/src/types/state.ts @@ -242,6 +242,10 @@ export type MannWhitneyResultsItem = { is_meaningful: boolean | null; more_runs_are_needed: boolean | null; warning_c_delta?: string | null; + // Bootstrap (BCa) [see src/utils/bootstrap-ci.ts#L163-L203] CI for the difference of medians. + // `null` means the CI couldn't be computed (e.g. + // missing base_runs/new_runs); callers treat that as "not significant". + bootstrapCi?: import('../utils/bootstrap-ci').BootstrapCI | null; /* Each test has a signature and each signature may or may not have a parent_signature. If a signature has a parent_signature then we are looking at a subtest. For regular tests this field will be null. From cb2f1cbf5152ffa38f4b6a38463785ce71d1a639 Mon Sep 17 00:00:00 2001 From: Carla Severe Date: Wed, 24 Jun 2026 14:45:37 -0700 Subject: [PATCH 2/3] mannWhitney: render Sig column as S/NS text instead of arrow icon --- .../CompareResults/ResultsTable.test.tsx | 300 +++++++++--------- .../SubtestsResultsView.test.tsx | 100 +++--- .../SubtestsRevisionRow.test.tsx | 8 +- .../OverTimeResultsView.test.tsx.snap | 60 +--- .../__snapshots__/ResultsTable.test.tsx.snap | 201 +++--------- .../__snapshots__/ResultsView.test.tsx.snap | 60 +--- .../SubtestsResultsView.test.tsx.snap | 50 +-- src/common/constants.ts | 2 +- src/common/testVersions/mannWhitney.tsx | 17 +- 9 files changed, 284 insertions(+), 514 deletions(-) diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx index 4f0e558d9..9e8d4f7d4 100644 --- a/src/__tests__/CompareResults/ResultsTable.test.tsx +++ b/src/__tests__/CompareResults/ResultsTable.test.tsx @@ -722,9 +722,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ' rev: devilrabbit', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -748,12 +748,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -762,9 +762,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'linux', 'android', 'ios'], @@ -775,12 +775,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -788,8 +788,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios'], @@ -798,9 +798,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios', 'linux'], @@ -809,22 +809,22 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', 'Select all values'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); await clickMenuItem(user, 'Platform', /macOS/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['windows', 'linux', 'android', 'ios'], @@ -833,9 +833,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['windows', 'linux', 'ios'], @@ -844,7 +844,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Select only.*Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['android'], @@ -883,10 +883,10 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -894,8 +894,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /No changes/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement', 'regression'], @@ -904,7 +904,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -914,9 +914,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['none', 'improvement'], @@ -925,17 +925,17 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); await clickMenuItem(user, 'Status', /Select only.*Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -944,7 +944,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Select only.*Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement'], @@ -961,12 +961,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', ]); const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({ 'Platform(2)': ['macOS', 'Android'], - 'Sig(2)': ['Significant', 'Not Significant-'], + 'Sig(2)': ['SignificantS', 'Not SignificantNS'], 'Status(3)': ['No changes', 'Improvement', 'Regression'], }); @@ -997,26 +997,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', - ' - Windows 10, -, , 1.2, -, 99.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', - ' - Windows 10, -, , 2, -, 98.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', - ' - Windows 10, -, , 0.8, -, 99.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', ]); // It should have the "descending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -1028,26 +1028,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Windows 10, -, , 2, -, 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Windows 10, -, , 1.2, -, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Windows 10, -, , 0.8, -, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Windows 10, -, , -, -, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -1062,26 +1062,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', - ' - Windows 10, -, , 0.8, -, 99.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', - ' - Windows 10, -, , 1.2, -, 99.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', - ' - Windows 10, -, , 2, -, 98.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1093,26 +1093,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , -, -, 100.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 0.8, -, 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , 1.2, -, 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 2, -, 98.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1127,26 +1127,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , -, -, 100.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - Windows 10, -2.401 %, , -, , 50.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 0.8, -, 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -, , 1.2, -, 99.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', ' rev: tictactoe', - ' - Windows 10, -, , 2, -, 98.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); @@ -1158,26 +1158,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , -, , 50.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, , 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, , 25.00 %', - ' - Windows 10, -, , -, -, 100.00 %', + ' - Windows 10, -2.401 %, , -, S, 50.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Windows 10, -, , -, NS, 100.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 0.8, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, , 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, , 24.00 %', - ' - Windows 10, -, , 0.8, -, 99.00 %', + ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', + ' - Windows 10, -, , 0.8, NS, 99.00 %', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Windows 10, -2.401 %, , 1.2, , 49.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, , 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, , 24.00 %', - ' - Windows 10, -, , 1.2, -, 99.00 %', + ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', + ' - Windows 10, -, , 1.2, NS, 99.00 %', ' rev: tictactoe', - ' - Windows 10, -2.401 %, , 2, , 48.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, , 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, , 23.00 %', - ' - Windows 10, -, , 2, -, 98.00 %', + ' - Windows 10, -2.401 %, , 2, S, 48.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', + ' - Windows 10, -, , 2, NS, 98.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); // It should be persisted in the URL diff --git a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx index 212640cdb..203ed4340 100644 --- a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx +++ b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx @@ -527,11 +527,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting(); // Initial view (alphabetical ordered, even if "sort by subtests" isn't specified expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // Sort by Delta @@ -542,11 +542,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort descending await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. @@ -557,11 +557,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort ascending await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -574,11 +574,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( }); await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "no sort" SVG. expect(deltaButton).toMatchSnapshot(); @@ -590,11 +590,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort by Significance ascending await user.click(significanceButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', ]); expectParameterToHaveValue('sort', 'significance|asc'); @@ -604,11 +604,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( }); await user.click(effectButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', ]); // It should have the "descending" SVG. @@ -619,11 +619,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort by Effect Size ascending await user.click(effectButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', ]); expectParameterToHaveValue('sort', 'effects|asc'); }); @@ -632,11 +632,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting({ extraParameters: 'sort=delta|asc' }); await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'regression.html: 1.135 %, 0.12, -, 25.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', ]); // It should have the "ascending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -646,11 +646,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting({ extraParameters: 'sort=delta' }); await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -659,11 +659,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( it('initializes the sort from the URL at load time for a descending sort', async () => { await setupForSorting({ extraParameters: 'sort=delta|desc' }); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, -, 25.00%', - 'improvement.html: 0.963 %, -0.05, -, 50.00%', - 'browser.html: 0.963 %, -0.04, -, 15.00%', - 'dhtml.html: 1.135 %, 0.02, -, 60.00%', - 'tablemutation.html: 0.98 %, 0.01, -, 45.00%', + 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'browser.html: 0.963 %, -0.04, NS, 15.00%', + 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); diff --git a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx index adfbf5770..def10e054 100644 --- a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx +++ b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx @@ -194,11 +194,11 @@ describe('SubtestsRevisionRow Component', () => { expect(effects).toHaveTextContent('60.00%'); // The fixture runs don't yield a CI that excludes 0 once precomputed by - // the loader, so this row renders the "-" placeholder. This test mounts - // the row directly without the loader, leaving bootstrapCi undefined, - // which also falls back to "-". Either way: no icon is rendered. + // the loader, so this row renders "NS". This test mounts the row directly + // without the loader, leaving bootstrapCi undefined, which also falls + // back to "NS". const significanceCell = roles[8]; - expect(significanceCell).toHaveTextContent('-'); + expect(significanceCell).toHaveTextContent('NS'); const cliffs_delta = roles[6]?.childNodes[1]; expect(cliffs_delta).toHaveTextContent('0.02'); diff --git a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap index 78d7450be..c59fe72da 100644 --- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap @@ -824,20 +824,7 @@ exports[`Results View The table should match snapshot and other elements should class="significance cell" role="cell" > - + S
- + S
- + S
- + S
- + S
- + S
- + S
- + S
- + S
- + S
- + S
- - + NS
- + S
- + S
- + S
- + S
- + S
- + S
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
- - + NS
, + icon:
S
, }, { label: 'Not Significant', key: 'not significant', - icon:
-
, + icon:
NS
, }, ], matchesFunction(result: MannWhitneyResultsItem, valueKey: string) { @@ -396,11 +395,7 @@ export const mannWhitneyStrategy = { {clesVal ? `${clesVal}% ` : '-'}
- {bootstrapCi?.significant ? ( - - ) : ( - '-' - )} + {bootstrapCi?.significant ? 'S' : 'NS'}
); @@ -584,11 +579,7 @@ export const mannWhitneyStrategy = { {clesValue}
- {bootstrapCi?.significant ? ( - - ) : ( - '-' - )} + {bootstrapCi?.significant ? 'S' : 'NS'}
); From 1f4ca56725c8ba9359d635b40c4f10d3931d686d Mon Sep 17 00:00:00 2001 From: Carla Severe Date: Wed, 24 Jun 2026 18:05:04 -0700 Subject: [PATCH 3/3] mannWhitney: precompute bootstrap CI on replicates when available mannWhitney: lazy-precompute Sig CI to restore production-level load speed --- .../CompareResults/ResultsTable.test.tsx | 138 ++++++------- .../SubtestsResultsView.test.tsx | 36 ++-- .../SubtestsRevisionRow.test.tsx | 11 +- .../OverTimeResultsView.test.tsx.snap | 8 +- .../__snapshots__/ResultsTable.test.tsx.snap | 18 +- .../__snapshots__/ResultsView.test.tsx.snap | 22 +-- .../SubtestsResultsView.test.tsx.snap | 18 +- src/common/testVersions/mannWhitney.tsx | 181 ++++++++++++++---- src/components/CompareResults/loader.ts | 29 +-- .../CompareResults/overTimeLoader.ts | 16 +- .../CompareResults/subtestsLoader.ts | 16 +- .../CompareResults/subtestsOverTimeLoader.tsx | 14 +- 12 files changed, 286 insertions(+), 221 deletions(-) diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx index 9e8d4f7d4..9f6921cbf 100644 --- a/src/__tests__/CompareResults/ResultsTable.test.tsx +++ b/src/__tests__/CompareResults/ResultsTable.test.tsx @@ -722,9 +722,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ' rev: devilrabbit', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -748,11 +748,11 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); @@ -762,9 +762,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'linux', 'android', 'ios'], @@ -775,11 +775,11 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -788,8 +788,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios'], @@ -798,9 +798,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios', 'linux'], @@ -809,11 +809,11 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', 'Select all values'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - inexistant, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - inexistant, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -821,9 +821,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /macOS/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -833,8 +833,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -844,7 +844,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Select only.*Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Android, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['android'], @@ -883,9 +883,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -894,8 +894,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /No changes/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement', 'regression'], @@ -904,7 +904,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -914,8 +914,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -925,9 +925,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -935,7 +935,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Select only.*Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -944,7 +944,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Select only.*Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement'], @@ -961,7 +961,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', ]); const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({ @@ -997,25 +997,25 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', - ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, NS, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, NS, 24.00 %', + ' - Windows 10, -, , 1.2, S, 99.00 %', ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', - ' - Windows 10, -, , 2, NS, 98.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, NS, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, NS, 23.00 %', + ' - Windows 10, -, , 2, S, 98.00 %', ' - Windows 10, -2.401 %, , 2, S, 48.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', - ' - Windows 10, -, , 0.8, NS, 99.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, NS, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, NS, 24.00 %', + ' - Windows 10, -, , 0.8, S, 99.00 %', ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', ]); // It should have the "descending" SVG. @@ -1028,26 +1028,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, S, 23.00 %', - ' - Linux 18.04, 1.849 %, Regression, 2, S, 43.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 2.1, NS, 23.00 %', + ' - Linux 18.04, 1.849 %, Regression, 2, NS, 43.00 %', ' - Windows 10, -2.401 %, , 2, S, 48.00 %', - ' - Windows 10, -, , 2, NS, 98.00 %', + ' - Windows 10, -, , 2, S, 98.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, S, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 1.3, NS, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 1.2, NS, 44.00 %', ' - Windows 10, -2.401 %, , 1.2, S, 49.00 %', - ' - Windows 10, -, , 1.2, NS, 99.00 %', + ' - Windows 10, -, , 1.2, S, 99.00 %', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: tictactoe', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, S, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 0.8, S, 44.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.9, NS, 24.00 %', + ' - Linux 18.04, 1.849 %, Regression, 0.8, NS, 44.00 %', ' - Windows 10, -2.401 %, , 0.8, S, 49.00 %', - ' - Windows 10, -, , 0.8, NS, 99.00 %', + ' - Windows 10, -, , 0.8, S, 99.00 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, S, 25.00 %', - ' - Linux 18.04, 1.849 %, Regression, -, S, 45.00 %', + ' - macOS 10.15, 1.078 %, Improvement, 0.1, NS, 25.00 %', + ' - Linux 18.04, 1.849 %, Regression, -, NS, 45.00 %', ' - Windows 10, -2.401 %, , -, S, 50.00 %', - ' - Windows 10, -, , -, NS, 100.00 %', + ' - Windows 10, -, , -, S, 100.00 %', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); diff --git a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx index 203ed4340..1a86b53f1 100644 --- a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx +++ b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx @@ -528,9 +528,9 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Initial view (alphabetical ordered, even if "sort by subtests" isn't specified expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'browser.html: 0.963 %, -0.04, NS, 15.00%', - 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', - 'improvement.html: 0.963 %, -0.05, NS, 50.00%', - 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); @@ -542,10 +542,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // Sort descending await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, NS, 25.00%', - 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', 'browser.html: 0.963 %, -0.04, NS, 15.00%', - 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); @@ -558,10 +558,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await user.click(deltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', - 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', 'browser.html: 0.963 %, -0.04, NS, 15.00%', - 'improvement.html: 0.963 %, -0.05, NS, 50.00%', - 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -633,10 +633,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', - 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', 'browser.html: 0.963 %, -0.04, NS, 15.00%', - 'improvement.html: 0.963 %, -0.05, NS, 50.00%', - 'regression.html: 1.135 %, 0.12, NS, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', ]); // It should have the "ascending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -646,10 +646,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( await setupForSorting({ extraParameters: 'sort=delta' }); await screen.findByText('dhtml.html'); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, NS, 25.00%', - 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', 'browser.html: 0.963 %, -0.04, NS, 15.00%', - 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. @@ -659,10 +659,10 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( it('initializes the sort from the URL at load time for a descending sort', async () => { await setupForSorting({ extraParameters: 'sort=delta|desc' }); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ - 'regression.html: 1.135 %, 0.12, NS, 25.00%', - 'improvement.html: 0.963 %, -0.05, NS, 50.00%', + 'regression.html: 1.135 %, 0.12, S, 25.00%', + 'improvement.html: 0.963 %, -0.05, S, 50.00%', 'browser.html: 0.963 %, -0.04, NS, 15.00%', - 'dhtml.html: 1.135 %, 0.02, NS, 60.00%', + 'dhtml.html: 1.135 %, 0.02, S, 60.00%', 'tablemutation.html: 0.98 %, 0.01, NS, 45.00%', ]); // It should have the "descending" SVG. diff --git a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx index def10e054..25ce9e6f7 100644 --- a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx +++ b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx @@ -193,12 +193,13 @@ describe('SubtestsRevisionRow Component', () => { const effects = roles[7]?.childNodes[0]; expect(effects).toHaveTextContent('60.00%'); - // The fixture runs don't yield a CI that excludes 0 once precomputed by - // the loader, so this row renders "NS". This test mounts the row directly - // without the loader, leaving bootstrapCi undefined, which also falls - // back to "NS". + // The Sig cell renders lazily: when no CI has been cached on the row + // yet, it falls back to `mann_whitney_test.interpretation` from the + // backend. The fixture's interpretation is "significant", so the cell + // shows "S" here. First click on the Sig column header would trigger + // BCa and could flip this if the CI includes zero. const significanceCell = roles[8]; - expect(significanceCell).toHaveTextContent('NS'); + expect(significanceCell).toHaveTextContent('S'); const cliffs_delta = roles[6]?.childNodes[1]; expect(cliffs_delta).toHaveTextContent('0.02'); diff --git a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap index c59fe72da..3adc84d11 100644 --- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap @@ -824,7 +824,7 @@ exports[`Results View The table should match snapshot and other elements should class="significance cell" role="cell" > - S + NS
- S + NS
- S + NS
- S + NS
- S + NS
- S + NS
- S + NS
- S + NS
- S + NS
- S + NS
- NS + S
- S + NS
- S + NS
= - +9.00 + +8.74 ms (+1.5%) 95% CI [ - +0.00 + +3.57 , - +18.01 + +18.16 ]
@@ -319,12 +319,12 @@ exports[`Results View Should display Base, New and Common graphs with replicates : We are 95% confident the median difference is between - +0.00 + +3.57 and - +18.01 + +18.16 @@ -815,7 +815,7 @@ exports[`Results View Should display Base, New and Common graphs with tooltips 1 (+1.5%) 95% CI [ - +3.27 + +3.57 , +18.16 ] @@ -851,7 +851,7 @@ exports[`Results View Should display Base, New and Common graphs with tooltips 1 : We are 95% confident the median difference is between - +3.27 + +3.57 and @@ -1953,7 +1953,7 @@ exports[`Results View The table should match snapshot and other elements should class="significance cell" role="cell" > - S + NS
- S + NS
- S + NS
- S + NS
- NS + S
- NS + S
- NS + S
- NS + S
- NS + S
- NS + S
- NS + S
- NS + S
- NS + S
(BOOTSTRAP_SAMPLE_CAP); + const stride = values.length / BOOTSTRAP_SAMPLE_CAP; + for (let i = 0; i < BOOTSTRAP_SAMPLE_CAP; i++) { + out[i] = values[Math.floor(i * stride)]; + } + return out; +} + +// Resolve a row's KDE/BCa input sample set: prefer replicates over the +// aggregated runs. Mirrors RevisionRowExpandable's selection for the chart +// and KdeModesPanel so every view of the row uses the same underlying data. +// Returned arrays are NOT downsampled — callers feeding BCa should pass +// them through `downsampleForBootstrap` first. +function runsFor(result: MannWhitneyResultsItem): { + baseRuns: number[]; + newRuns: number[]; +} { + const baseRuns = + result.base_runs_replicates && result.base_runs_replicates.length + ? result.base_runs_replicates + : (result.base_runs ?? []); + const newRuns = + result.new_runs_replicates && result.new_runs_replicates.length + ? result.new_runs_replicates + : (result.new_runs ?? []); + return { baseRuns, newRuns }; +} + /** - * Precompute the bootstrap (BCa)[see src/utils/bootstrap-ci.ts#L163-L203] CI for the difference of medians on every - * Mann-Whitney result and attach it to `result.bootstrapCi`. Called from the - * data loaders so the Sig column's filter/sort and the expanded-row alert can - * read a precomputed value instead of triggering bootstrapMedianDiffCI per - * row per render (BCa is ~10–30 ms/row and would tank sort interactions). + * Lazily compute (and cache) the bootstrap (BCa) [see + * src/utils/bootstrap-ci.ts#L163-L203] CI for the difference of medians + * on a single row. + * + * The lazy strategy: at load time we do NO BCa work (matches production + * speed). The Sig column's `matchesFunction`/`sortFunction`/cell-render + * call this helper as needed. Result is cached on `result.bootstrapCi` + * so the second click on the column is free. + * + * `undefined` vs `null`: + * - `undefined` ⇒ never computed + * - `null` ⇒ computed but couldn't produce a CI (< 2 samples) + * We check `=== undefined` instead of `?? null` to keep that distinction. * - * Rows without enough data (< 2 samples on either side) get `bootstrapCi: - * null`; the column code treats that as "not significant". + * Uses the replicates-preferred sample selection (via `runsFor`) and the + * downsampled-for-BCa cap so per-row cost stays bounded regardless of how + * many replicates the backend ships. See `BOOTSTRAP_SAMPLE_CAP` and + * `BOOTSTRAP_ITERATIONS` above. */ -export function precomputeMannWhitneyCI( - results: MannWhitneyResultsItem[], -): void { - for (const result of results) { - const baseRuns = result.base_runs ?? []; - const newRuns = result.new_runs ?? []; - result.bootstrapCi = - baseRuns.length >= 2 && newRuns.length >= 2 - ? bootstrapMedianDiffCI(baseRuns, newRuns) - : null; +export function getBootstrapCi( + result: MannWhitneyResultsItem, +): BootstrapCI | null { + if (result.bootstrapCi !== undefined) return result.bootstrapCi; + const { baseRuns, newRuns } = runsFor(result); + const baseSamples = downsampleForBootstrap(baseRuns); + const newSamples = downsampleForBootstrap(newRuns); + const ci = + baseSamples.length >= 2 && newSamples.length >= 2 + ? bootstrapMedianDiffCI(baseSamples, newSamples, BOOTSTRAP_ITERATIONS) + : null; + result.bootstrapCi = ci; + return ci; +} + +// Decide whether the Sig cell should render "S" or "NS". +// +// Cell renders run for EVERY row on every render — we can't afford to +// compute BCa here at load time. So the cell uses whichever signal is +// available without forcing compute: +// - If the CI has been cached (filter/sort has been used, or the +// expanded-row alert ran), use it — keeps the column consistent with +// the rest of the UI on rows the user has engaged with. +// - Otherwise fall back to the backend's `mann_whitney_test.interpretation` +// — close to production's pre-branch behavior and free to read. +// +// First filter/sort click populates `bootstrapCi` for all rows; from then +// on the column reads the CI-based verdict everywhere. So you only see the +// fallback on first render before any Sig interaction. +function isSignificantForDisplay(result: MannWhitneyResultsItem): boolean { + if (result.bootstrapCi !== undefined) { + return result.bootstrapCi?.significant ?? false; } + return result.mann_whitney_test?.interpretation === 'significant'; } export const mannWhitneyStrategy = { @@ -253,10 +332,11 @@ export const mannWhitneyStrategy = { }, ], matchesFunction(result: MannWhitneyResultsItem, valueKey: string) { - // Significance comes from the precomputed bootstrap CI (see - // precomputeMannWhitneyCI above). - // Missing CI ⇒ treat as not-significant. - const isSig = result.bootstrapCi?.significant ?? false; + // Lazily compute and cache the CI on first filter-click. After + // that, the CI is read straight from `result.bootstrapCi` on + // every subsequent comparison/render (see getBootstrapCi above). + const ci = getBootstrapCi(result); + const isSig = ci?.significant ?? false; return (isSig ? 'significant' : 'not significant') === valueKey; }, sortFunction( @@ -267,11 +347,18 @@ export const mannWhitneyStrategy = { // this produces "significant first, then |medianDiff| desc"; in ASC // mode the inverse. Significance is the primary key, magnitude the // tie-breaker so the biggest changes float to the top of each group. - const sigA = resultA.bootstrapCi?.significant ?? false; - const sigB = resultB.bootstrapCi?.significant ?? false; + // + // First sort-click pays the BCa cost across all rows (the + // comparator is invoked O(n log n) times but each row is computed + // only once and cached via getBootstrapCi). Subsequent sorts are + // free. + const ciA = getBootstrapCi(resultA); + const ciB = getBootstrapCi(resultB); + const sigA = ciA?.significant ?? false; + const sigB = ciB?.significant ?? false; if (sigA !== sigB) return sigA ? 1 : -1; - const magA = Math.abs(resultA.bootstrapCi?.medianDiff ?? 0); - const magB = Math.abs(resultB.bootstrapCi?.medianDiff ?? 0); + const magA = Math.abs(ciA?.medianDiff ?? 0); + const magB = Math.abs(ciB?.medianDiff ?? 0); return magA - magB; }, }, @@ -296,17 +383,22 @@ export const mannWhitneyStrategy = { }, renderSubtestColumns(result: CombinedResultsItemType, expanded: boolean) { + const mwResult = result as MannWhitneyResultsItem; const { test, cliffs_delta, cles, direction_of_change, - bootstrapCi, base_measurement_unit: baseUnit, new_measurement_unit: newUnit, base_app: baseApp, new_app: newApp, - } = result as MannWhitneyResultsItem; + } = mwResult; + // See `isSignificantForDisplay` above — uses the cached CI when one + // exists and falls back to the backend interpretation otherwise. + // Computing BCa here on every cell render would re-introduce the + // per-row load cost we just removed. + const sigDisplay = isSignificantForDisplay(mwResult) ? 'S' : 'NS'; const clesVal = ((cles?.cles ?? 0) * 100).toFixed(2); const baseAvgValue = (result as MannWhitneyResultsItem).base_standard_stats?.mean ?? 0; @@ -395,7 +487,7 @@ export const mannWhitneyStrategy = { {clesVal ? `${clesVal}% ` : '-'}
- {bootstrapCi?.significant ? 'S' : 'NS'} + {sigDisplay}
); @@ -435,15 +527,18 @@ export const mannWhitneyStrategy = { // Prefer the precomputed CI populated by the loader. Fall back to an // inline compute for backwards compatibility (e.g. tests that mount the // strategy without going through a loader, or stale results without the - // field). - const baseRuns = mwResult.base_runs ?? []; - const newRuns = mwResult.new_runs ?? []; - const ci = - mwResult.bootstrapCi !== undefined - ? mwResult.bootstrapCi - : baseRuns.length > 0 && newRuns.length > 0 - ? bootstrapMedianDiffCI(baseRuns, newRuns) - : null; + // field). `baseRuns`/`newRuns` is the full replicates-preferred set + // (used for the median below); the BCa fallback runs on the capped + // downsample so it can't hang on rich-replicates rows. + const { baseRuns, newRuns } = runsFor(mwResult); + const ci = (() => { + if (mwResult.bootstrapCi !== undefined) return mwResult.bootstrapCi; + const baseSamples = downsampleForBootstrap(baseRuns); + const newSamples = downsampleForBootstrap(newRuns); + return baseSamples.length >= 2 && newSamples.length >= 2 + ? bootstrapMedianDiffCI(baseSamples, newSamples, BOOTSTRAP_ITERATIONS) + : null; + })(); const rawUnit = mwResult.base_measurement_unit ?? mwResult.new_measurement_unit ?? 'ms'; const { fmt, displayUnit } = ci @@ -508,14 +603,18 @@ export const mannWhitneyStrategy = { }, renderColumns(result: CombinedResultsItemType) { + const mwResult = result as MannWhitneyResultsItem; const { cliffs_delta, direction_of_change, cles, - bootstrapCi, base_standard_stats, new_standard_stats, - } = result as MannWhitneyResultsItem; + } = mwResult; + // See `isSignificantForDisplay` — uses the cached CI if a filter/sort + // populated it, otherwise the backend's interpretation. Cell renders + // can't afford to trigger BCa on every row at load time. + const sigDisplay = isSignificantForDisplay(mwResult) ? 'S' : 'NS'; const clesValue = cles?.cles ? `${(cles.cles * 100).toFixed(2)} %` : '-'; const baseMedian = base_standard_stats?.median ?? 0; const newMedian = new_standard_stats?.median ?? 0; @@ -579,7 +678,7 @@ export const mannWhitneyStrategy = { {clesValue}
- {bootstrapCi?.significant ? 'S' : 'NS'} + {sigDisplay}
); diff --git a/src/components/CompareResults/loader.ts b/src/components/CompareResults/loader.ts index 81fc998d1..10ad9e944 100644 --- a/src/components/CompareResults/loader.ts +++ b/src/components/CompareResults/loader.ts @@ -4,7 +4,6 @@ import { compareView, MANN_WHITNEY_U, } from '../../common/constants'; -import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchCompareResults, fetchFakeCompareResults, @@ -13,7 +12,6 @@ import { import { Changeset, CombinedResultsItemType, - MannWhitneyResultsItem, Repository, } from '../../types/state'; import { FakeCommitHash, Framework, TestVersion } from '../../types/types'; @@ -199,13 +197,10 @@ export async function loader({ request }: { request: Request }) { const useFakeData = url.searchParams.has('fakedata'); if (useFakeData) { const results = await fetchAllFakeCompareResults(); - // Fake results are Mann-Whitney shaped; precompute the CI per row so the - // Sig column behaves the same way as it would on real backend data. - for (const oneRevsResults of results) { - precomputeMannWhitneyCI( - oneRevsResults as unknown as MannWhitneyResultsItem[], - ); - } + // No bootstrap CI precompute here — the Sig column lazily computes (and + // caches) on the first filter/sort interaction via `getBootstrapCi` in + // mannWhitney.tsx. Eagerly precomputing on every row was blocking the + // table render at load time. // They're all based on the same rev const baseRev = results[0][0].base_rev; // And the same repository @@ -301,19 +296,11 @@ export async function getComparisonInformation( replicates, testVersion, silvermanKDEEnabled, - }).then((results) => { - // Precompute the bootstrap CI per row when the data is Mann-Whitney — - // the Sig column sorts/filters on it and the expanded-row alert reads it - // too, so doing the heavy BCa [see src/utils/bootstrap-ci.ts#L163-L203] work once here avoids per-render thrashing. - if (testVersion === MANN_WHITNEY_U) { - for (const oneRevsResults of results) { - precomputeMannWhitneyCI( - oneRevsResults as unknown as MannWhitneyResultsItem[], - ); - } - } - return results; }); + // No bootstrap CI precompute here — see the lazy `getBootstrapCi` helper + // in mannWhitney.tsx. Eager precompute on every row was blocking table + // render; lazy compute defers the BCa cost to the first Sig filter/sort + // click (and caches per row from then on). // TODO what happens if there's no result? const baseRevInfoPromise = memoizedFetchRevisionForRepository({ diff --git a/src/components/CompareResults/overTimeLoader.ts b/src/components/CompareResults/overTimeLoader.ts index d4704c8b4..2aa012276 100644 --- a/src/components/CompareResults/overTimeLoader.ts +++ b/src/components/CompareResults/overTimeLoader.ts @@ -5,7 +5,6 @@ import { compareOverTimeView, MANN_WHITNEY_U, } from '../../common/constants'; -import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchCompareOverTimeResults, memoizedFetchRevisionForRepository, @@ -13,7 +12,6 @@ import { import { Changeset, CombinedResultsItemType, - MannWhitneyResultsItem, Repository, } from '../../types/state'; import { Framework, TestVersion, TimeRange } from '../../types/types'; @@ -230,18 +228,10 @@ export async function loader({ request }: { request: Request }) { replicates, testVersion, silvermanKDEEnabled, - }).then((results) => { - // Same precompute as the main loader so the Sig column has a precomputed - // CI to sort/filter on without recomputing per render. - if (testVersion === MANN_WHITNEY_U) { - for (const oneRevsResults of results) { - precomputeMannWhitneyCI( - oneRevsResults as unknown as MannWhitneyResultsItem[], - ); - } - } - return results; }); + // No bootstrap CI precompute — the Sig column lazily computes (and caches) + // via `getBootstrapCi` in mannWhitney.tsx on the first filter/sort click. + // Same change as the main loader, applied here to keep load time aligned. const newRevsInfoPromises = newRevs.map((newRev, i) => memoizedFetchRevisionForRepository({ diff --git a/src/components/CompareResults/subtestsLoader.ts b/src/components/CompareResults/subtestsLoader.ts index bff1098ab..f1aa44412 100644 --- a/src/components/CompareResults/subtestsLoader.ts +++ b/src/components/CompareResults/subtestsLoader.ts @@ -1,7 +1,6 @@ import { repoMap, frameworks, MANN_WHITNEY_U } from '../../common/constants'; -import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchSubtestsCompareResults } from '../../logic/treeherder'; -import { MannWhitneyResultsItem, Repository } from '../../types/state'; +import { Repository } from '../../types/state'; import { Framework, TestVersion } from '../../types/types'; // This function checks and sanitizes the input values, then returns values that @@ -187,17 +186,10 @@ export function loader({ request }: { request: Request }) { replicates, testVersion, silvermanKDEEnabled, - }).then((subtestResults) => { - // Precompute the bootstrap CI for the Sig column when these are - // Mann-Whitney results. Subtests return a flat array (one entry per - // subtest), not the per-revision nesting the main loader has. - if (testVersion === MANN_WHITNEY_U) { - precomputeMannWhitneyCI( - subtestResults as unknown as MannWhitneyResultsItem[], - ); - } - return subtestResults; }); + // No bootstrap CI precompute — the Sig column lazily computes (and + // caches) on the first filter/sort interaction via `getBootstrapCi` in + // mannWhitney.tsx. Eager precompute was blocking table render at load. return { results, diff --git a/src/components/CompareResults/subtestsOverTimeLoader.tsx b/src/components/CompareResults/subtestsOverTimeLoader.tsx index a9edd4b9f..415ec7469 100644 --- a/src/components/CompareResults/subtestsOverTimeLoader.tsx +++ b/src/components/CompareResults/subtestsOverTimeLoader.tsx @@ -4,9 +4,8 @@ import { timeRanges, MANN_WHITNEY_U, } from '../../common/constants'; -import { precomputeMannWhitneyCI } from '../../common/testVersions/mannWhitney'; import { fetchSubtestsCompareOverTimeResults } from '../../logic/treeherder'; -import { MannWhitneyResultsItem, Repository } from '../../types/state'; +import { Repository } from '../../types/state'; import { Framework, TestVersion, TimeRange } from '../../types/types'; // This function checks and sanitizes the input values, then returns values that @@ -213,14 +212,11 @@ export function loader({ request }: { request: Request }) { replicates, testVersion, silvermanKDEEnabled, - }).then((subtestResults) => { - if (testVersion === MANN_WHITNEY_U) { - precomputeMannWhitneyCI( - subtestResults as unknown as MannWhitneyResultsItem[], - ); - } - return subtestResults; }); + // No bootstrap CI precompute — the Sig column lazily computes (and + // caches) via `getBootstrapCi` in mannWhitney.tsx on the first + // filter/sort click. Same change as the other loaders to keep load + // time aligned with production. return { results,