Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long double tests are too strict on platforms without long double #147

Closed
DavisVaughan opened this issue Mar 18, 2021 · 0 comments
Closed

Comments

@DavisVaughan
Copy link
Member

They are barely off. On these platforms long double is aliased to double, so in theory I think the results should be identical. I think the difference comes from the fact that the elements are probably being added in different orders (base R adds in sequential order, slider adds in an order defined from the segment tree), and precision loss aggregates in slightly different ways.

M1Mac CRAN failure:

  Runningtestthat.RERROR
Running the tests intests/testthat.Rfailed.
Complete output:
  > library(testthat)
  > library(slider)
  > 
  > test_check("slider")
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  ● On CRAN (13)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-summary-slide.R:247:3): precision matches base R (long doubles) ──
  mean(x) (`actual`) not identical to slide_mean(x, before = Inf)[[length(x)]] (`expected`).
  
    `actual`: 0.20634920634920634
  `expected`: 0.20634920634920637
  
  [ FAIL 1 | WARN 0 | SKIP 13 | PASS 1073 ]
  Error: Test failures
  Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ininst/doc... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* checking for detritus in the temp directory ... OK
* DONE

Status: 1 ERROR
See/Users/ripley/R/packages/tests-devel/slider.Rcheck/00check.logfor details.

       41.76 real        29.94 user         5.05 sys

noLD CRAN failure:

  Runningtestthat.R’ [26s/28s]
 [26s/29s] ERROR
Running the tests intests/testthat.Rfailed.
Complete output:
  > library(testthat)
  > library(slider)
  > 
  > test_check("slider")
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  ● On CRAN (13)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-summary-slide.R:76:3): precision matches base R (long doubles) ──
  sum(x) (`actual`) not identical to slide_sum(x, before = Inf)[[length(x)]] (`expected`).
  
    `actual`: 1.4285714285714282
  `expected`: 1.4285714285714284
  
  [ FAIL 1 | WARN 0 | SKIP 13 | PASS 1073 ]
  Error: Test failures
  Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ininst/doc... OK
* checking re-building of vignette outputs ... [10s/12s] OK
* checking PDF version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE

Status: 1 ERROR
See/data/gannet/ripley/R/packages/tests-noLD/slider.Rcheck/00check.logfor details.

Command exited with non-zero status 1
Time 2:04.86, 87.44 + 7.76
DavisVaughan added a commit that referenced this issue Mar 18, 2021
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

No branches or pull requests

1 participant