Skip to content

tests: pin #1342's two rounding-law models, fixed by #1302 - #1404

Merged
wshlavacek merged 1 commit into
lanl:mainfrom
Montana:fix/1342-rounding-grid
Oct 31, 2026
Merged

wshlavacek merged 1 commit into
lanl:mainfrom
Montana:fix/1342-rounding-grid

Conversation

@Montana

@Montana Montana commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Closes #1342. It was fixed by #1302; this pins it.

What I found

Both of the issue's models are within tolerance on current main, on either grid, and model 174 runs at rtol 1e-12. They were broken at 7f3e784, the commit #1306's generator (#1317) drew them on.

I bisected over the three C++ changes between that commit and the issue's filing (Simulator(method="ode").run(t_span=(0, 10), n_points=n, rtol=rtol, atol=rtol*1e-2), against a run at rtol 1e-12 (1e-11 for model 174), read at the same 21 times, as a part of the peak; macOS arm64):

core model 72, rtol 1e-8, 161 points model 174, rtol 1e-8, 161 points model 174, rtol 1e-12, 21 points
7f3e784 4.9e-5 8.4e-3 CV_CONV_FAILURE at t = 8.5
aedadd8 (#1302 merged) 4.5e-8 4.1e-8 9.5e-11
d1b27d5 (#1328) 4.5e-8 4.1e-8 9.5e-11
filing-time main (4566562) 4.5e-8 4.1e-8 9.5e-11
current main (5f02960) 4.5e-8 4.1e-8 9.5e-11

The first row is the issue's own numbers, to the digit. #1302 ("fix/1002-run-starts-on-jump") is what moved them; the 21-point grid was right throughout. On current main the answers are the same with codegen=True and with jacobian="fd".

The test

test_rounding_law_grid.py, 5 tests: the issue's two models, written verbatim with only their long laws split across string literals, and each law checked equal to the issue's text.

  • On either grid at rtol 1e-8, the answer is within 1e-6 of the peak (100× the tolerance; the regression was 4.9e-5 and 8.4e-3).
  • Model 174 runs at rtol 1e-12 on either grid.

At 7f3e784, 3 of the 5 fail, exactly the issue's three cases. The two 21-point cases pass there, as controls.

Test-only; ci/changelog.py required passes without a fragment, and pre-commit is clean.

Not checked

Linux. These are rounding switches crossed or stepped over depending on where the output stops fall, the kind of answer an ulp can move, so a Linux run is worth having. This PR's CI is that run.

At rtol 1e-8 their answer moved with the output grid by up to 1e3x the
tolerance (4.9e-5 and 8.4e-3 of the peak on 161 points), and the trunc
model failed with CV_CONV_FAILURE at rtol 1e-12. Bisected to lanl#1302: at
7f3e784, where the generator drew them, these fail; from aedadd8 on they
hold to their tolerance on either grid.
@wshlavacek
wshlavacek merged commit 787597c into lanl:main Oct 31, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated models (#1306): a floor/round/trunc law's answer depends on the output grid at rtol 1e-8, by up to 1e3x the tolerance; one fails at rtol 1e-12

2 participants