Which optimization level would turn off @assert in run time?

sorry, maybe a dump question, but I failed to find relevant docs …

None. They do not get turned off.

I’m not sure how it is in julia, but generally assertions can be used by the compiler as guarantees - after all, they assert a certain property. More guarantees can lead to more optimizations, which I’m not sure you want to reduce.

Cf
https://github.com/JuliaLang/julia/issues/10614

https://github.com/JuliaLang/julia/pull/25576

3 Likes

None currently, but it is documented that such an option might exist in the future, so the macro shouldn’t be used for side effects that are needed for correctness.

so, if I understand the PRs correctly, seems like in future releases we should use @check (rather than @assert) and then enable/disable it by --debug={yes|no} ?

Possibly, but these are open questions at the moment.