[R-pkg-team] Bug#980809: Matrix package default tolerance on s390x (Re: Bug#980809: rmatrix: breaks autopkgtest of r-cran-glmmtmb on s390x)

Dirk Eddelbuettel edd at debian.org
Wed Feb 17 13:10:30 GMT 2021


Hi Martin,

On 17 February 2021 at 10:43, Martin Maechler wrote:
| Dear Dirk,
| I'm in vacations right now ...

Ah, nice.
 
| 1)  I think I might simply disable the check  *on* that platform .. or
| platforms with similar characteristics.

Sounds good to me.

| Can you send me the outputs of  so I can take some of the entries to
| determine I'm on the platform?
| 
| sessionInfo()

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: s390x-ibm-linux-gnu (64-bit)
Running under: Debian GNU/Linux bullseye/sid

Matrix products: default
BLAS:   /usr/lib/s390x-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.9.0

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3
> 

| str(.Machine, digits=10)

>  str(.Machine, digits=10)
List of 28
 $ double.eps               : num 2.220446049e-16
 $ double.neg.eps           : num 1.110223025e-16
 $ double.xmin              : num 2.225073859e-308
 $ double.xmax              : num 1.797693135e+308
 $ double.base              : int 2
 $ double.digits            : int 53
 $ double.rounding          : int 5
 $ double.guard             : int 0
 $ double.ulp.digits        : int -52
 $ double.neg.ulp.digits    : int -53
 $ double.exponent          : int 11
 $ double.min.exp           : int -1022
 $ double.max.exp           : int 1024
 $ integer.max              : int 2147483647
 $ sizeof.long              : int 8
 $ sizeof.longlong          : int 8
 $ sizeof.longdouble        : int 16
 $ sizeof.pointer           : int 8
 $ longdouble.eps           : num 1.925929944e-34
 $ longdouble.neg.eps       : num 9.629649722e-35
 $ longdouble.digits        : int 113
 $ longdouble.rounding      : int 5
 $ longdouble.guard         : int 0
 $ longdouble.ulp.digits    : int -112
 $ longdouble.neg.ulp.digits: int -113
 $ longdouble.exponent      : int 15
 $ longdouble.min.exp       : int -16382
 $ longdouble.max.exp       : int 16384
> 

| capabilities()

> capabilities()
       jpeg         png        tiff       tcltk         X11        aqua 
       TRUE        TRUE        TRUE        TRUE       FALSE       FALSE 
   http/ftp     sockets      libxml        fifo      cledit       iconv 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 
        NLS     profmem       cairo         ICU long.double     libcurl 
       TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 
> 

| .Platform

> str(.Platform)
List of 8
 $ OS.type   : chr "unix"
 $ file.sep  : chr "/"
 $ dynlib.ext: chr ".so"
 $ GUI       : chr "X11"
 $ endian    : chr "big"
 $ pkgType   : chr "source"
 $ path.sep  : chr ":"
 $ r_arch    : chr ""
> 
 
| 2)  Can you send me the  result of     rankMatrix(Z, method="qr")
| i.e.  `rnkZ.`  from the above example ?

> library(Matrix)
> Z. <- readRDS(system.file("external", "Z_NA_rnk.rds", package="Matrix"))
> rnkZ. <- rankMatrix(Z., method = "qr")
> rnkZ.
[1] 724
attr(,"method")
[1] "qr.R"
attr(,"useGrad")
[1] FALSE
attr(,"tol")
[1] 3.126388e-13
> 

Graham (in subsequent message) makes a good point about big endian. Maybe we
need a slightly wider net.

It could, as always, of course be something else but related. I could replace
the default BLAS with OpenBLAS etc but ex ante the default BLAS should work :-/

But as you hinted, if we skip that one test on this one architecture it
passes. I used a very minimal diff (below) and quickly rebuilt (by skipping
vignettes as I currently do not have texlive installed on the s390x (but
could add  it)).

(sid_s390x-dchroot)edd at zelenka:/tmp/downloaded_packages$ diff -u Matrix{,.orig}/tests/factorizing.R 
--- Matrix/tests/factorizing.R  2021-02-17 13:01:06.511757335 +0000
+++ Matrix.orig/tests/factorizing.R     2021-01-04 20:32:35.000000000 +0000
@@ -472,7 +472,6 @@
 })
 options(oo)
 
-if (Sys.info()[["machine"]] != "s390x") {
 ## problematic rank deficient rankMatrix() case -- only seen in large cases ??
 Z. <- readRDS(system.file("external", "Z_NA_rnk.rds", package="Matrix"))
 tools::assertWarning(rnkZ. <- rankMatrix(Z., method = "qr")) # gave errors
@@ -482,7 +481,6 @@
 oo <- options(warn=2)# no warnings allowed from here
 di <- diag(qrZ. at R)
 stopifnot(is.na(rnkZ.), is(qrZ, "sparseQR"), is.na(rnk2), anyNA(di))
-}
 
 ## The above bug fix was partly wrongly extended to  dense matrices for "qr.R":
 x <- cbind(1, rep(0:9, 18))
(sid_s390x-dchroot)edd at zelenka:/tmp/downloaded_packages$ 



(Obviously the if above could be indentented and all that.)

Graham:  What does that bigendian box say for   Sys.info()[["machine"]]   ?
Should we test for endianness instead?  And then maybe try to roll up to the
cause of the difference?

Dirk


| Best, Martin
| 
| On Mon, Feb 15, 2021 at 5:12 PM Dirk Eddelbuettel <edd at debian.org> wrote:
| >
| >
| > Martin,
| >
| > I have this long-running bug report against Matrix, triggered by glmmTMB on
| > s390x.  Graham has been chasing this patiently and we are now at the level of
| > checking on a shell account on the appropriate hardware.
| >
| > We validated that everything does in fact "still break" with CRAN-current
| > packages of everything (and R 4.0.3, I guess by tomorrow we'd have 4.0.4).
| >
| > glmmTMB does indeed fail in an example -- but so does Matrix 1.3-2 when I run
| >
| >   _R_CHECK_FORCE_SUGGESTS_=false R CMD check \
| >                      --no-manual --no-vignettes Matrix_1.3-2.tar.gz
| >
| > and I see
| >
| >   [...]
| >   Running 'factorizing.R'
| >  ERROR
| > Running the tests in 'tests/factorizing.R' failed.
| > Last 13 lines of output:
| >   +     inherits(qrZ, "sparseQR")
| >   +     inherits(Rz, "sparseMatrix")
| >   +     isTriangular(Rz)
| >   +     isDiagonal(Rz) # even though formally a "dtCMatrix"
| >   +     qr2rankMatrix(qrZ, do.warn=FALSE) == 6
| >   + })
| >   > options(oo)
| >   >
| >   > ## problematic rank deficient rankMatrix() case -- only seen in large cases ??
| >   > Z. <- readRDS(system.file("external", "Z_NA_rnk.rds", package="Matrix"))
| >   > tools::assertWarning(rnkZ. <- rankMatrix(Z., method = "qr")) # gave errors
| >   Error in assertCondition(expr, classes, .exprString = d.expr) :
| >     Failed to get warning in evaluating rnkZ. <- rankMatrix(Z., method  ...
| >   Calls: <Anonymous> -> assertCondition
| >   Execution halted
| > * checking for unstated dependencies in vignettes ... OK
| >
| > Can you advise if I should dive into a particular routine or comparison to
| > see what is up here?
| >
| > Best,  Dirk
| >
| > --
| > https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
| >
| 
| 
| -- 
| Martin Maechler,
| Seminar fuer Statistik, ETH Zurich

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org



More information about the R-pkg-team mailing list