Skip to content

Conversation

@JeffFessler
Copy link
Contributor

The documentation for AbstractFFTs makes explicit reference to certain FFTW flags, so it would be very desirable for those flags to be public in FFTW so that developers can count on them indefinitely and so that users (like me) who follow those docs do not get warnings about using "non-public" names from ExplicitImports.jl.

Perhaps more (all?) of the FFTW constants should also be public and you or I could amend this PR to be more inclusive. For now I am limiting the request to just those that are cited explicitly in public Julia package documentation because I am unsure which of the many const values in fft.jl should be public.

@codecov
Copy link

codecov bot commented Dec 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.64%. Comparing base (03ad4a8) to head (32ca781).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #329   +/-   ##
=======================================
  Coverage   73.64%   73.64%           
=======================================
  Files           5        5           
  Lines         535      535           
=======================================
  Hits          394      394           
  Misses        141      141           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stevengj
Copy link
Member

I think all of the flags here should be public, since they are all documented in the underlying FFTW library:

FFTW.jl/src/fft.jl

Lines 70 to 79 in 08e409c

const MEASURE = UInt32(0)
const DESTROY_INPUT = UInt32(1 << 0)
const UNALIGNED = UInt32(1 << 1)
const CONSERVE_MEMORY = UInt32(1 << 2)
const EXHAUSTIVE = UInt32(1 << 3) # NO_EXHAUSTIVE is default
const PRESERVE_INPUT = UInt32(1 << 4) # cancels DESTROY_INPUT
const PATIENT = UInt32(1 << 5) # IMPATIENT is default
const ESTIMATE = UInt32(1 << 6)
const WISDOM_ONLY = UInt32(1 << 21)
const NO_SIMD = UInt32(1 << 17) # disable SIMD, useful for benchmarking

@JeffFessler
Copy link
Contributor Author

That's kind of what I guessed- thanks. Done.

src/FFTW.jl Outdated
export dct, idct, dct!, idct!, plan_dct, plan_idct, plan_dct!, plan_idct!

# FFTW flags from fft.jl
public MEASURE
Copy link
Member

Choose a reason for hiding this comment

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

In case it wasn't clear, public doesn't work in v1.10.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the reminder. I added a VERSION switch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having public within an if statement did not work; i.e., this fails with the error "Expected end" in v1.12.3 on MacOS:

if true
    public foo
end

Fortunately, having an include within the if statement appears to work, so I isolated the public assertions to a separate file, public.jl, as a workaround. Suggestions welcome.

Copy link
Member

Choose a reason for hiding this comment

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

You can use something like https://github.com/JuliaStats/StatsAPI.jl/blob/ee9906ddd8cab08b454d1f0088c5285ac7bed1fe/src/StatsAPI.jl#L5-L10. Or Compat.jl which provides a macro for this expression, but in StatsAPI it didn't seem worth adding an additional dependency (in particular due to the large number of packages that depend on StatsAPI).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @devmotion for that very helpful suggestion. I'm giving it a try now.

@JeffFessler JeffFessler marked this pull request as draft December 29, 2025 02:56
@JeffFessler
Copy link
Contributor Author

Now the Julia min (aka v1.10) CI errors seem to be with CoverageTools.jl - it seems that CoverageTools is trying to parse public.jl even though the include for public.jl is wrapped in an if VERSION ... statement. Is this erroneous behavior of CoverageTools that I should report elsewhere? Or am I doing something wrong?

@JeffFessler JeffFessler marked this pull request as ready for review December 29, 2025 17:58
@JeffFessler
Copy link
Contributor Author

Now passes all the relevant tests. (The macOS-13 tests seem to be deprecated - unrelated to this PR.)
The use of Eval seems slightly unbeatiful to me, but it works across old and new versions, again thanks to @devmotion.
When Julia min becomes 1.11 or higher, then this block of code could be simplified.

@giordano giordano merged commit 566f3c6 into JuliaMath:master Dec 29, 2025
51 checks passed
@JeffFessler JeffFessler deleted the jf/public branch December 29, 2025 19:56
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.

4 participants