From b846272388bad714fc82ad8c5e059155b758e714 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 22 Oct 2026 14:14:05 +0000 Subject: [PATCH] test(@stdlib/fft/base/fftpack/float32/sinqi): fix factorization reads The scheduled `linux_test` workflow failed on develop with four assertion failures in the "stride and offset" test of `fft/base/fftpack/float32/sinqi` (e.g., expected `8`, actual `1.1210387714598537e-44`). Root cause: `rffti1` stores the integer factorization data (sequence length, number of factors, and factors) through a `Uint32Array` view over the `Float32Array` workspace, so reading those slots as floats yields denormals. This commit reads the factorization section through a `Uint32Array` view, consistent with the `cosqi` and `rffti` tests. Ref: https://github.com/stdlib-js/stdlib/actions/runs/39753951313 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01CrVhRwPsPFuqS8JdR5SEeJ --- .../fft/base/fftpack/float32/sinqi/test/test.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/fft/base/fftpack/float32/sinqi/test/test.js b/lib/node_modules/@stdlib/fft/base/fftpack/float32/sinqi/test/test.js index 7824a1b057ef..28a22c6d6aec 100644 --- a/lib/node_modules/@stdlib/fft/base/fftpack/float32/sinqi/test/test.js +++ b/lib/node_modules/@stdlib/fft/base/fftpack/float32/sinqi/test/test.js @@ -22,6 +22,7 @@ var tape = require( 'tape' ); var Float32Array = require( '@stdlib/array/float32' ); +var Uint32Array = require( '@stdlib/array/uint32' ); var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' ); var sinqi = require( './../lib' ); @@ -286,6 +287,7 @@ tape( 'the function correctly handles stride and offset parameters', function te var expected; var stride; var offset; + var fview; var nf; var N; var i; @@ -297,12 +299,15 @@ tape( 'the function correctly handles stride and offset parameters', function te sinqi( N, workspace, stride, offset ); - t.strictEqual( workspace[ offset + ( 3*N * stride ) ], N, 'returns expected value' ); + // Create an unsigned integer view over the workspace to read the factorization section: + fview = new Uint32Array( workspace.buffer, workspace.byteOffset, workspace.length ); // eslint-disable-line max-len - nf = workspace[ offset + ( ( ( 3*N ) + 1 ) * stride ) ]; + t.strictEqual( fview[ offset + ( 3*N * stride ) ], N, 'returns expected value' ); + + nf = fview[ offset + ( ( ( 3*N ) + 1 ) * stride ) ]; t.strictEqual( nf, 2, 'returns expected value' ); - t.strictEqual( workspace[ offset + ( ( ( 3*N ) + 2 ) * stride ) ], 2, 'returns expected value' ); - t.strictEqual( workspace[ offset + ( ( ( 3*N ) + 3 ) * stride ) ], 4, 'returns expected value' ); + t.strictEqual( fview[ offset + ( ( ( 3*N ) + 2 ) * stride ) ], 2, 'returns expected value' ); + t.strictEqual( fview[ offset + ( ( ( 3*N ) + 3 ) * stride ) ], 4, 'returns expected value' ); expected = new Float32Array( ( 3*N ) + 34 ); sinqi( N, expected, 1, 0 );