benchforge 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +432 -0
  2. package/bin/benchforge +3 -0
  3. package/dist/bin/benchforge.mjs +9 -0
  4. package/dist/bin/benchforge.mjs.map +1 -0
  5. package/dist/browser/index.js +914 -0
  6. package/dist/index.mjs +3 -0
  7. package/dist/src-CGuaC3Wo.mjs +3676 -0
  8. package/dist/src-CGuaC3Wo.mjs.map +1 -0
  9. package/package.json +49 -0
  10. package/src/BenchMatrix.ts +380 -0
  11. package/src/Benchmark.ts +33 -0
  12. package/src/BenchmarkReport.ts +156 -0
  13. package/src/GitUtils.ts +79 -0
  14. package/src/HtmlDataPrep.ts +148 -0
  15. package/src/MeasuredResults.ts +127 -0
  16. package/src/NodeGC.ts +48 -0
  17. package/src/PermutationTest.ts +115 -0
  18. package/src/StandardSections.ts +268 -0
  19. package/src/StatisticalUtils.ts +176 -0
  20. package/src/TypeUtil.ts +8 -0
  21. package/src/bin/benchforge.ts +4 -0
  22. package/src/browser/BrowserGcStats.ts +44 -0
  23. package/src/browser/BrowserHeapSampler.ts +248 -0
  24. package/src/cli/CliArgs.ts +64 -0
  25. package/src/cli/FilterBenchmarks.ts +68 -0
  26. package/src/cli/RunBenchCLI.ts +856 -0
  27. package/src/export/JsonExport.ts +103 -0
  28. package/src/export/JsonFormat.ts +91 -0
  29. package/src/export/PerfettoExport.ts +203 -0
  30. package/src/heap-sample/HeapSampleReport.ts +196 -0
  31. package/src/heap-sample/HeapSampler.ts +78 -0
  32. package/src/html/HtmlReport.ts +131 -0
  33. package/src/html/HtmlTemplate.ts +284 -0
  34. package/src/html/Types.ts +88 -0
  35. package/src/html/browser/CIPlot.ts +287 -0
  36. package/src/html/browser/HistogramKde.ts +118 -0
  37. package/src/html/browser/LegendUtils.ts +163 -0
  38. package/src/html/browser/RenderPlots.ts +263 -0
  39. package/src/html/browser/SampleTimeSeries.ts +389 -0
  40. package/src/html/browser/Types.ts +96 -0
  41. package/src/html/browser/index.ts +1 -0
  42. package/src/html/index.ts +17 -0
  43. package/src/index.ts +92 -0
  44. package/src/matrix/CaseLoader.ts +36 -0
  45. package/src/matrix/MatrixFilter.ts +103 -0
  46. package/src/matrix/MatrixReport.ts +290 -0
  47. package/src/matrix/VariantLoader.ts +46 -0
  48. package/src/runners/AdaptiveWrapper.ts +391 -0
  49. package/src/runners/BasicRunner.ts +368 -0
  50. package/src/runners/BenchRunner.ts +60 -0
  51. package/src/runners/CreateRunner.ts +11 -0
  52. package/src/runners/GcStats.ts +107 -0
  53. package/src/runners/RunnerOrchestrator.ts +374 -0
  54. package/src/runners/RunnerUtils.ts +2 -0
  55. package/src/runners/TimingUtils.ts +13 -0
  56. package/src/runners/WorkerScript.ts +256 -0
  57. package/src/table-util/ConvergenceFormatters.ts +19 -0
  58. package/src/table-util/Formatters.ts +152 -0
  59. package/src/table-util/README.md +70 -0
  60. package/src/table-util/TableReport.ts +293 -0
  61. package/src/table-util/test/TableReport.test.ts +105 -0
  62. package/src/table-util/test/TableValueExtractor.test.ts +41 -0
  63. package/src/table-util/test/TableValueExtractor.ts +100 -0
  64. package/src/test/AdaptiveRunner.test.ts +185 -0
  65. package/src/test/AdaptiveStatistics.integration.ts +119 -0
  66. package/src/test/BenchmarkReport.test.ts +82 -0
  67. package/src/test/BrowserBench.e2e.test.ts +44 -0
  68. package/src/test/BrowserBench.test.ts +79 -0
  69. package/src/test/GcStats.test.ts +94 -0
  70. package/src/test/PermutationTest.test.ts +121 -0
  71. package/src/test/RunBenchCLI.test.ts +166 -0
  72. package/src/test/RunnerOrchestrator.test.ts +102 -0
  73. package/src/test/StatisticalUtils.test.ts +112 -0
  74. package/src/test/TestUtils.ts +93 -0
  75. package/src/test/fixtures/test-bench-script.ts +30 -0
  76. package/src/tests/AdaptiveConvergence.test.ts +177 -0
  77. package/src/tests/AdaptiveSampling.test.ts +240 -0
  78. package/src/tests/BenchMatrix.test.ts +366 -0
  79. package/src/tests/MatrixFilter.test.ts +117 -0
  80. package/src/tests/MatrixReport.test.ts +139 -0
  81. package/src/tests/RealDataValidation.test.ts +177 -0
  82. package/src/tests/fixtures/baseline/impl.ts +4 -0
  83. package/src/tests/fixtures/bevy30-samples.ts +158 -0
  84. package/src/tests/fixtures/cases/asyncCases.ts +7 -0
  85. package/src/tests/fixtures/cases/cases.ts +8 -0
  86. package/src/tests/fixtures/cases/variants/product.ts +2 -0
  87. package/src/tests/fixtures/cases/variants/sum.ts +2 -0
  88. package/src/tests/fixtures/discover/fast.ts +1 -0
  89. package/src/tests/fixtures/discover/slow.ts +4 -0
  90. package/src/tests/fixtures/invalid/bad.ts +1 -0
  91. package/src/tests/fixtures/loader/fast.ts +1 -0
  92. package/src/tests/fixtures/loader/slow.ts +4 -0
  93. package/src/tests/fixtures/loader/stateful.ts +2 -0
  94. package/src/tests/fixtures/stateful/stateful.ts +2 -0
  95. package/src/tests/fixtures/variants/extra.ts +1 -0
  96. package/src/tests/fixtures/variants/impl.ts +1 -0
  97. package/src/tests/fixtures/worker/fast.ts +1 -0
  98. package/src/tests/fixtures/worker/slow.ts +4 -0
@@ -0,0 +1,177 @@
1
+ import { test } from "vitest";
2
+ import { checkConvergence } from "../runners/AdaptiveWrapper.ts";
3
+ import {
4
+ coefficientOfVariation,
5
+ medianAbsoluteDeviation,
6
+ percentile,
7
+ } from "../StatisticalUtils.ts";
8
+ import { bevy30SamplesMs, bevy30SamplesNs } from "./fixtures/bevy30-samples.ts";
9
+
10
+ test("bevy30 data characteristics", () => {
11
+ const sortedMs = [...bevy30SamplesMs].sort((a, b) => a - b);
12
+
13
+ const stats = {
14
+ count: sortedMs.length,
15
+ min: sortedMs[0],
16
+ p25: percentile(sortedMs, 0.25),
17
+ p50: percentile(sortedMs, 0.5),
18
+ p75: percentile(sortedMs, 0.75),
19
+ p95: percentile(sortedMs, 0.95),
20
+ p99: percentile(sortedMs, 0.99),
21
+ max: sortedMs[sortedMs.length - 1],
22
+ mean: sortedMs.reduce((a, b) => a + b, 0) / sortedMs.length,
23
+ cv: coefficientOfVariation(sortedMs),
24
+ mad: medianAbsoluteDeviation(sortedMs),
25
+ };
26
+
27
+ console.log("Bevy30 benchmark statistics:");
28
+ console.log(` Samples: ${stats.count}`);
29
+ console.log(` Min: ${stats.min.toFixed(2)}ms`);
30
+ console.log(` P25: ${stats.p25.toFixed(2)}ms`);
31
+ console.log(` P50: ${stats.p50.toFixed(2)}ms`);
32
+ console.log(` P75: ${stats.p75.toFixed(2)}ms`);
33
+ console.log(` P95: ${stats.p95.toFixed(2)}ms`);
34
+ console.log(` P99: ${stats.p99.toFixed(2)}ms`);
35
+ console.log(` Max: ${stats.max.toFixed(2)}ms`);
36
+ console.log(` Mean: ${stats.mean.toFixed(2)}ms`);
37
+ console.log(` CV: ${(stats.cv * 100).toFixed(1)}%`);
38
+ console.log(` MAD: ${stats.mad.toFixed(2)}ms`);
39
+
40
+ if (stats.count !== 610) throw new Error("Expected 610 samples");
41
+ if (stats.min < 40 || stats.min > 100)
42
+ throw new Error("Unexpected min value");
43
+ if (stats.max < 50 || stats.max > 100)
44
+ throw new Error("Unexpected max value");
45
+
46
+ // Check for reasonable variation (not too noisy, not suspiciously stable)
47
+ if (stats.cv < 0.01) console.warn("Very low variation - may be synthetic");
48
+ if (stats.cv > 0.5) console.warn("Very high variation - may be unstable");
49
+ });
50
+
51
+ test("convergence at different time points matches CLI behavior", () => {
52
+ // Simulate 5-second run (approximately 100 samples at ~50ms each)
53
+ const samples5s = bevy30SamplesNs.slice(0, 100);
54
+ const result5s = checkConvergence(samples5s);
55
+
56
+ const msg5s = `5-second equivalent (100 samples): converged=${result5s.converged}, confidence=${result5s.confidence}%`;
57
+ console.log(msg5s);
58
+
59
+ // Should match what we saw in CLI: 100% convergence
60
+ if (result5s.confidence !== 100)
61
+ console.warn(
62
+ `Expected 100% convergence at 5s, got ${result5s.confidence}%`,
63
+ );
64
+
65
+ // Simulate very short run (0.5 seconds, ~10 samples)
66
+ const samples500ms = bevy30SamplesNs.slice(0, 10);
67
+ const result500ms = checkConvergence(samples500ms);
68
+
69
+ const msg500ms = `0.5-second equivalent (10 samples): converged=${result500ms.converged}, confidence=${result500ms.confidence}%`;
70
+ console.log(msg500ms);
71
+
72
+ // Should have low convergence like we saw in CLI
73
+ if (result500ms.confidence > 20)
74
+ console.warn(
75
+ `Expected low convergence at 0.5s, got ${result500ms.confidence}%`,
76
+ );
77
+ });
78
+
79
+ test("warm-up detection in real data", () => {
80
+ const windowSize = 20;
81
+ const windows: Array<{ start: number; median: number }> = [];
82
+
83
+ for (let i = 0; i <= bevy30SamplesMs.length - windowSize; i += windowSize) {
84
+ const window = bevy30SamplesMs.slice(i, i + windowSize);
85
+ const median = percentile(window, 0.5);
86
+ windows.push({ start: i, median });
87
+ }
88
+
89
+ // Find the window with highest median (likely during warm-up)
90
+ const maxWindow = windows.reduce((max, w) =>
91
+ w.median > max.median ? w : max,
92
+ );
93
+ const stableMedian = windows[windows.length - 1].median;
94
+
95
+ console.log(`Warm-up analysis:`);
96
+ const peak = `${maxWindow.median.toFixed(2)}ms at sample ${maxWindow.start}`;
97
+ console.log(` Highest median: ${peak}`);
98
+ console.log(` Stable median: ${stableMedian.toFixed(2)}ms`);
99
+ const overhead = ((maxWindow.median / stableMedian - 1) * 100).toFixed(1);
100
+ console.log(` Warm-up overhead: ${overhead}%`);
101
+
102
+ if (maxWindow.start === 0) {
103
+ console.log(" Warm-up detected at start of benchmark");
104
+ }
105
+ });
106
+
107
+ test("convergence stability over sliding windows", () => {
108
+ const windowSize = 100;
109
+ const step = 50;
110
+ const history: Array<{ start: number; confidence: number }> = [];
111
+
112
+ for (let i = windowSize; i <= bevy30SamplesNs.length; i += step) {
113
+ const samples = bevy30SamplesNs.slice(0, i);
114
+ const result = checkConvergence(samples);
115
+ history.push({ start: i - windowSize, confidence: result.confidence });
116
+ }
117
+
118
+ const firstFull = history.findIndex(h => h.confidence === 100);
119
+
120
+ if (firstFull !== -1) {
121
+ const samplesNeeded = history[firstFull].start + windowSize;
122
+ console.log(`First 100% convergence at ${samplesNeeded} samples`);
123
+
124
+ const unstable = history.slice(firstFull).some(h => h.confidence < 100);
125
+ if (unstable) {
126
+ console.warn("Convergence became unstable after initially reaching 100%");
127
+ } else {
128
+ console.log(
129
+ "Convergence remained stable at 100% after initial achievement",
130
+ );
131
+ }
132
+ }
133
+ });
134
+
135
+ test("adaptive algorithm would stop at correct time", () => {
136
+ const target = 95;
137
+ const fallback = 80;
138
+ const minSamples = 50;
139
+
140
+ let stopAt = -1;
141
+ let stopConfidence = 0;
142
+
143
+ for (let i = minSamples; i <= bevy30SamplesNs.length; i++) {
144
+ const samples = bevy30SamplesNs.slice(0, i);
145
+ const result = checkConvergence(samples);
146
+
147
+ if (result.converged && result.confidence >= target) {
148
+ stopAt = i;
149
+ stopConfidence = result.confidence;
150
+ break;
151
+ }
152
+
153
+ // Check fallback condition (after minimum time)
154
+ if (i >= 100 && result.confidence >= fallback) {
155
+ stopAt = i;
156
+ stopConfidence = result.confidence;
157
+ break;
158
+ }
159
+ }
160
+
161
+ if (stopAt !== -1) {
162
+ const timeSec = ((stopAt * 50) / 1000).toFixed(1); // Approximate seconds
163
+ console.log(`Adaptive would stop at:`);
164
+ console.log(` Samples: ${stopAt}`);
165
+ console.log(` Confidence: ${stopConfidence}%`);
166
+ console.log(` Estimated time: ${timeSec}s`);
167
+ } else {
168
+ console.log("Adaptive would run to maximum time");
169
+ }
170
+
171
+ // Should stop relatively quickly with this stable data
172
+ if (stopAt > 200) {
173
+ console.warn(
174
+ "Takes many samples to converge - may indicate initial instability",
175
+ );
176
+ }
177
+ });
@@ -0,0 +1,4 @@
1
+ export const run = () => {
2
+ let _x = 0;
3
+ for (let i = 0; i < 100; i++) _x++;
4
+ };
@@ -0,0 +1,158 @@
1
+ export const bevy30SamplesMs = [
2
+ 80.61558300000002, 66.37175000000002, 66.61120900000003, 59.746249999999975,
3
+ 55.74012499999992, 52.160124999999994, 52.13995800000009, 54.286749999999984,
4
+ 50.80370800000003, 59.12149999999997, 55.563625, 52.23887500000001,
5
+ 52.77595900000006, 51.07529199999999, 50.427041000000145, 50.14474999999993,
6
+ 48.28724999999986, 46.59700000000021, 52.06224999999995, 50.592083,
7
+ 49.3754170000002, 48.68487500000015, 50.96391700000004, 62.87133299999982,
8
+ 50.64754100000005, 49.78441699999985, 47.675250000000005, 48.32424999999989,
9
+ 47.57083399999988, 49.08341599999994, 47.32058300000017, 46.605583000000024,
10
+ 51.04104099999995, 58.430166999999756, 50.8732500000001, 50.563208999999915,
11
+ 48.91212499999983, 48.50745800000004, 48.26179199999979, 50.23324999999977,
12
+ 47.112125000000106, 46.432374999999865, 51.7100419999997, 50.23104199999989,
13
+ 50.73958399999992, 49.152374999999665, 48.91470799999979, 47.4652500000002,
14
+ 50.519874999999956, 48.05470800000012, 51.37241700000004, 47.42558299999973,
15
+ 49.976624999999785, 50.045416999999816, 49.49662499999977, 48.76820799999996,
16
+ 49.057042000000365, 45.995666000000256, 46.33241599999974, 48.73274999999967,
17
+ 49.58787500000017, 48.81129099999998, 48.582708999999795, 47.78579200000013,
18
+ 48.683750000000146, 58.49037500000031, 49.004333000000315, 48.63583299999982,
19
+ 49.12008300000025, 49.317291999999725, 49.40095800000017, 46.12416699999994,
20
+ 45.25195799999983, 45.45441699999992, 52.73383399999966, 50.02391699999953,
21
+ 48.482333999999355, 48.20887499999935, 47.37054199999966, 47.55670800000007,
22
+ 46.027916999999434, 45.494958000000224, 45.11879200000021, 49.45758300000034,
23
+ 50.42462500000056, 49.037874999999985, 50.33866699999999, 54.52958300000046,
24
+ 69.9647500000001, 49.59545900000012, 49.00279099999989, 47.60712499999954,
25
+ 48.60533300000043, 45.83591699999943, 45.930459000000155, 45.48499999999967,
26
+ 49.828042000000096, 49.24304200000006, 49.724583999999595, 53.80274999999983,
27
+ 53.551124999999956, 46.535917000000154, 48.323333000000275, 49.24279200000001,
28
+ 49.24879099999998, 48.51916600000004, 49.95087500000045, 45.488084000000526,
29
+ 45.539458000000195, 45.34254199999941, 49.46349999999984, 49.354709000000184,
30
+ 48.80279100000007, 54.84016699999938, 58.64879199999996, 49.04120899999998,
31
+ 51.46087499999976, 48.319375000000036, 50.23133300000063, 49.4809580000001,
32
+ 48.86879200000021, 46.242457999999715, 45.80670800000007, 45.17291699999987,
33
+ 48.92499999999927, 48.98304199999984, 50.21979199999987, 55.287083000000166,
34
+ 53.05920799999967, 46.0953329999993, 48.611291000000165, 49.58479100000022,
35
+ 49.206874999999854, 48.37412500000028, 47.9027500000002, 47.0250419999993,
36
+ 45.96295800000007, 46.65641700000015, 45.70629199999985, 48.69391700000051,
37
+ 50.882416999999805, 48.422458000000006, 55.62487500000043, 53.483374999999796,
38
+ 49.25241600000027, 49.792208999999275, 48.43920799999978, 49.772375000000466,
39
+ 47.49924999999985, 47.568208000000595, 45.369832999999744, 45.570708999999624,
40
+ 45.60504199999923, 48.647915999999896, 47.968957999999475, 48.74304200000006,
41
+ 53.748333999999886, 52.548915999999736, 46.5418750000008, 49.49512499999946,
42
+ 50.23383300000023, 49.32266600000003, 48.34254200000032, 47.87970900000073,
43
+ 47.2142500000009, 45.91208299999926, 45.81825000000026, 45.34966600000007,
44
+ 49.91004199999952, 49.10462499999994, 48.66849999999977, 53.483917000001384,
45
+ 54.54808299999968, 45.9251660000009, 49.77758300000096, 49.1763749999991,
46
+ 49.095666999999594, 48.957249999999476, 47.853290999999444, 47.53254200000083,
47
+ 45.95770900000025, 46.21495900000082, 45.60704199999964, 49.116416999999274,
48
+ 49.75299999999879, 48.92104199999994, 54.059792000000016, 52.9361659999995,
49
+ 51.10912499999904, 49.26566599999933, 48.63745799999924, 48.949916999999914,
50
+ 47.82220800000141, 47.57375000000138, 46.22849999999926, 45.18529200000012,
51
+ 45.9122499999994, 49.942832999999155, 49.02745800000048, 48.77312499999971,
52
+ 55.1904169999998, 54.38104199999907, 50.804040999999415, 48.82645800000137,
53
+ 49.96941700000025, 48.79229200000009, 47.69579200000044, 47.33008299999892,
54
+ 45.52220800000032, 45.705792000000656, 45.56195899999875, 49.780249999999796,
55
+ 49.76762500000041, 48.413125000000946, 53.676542000001064, 53.817542000000685,
56
+ 49.37212500000169, 49.303916999999274, 49.09791600000062, 49.281333000000814,
57
+ 48.678916999999274, 48.69449999999961, 47.745334000001094, 47.116541999999754,
58
+ 47.39574999999968, 51.91700000000128, 50.17708300000049, 50.595791000001554,
59
+ 56.257958000000144, 54.78375000000051, 50.82316700000047, 49.921291000000565,
60
+ 49.13329200000044, 48.78295799999978, 47.06054099999892, 47.66666699999951,
61
+ 45.618749999999636, 45.70125000000007, 45.93916700000045, 49.99633300000096,
62
+ 49.5435839999991, 48.83324999999968, 54.72229100000004, 52.958042000000205,
63
+ 45.967249999999694, 48.97375000000102, 48.961583000000246, 49.52741700000115,
64
+ 48.45679100000052, 49.45841599999949, 45.56870899999922, 45.78220799999872,
65
+ 45.15870899999936, 48.222999999999956, 49.63791599999968, 49.90116699999999,
66
+ 55.798375000000306, 53.571249999999054, 49.82495800000106, 49.107082999998966,
67
+ 48.09837499999958, 48.91808299999866, 47.980875000001106, 47.301415999998426,
68
+ 45.586332999999286, 45.82050000000163, 45.91820800000096, 49.95800000000054,
69
+ 48.91974999999911, 49.33429200000137, 54.322291000000405, 54.163916999999856,
70
+ 45.9068329999991, 49.55379199999879, 49.53358299999854, 48.059416000000056,
71
+ 48.247417000000496, 49.68645800000013, 45.87512500000048, 45.10520799999904,
72
+ 45.71270900000127, 48.5206249999992, 50.58295799999905, 48.3025000000016,
73
+ 54.945708999999624, 54.39416600000004, 46.142250000000786, 50.030249999999796,
74
+ 51.16112500000054, 48.798249999999825, 49.47741700000006, 47.373875000001135,
75
+ 48.41849999999977, 45.97737500000039, 44.88337499999943, 45.64862499999981,
76
+ 48.39933299999939, 51.11124999999993, 49.64616600000045, 53.925750000000335,
77
+ 53.39754200000061, 46.21454100000119, 50.089500000000044, 50.36762499999895,
78
+ 48.34858300000087, 48.51875000000109, 48.96274999999878, 45.74474999999984,
79
+ 45.79920800000036, 45.58704100000068, 49.909083999998984, 49.55683299999873,
80
+ 48.94958299999962, 57.076208000000406, 52.73583399999916, 46.15720799999872,
81
+ 48.42695900000035, 49.7913750000007, 49.42625000000044, 48.889500000001135,
82
+ 47.973917000001165, 47.287625000000844, 45.76283400000102, 46.195708000001105,
83
+ 46.194124999999985, 50.33754100000078, 48.24095800000214, 49.14208399999916,
84
+ 55.5870419999992, 53.15037500000108, 46.09875000000102, 50.084499999997206,
85
+ 49.441209000000526, 48.692792000001646, 49.08374999999796, 47.79175000000032,
86
+ 47.27362500000163, 45.38091699999859, 45.635250000003, 47.23349999999846,
87
+ 49.77679100000023, 49.17045800000051, 48.45100000000093, 55.641208000000915,
88
+ 54.024750000000495, 46.13704199999847, 49.809832999999344, 49.05558300000121,
89
+ 47.957916999999725, 48.55262500000026, 48.66766600000119, 46.03325000000041,
90
+ 45.76920799999789, 45.16666699999769, 49.53404199999932, 52.150707999997394,
91
+ 49.74516700000095, 55.66187499999796, 53.50929199999882, 46.443083999998635,
92
+ 50.69879199999923, 48.70245799999975, 48.95000000000073, 48.59899999999834,
93
+ 50.081583000002865, 46.214625000000524, 45.804707999999664,
94
+ 45.095792000000074, 48.98354100000142, 48.89466700000048, 48.812708000001294,
95
+ 53.922207999999955, 52.70049999999901, 49.61370900000111, 50.798915999999736,
96
+ 49.360875000002125, 49.354208000000654, 47.13891700000022, 47.816791999997804,
97
+ 45.41125000000102, 45.98400000000038, 44.92933400000038, 48.742167000000336,
98
+ 48.83304099999805, 49.36870899999849, 54.48670800000036, 52.75483300000269,
99
+ 46.27441700000054, 48.46429199999693, 48.409333000003244, 48.59400000000096,
100
+ 48.72195799999827, 48.66749999999956, 46.51574999999866, 45.342625000001135,
101
+ 45.40983300000153, 51.87858299999789, 48.33650000000125, 48.89666699999725,
102
+ 55.85283400000117, 53.97491699999955, 51.93662499999846, 49.21224999999686,
103
+ 48.30145899999843, 48.45275000000038, 47.656707999998616, 48.81725000000006,
104
+ 45.57354200000191, 45.459249999999884, 45.343958000001294, 49.432583999998315,
105
+ 49.647124999999505, 48.851041999998415, 54.16299999999683, 53.54054100000212,
106
+ 49.159208000000945, 48.99841599999854, 49.07083299999795, 48.51525000000038,
107
+ 47.105374999999185, 48.29975000000195, 46.098667000002024, 46.108500000002095,
108
+ 45.44562500000029, 49.38929100000314, 50.16675000000032, 48.86854200000016,
109
+ 55.041166000002704, 54.83183300000019, 45.99804199999926, 50.307709000000614,
110
+ 48.711708999999246, 48.71820800000205, 48.39937500000087, 49.33816599999773,
111
+ 45.464874999997846, 47.00366700000086, 46.807958000001236, 50.48908300000039,
112
+ 51.03966700000092, 50.539041, 55.56983300000138, 55.554917000001296,
113
+ 47.528833000000304, 50.371125000001484, 51.22849999999744, 50.604583000000275,
114
+ 49.44691700000112, 47.18741600000067, 47.74704200000269, 45.759665999998106,
115
+ 45.92933300000004, 45.08745899999849, 49.758583999999246, 48.574875000002066,
116
+ 48.469374999996944, 53.76145899999756, 53.07483299999876, 49.99329200000284,
117
+ 48.59245799999917, 48.815458000000945, 48.628458999999566, 47.534708000002865,
118
+ 47.15100000000166, 45.8171250000014, 46.22229199999856, 45.70787500000006,
119
+ 50.791165999999066, 49.08420800000022, 49.10949999999866, 53.97541699999783,
120
+ 53.11329200000182, 45.94574999999895, 50.71537499999977, 48.68037499999991,
121
+ 49.84808300000077, 48.72179099999994, 48.80349999999817, 46.715250000001106,
122
+ 45.805333000000246, 45.3507090000021, 50.67554199999722, 49.488375000000815,
123
+ 49.021624999997584, 54.55595899999753, 53.0313750000023, 46.67766699999993,
124
+ 48.7364579999994, 48.38183299999946, 48.359707999999955, 48.29820800000016,
125
+ 49.10720799999763, 45.73804100000052, 45.88729200000307, 46.00895899999887,
126
+ 49.11087499999849, 49.64783400000306, 48.246124999997846, 53.89704200000051,
127
+ 54.30987499999901, 52.402375000001484, 49.89104199999929, 51.11099999999715,
128
+ 50.291291999998066, 48.18249999999898, 47.65270800000144, 46.02037500000006,
129
+ 45.74329099999886, 45.31195799999841, 49.5357499999991, 49.88429100000212,
130
+ 49.181916999998066, 54.580792000000656, 53.722624999998516,
131
+ 45.724874999999884, 49.99233300000196, 49.896624999997584, 48.12062499999956,
132
+ 49.195457999998325, 48.91291700000147, 45.73216700000194, 45.643874999997934,
133
+ 45.62666700000045, 49.03704199999993, 49.06529199999932, 48.76683299999786,
134
+ 54.8761250000025, 52.949124999999185, 46.09779100000014, 49.21733400000085,
135
+ 49.02845800000068, 48.11529199999859, 48.92212499999732, 46.77283400000306,
136
+ 47.442416999998386, 45.066500000000815, 45.99537500000224, 45.02600000000166,
137
+ 48.662875000001804, 48.97608399999808, 48.133874999999534, 53.967500000002474,
138
+ 52.93541600000026, 47.48162500000035, 51.27733299999818, 48.93304200000057,
139
+ 49.10966700000063, 49.105124999998225, 47.832791000000725, 47.55662500000108,
140
+ 45.263958999999886, 45.89308300000266, 45.14274999999907, 50.08416700000089,
141
+ 48.17337499999849, 49.68975000000137, 54.730875000001106, 53.85200000000259,
142
+ 45.659583000000566, 49.74187499999971, 49.65020899999945, 48.14274999999907,
143
+ 48.44183400000111, 49.54704100000163, 45.452666999997746, 45.54370800000106,
144
+ 45.30216699999801, 48.969959000001836, 49.36304200000086, 48.47708299999795,
145
+ 53.67975000000297, 53.69904099999985, 46.765542000001005, 50.87083300000086,
146
+ 49.14904199999728, 48.34608300000036, 48.5568749999984, 49.42708300000231,
147
+ 45.6563750000023, 45.61137499999677, 45.150540999999066, 49.74079200000051,
148
+ 49.224124999997, 48.68712500000038, 54.10337499999878, 52.861957999997685,
149
+ 45.97370800000135, 48.53074999999808, 48.85729199999696, 49.814375000001746,
150
+ 48.98833400000149, 49.80070799999885, 50.524208999999246, 46.54212499999994,
151
+ 46.037625000000844, 45.34429200000159, 49.72775000000183, 50.20683399999689,
152
+ 49.39600000000064, 53.93683299999975, 53.79412500000035, 45.827917000002344,
153
+ 48.4642079999976, 48.603000000002794, 49.95691699999952, 48.397916999998415,
154
+ 48.471582999998645, 45.439125000000786, 45.06537500000195, 45.87945800000307,
155
+ ] as number[];
156
+
157
+ /** Get samples in nanoseconds */
158
+ export const bevy30SamplesNs = bevy30SamplesMs.map(s => s * 1_000_000);
@@ -0,0 +1,7 @@
1
+ /** Test cases module with async loadCase */
2
+ export const cases = ["alpha", "beta"];
3
+
4
+ export async function loadCase(id: string) {
5
+ await Promise.resolve(); // simulate async
6
+ return { data: id.toUpperCase(), metadata: { original: id } };
7
+ }
@@ -0,0 +1,8 @@
1
+ /** Test cases module for Phase 3 testing */
2
+ export const cases = ["small", "large"];
3
+
4
+ export function loadCase(id: string) {
5
+ const data =
6
+ id === "small" ? [1, 2, 3] : Array.from({ length: 100 }, (_, i) => i);
7
+ return { data, metadata: { size: data.length } };
8
+ }
@@ -0,0 +1,2 @@
1
+ /** Variant that multiplies array elements */
2
+ export const run = (arr: number[]) => arr.reduce((a, b) => a * b, 1);
@@ -0,0 +1,2 @@
1
+ /** Variant that sums array elements */
2
+ export const run = (arr: number[]) => arr.reduce((a, b) => a + b, 0);
@@ -0,0 +1 @@
1
+ export const run = () => {};
@@ -0,0 +1,4 @@
1
+ export const run = () => {
2
+ let _x = 0;
3
+ for (let i = 0; i < 100; i++) _x++;
4
+ };
@@ -0,0 +1 @@
1
+ export const notRun = () => {};
@@ -0,0 +1 @@
1
+ export const run = () => {};
@@ -0,0 +1,4 @@
1
+ export const run = () => {
2
+ let _x = 0;
3
+ for (let i = 0; i < 100; i++) _x++;
4
+ };
@@ -0,0 +1,2 @@
1
+ export const setup = data => ({ value: data });
2
+ export const run = state => state.value;
@@ -0,0 +1,2 @@
1
+ export const setup = data => ({ value: data });
2
+ export const run = state => state.value;
@@ -0,0 +1 @@
1
+ export const run = () => {};
@@ -0,0 +1 @@
1
+ export const run = () => {};
@@ -0,0 +1 @@
1
+ export const run = () => {};
@@ -0,0 +1,4 @@
1
+ export const run = () => {
2
+ let _x = 0;
3
+ for (let i = 0; i < 100; i++) _x++;
4
+ };