Skip to content

Fix stride decrease check for negative strides - #415

Open
haiwenheaven wants to merge 1 commit into
FFTW:masterfrom
haiwenheaven:fix-negative-stride-planner-recursion
Open

Fix stride decrease check for negative strides#415
haiwenheaven wants to merge 1 commit into
FFTW:masterfrom
haiwenheaven:fix-negative-stride-planner-recursion

Conversation

@haiwenheaven

@haiwenheaven haiwenheaven commented Jul 29, 2026

Copy link
Copy Markdown

Related to #414

This patch fixes an infinite planner recursion triggered by a valid
out-of-place complex DFT layout containing negative strides.

The recursion occurs because tensor_strides_decrease compares signed
stride values directly. With negative strides, this can select
indirect-before instead of indirect-after, allowing
indirect-before and indirect-transpose to repeatedly reconstruct
each other's subproblems.

Compare strides by magnitude in tensor_strides_decrease, using the
signed value as a tie-breaker when magnitudes are equal. This prevents
negative strides from selecting the wrong indirect solver and avoids
recursion between indirect-before and indirect-transpose.
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.

1 participant