Skip to main content

Module parity

Module parity 

Expand description

The cross-language parity gate, and the runner that keeps every example executed.

§What this proves

atune’s determinism contract says the parameters of trial n are a pure function of (study seed, n, space). That promise crosses the binding boundary too, because atune_py delegates to core’s optimize_with and the Python sampler factories take no seed of their own (a non-None seed= raises), so the study seed is the only one. So the strongest documentation gate available is: the Rust and Python versions of an example must agree on the answer — and not approximately, but bit for bit.

No other HPO framework can run this gate, because none of them promises bit-reproducibility across its bindings.

§Why there are two halves

check-parity runs both arms and compares them, which needs a built wheel. check-parity --rust-golden compares only the Rust arm against a committed golden, which needs nothing but the workspace — so it belongs in the fast per-push gate, where a change in optimiser behaviour reddens CI immediately rather than waiting for the documentation job.

The goldens are platform-pinned, and each file says so. A parity block carries float bits, and float bits from cos come from the platform libm, which is not required to be correctly rounded and may differ between platforms. Every rust.yml job is ubuntu-latest today, so one golden per arm is correct and cheap. If the release gate ever gains a second OS, the choice is per-platform goldens or dropping the value line — never a tolerance.

Re-exports§

pub use runner::run_examples;

Modules§

block
The atune-parity/1 block: its grammar, its parser, and the comparison.
golden 🔒
Rust-arm golden comparison and blessing.
manifest
examples/parity.toml — the single source of what must agree.
runner 🔒
Execution helpers for parity examples.

Functions§

check
Runs the parity gate.
check_across_languages 🔒
Runs both arms of one pair and compares their blocks.