reproduce¶
Phase 4 — re-run determinism check: every statistic must return essentially identical.
reproduce
¶
Phase 4 — reproducibility.
Re-run the same Python analysis a second time (with the same seed, if any) and confirm every statistic comes back essentially identical. This tests determinism within one process — it is not a guarantee of reproducibility on a different machine, OS, or BLAS/library build.
The default tolerance is extremely tight (rtol = 1e-12) rather than bit-exact, so
genuinely deterministic code still passes when a multithreaded BLAS reduces sums
in a slightly different order between two calls (last-ULP drift). Set
reproducibility: {atol, rtol} in the project to tighten or loosen it, or pin
OMP_NUM_THREADS=1 if you require bit-for-bit equality.
Note on randomness: a shared seed makes a same-tool re-run reproducible, but it does NOT align random streams across Python and R (the two use different RNGs), so the Phase 5 cross-tool comparison is meaningful only for deterministic estimators, not seed-matched random draws.
reproducibility(run1, run2, tol=None)
¶
Compare two runs of the same analysis and flag any statistic that drifted.
Walks the union of keys across run1 and run2. A key present in only one
run fails as a presence check; a key present in both is compared with
:func:~crossverify.checks.is_close under the resolved tolerance. The default
tolerance is extremely tight (rtol = 1e-12) rather than bit-exact, so genuinely
deterministic code still passes when a multithreaded BLAS reduces sums in a slightly
different order between two calls (last-ULP drift).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run1
|
Mapping of statistic name to value from the first run. |
required | |
run2
|
Mapping of statistic name to value from the second (re-)run. |
required | |
tol
|
Optional tolerance mapping; reads |
None
|
Returns:
| Type | Description |
|---|---|
|
A list of phase-4 |
|
|
|
|
|
run, otherwise a pass/fail on whether the two values agree within tolerance. |