grimbough / rhdf5

Package providing an interface between HDF5 and R
http://bioconductor.org/packages/rhdf5
61 stars 22 forks source link

Some tests fails on PowerPC: [ FAIL 39 | WARN 0 | SKIP 2 | PASS 970 ] #122

Open barracuda156 opened 1 year ago

barracuda156 commented 1 year ago

R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.8.0 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(testthat)
> library(rhdf5)
> 
> test_check("rhdf5")
R(60123,0xa0dfb620) malloc: *** mmap(size=4000002048) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
R(60123,0xa0dfb620) malloc: *** mmap(size=4000002048) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
[ FAIL 39 | WARN 0 | SKIP 2 | PASS 970 ]

══ Skipped tests ═══════════════════════════════════════════════════════════════
• On CRAN (2)

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test_H5A.R:112:5'): unsigned 32-bit integer attributes are read correctly ──
`H5Aread(aid, bit64conversion = "int")` did not produce any warnings.
Backtrace:
    ▆
 1. ├─testthat::expect_true(any(is.na(expect_warning(H5Aread(aid, bit64conversion = "int"))))) at test_H5A.R:112:4
 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
 3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
 4. └─testthat::expect_warning(H5Aread(aid, bit64conversion = "int"))
── Failure ('test_H5A.R:112:5'): unsigned 32-bit integer attributes are read correctly ──
any(is.na(expect_warning(H5Aread(aid, bit64conversion = "int")))) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
── Failure ('test_H5A.R:116:5'): unsigned 32-bit integer attributes are read correctly ──
expect_silent(H5Aread(aid, bit64conversion = "double")) not equivalent to c(1:9, 2^31).
10/10 mismatches (average diff: 2.9e+08)
[1] 1.68e+07 - 1 == 1.68e+07
[2] 3.36e+07 - 2 == 3.36e+07
[3] 5.03e+07 - 3 == 5.03e+07
[4] 6.71e+07 - 4 == 6.71e+07
[5] 8.39e+07 - 5 == 8.39e+07
[6] 1.01e+08 - 6 == 1.01e+08
[7] 1.17e+08 - 7 == 1.17e+08
[8] 1.34e+08 - 8 == 1.34e+08
[9] 1.51e+08 - 9 == 1.51e+08
...
── Failure ('test_H5A.R:120:5'): unsigned 32-bit integer attributes are read correctly ──
`x3` not equivalent to bit64::as.integer64(c(1:9, 2^31)).
Mean relative difference: 3.844444
── Failure ('test_H5P_dcpl.R:16:5'): Filters can be set ────────────────────────
H5Pset_szip(dcpl, options_mask = 1L, pixels_per_block = 8L) is not more than 0. Difference: -1
── Failure ('test_H5P_dcpl.R:17:5'): Filters can be set ────────────────────────
H5Pget_nfilters(dcpl) not equal to 3L.
1/1 mismatches
[1] 2 - 3 == -1
── Failure ('test_h5create.R:263:5'): attributes can be added using file name ──
"foo_attr" %in% names(h5readAttributes(file = h5File, name = "foo")) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
── Failure ('test_h5read.R:83:5'): Reading attributes too ──────────────────────
as.character(attributes(baa)$scale) not equal to attributes(D)$scale.
Lengths differ: 0 is not 1
── Error ('test_h5read.R:350:5'): Reading SZIP ─────────────────────────────────
Error: 'idx' argument is outside the range of filters set on this property list.
Backtrace:
     ▆
  1. ├─... %>% expect_equal(c(64, 32)) at test_h5read.R:350:4
  2. ├─testthat::expect_equal(., c(64, 32))
  3. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
  4. │   └─rlang::eval_bare(expr, quo_get_env(quo))
  5. ├─testthat::expect_is(., "matrix")
  6. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
  7. │   └─rlang::eval_bare(expr, quo_get_env(quo))
  8. ├─testthat::expect_silent(h5read(szip_file, "DS1"))
  9. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
 10. │   ├─testthat (local) .capture(...)
 11. │   │ ├─withr::with_output_sink(...)
 12. │   │ │ └─base::force(code)
 13. │   │ ├─base::withCallingHandlers(...)
 14. │   │ └─base::withVisible(code)
 15. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 16. └─rhdf5::h5read(szip_file, "DS1")
 17.   └─rhdf5:::h5readDataset(...)
 18.     └─base::tryCatch(...)
 19.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 20.         └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 21.           └─value[[3L]](cond)
 22.             └─rhdf5:::h5checkFilters(h5dataset)
 23.               └─rhdf5::H5Pget_filter(pid, i - 1)
── Failure ('test_h5readAttributes.R:31:5'): 64-bit integer attributes are read correctly ──
`x1 <- h5readAttributes(h5File, "A", bit64conversion = "int")` did not produce any warnings.
── Failure ('test_h5readAttributes.R:32:5'): 64-bit integer attributes are read correctly ──
"int64" %in% names(x1) && "uint32" %in% names(x1) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
── Failure ('test_h5readAttributes.R:33:5'): 64-bit integer attributes are read correctly ──
x1$int64 not equivalent to c(1:9, NA).
target is NULL, current is numeric
── Failure ('test_h5readAttributes.R:34:5'): 64-bit integer attributes are read correctly ──
x1$uint32 not equivalent to c(1:9, NA).
target is NULL, current is numeric
── Failure ('test_h5readAttributes.R:37:5'): 64-bit integer attributes are read correctly ──
x2$int64 not equivalent to c(1:9, 2^32).
target is NULL, current is numeric
── Failure ('test_h5readAttributes.R:38:5'): 64-bit integer attributes are read correctly ──
x2$uint32 not equivalent to c(1:9, 2^31).
target is NULL, current is numeric
── Failure ('test_h5readAttributes.R:39:5'): 64-bit integer attributes are read correctly ──
x2$int64 inherits from `'NULL'` not `'character'`.
── Failure ('test_h5readAttributes.R:40:5'): 64-bit integer attributes are read correctly ──
x2$int64 has type 'NULL', not 'double'.
── Failure ('test_h5readAttributes.R:43:5'): 64-bit integer attributes are read correctly ──
x3$int64 not equivalent to c(1:9, 2^32).
target is NULL, current is numeric
── Failure ('test_h5readAttributes.R:44:5'): 64-bit integer attributes are read correctly ──
x3$uint32 not equivalent to c(1:9, 2^31).
target is NULL, current is numeric
── Failure ('test_h5readAttributes.R:45:5'): 64-bit integer attributes are read correctly ──
x3$int64 is not an S3 object
── Failure ('test_h5write.R:39:5'): Attributes are written too ─────────────────
"scale" %in% names(h5readAttributes(file = h5File, name = "B")) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
── Failure ('test_h5writeAttributes.R:33:5'): Adding attribute to file ─────────
`attr_back` has length 0, not length 4.
── Failure ('test_h5writeAttributes.R:34:5'): Adding attribute to file ─────────
all(...) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
── Failure ('test_h5writeAttributes.R:35:5'): Adding attribute to file ─────────
attr_back$char_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:36:5'): Adding attribute to file ─────────
attr_back$int_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:37:5'): Adding attribute to file ─────────
attr_back$numeric_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:63:5'): Adding attribute to group ────────
`attr_back` has length 0, not length 4.
── Failure ('test_h5writeAttributes.R:64:5'): Adding attribute to group ────────
all(...) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
── Failure ('test_h5writeAttributes.R:65:5'): Adding attribute to group ────────
attr_back$char_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:66:5'): Adding attribute to group ────────
attr_back$int_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:67:5'): Adding attribute to group ────────
attr_back$numeric_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:93:5'): Adding attribute to dataset ──────
`attr_back` has length 0, not length 4.
── Failure ('test_h5writeAttributes.R:95:5'): Adding attribute to dataset ──────
attr_back$char_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:96:5'): Adding attribute to dataset ──────
attr_back$int_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:97:5'): Adding attribute to dataset ──────
attr_back$numeric_attr[1] inherits from `'NULL'` not `'character'`.
── Failure ('test_h5writeAttributes.R:130:5'): Checking other string options when adding attributes ──
`attr_back` has length 0, not length 4.
── Failure ('test_h5writeAttributes.R:133:5'): Checking other string options when adding attributes ──
sort(expected) not identical to sort(names(attr_back)).
Types not compatible: character is not NULL
── Failure ('test_h5writeAttributes.R:134:5'): Checking other string options when adding attributes ──
unname(unlist(attr_back[expected])) not identical to c("blah", "blah2", "blah3", "blah4").
target is NULL, current is character
── Failure ('test_h5writeAttributes.R:149:5'): Overwrite exisiting attribute ───
attr_list$char_attr[1] not identical to "new_character".
target is NULL, current is character

[ FAIL 39 | WARN 0 | SKIP 2 | PASS 970 ]
Error: Test failures
Execution halted
grimbough commented 1 year ago

A bunch of these (maybe all?) appear to be related to how we treat 64-bit integers, which is presumably pretty weird on a 32-bit system. It's not something I've ever tested or tried. I'll have a think about what might be possible.