# SCIENTIFIC_PARITY_REPORT — status 2026-09-27

| Comparison (ADR-0002 D3) | Status | Tolerance | Evidence |
|---|---|---|---|
| A1: canonical tree vs. extracted core, Linux x86_64, CPython 3.12.3 / numpy 2.4.4 | **PASS, 25/25 bit-identical** | exact (`float.hex`), identical error messages | `packages/benchews_core/tests/test_core_w1.py::BaselineParity` |
| A1e: same comparison under CPython **3.11.15** (host and real container) | **PASS, 25/25 bit-identical to the 3.12.3 baseline, CRTI included** | exact | `evidence/w2a_host_py311.json`, `evidence/w2a_container_substitute_run*.json` |
| A2a: extracted core vs. Web boundary service (JSON and CSV paths) | **PASS, 12/12 valid baseline cases bit-identical; input hash identical** | exact | `apps/api/tests/test_boundary.py::ApiParityA2`, `Csv::test_csv_hash_semantics` |
| A2-exec: boundary → capacity reservation → worker process (BLAS 1 thread, measured) → core | **PASS, 12/12 bit-identical, CRTI reference window included**; scientific error outcomes preserved | exact | `apps/api/tests/test_executor.py::ParityThroughWorkers` (host and container) |
| A2b: via HTTP (FastAPI) | **PASS — same-runtime HTTP/API parity executed** | exact | W3 run `36311646929`; `apps/api/tests/test_http.py::HttpLayer::test_all_baseline_value_cases_through_http_a2b` |
| A1c: canonical tree regenerated in a read-only, non-root, network-less host simulation | PASS, 25/25 exact | exact | `evidence/w2a_container_simulation.json` |
| A1d: real Docker container | **PASS on LOCAL_SUBSTITUTE_BASE** (CPython 3.11.15), 25/25 exact. Committed image (3.12.3): CONFIGURED, NOT EXECUTED | exact for univariate; CRTI reported | `evidence/w2a_container_substitute_summary.json` |
| A3: other Linux runtimes (IONOS image) | NOT STARTED | exact expected for univariate; CRTI see D7 | W6 |
| B: frozen macOS Desktop 2.0.0 outputs | **BLOCKED — not supplied** | univariate: exact expected; CRTI: tolerance to be justified from Mac numpy/BLAS versions | ACQUISITION_REQUEST B1/B3 |

## Finding D7 — CRTI depends on BLAS thread count at the last bit (2026-09-26)
For a 20 000 × 64 window, `r_obs`, `phi_hat` and `historical_t` differ by ≈ 1e-16 relative between 1
and 2 OpenBLAS threads. `phi_obs` is unchanged, as are the canonical reference window (20 × 3) and a
2 000 × 16 window. OpenBLAS's default thread count equals the CPU count, so default CRTI results depend
on the server's core count.

**Decision D7 (ACCEPTED, ADR-0006).** The Web workers run with 1 BLAS thread:
- the variables are set before numpy is imported;
- each worker **measures** its own OpenBLAS thread count and refuses to start if it is not 1;
- the measured value is part of every result's provenance (`blas_threads_source: measured_in_worker`).

Verified on the host and inside the substitute container (verify_w2a job E, 25/25). D7 does not
establish cross-platform bit identity.

Consequence for W2-B: an exact CRTI match with the Mac (numpy/Accelerate or OpenBLAS, unknown thread
count) cannot be expected for large windows. The CRTI tolerance must be derived from the Mac's recorded
numerical environment (B3), not chosen to make a comparison pass. Univariate modules use stdlib
`statistics` and are unaffected.

## Value-kind rule
`EXPECTED_VARIANCE = 0.8310` and `EXPECTED_LAG1_AUTOCORRELATION = 0.7753` are displayed/rounded. They
are used only to check `.4f` display rounding (both consistent), never as numerical truth.

W2 cannot PASS until B is done for the available modules.

## Numerical Tolerance Contract governance — 2026-09-29
All non-exact parity decisions are now governed by `docs/TOLERANCE_CONTRACT_POLICY.md`. A numerical tolerance must be versioned, SHA-256 pinned and FROZEN before the comparison is evaluated. Missing, PENDING, modified or unregistered contracts fail closed and cannot produce PASS. Same-runtime parity is bound to `TC-EXACT-SAME-RUNTIME@1`. The macOS/Linux CRTI contract `TC-CRTI-MAC-LINUX@1` is deliberately PENDING with no numeric tolerance until B1/B3 evidence exists. A later justified tolerance requires a new immutable contract version; no post-hoc widening is permitted.
