Skip to content

Migrate to FFTW from FFTS inside unit tests#900

Merged
azonenberg merged 1 commit intongscopeclient:masterfrom
helaslo:fftw-tests
Sep 24, 2025
Merged

Migrate to FFTW from FFTS inside unit tests#900
azonenberg merged 1 commit intongscopeclient:masterfrom
helaslo:fftw-tests

Conversation

@helaslo
Copy link
Copy Markdown
Contributor

@helaslo helaslo commented Sep 22, 2025

This PR closes ngscopeclient/scopehal#757

There are some things that I wasn't sure about, I will mark them inside the code comment region after the PR is submitted, the most notable is that I changed nouts to sines.size() inside the DeEmbed filter test, because otherwise ASAN complained, although the tests ran fine either way.

Windows CI started to fail, but it seems like clang is being more aggressive with some imgui internal function, in other platform it builds fine.

@@ -1,5 +1,4 @@
../LICENSE
../../ffts/COPYRIGHT
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how shall I place the license here for FFTW

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean since it is test-case only, shall it be included?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually don't display licenses in the MSI installer (and FFTS isn't shipped in the binary) so that entire file is legacy and can probably be removed but I need to verify. Deleting that line is fine.

${LIBFFTS_LIBRARIES}
)

pkg_search_module(FFTW fftw3f IMPORTED_TARGET)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen this way of including PkgConfig modules elsewhere in the codebase, is it okay this way?


//Apply the interpolated S-parameters
for(size_t j=0; j<nouts; j++)
for(size_t j = 0; j < sines.size(); j++)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this because ASAN was failing in the old way, although tests ran fine otherwise. Not sure if mathematically this is still correct, but the tests are passing.

Interesting thing is that valgrind wasn't complaining either way, and if I didn't execute any FFTW function ASAN didn't find any problems either.

@helaslo
Copy link
Copy Markdown
Contributor Author

helaslo commented Sep 23, 2025

CI seems to pass now aside from the random macOs failure, grepping for FFTS and ffts both shows no results except inside VkFFT

I think it can be merged now. Companion PR for docs is ngscopeclient/scopehal-docs#108

➜  scopehal-apps git:(fftw-tests) ✗ rg -lH FFTS
lib/VkFFT/vkFFT/vkFFT/vkFFT_Structs/vkFFT_Structs.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_Plans/vkFFT_Plan_R2C.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_Plans/vkFFT_Plan_FFT.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_HostFunctions/vkFFT_Scheduler.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_HostFunctions/vkFFT_RecursiveFFTGenerators.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_HostFunctions/vkFFT_AxisBlockSplitter.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_PlanManagement/vkFFT_API_handles/vkFFT_InitAPIParameters.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_StringManagement/vkFFT_StringManager.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_MathUtils/vkFFT_MathUtils.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel2/vkFFT_R2C_even_decomposition.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel2/vkFFT_FFT.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/vkFFT_RegisterBoost.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/vkFFT_RaderKernels.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/vkFFT_ReadWrite.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/vkFFT_RadixStage.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/vkFFT_RadixShuffle.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/PrePostProcessing/vkFFT_R2R.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/PrePostProcessing/vkFFT_4step.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/vkFFT_RadixKernels.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/PrePostProcessing/vkFFT_R2C.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/PrePostProcessing/vkFFT_Convolution.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_Zeropad.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_KernelStartEnd.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel1/PrePostProcessing/vkFFT_Bluestein.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_AppManagement/vkFFT_RunApp.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryTransfers/vkFFT_Transfers.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_AppManagement/vkFFT_InitializeApp.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryInitialization/vkFFT_SharedMemory.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryInitialization/vkFFT_InputOutput.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryInitialization/vkFFT_Registers.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryInitialization/vkFFT_Constants.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryInitialization/vkFFT_PushConstants.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryInitialization/vkFFT_InputOutputLayout.h
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_KernelUtils.h
➜  scopehal-apps git:(fftw-tests) ✗ rg -lH ffts
lib/VkFFT/vkFFT/vkFFT/vkFFT_CodeGen/vkFFT_KernelsLevel0/vkFFT_MemoryManagement/vkFFT_MemoryInitialization/vkFFT_SharedMemory.h
➜  scopehal-apps git:(fftw-tests) ✗ 

@helaslo helaslo marked this pull request as ready for review September 23, 2025 21:46
@helaslo helaslo changed the title WIP: Migrate to FFTW from FFTS inside unit tests Migrate to FFTW from FFTS inside unit tests Sep 23, 2025
@azonenberg azonenberg merged commit 2efc067 into ngscopeclient:master Sep 24, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert unit tests that use FFTS to use FFTW

2 participants