Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teach julia that NaNMath functions don't have effects #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oscardssmith
Copy link
Member

This allows constant folding and dead code elimination on Julia 1.8 and up.

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: +0.02% 🎉

Comparison is base (d5ea765) 97.05% compared to head (d51c509) 97.08%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
+ Coverage   97.05%   97.08%   +0.02%     
==========================================
  Files           1        1              
  Lines         102      103       +1     
==========================================
+ Hits           99      100       +1     
  Misses          3        3              
Files Changed Coverage Δ
src/NaNMath.jl 97.08% <80.00%> (+0.02%) ⬆️

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

@oscardssmith oscardssmith requested a review from ViralBShah August 7, 2023 13:04
@ViralBShah
Copy link
Member

I'm not the right person to review this.

@oscardssmith oscardssmith changed the title Teach julia that NaNMath functions don't have effectsAssume effects Teach julia that NaNMath functions don't have effects Aug 8, 2023
@mlubin
Copy link
Collaborator

mlubin commented Aug 14, 2023

This needs a review from someone who understands @assume_effects

@oscardssmith
Copy link
Member Author

I've talked to @vtjnash about this a bit and he thinks that libm might be leaking effectful information (rounding modes and signals) but I haven't been able to find observe this.

@vtjnash
Copy link

vtjnash commented Aug 15, 2023

In particular, note that C documentation for these explicitly states these are not pure due to side effects.

@oscardssmith
Copy link
Member Author

however the two areas of impurity (rounding modes and flags) appear not to be accessible from julia (or at least I haven't been able to observe the impurity)

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