1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2023 - 2026. The DeepCausality Authors and Contributors. All Rights Reserved.
*/
//! Fixtures, assertions and oracles shared by the test suites.
//!
//! This module lives in `src` rather than `tests` because Bazel test targets cannot reach the
//! `tests` tree, but can reach the whole of `src`. It is `#[doc(hidden)]` at the root: it is
//! reachable, and it is not API.
//!
//! The scalar crossing itself is not here. `deep_causality_num::lift` owns it, for every primitive
//! float and integer, and these fixtures call it. What is here is only what a crossing does not
//! provide: an array of literals, a distribution, the per-precision tolerance table, the shared
//! assertions and the independent oracles.
// Spawns a thread to bound a non-terminating draw, so it needs `std`.
use Vec;
use ;
/// An array of `f64` literals lifted into the working scalar.
///
/// The elementwise form of `deep_causality_num::lift`, which crosses one value. It lives here
/// rather than beside it because it returns a `Vec` and `deep_causality_num` is `no_std` over
/// `core` alone.
///
/// Test expectations are written as decimal literals and the suites run at three precisions, so a
/// fixture crosses into `T` at one place rather than at each element.
/// A uniform distribution over `n` outcomes.
///
/// Not a crossing: a fixture. `1/n` is computed at `f64` and lifted, so the entries are the same
/// value at every precision rather than the nearest representable quotient in each.