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

Fix setprecision errors on Julia nightly #187

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

devmotion
Copy link
Contributor

JuliaLang/julia#51362 (which switched to ScopeValue for MPFR precision and rounding which, however, seems to cause performance regressions; see also #171) of restricted Base.setprecision(f::Function, ::Type, ::Integer; kwargs...) to Type{BigFloat} which broke tests of Arblib on Julia nightly. The PR copies the implementation for ArbTypes.

@kalmarek
Copy link
Owner

@devmotion thanks especially for including those links to PRs in base and julia dev revisions.
What is the easiest way to find them in the future?

@kalmarek kalmarek merged commit f0efb0f into kalmarek:master Apr 17, 2024
11 checks passed
@devmotion
Copy link
Contributor Author

What is the easiest way to find them in the future?

The process is actually quite simple: You go to the PR in the Julia repo that introduced the change, obtain the merge commit (easiest by clicking on the link to the commit shown on Github when the PR was merged, eg above here it would be "commit f0efb0f" shown in the line "kalmarek merged ..."), and then obtain the corresponding Julia version number with the contrib/commit-name.sh script in the Julia repo. From the Compat.jl README:

If you're adding additional compatibility code to this package, the contrib/commit-name.sh script in the base Julia repository is useful for extracting the version number from a git commit SHA. For example, from the git repository of julia, run something like this:

bash $ contrib/commit-name.sh a378b60fe483130d0d30206deb8ba662e93944da
0.5.0-dev+2023

This prints a version number corresponding to the specified commit of the form X.Y.Z-aaa+NNNN, and you can then test whether Julia is at least this version by VERSION >= v"X.Y.Z-aaa+NNNN".

@nsajko
Copy link

nsajko commented Sep 27, 2024

FTR, it's much better to report an issue to upstream as a bug report, rather than working around it: JuliaLang/julia#55899

# Since Julia 1.11.0, the single-argument `Base._precision` is
# renamed to `Base._precision_with_base_2`
# Ref: https://github.com/JuliaLang/julia/pull/52910
:_precision_with_base_2
Copy link

Choose a reason for hiding this comment

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

The name is prefixed with an underscore to make it clear it's internal. Why trespass!?

Copy link
Owner

Choose a reason for hiding this comment

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

Trespassing or not ;)

I personally don't have time now to delve into (internals or not) the design of Base.precision to figure out what would suit us best and will be least maintenance in the future. If you do have a clear solution we're all ears ;)

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.

3 participants