From f44c25bf32efca1f0ec5e39e77a703ccc5668315 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 8 Sep 2026 14:14:58 +0000 Subject: [PATCH] test(@stdlib/random/base/mt19937): bound seed growth in `factory` benchmark The job `random_benchmarks` on workflow `random_benchmarks` failed on develop with `RangeError: invalid option. \`seed\` option must be a positive integer less than or equal to the maximum unsigned 32-bit integer. Option: \`4295022904\`.` in benchmark.factory.js. Root cause: the `factory:seed=` benchmark accumulated the seed across iterations (`opts.seed += i`), a triangular-number sum that deterministically exceeds the maximum unsigned 32-bit seed after roughly 92700 iterations, regardless of which SHA is checked out. This commit assigns a bounded, always-valid seed per iteration (`opts.seed = i + 1`), matching the pattern already used by the sibling `factory:seed=` benchmark in the same file, so the benchmark no longer overflows the valid seed range. Ref: https://github.com/stdlib-js/stdlib/actions/runs/34173224406 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01AiQ7xQp83BfogoNxDNvNW8 --- .../@stdlib/random/base/mt19937/benchmark/benchmark.factory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/random/base/mt19937/benchmark/benchmark.factory.js b/lib/node_modules/@stdlib/random/base/mt19937/benchmark/benchmark.factory.js index 2468ecbb10ea..3a4e084630b3 100644 --- a/lib/node_modules/@stdlib/random/base/mt19937/benchmark/benchmark.factory.js +++ b/lib/node_modules/@stdlib/random/base/mt19937/benchmark/benchmark.factory.js @@ -61,7 +61,7 @@ bench( format( '%s:factory:seed=', pkg ), function benchmark( b ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - opts.seed += i; + opts.seed = i + 1; f = factory( opts ); if ( typeof f !== 'function' ) { b.fail( 'should return a function' );