Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ jobs:
path: ${{ env.BASELINE_NAME }}.tar.xz

- name: Run wall time benchmarks
run: ./ci/bench-runtime.sh
run: ./ci/bench-walltime.sh

- name: Print test logs if available
if: always()
Expand Down
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,37 @@ exclude = [
[workspace.dependencies]
anyhow = "1.0.101"
assert_cmd = "2.1.2"
cc = "1.2.55"
cc = "1.2.56"
cfg-if = "1.0.4"
compiler_builtins = { path = "builtins-shim", default-features = false }
criterion = { version = "0.6.0", default-features = false, features = ["cargo_bench_support"] }
criterion = { version = "0.8.2", default-features = false, features = ["cargo_bench_support"] }
getopts = "0.2.24"
getrandom = "0.3.4"
getrandom = "0.4.1"
gmp-mpfr-sys = { version = "1.6.8", default-features = false }
gungraun = "0.17.0"
gungraun = "0.17.2"
heck = "0.5.0"
indicatif = { version = "0.18.3", default-features = false }
libm = { path = "libm", default-features = false }
libm-macros = { path = "crates/libm-macros" }
libm-test = { path = "libm-test", default-features = false }
libtest-mimic = "0.8.1"
musl-math-sys = { path = "crates/musl-math-sys" }
no-panic = "0.1.35"
object = { version = "0.37.3", features = ["wasm"] }
no-panic = "0.1.36"
object = { version = "0.38.1", features = ["wasm"] }
panic-handler = { path = "crates/panic-handler" }
paste = "1.0.15"
proc-macro2 = "1.0.106"
quote = "1.0.44"
rand = "0.9.2"
rand_chacha = "0.9.0"
rand_xoshiro = "0.7"
rand = "0.10.0"
rand_chacha = "0.10.0"
rand_xoshiro = "0.8"
rayon = "1.11.0"
regex = "1.12.3"
rug = { version = "1.28.1", default-features = false, features = ["float", "integer", "std"] }
rustc_apfloat = "0.2.3"
serde_json = "1.0.149"
syn = "2.0.114"
tempfile = "3.24.0"
syn = "2.0.115"
tempfile = "3.25.0"

[profile.release]
panic = "abort"
Expand Down
19 changes: 15 additions & 4 deletions builtins-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ rand_xoshiro.workspace = true
# To compare float builtins against
rustc_apfloat.workspace = true

# Really a dev dependency, but dev dependencies can't be optional
# Really dev dependencies, but those can't be optional
criterion = { workspace = true, optional = true }
gungraun = { workspace = true, optional = true }

[dev-dependencies]
criterion.workspace = true
paste.workspace = true

[target.'cfg(all(target_arch = "arm", not(any(target_env = "gnu", target_env = "musl")), target_os = "linux"))'.dev-dependencies]
Expand All @@ -46,8 +46,10 @@ no-sys-f16 = ["no-sys-f16-f64-convert"]
# Enable icount benchmarks (requires gungraun-runner and valgrind locally)
icount = ["dep:gungraun"]

# Enable report generation without bringing in more dependencies by default
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]
# Config for wall time benchmarks. Plotters and html_reports bring in extra
# deps so are off by default for CI.
benchmarking-reports = ["walltime", "criterion/plotters", "criterion/html_reports"]
walltime = ["dep:criterion"]

# NOTE: benchmarks must be run with `--no-default-features` or with
# `-p builtins-test`, otherwise the default `compiler-builtins` feature
Expand All @@ -57,38 +59,47 @@ benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]
[[bench]]
name = "float_add"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_sub"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_mul"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_div"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_cmp"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_conv"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_extend"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_trunc"
harness = false
required-features = ["walltime"]

[[bench]]
name = "float_pow"
harness = false
required-features = ["walltime"]

[[bench]]
name = "mem_icount"
Expand Down
2 changes: 1 addition & 1 deletion builtins-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern crate alloc;
use compiler_builtins::float::Float;
use compiler_builtins::int::{Int, MinInt};
use rand_xoshiro::Xoshiro128StarStar;
use rand_xoshiro::rand_core::{RngCore, SeedableRng};
use rand_xoshiro::rand_core::{Rng, SeedableRng};

/// Sets the number of fuzz iterations run for most tests. In practice, the vast majority of bugs
/// are caught by the edge case testers. Most of the remaining bugs triggered by more complex
Expand Down
2 changes: 1 addition & 1 deletion ci/bench-runtime.sh → ci/bench-walltime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
export LIBM_SEED=benchesbenchesbenchesbencheswoo!
cargo bench --package libm-test \
--no-default-features \
--features short-benchmarks,build-musl,libm/force-soft-floats
--features walltime,short-benchmarks,build-musl,libm/force-soft-floats
6 changes: 5 additions & 1 deletion ci/miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ targets=(
)
for target in "${targets[@]}"; do
# Only run the `mem` tests to avoid this taking too long.
cargo miri test --manifest-path builtins-test/Cargo.toml --features no-asm --target "$target" -- mem
cargo miri test \
--manifest-path builtins-test/Cargo.toml \
--features no-asm \
--target "$target" \
-- mem
done
13 changes: 9 additions & 4 deletions libm-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ license = "MIT OR Apache-2.0"
anyhow.workspace = true
# This is not directly used but is required so we can enable `gmp-mpfr-sys/force-cross`.
gmp-mpfr-sys = { workspace = true, optional = true }
gungraun = { workspace = true, optional = true }
indicatif.workspace = true
libm = { workspace = true, default-features = true, features = ["unstable-public-internals"] }
libm-macros.workspace = true
Expand All @@ -20,14 +19,17 @@ rand_chacha.workspace = true
rayon.workspace = true
rug = { workspace = true, optional = true }

# Really dev dependencies, but those can't be optional
criterion = { workspace = true, optional = true }
gungraun = { workspace = true, optional = true }

[target.'cfg(target_family = "wasm")'.dependencies]
getrandom = { workspace = true, features = ["wasm_js"] }

[build-dependencies]
rand = { workspace = true, optional = true }

[dev-dependencies]
criterion.workspace = true
libtest-mimic.workspace = true

[features]
Expand All @@ -43,8 +45,10 @@ build-mpfr = ["dep:rug", "dep:gmp-mpfr-sys"]
# Build our own musl for testing and benchmarks
build-musl = ["dep:musl-math-sys"]

# Enable report generation without bringing in more dependencies by default
benchmarking-reports = ["criterion/plotters", "criterion/html_reports"]
# Config for wall time benchmarks. Plotters and html_reports bring in extra
# deps so are off by default for CI.
benchmarking-reports = ["walltime", "criterion/plotters", "criterion/html_reports"]
walltime = ["dep:criterion"]

# Enable icount benchmarks (requires gungraun-runner and valgrind locally)
icount = ["dep:gungraun"]
Expand All @@ -60,6 +64,7 @@ required-features = ["icount"]
[[bench]]
name = "random"
harness = false
required-features = ["walltime"]

[[test]]
# No harness so that we can skip tests at runtime based on env. Prefixed with
Expand Down
2 changes: 1 addition & 1 deletion libm-test/src/generate/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::sync::LazyLock;
use libm::support::Float;
use rand::distr::{Alphanumeric, StandardUniform};
use rand::prelude::Distribution;
use rand::{Rng, SeedableRng};
use rand::{RngExt, SeedableRng};
use rand_chacha::ChaCha8Rng;

use super::KnownSize;
Expand Down
2 changes: 1 addition & 1 deletion libm-test/tests/u256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type BigInt = rug::Integer;

use libm_test::bigint_fuzz_iteration_count;
use libm_test::generate::random::SEED;
use rand::{Rng, SeedableRng};
use rand::{RngExt, SeedableRng};
use rand_chacha::ChaCha8Rng;
use rug::Assign;
use rug::integer::Order;
Expand Down
2 changes: 1 addition & 1 deletion libm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rust-version = "1.67"

[dev-dependencies]
# FIXME(msrv): switch to `no-panic.workspace` when possible
no-panic = "0.1.35"
no-panic = "0.1.36"

[features]
default = ["arch"]
Expand Down
Loading