Skip to content

Keep the istft slice from emptying when fft_length is 0 or 1 - #46

Open
MarcosAsh wants to merge 2 commits into
mainfrom
fix-istft
Open

Keep the istft slice from emptying when fft_length is 0 or 1#46
MarcosAsh wants to merge 2 commits into
mainfrom
fix-istft

Conversation

@MarcosAsh

@MarcosAsh MarcosAsh commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Description

istft returned an empty array whenever fft_length was 0 or 1 with center=True. The end of the slice was -(fft_length // 2), which is -0 in that case, so x[..., start:0] kept nothing. jax counts back from the expected length instead, expected_output_len - (fft_length // 2), which this now matches.

The test_istft7 and test_istft8 exclusions stay. Removing them passes on linux but fails on macOS, where the same input comes back as the right values interleaved with zeros, [v0, 0, v1, 0, ...] against [v0, v1, v2, ...]. That is a separate Metal only problem in the overlap and add path and it needs a machine with Metal to chase, so it is not in this PR.

The other five istft exclusions also stay. Their mismatches are all inside the 5% of each boundary that math_test.py already truncates for numpy, jax, torch and openvino, so they are the same boundary difference those backends have rather than anything wrong here. Adding mlx to that list is a keras change, not one for this repo.

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