Skip to main content

Crate salib

Crate salib 

Source

Re-exports§

pub use salib_samplers as samplers;
pub use salib_estimators as estimators;

Modules§

distribution
Distribution — closed enum of factor distributions, with inverse-CDF (quantile) and support boundaries as the unified extension point.
problem
Problem — the declarative, content-addressable description of an SA campaign’s input space. Vector of factors, each with a name, distribution, and kind (continuous / discrete / categorical / boolean).
reduce
Deterministic f64 reductions for saltelli — fixed-tree pairwise folds whose output is bit-identical regardless of rayon partitioning.
rng
RngState — multi-stream ChaCha20 with deterministic salt-derived forking. The replay-determinism foundation for every salib sampler and estimator.

Structs§

Factor
A single factor in the experiment. Name + distribution + kind. #[non_exhaustive] blocks struct-literal construction outside this crate; consumers go through ProblemBuilder.
Group
A named group of factors treated as a single unit in SA.
Problem
The declarative input-space description for an SA campaign.
ProblemBuilder
Builder for Problem. The only public path to a Problem value.
RngState
The serializable RNG state. The single source of truth for any SA campaign’s randomness.

Enums§

BuildError
Errors arising from ProblemBuilder::build.
Distribution
Factor distributions saltelli supports. Closed enum, #[non_exhaustive]. Future variants (Truncated, Empirical, Categorical, …) land non-breaking via follow-on ADRs.
FactorKind
The role a factor plays in the experiment. Closed enum, #[non_exhaustive]. Continuous is the default for typical SA applications.
RngAlgorithm
The set of RNG algorithms salib supports. Closed enum + #[non_exhaustive]; future variants land non-breaking.

Constants§

BLOCK
Per-chunk size for the parallel block-then-tree reduction. Fixed; changing it would change reduction-tree shape and therefore bit-level results. Future workload-tuned per-Experiment blocks would land via ADR.

Functions§

par_tree_dot
Parallel block-then-tree dot product. Same partitioning logic as par_tree_sum; bit-identical to tree_dot.
par_tree_sum
Parallel block-then-tree sum. Partitions xs into BLOCK-sized chunks, reduces each chunk via tree_sum in parallel via rayon, then reduces the per-chunk sums via tree_sum sequentially. Bit-identical to tree_sum(xs) regardless of rayon thread count or worker partition pattern.
par_tree_var
Parallel two-pass unbiased sample variance. Mean via par_tree_sum; centered-square via parallel map (preserves index order on IndexedParallelIterator); then the centered-square reduction via par_tree_sum.
tree_dot
Sequential pairwise tree-fold dot product. Produces Σᵢ aᵢ·bᵢ in tree order. Bit-identical to par_tree_dot.
tree_sum
Sequential pairwise tree-fold sum. O(N) work, O(log N) reduction depth. Bit-identical to par_tree_sum regardless of rayon thread count.
tree_var
Sequential two-pass unbiased sample variance, routed through tree_sum in both passes. Returns 0.0 for inputs of length < 2.