You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each test file correctly replaces all uses of npt.assert_almost_equal or npt.assert_array_almost_equal with its equivalent npt.assert_allclose (check with grep assert*_almost tests/*)
When rtol=0 for npt.assert_allclose, simply omit this paramter and value since this is the default
Ensure that npt.assert_allclose(actual, desired) and npt.assert_array_equal(actual, desired) always has the stumpy computed value as "actual" and the naive computation as "desired"
Use atol=1.5e-07 rather than atol=1.5*10**-07
Eventually, replace the ugly 1.5*10**-config.STUMPY_TEST_PRECISION with config.STUMPY_TEST_PRECISION = 1.5e-07 (in config.py)
Replace comp with cmp
Rename naive outputs to ref_ and stumpy-computed outputs to cmp_ (applies to npt.assert_array_equal too)
Omit "Fixed # 1175" from PR title and initial comment (use "Related to # 1175" instead)
Agreed ,assert_almost_equal only checks absolute tolerance (abs(actual-desired) < 1.510**-decimal), while assert_allclose combines relative + absolute (atol + rtolabs(desired)), so it's more meaningful for comparisons across varying magnitudes and matches what NumPy recommends.
I count 1283 call sites across 40 test files currently using assert_almost_equal (only 2 already use assert_allclose), so this is a fairly mechanical but wide-reaching change. Proposing two passes: first a straight swap to assert_allclose(a, b, atol=1.5*10**-decimal, rtol=0) everywhere, which preserves today's exact pass/fail behavior with no risk, then a follow-up pass to set meaningful rtol/atol case-by-case where a relative tolerance is actually the right thing to check (the rtol=1e-12, atol=1e-12 used in the #1174 MASS precision tests is a decent template for that). I can start on pass 1 if that approach sounds good to you.
Hi @seanlaw, would tests/test_stumped.py be available for the next migration PR after #1228? It has 32 remaining assert_almost_equal comparisons. I’d keep the change to that file, put the computed results first, and preserve the existing tolerances. If you’d prefer I help with another issue or an open PR, I’m happy to take a look. Thanks!
Thanks, Sean! I’m taking STUMPED, STUMPI, and Ray as separate migrations. I’ll also check whether the Ostinato and precision migrations can land cleanly alongside #1012, #907, #1174, and #1207. Austin has SCRAAMP. Once those are covered, I’ll check what’s left for the shared tolerance cleanup.
One question on the final tolerance cleanup, @seanlaw. The current configured tolerance converts to 1.5e-05. With the #1163 seed, the existing egress test reports one mismatch at that tolerance and two at the proposed 1.5e-07. Would you prefer converting the setting to an absolute tolerance while preserving 1.5e-05, then tightening it once the precision issues are fixed?
One question on the final tolerance cleanup, @seanlaw. The current configured tolerance converts to 1.5e-05. With the #1163 seed, the existing egress test reports one mismatch at that tolerance and two at the proposed 1.5e-07. Would you prefer converting the setting to an absolute tolerance while preserving 1.5e-05, then tightening it once the precision issues are fixed?
Thanks, @seanlaw. I'll keep going with the migrations as planned. The targeted tests passed for all five drafts, and the full coverage run is still going.
I checked the shared tolerance from the checklist, @seanlaw. On Ubuntu with JIT off and CUDA simulation on, all 255 affected cases passed at the current tolerance with seed 3559353816. At 1.5e-07, three identical-subsequence tests failed in GPU-STUMP, MSTUMP, and STUMPI.
Once the file PRs land, would a separate PR to make the setting absolute at its current value be useful?
Thanks for merging the five PRs, @seanlaw. The remaining cache, chains, and SDP naming cleanup is in #1237, with the full suite running.
On current main (dcdeeb1), the tolerance check passed all 256 cases at 1.5e-05. At the requested 1.5e-07, five cases failed across GPU-STUMP, MSTUMP, STUMP, and STUMPI with seed 3559353816 (JIT off, CUDA simulated). This also included the configured SCRAAMP comparison in a temporary copy.
Should the shared setting wait for the precision fixes, or would you like a draft with these failures documented?
On current main (dcdeeb1), the tolerance check passed all 256 cases at 1.5e-05. At the requested 1.5e-07, five cases failed across GPU-STUMP, MSTUMP, STUMP, and STUMPI with seed 3559353816 (JIT off, CUDA simulated). This also included the configured SCRAAMP comparison in a temporary copy.
Sorry, I'm having trouble understanding what you mean here.
Sorry, Sean, I was unclear. The current setting is 5, so 1.5 * 10**-5 gives an absolute tolerance of 1.5e-05. Changing it to the checklist's 1.5e-07 also makes those comparisons 100 times stricter.
I've prepared that change in draft #1240. Rechecking on a42ca40, all 256 affected cases passed on main; with the stricter setting, 251 passed and five failed. For example, GPU-STUMP returned 4.04e-07 where the reference returned zero, which exceeds 1.5e-07.
The draft includes the failing tests and a reproduction command using the same seed and test order. It stays in draft while we discuss those failures.
Should the shared setting wait for the precision fixes, or would you like a draft with these failures documented?
No, we should not progress any further. I would like to wait a (long) while before making any further changes to the tests as it relates to the precision.
Activity
viknesh-ai commentedon Aug 9, 2026
Agreed ,assert_almost_equal only checks absolute tolerance (abs(actual-desired) < 1.510**-decimal), while assert_allclose combines relative + absolute (atol + rtolabs(desired)), so it's more meaningful for comparisons across varying magnitudes and matches what NumPy recommends.
I count 1283 call sites across 40 test files currently using assert_almost_equal (only 2 already use assert_allclose), so this is a fairly mechanical but wide-reaching change. Proposing two passes: first a straight swap to assert_allclose(a, b, atol=1.5*10**-decimal, rtol=0) everywhere, which preserves today's exact pass/fail behavior with no risk, then a follow-up pass to set meaningful rtol/atol case-by-case where a relative tolerance is actually the right thing to check (the rtol=1e-12, atol=1e-12 used in the #1174 MASS precision tests is a decent template for that). I can start on pass 1 if that approach sounds good to you.
Migrate tests from npt.assert_almost_equal to npt.assert_allclose
Migrate tests from npt.assert_almost_equal to npt.assert_allclose
Migrate tests/test_aamp.py from npt.assert_almost_equal to npt.assert…
Fixed stumpy-dev#1175 Migrate tests/test_aamp.py to npt.assert_allclo…
Fixed #1175 Migrate tests/test_aamp_motifs.py to npt.assert_allclose (#…
seanlaw commentedon Aug 15, 2026
@viknesh-ai Please continue when you get a chance. Perhaps, let's do three PRs at a time?
seanlaw commentedon Aug 29, 2026
@viknesh-ai I am ready for more! 👍
12 remaining items
seanlaw commentedon Nov 16, 2026
@karthiksenv Please proceed. Thank you
karthiksenv commentedon Nov 16, 2026
Thanks, Sean! The
test_mstumped.pymigration passed the full Ubuntu suite with 100% coverage. I'll send it as a separate PR.karthiksenv commentedon Nov 17, 2026
Hi @seanlaw, would
tests/test_stumped.pybe available for the next migration PR after #1228? It has 32 remainingassert_almost_equalcomparisons. I’d keep the change to that file, put the computed results first, and preserve the existing tolerances. If you’d prefer I help with another issue or an open PR, I’m happy to take a look. Thanks!seanlaw commentedon Nov 17, 2026
@karthiksenv Grab as many that are not fixed
karthiksenv commentedon Nov 17, 2026
Thanks, Sean! I’m taking STUMPED, STUMPI, and Ray as separate migrations. I’ll also check whether the Ostinato and precision migrations can land cleanly alongside #1012, #907, #1174, and #1207. Austin has SCRAAMP. Once those are covered, I’ll check what’s left for the shared tolerance cleanup.
karthiksenv commentedon Nov 17, 2026
One question on the final tolerance cleanup, @seanlaw. The current configured tolerance converts to 1.5e-05. With the #1163 seed, the existing egress test reports one mismatch at that tolerance and two at the proposed 1.5e-07. Would you prefer converting the setting to an absolute tolerance while preserving 1.5e-05, then tightening it once the precision issues are fixed?
seanlaw commentedon Nov 17, 2026
@karthiksenv Please ignore issue #1163 and simply proceed as before
karthiksenv commentedon Nov 17, 2026
Thanks, @seanlaw. I'll keep going with the migrations as planned. The targeted tests passed for all five drafts, and the full coverage run is still going.
karthiksenv commentedon Nov 17, 2026
I checked the shared tolerance from the checklist, @seanlaw. On Ubuntu with JIT off and CUDA simulation on, all 255 affected cases passed at the current tolerance with seed 3559353816. At 1.5e-07, three identical-subsequence tests failed in GPU-STUMP, MSTUMP, and STUMPI.
Once the file PRs land, would a separate PR to make the setting absolute at its current value be useful?
karthiksenv commentedon Nov 17, 2026
Hi @seanlaw, could you review and merge #1229, #1230, #1231, #1232, and #1233 when you get a chance? All 31 CI jobs passed on each PR. Thanks!
karthiksenv commentedon Nov 18, 2026
Thanks for merging the five PRs, @seanlaw. The remaining cache, chains, and SDP naming cleanup is in #1237, with the full suite running.
On current main (
dcdeeb1), the tolerance check passed all 256 cases at1.5e-05. At the requested1.5e-07, five cases failed across GPU-STUMP, MSTUMP, STUMP, and STUMPI with seed3559353816(JIT off, CUDA simulated). This also included the configured SCRAAMP comparison in a temporary copy.Should the shared setting wait for the precision fixes, or would you like a draft with these failures documented?
seanlaw commentedon Nov 19, 2026
Sorry, I'm having trouble understanding what you mean here.
karthiksenv commentedon Nov 19, 2026
Sorry, Sean, I was unclear. The current setting is
5, so1.5 * 10**-5gives an absolute tolerance of1.5e-05. Changing it to the checklist's1.5e-07also makes those comparisons 100 times stricter.I've prepared that change in draft #1240. Rechecking on
a42ca40, all 256 affected cases passed on main; with the stricter setting, 251 passed and five failed. For example, GPU-STUMP returned4.04e-07where the reference returned zero, which exceeds1.5e-07.The draft includes the failing tests and a reproduction command using the same seed and test order. It stays in draft while we discuss those failures.
seanlaw commentedon Nov 19, 2026
No, we should not progress any further. I would like to wait a (long) while before making any further changes to the tests as it relates to the precision.
karthiksenv commentedon Nov 20, 2026
Understood, Sean. I'll hold off on further precision-related test changes and leave #1240 closed. Thanks for clarifying.