Story: Hotfix: stochastic process statistical tests fail on macOS CI

Table of Contents

This page documents a story in Sprint 25. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

Goal

Two Monte Carlo statistical tests in ores.analytics.quant fail on macOS CI: the Black-Karasinski sample-variance check and the HJM drift-mean check assert tolerances tighter than the tests' own standard error. std::normal_distribution is implementation-defined, so the same mt19937 seeds produce a different draw sequence under libc++ (macOS) than under libstdc++ (Linux), and the macOS draws land just outside the bounds. The fix widens the tolerances to multi-sigma bounds so the tests pass on every platform while still rejecting genuine model errors.

Status

Field Value
State DONE
Parent sprint Sprint 25
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-08-12

Acceptance

  • ores.analytics.quant tests pass on Linux, macOS, and Windows CI.
  • Statistical assertions still bound genuine deviations (tolerances at or above ~3 sigma of the estimator's standard error).

Tasks

Task State Start End Description
Scaffold story: Hotfix: stochastic process statistical tests fail on macOS CI DONE 2026-08-12 2026-08-12 Story scaffolding rides this task: documents, sprint wiring, and the scaffold PR. Close it before merging that PR.
Implement Hotfix: stochastic process statistical tests fail on macOS CI DONE 2026-08-12 2026-08-12 Initial task for: Hotfix: stochastic process statistical tests fail on macOS CI

Decisions

  • Widen test tolerances rather than replace std::normal_distribution with a platform-independent generator: test-only, minimal hotfix scope; the per-platform draws remain statistically valid samples.
  • BK variance epsilon 1.5e-2 (~4.7 sigma at 200000 paths), matching the sibling Gaussian-OU moments test in the same file.
  • HJM drift margins 1e-2 (>= 3.2 sigma at the noisiest leg). Per-rate margins declined at review: a drift-formula error and the standard error of each mean both scale with the rate's volatility, so detection sensitivity is leg-independent in sigma units.

Out of scope

Emacs 29.3 (Org mode 9.6.15)