caelum0x afd9f736dc
Some checks failed
Pull request checks / typescript (push) Failing after 26s
Pull request checks / rust (push) Failing after 31s
Pull request checks / python (push) Failing after 34s
fix(sim): widen ODE end-of-run tolerance to absorb float drift
`simulate` compared the remaining time against `config.step * 1e-12` to
decide whether the run had reached `config.end`. Repeated `time = time
+ step` additions drift from the exact grid by more than that after a
few hundred steps (e.g. 0.0..=5.0 step 0.01), so an extra near-zero
duration RK4 step snuck in right at the end, producing a spurious
duplicate-looking final sample (502 rows instead of the expected 501
for a 500-step run). This silently inflated row counts in simulate,
forecast, validate, backtest, and report output. Scaled the tolerance
to the step size (1e-6 instead of 1e-12) so it comfortably absorbs
summation drift while staying far smaller than any real remaining
sub-step. Added a regression test pinning the exact sample count for
a run that previously tripped this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-04 17:05:35 +03:00
..