r-lib / slider

Sliding Window Functions
https://slider.r-lib.org
Other
295 stars 12 forks source link

NA vs NaN failures on BDR's valgrind machine #198

Closed DavisVaughan closed 9 months ago

DavisVaughan commented 9 months ago

See ?NA where it says:

Dynamic binary translation may also impact this behavior (with valgrind, computations using NA may result in NaN even when no NaN is involved).

which does seem to be part of this

* using log directory ‘/data/blackswan/ripley/R/packages/tests-vg/slider.Rcheck’
* using R Under development (unstable) (2023-10-06 r85273)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)
    GNU Fortran (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)
* running under: Fedora Linux 38 (Workstation Edition)
* using session charset: UTF-8
* using options ‘--use-valgrind --no-stop-on-test-error’
* checking for file ‘slider/DESCRIPTION’ ... OK
* this is package ‘slider’ version ‘0.3.0’
* package encoding: UTF-8
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking whether package ‘slider’ can be installed ... [13s/13s] OK
* used C compiler: ‘gcc (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)’
* used C++ compiler: ‘g++ (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)’
* checking C++ specification ... NOTE
  Specified C++11: please drop specification unless essential
* checking package directory ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking compiled code ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... [196s/197s] OK
* checking tests ...
  Running ‘testthat.R’ [46m/46m]
 [46m/46m] ERROR
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(slider)
  > 
  > test_check("slider")
  [ FAIL 13 | WARN 0 | SKIP 160 | PASS 1031 ]

  ══ Skipped tests (160) ═════════════════════════════════════════════════════════
  • On CRAN (160): 'test-block.R:14:3', 'test-block.R:27:3', 'test-block.R:33:3',
    'test-block.R:39:3', 'test-block.R:45:3', 'test-conditions.R:5:3',
    'test-conditions.R:10:3', 'test-conditions.R:17:3', 'test-conditions.R:26:3',
    'test-conditions.R:35:3', 'test-conditions.R:44:3', 'test-conditions.R:57:3',
    'test-conditions.R:63:3', 'test-conditions.R:72:3',
    'test-hop-index-vec.R:5:3', 'test-hop-index-vec.R:18:3',
    'test-hop-index-vec.R:43:3', 'test-hop-index-vec.R:52:3',
    'test-hop-index-vec.R:82:3', 'test-hop-index.R:24:3',
    'test-hop-index.R:30:3', 'test-hop-index.R:36:3', 'test-hop-index.R:42:3',
    'test-hop-index.R:57:3', 'test-hop-index.R:64:3', 'test-hop-index.R:71:3',
    'test-hop-index.R:78:3', 'test-hop-index.R:101:3', 'test-hop-index.R:115:3',
    'test-hop-index2-vec.R:18:3', 'test-hop-index2-vec.R:30:3',
    'test-hop-index2.R:38:3', 'test-hop-index2.R:56:3', 'test-hop-vec.R:5:3',
    'test-hop-vec.R:16:3', 'test-hop-vec.R:41:3', 'test-hop-vec.R:50:3',
    'test-hop.R:13:3', 'test-hop.R:28:3', 'test-hop.R:35:3', 'test-hop.R:42:3',
    'test-hop.R:65:3', 'test-hop.R:122:3', 'test-hop.R:136:3',
    'test-hop2-vec.R:18:3', 'test-hop2-vec.R:25:3', 'test-phop-index-vec.R:18:3',
    'test-phop-index-vec.R:52:3', 'test-phop-index.R:23:3',
    'test-phop-vec.R:18:3', 'test-phop-vec.R:30:3', 'test-phop.R:16:3',
    'test-phop.R:38:3', 'test-pslide-index-vec.R:20:3',
    'test-pslide-index-vec.R:63:3', 'test-pslide-index.R:6:3',
    'test-pslide-period-vec.R:5:3', 'test-pslide-period-vec.R:21:3',
    'test-pslide-period-vec.R:30:3', 'test-pslide-period-vec.R:59:3',
    'test-pslide-period-vec.R:68:3', 'test-pslide-period-vec.R:163:3',
    'test-pslide-period.R:10:3', 'test-pslide-vec.R:20:3',
    'test-pslide-vec.R:30:3', 'test-pslide-vec.R:62:3', 'test-pslide.R:15:3',
    'test-pslide.R:37:3', 'test-slide-index-vec.R:5:3',
    'test-slide-index-vec.R:17:3', 'test-slide-index-vec.R:26:3',
    'test-slide-index-vec.R:40:3', 'test-slide-index-vec.R:53:3',
    'test-slide-index-vec.R:62:3', 'test-slide-index-vec.R:136:3',
    'test-slide-index.R:24:3', 'test-slide-index.R:30:3',
    'test-slide-index.R:37:3', 'test-slide-index.R:44:3',
    'test-slide-index.R:108:3', 'test-slide-index.R:117:3',
    'test-slide-index.R:187:3', 'test-slide-index.R:326:3',
    'test-slide-index.R:457:3', 'test-slide-index.R:558:3',
    'test-slide-index.R:567:3', 'test-slide-index.R:653:3',
    'test-slide-index.R:789:3', 'test-slide-index.R:921:3',
    'test-slide-index.R:934:3', 'test-slide-index.R:945:3',
    'test-slide-index.R:960:3', 'test-slide-index.R:1050:3',
    'test-slide-index.R:1246:3', 'test-slide-index.R:1257:3',
    'test-slide-index.R:1374:3', 'test-slide-index2-vec.R:20:3',
    'test-slide-index2-vec.R:58:3', 'test-slide-index2.R:6:3',
    'test-slide-period-vec.R:5:3', 'test-slide-period-vec.R:19:3',
    'test-slide-period-vec.R:28:3', 'test-slide-period-vec.R:46:3',
    'test-slide-period-vec.R:59:3', 'test-slide-period-vec.R:68:3',
    'test-slide-period.R:9:3', 'test-slide-period.R:15:3',
    'test-slide-period.R:21:3', 'test-slide-period.R:28:3',
    'test-slide-period.R:38:3', 'test-slide-period.R:89:3',
    'test-slide-period.R:95:3', 'test-slide-period.R:101:3',
    'test-slide-period.R:110:3', 'test-slide-period.R:119:3',
    'test-slide-period.R:172:3', 'test-slide-period.R:178:3',
    'test-slide-period.R:184:3', 'test-slide-period.R:193:3',
    'test-slide-period.R:202:3', 'test-slide-period.R:245:3',
    'test-slide-period.R:251:3', 'test-slide-period.R:260:3',
    'test-slide-period2-vec.R:5:3', 'test-slide-period2-vec.R:21:3',
    'test-slide-period2-vec.R:30:3', 'test-slide-period2-vec.R:48:3',
    'test-slide-period2-vec.R:61:3', 'test-slide-period2-vec.R:70:3',
    'test-slide-period2-vec.R:165:3', 'test-slide-period2.R:35:3',
    'test-slide-vec.R:5:3', 'test-slide-vec.R:9:3', 'test-slide-vec.R:20:3',
    'test-slide-vec.R:29:3', 'test-slide-vec.R:43:3', 'test-slide-vec.R:56:3',
    'test-slide-vec.R:65:3', 'test-slide-vec.R:206:3', 'test-slide.R:150:3',
    'test-slide.R:156:3', 'test-slide.R:189:3', 'test-slide.R:504:3',
    'test-slide.R:511:3', 'test-slide.R:518:3', 'test-slide.R:528:3',
    'test-slide.R:564:3', 'test-slide2-vec.R:20:3', 'test-slide2-vec.R:30:3',
    'test-slide2-vec.R:62:3', 'test-slide2.R:12:3', 'test-summary-index.R:438:3',
    'test-summary-index.R:526:3', 'test-summary-index.R:540:3',
    'test-summary-index.R:556:3', 'test-summary-index.R:569:3',
    'test-summary-slide.R:493:3', 'test-summary-slide.R:578:3',
    'test-summary-slide.R:603:3', 'test-summary-slide.R:616:3'

  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-summary-index.R:44:3'): NA / NaN results are correct ─────────
  slide_index_sum(x, i, before = 3) (`actual`) not identical to slide_index_dbl(x, i, sum, .before = 3) (`expected`).

    `actual[8:24]`: 4 4 4 NaN NaN NaN NaN NaN NaN NaN and 7 more...
  `expected[8:24]`: 4 4 4  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-index.R:48:3'): NA / NaN results are correct ─────────
  slide_index_sum(y, i, before = 3) (`actual`) not identical to slide_index_dbl(y, i, sum, .before = 3) (`expected`).

    `actual[1:16]`: NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN and 6 more...
  `expected[1:16]`:  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-index.R:116:3'): NA / NaN results are correct ────────
  slide_index_prod(x, i, before = 3) (`actual`) not identical to slide_index_dbl(x, i, prod, .before = 3) (`expected`).

    `actual[8:24]`: 1 1 1 NaN NaN NaN NaN NaN NaN NaN and 7 more...
  `expected[8:24]`: 1 1 1  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-index.R:120:3'): NA / NaN results are correct ────────
  slide_index_prod(y, i, before = 3) (`actual`) not identical to slide_index_dbl(y, i, prod, .before = 3) (`expected`).

    `actual[1:16]`: NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN and 6 more...
  `expected[1:16]`:  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-index.R:187:3'): NA / NaN results are correct ────────
  slide_index_mean(x, i, before = 3) (`actual`) not identical to slide_index_dbl(x, i, mean, .before = 3) (`expected`).

    `actual[8:24]`: 1 1 1 NaN NaN NaN NaN NaN NaN NaN and 7 more...
  `expected[8:24]`: 1 1 1  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-index.R:191:3'): NA / NaN results are correct ────────
  slide_index_mean(y, i, before = 3) (`actual`) not identical to slide_index_dbl(y, i, mean, .before = 3) (`expected`).

    `actual[1:16]`: NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN and 6 more...
  `expected[1:16]`:  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-slide.R:46:3'): NA / NaN results are correct ─────────
  slide_sum(x, before = 3) (`actual`) not identical to slide_dbl(x, sum, .before = 3) (`expected`).

    `actual[8:24]`: 4 4 4 NaN NaN NaN NaN NaN NaN NaN and 7 more...
  `expected[8:24]`: 4 4 4  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-slide.R:50:3'): NA / NaN results are correct ─────────
  slide_sum(y, before = 3) (`actual`) not identical to slide_dbl(y, sum, .before = 3) (`expected`).

    `actual[1:16]`: NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN and 6 more...
  `expected[1:16]`:  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-slide.R:135:3'): NA / NaN results are correct ────────
  slide_prod(x, before = 3) (`actual`) not identical to slide_dbl(x, prod, .before = 3) (`expected`).

    `actual[8:24]`: 1 1 1 NaN NaN NaN NaN NaN NaN NaN and 7 more...
  `expected[8:24]`: 1 1 1  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-slide.R:139:3'): NA / NaN results are correct ────────
  slide_prod(y, before = 3) (`actual`) not identical to slide_dbl(y, prod, .before = 3) (`expected`).

    `actual[1:16]`: NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN and 6 more...
  `expected[1:16]`:  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-slide.R:218:3'): NA / NaN results are correct ────────
  slide_mean(x, before = 3) (`actual`) not identical to slide_dbl(x, mean, .before = 3) (`expected`).

    `actual[8:24]`: 1 1 1 NaN NaN NaN NaN NaN NaN NaN and 7 more...
  `expected[8:24]`: 1 1 1  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-slide.R:222:3'): NA / NaN results are correct ────────
  slide_mean(y, before = 3) (`actual`) not identical to slide_dbl(y, mean, .before = 3) (`expected`).

    `actual[1:16]`: NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN and 6 more...
  `expected[1:16]`:  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA           ...
  ── Failure ('test-summary-slide.R:249: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 13 | WARN 0 | SKIP 160 | PASS 1031 ]
  Error: Test failures
  Execution halted
  ==2938478== 
  ==2938478== HEAP SUMMARY:
  ==2938478==     in use at exit: 192,515,017 bytes in 35,337 blocks
  ==2938478==   total heap usage: 3,189,928 allocs, 3,154,591 frees, 3,725,044,640 bytes allocated
  ==2938478== 
  ==2938478== LEAK SUMMARY:
  ==2938478==    definitely lost: 0 bytes in 0 blocks
  ==2938478==    indirectly lost: 0 bytes in 0 blocks
  ==2938478==      possibly lost: 0 bytes in 0 blocks
  ==2938478==    still reachable: 192,515,017 bytes in 35,337 blocks
  ==2938478==         suppressed: 0 bytes in 0 blocks
  ==2938478== Reachable blocks (those to which a pointer was found) are not shown.
  ==2938478== To see them, rerun with: --leak-check=full --show-leak-kinds=all
  ==2938478== 
  ==2938478== For lists of detected and suppressed errors, rerun with: -s
  ==2938478== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
  ‘rowwise.Rmd’ using ‘UTF-8’... [40s/40s] OK
  ‘slider.Rmd’ using ‘UTF-8’... [41s/41s] OK
  ‘tsibble.Rmd’ using ‘UTF-8’... [38s/39s] OK
 [119s/121s] OK
* checking re-building of vignette outputs ... [48s/53s] OK
* DONE

Status: 1 ERROR, 1 NOTE
See
  ‘/data/blackswan/ripley/R/packages/tests-vg/slider.Rcheck/00check.log’
for details.

Command exited with non-zero status 1
Time 52:59.32, 3128.01 + 26.48