Skip to main content

Crate decimal_scaled_golden

Crate decimal_scaled_golden 

Source
Expand description

decimal-scaled-golden — the golden values + validation/reporting harness. Library-agnostic: a library implements subject::DecimalSubject (one per (width, scale) cell) to be validated/benched against the singular golden values. No subject impls live in this crate.

One folder per extension point — subject, loader, execution, runner, validators, reporting — with shared leaf types (function, rounding, outcome, string_decimal, collector) gathered under support.

Re-exports§

pub use support::collector;
pub use support::function;
pub use support::outcome;
pub use support::rounding;
pub use support::string_decimal;
pub use collector::CellStatus;
pub use collector::ExecutionCollector;
pub use collector::ExecutionResult;
pub use collector::FunctionCollector;
pub use collector::RunCollector;
pub use collector::SubjectCollector;
pub use execution::ExecutionStrategy;
pub use execution::RunOnce;
pub use execution::Timed;
pub use function::Function;
pub use loader::CaseLoader;
pub use loader::FileLoader;
pub use loader::FilterLoader;
pub use loader::GoldenCase;
pub use loader::GoldenValue;
pub use outcome::Outcome;
pub use reporting::ConsoleReporter;
pub use reporting::InlineReporter;
pub use reporting::ReportArtifact;
pub use reporting::ReportOutput;
pub use reporting::Reporter;
pub use reporting::RunSummary;
pub use reporting::TsvReporter;
pub use rounding::RoundingMode;
pub use runner::GoldenRunner;
pub use runner::ParallelRunner;
pub use runner::SequentialRunner;
pub use subject::Capabilities;
pub use subject::Computed;
pub use subject::DecimalSubject;
pub use subject::FnSupport;
pub use subject::Limits;
pub use subject::NonReal;
pub use subject::Overflow;
pub use subject::Radix;
pub use validators::OverflowValidator;
pub use validators::PrecisionValidator;
pub use validators::RoundingValidator;
pub use validators::ValidationContext;
pub use validators::Validator;

Modules§

execution
Execution strategies — HOW one input-set is run: once, or repeated for timing. Generic over DecimalSubject, so the strategy is the typed→string boundary (Value never escapes it).
loader
Loading golden cases + the golden value type. CaseLoader yields a function’s GoldenCases and declares the oracle’s reach; FileLoader reads + parses files (parsing is its private detail); GoldenValue is the parsed golden number.
reporting
Reporting. A Reporter consumes finished runs and renders named file outputs (IO at the edge); TsvReporter emits the flattened per-cell TSV. An InlineReporter instead streams a human-readable summary straight to a writer — the live console feedback a gate or shootout prints after validation; ConsoleReporter is the terminal impl.
runner
The runner: drives a subject over the golden cases. GoldenRunner is the trait; SequentialRunner / ParallelRunner differ only in scheduling. The shared per-cell work (run_cell, the input filter) lives here.
subject
The library-facing surface: the DecimalSubject trait a decimal library implements to be tested, plus the value types the runner reasons about (Capabilities, Limits, Computed). No subject impls live in this crate.
support
Shared leaf types used across the extension-point folders: the function enumeration, rounding mode, the Outcome verdict, the string_decimal comparison helper, and the run collector records. These carry no extension seam of their own — they are the vocabulary the seams speak in.
validators
Validation. One pure Validator trait — context in, Option<Outcome> out; the runner collects the verdicts. Validators only ever see the subject’s output as an erased Computed<String>; Value never reaches them. The three have DISJOINT domains and self-gate.