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
4 changes: 0 additions & 4 deletions deep_causality_num/tests/algebra/field_real_f64_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ fn test_log10() {
}

#[test]
// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg_attr(miri, ignore)]
fn test_powf() {
let x = 2.0_f64;
let n = 3.0_f64;
Expand Down
19 changes: 18 additions & 1 deletion deep_causality_num/tests/algebra/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,30 @@
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/

// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod algebra_tests;
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
#[cfg(test)]
mod domain_euclidean_tests;
// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod field_real_f32_tests;
// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
mod field_real_f64_tests;
#[cfg(not(miri))]
pub(crate) mod field_real_f64_tests;
// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod real_tests;
16 changes: 10 additions & 6 deletions deep_causality_num/tests/float/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/

// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod float_32_tests;
// Skipped wholesale under Miri: this module exercises f64 floating-point
// behavior, much of it via exact `assert_eq!` on transcendental results
// (sin/cos/cbrt/atan2/...). Miri's soft-float emulation differs from hardware
// in the last bit, so these comparisons spuriously fail one by one. The tests
// are correct and pass under normal CI.
#[cfg(all(test, not(miri)))]
// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod float_64_tests;
8 changes: 8 additions & 0 deletions deep_causality_num/tests/float_double/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ mod double_attributes_tests;
mod double_comparison_tests;
#[cfg(test)]
mod double_display_tests;
// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod double_erf_tests;
#[cfg(test)]
mod double_float_tests;
Expand All @@ -26,5 +30,9 @@ mod double_num_traits_tests;
mod double_ops_tests;
#[cfg(test)]
mod double_traits_tests;
// Disabled under Miri: software-emulated floats produce different last-bit
// results for transcendental ops, so exact equality cannot hold. The test
// itself is correct and runs under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod double_transcendental_tests;
2 changes: 0 additions & 2 deletions deep_causality_physics/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ rust_test_suite(
],
)



rust_test_suite(
name = "theories",
srcs = glob([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use deep_causality_rand::types::distr::normal::standard_normal::StandardNormal;
macro_rules! standard_normal_tests {
($float_type:ty, $tolerance:expr) => {
#[test]
#[cfg_attr(miri, ignore)]
fn test_mean_and_std_dev() {
let mut rng = rng();
let distr = StandardNormal;
Expand Down Expand Up @@ -91,6 +92,7 @@ mod f106_tests {
use deep_causality_rand::rng;

#[test]
#[cfg_attr(miri, ignore)]
fn test_mean_and_std_dev() {
let mut rng = rng();
let distr = StandardNormal;
Expand Down
2 changes: 2 additions & 0 deletions deep_causality_rand/tests/types/dist/uniform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/

#[cfg(test)]
#[cfg(not(miri))]
mod standard_uniform_tests;
#[cfg(test)]
#[cfg(not(miri))]
mod uniform_tests;
4 changes: 4 additions & 0 deletions deep_causality_rand/tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
#[cfg(test)]
// Disabled under Miri: Miri's soft-float emulation drifts by ~1 ULP (got 0.9999999996 vs 1)
#[cfg(not(miri))]
mod inverse_cdf_tests;
#[cfg(test)]
// Disabled under Miri: Miri's soft-float emulation drifts by ~1 ULP (got 0.9999999996 vs 1)
#[cfg(not(miri))]
mod sobol_tests;
4 changes: 4 additions & 0 deletions deep_causality_uncertain/tests/types/sampler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
#[cfg(test)]
// Disabled under Miri: Miri's soft-float emulation drifts by ~1 ULP (got 0.9999999996 vs 1)
#[cfg(not(miri))]
mod qmc_sampler_tests;
#[cfg(test)]
mod sampler_seed_tests;
#[cfg(test)]
// Disabled under Miri: Miri's soft-float emulation drifts by ~1 ULP (got 0.9999999996 vs 1)
#[cfg(not(miri))]
mod sequential_sampler_tests;
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ fn test_logical_op_errors() {
}

#[test]
// Disabled under Miri: the sampler evaluates `x.powi(2)` on f64, which under
// Miri's soft-float emulation drifts by ~1 ULP (got 99.99999999999996 vs
// 100.0). Test is correct under normal CI.
#[cfg_attr(miri, ignore)]
fn test_function_op_f64() {
let sampler = SequentialSampler;
let operand = create_node(UncertainNodeContent::Value(SampledValue::Float(10.0f64)));
Expand Down
19 changes: 13 additions & 6 deletions deep_causality_uncertain/tests/types/uncertain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@
// a subprocess via `posix_spawn`, and Miri does not implement the
// `posix_spawn*` libc shims, so the tests abort. They are correct and run
// under normal CI.
#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_arithmetic_tests;
#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_comparison_tests;
#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_default;
#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_logic_tests;
#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_sampling_tests;
#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_statistics_tests;
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_tests;
10 changes: 7 additions & 3 deletions deep_causality_uncertain/tests/types/uncertain_maybe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
// not implement the `posix_spawn*` libc shims, so the tests abort. They are
// correct and run under normal CI.
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_maybe_bool_tests;
#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_maybe_f64_tests;

#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_maybe_f64_arithmetic_tests;

#[cfg(all(test, not(miri)))]
#[cfg(test)]
#[cfg(not(miri))]
mod uncertain_maybe_f106_tests;
Loading