Skip to content

Raise five tolerances near machine precision - #691

Open
avehtari wants to merge 34 commits into
masterfrom
test-tolerance-margins
Open

avehtari wants to merge 34 commits into
masterfrom
test-tolerance-margins

Conversation

@avehtari

Copy link
Copy Markdown
Member

Summary

This PR depends on #688, #689 and #690. The branch contains them (base bee4d6f), so the diff shows their changes until they are merged. The commits of this PR are fd9e2ae and 444dcaf.

In the CI of #682, the check at test_varsel.R:598 failed on Linux and macOS: the mean relative difference was 2.34e-15 and the tolerance 2.2e-15. On CSC Roihu and Windows, it passed. The rounding of two computations of the same value depends on the platform. This PR raises the tolerance of five similar checks, so that they do not fail on other platforms.

Changes

check old tolerance new tolerance old margin on Roihu
test_methods_vsel.R:751 (cv_proportions(), cumulated) .Machine$double.eps 1e2 * .Machine$double.eps 0.64
test_proj_predfun.R:97 (repair_re(), GLMM) 1e-15 1e-13 0.58
test_proj_predfun.R:109 (repair_re(), GLMM) 1e-15 1e-13 0.58
test_proj_predfun.R:165 (repair_re(), GLMM) 1e-15 1e-13 0.13
test_glm_ridge.R:348 (glm_ridge, intercept only) 1e-12 1e-10 0.11

With the new tolerances, the margins are 100 times smaller (at most 0.0064).

This PR was assisted by Claude

# Conflicts:
#	NEWS.md
#	tests/testthat/helpers/expectors.R
#	tests/testthat/setup.R
#	tests/testthat/test_as_matrix.R
#	tests/testthat/test_parallel.R
#	tests/testthat/test_proj_pred.R
#	tests/testthat/test_project.R
#	tests/testthat/test_refmodel.R
#	tests/testthat/test_setup.R
#	tests/testthat/test_varsel.R
# Conflicts:
#	tests/testthat/test_varsel.R
@avehtari avehtari added the tests testthat tests label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests testthat tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant