-
Notifications
You must be signed in to change notification settings - Fork 6
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
Full no_std
and miri
support
#18
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robamler
force-pushed
the
new-probability
branch
8 times, most recently
from
November 6, 2022 23:10
772ebe8
to
5994eec
Compare
robamler
force-pushed
the
new-probability
branch
2 times, most recently
from
November 7, 2022 01:25
7dd84f0
to
4f85172
Compare
It might be worth waiting for rust-lang/rust#103765 to be stabilized, as that would probably allow us to be |
robamler
force-pushed
the
new-probability
branch
2 times, most recently
from
December 18, 2022 20:44
01a5259
to
3648102
Compare
This changes some type signatures, which is technically a breaking change (although the previous implementations were essentially unusable anyway).
This requires upgrading the dependency on `probability` from 0.17 to 0.18, which is technically a breaking change since `constriction` re-exports `probability::distribution::Distribution` and `probability::distribution::Inverse` unless compiled without the default feature "std".
Starting from version 0.19, crate `probability` is now supposed to both support `no_std` mode and remove all external syscalls for mathematical special functions. We therefore no longer need to make the crate `probability` an optional dependency. The updated `probability` *should* allow users to use `constriction` in `no_std` mode in more contexts, and to run more tests in `miri`. Whether this is actually the case will be tested in the next few commits.
The new version of the `probability` crate no longer uses system calls for special mathematical functions, so we can now run (almost) all tests in miri. The only tests that are still disabled in miri are the benchmarks in directory `benches`. These cannot be enabled at this point since `criterion` seems to be incompatible with `miri`.
First step towards `no_std` compatibility.
This reverts commit 63f6252.
For `no_std` compatibility, we can use `log2` only if either feature "std" or feature "libm" is active.
This one is `no_std` compatible
robamler
force-pushed
the
new-probability
branch
from
December 22, 2022 12:37
3648102
to
c7163ba
Compare
The only missing piece was to replace `f64::ln_1p` with `libm::log1p`.
robamler
force-pushed
the
new-probability
branch
from
January 28, 2023 12:55
3a447ba
to
a969ef3
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update dependency on
probability
from version 0.18 to version 0.19.1 make it non-optional. This is a breaking change sinceconstriction
's public API exposes traits fromprobability
.Starting from version 0.19, crate
probability
is now supposed toboth support
no_std
mode and remove all external syscalls formathematical special functions. We therefore no longer need to make the
crate
probability
an optional dependency.The updated
probability
should allow users to useconstriction
inno_std
mode in more contexts, and to run more tests inmiri
. Tests on this PR will show whether this is indeed the case.