* using log directory ‘/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL.Rcheck’ * using R Under development (unstable) (2026-12-01 r91013) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 16.2.1 20261029 (Red Hat 16.2.1-3) GNU Fortran (GCC) 16.2.1 20261029 (Red Hat 16.2.1-3) * running under: Fedora Linux 44 (Server Edition) * using session charset: UTF-8 * current time: 2026-12-02 04:31:22 UTC * using options ‘--use-valgrind --no-stop-on-test-error’ * checking for file ‘RcppAMGCL/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘RcppAMGCL’ version ‘0.1.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 ‘RcppAMGCL’ can be installed ... OK * used C++ compiler: ‘g++ (GCC) 16.2.1 20261029 (Red Hat 16.2.1-3)’ * 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 examples ... [37s/37s] OK * checking tests ... Running ‘solver.R’ [41s/41s] [41s/41s] ERROR Running the tests in ‘tests/solver.R’ failed. Complete output: > library(RcppAMGCL) > > expect_error <- function(expr, patterns = character()) { + result <- tryCatch(force(expr), error = identity) + stopifnot(inherits(result, "error")) + for (pattern in patterns) { + stopifnot(grepl(pattern, conditionMessage(result), fixed = TRUE)) + } + invisible(result) + } > > # 1024 unknowns exceed the wrapper's coarse-grid threshold, exercising > # aggregation, interpolation, smoothing, and the coarse solve. > side <- 32L > n <- side * side > ii <- seq_len(n) > horizontal <- ii[ii %% side != 0L] > vertical <- ii[ii <= n - side] > A <- Matrix::sparseMatrix( + i = c(ii, horizontal, horizontal + 1L, vertical, vertical + side), + j = c(ii, horizontal + 1L, horizontal, vertical + side, vertical), + x = c(rep(4, n), rep(-1, 2L * (length(horizontal) + length(vertical)))), + dims = c(n, n) + ) > stopifnot(inherits(A, "dgCMatrix")) > x_true <- sin(ii / 13) + cos(ii / 29) > b <- as.numeric(A %*% x_true) > > info <- amgcl_info() > stopifnot(is.logical(info$openmp), length(info$openmp) == 1L, + info$max_threads >= 1, info$thread_limit >= 1, + info$current_threads >= 1, nzchar(info$amgcl_version)) > if (!info$openmp) stopifnot(info$max_threads == 1L) > > check_result <- function(result, matrix, rhs, reference, threads) { + rhs <- as.numeric(rhs) + independently_computed <- sqrt(sum((as.numeric(matrix %*% result$x) - rhs)^2)) + if (any(rhs != 0)) independently_computed <- independently_computed / sqrt(sum(rhs^2)) + stopifnot(is.list(result), is.numeric(result$x), length(result$x) == nrow(matrix), + result$converged, result$iterations >= 0L, + is.finite(result$error), result$error >= 0, + isTRUE(all.equal(result$residual, independently_computed, + tolerance = 1e-10)), + result$residual < 1e-8, + max(abs(result$x - reference)) < 1e-6, + result$threads == min(threads, info$max_threads), + identical(amgcl_info()$current_threads, info$current_threads)) + } > > for (solver in c("cg", "bicgstab")) { + one <- amgcl_solve(A, b, solver = solver, tol = 1e-10, threads = 1L) + check_result(one, A, b, x_true, 1L) + reusable <- amgcl_setup(A, solver = solver, tol = 1e-10, threads = 2L) + stopifnot(inherits(reusable, "amgcl_solver"), + identical(amgcl_info()$current_threads, info$current_threads)) + check_result(amgcl_solve(reusable, b, threads = 2L), A, b, x_true, 2L) + b2 <- as.numeric(A %*% (2 * x_true)) + check_result(amgcl_solve(reusable, b2), A, b2, 2 * x_true, 1L) + zero <- amgcl_solve(reusable, numeric(n)) + stopifnot(zero$converged, zero$residual == 0, all(zero$x == 0)) + restored <- unserialize(serialize(reusable, NULL)) + expect_error(amgcl_solve(restored, b)) + } > > # Exercise the large residual reduction with a final one-row partial block. > # The last component dominates the RHS norm, so omitting that block changes > # the reported relative residual measurably even after convergence. > local({ + large_n <- 32769L + rows <- seq_len(large_n) + edges <- seq_len(large_n - 1L) + large <- Matrix::sparseMatrix(i = c(rows, edges, edges + 1L), + j = c(rows, edges + 1L, edges), + x = c(rep(3, large_n), rep(-1, 2L * length(edges))), + dims = c(large_n, large_n)) + reference <- sin(rows / 17) + cos(rows / 43) + reference[large_n] <- reference[large_n] + 1000 + rhs <- as.numeric(large %*% reference) + state <- amgcl_info() + solver <- amgcl_setup(large, tol = 1e-10, threads = 2L) + stopifnot(identical(amgcl_info()$current_threads, state$current_threads)) + for (scale in c(1e-200, 1, 1e200)) { + scaled_rhs <- rhs * scale + rhs_scale <- max(abs(scaled_rhs)) + normalized_rhs <- scaled_rhs / rhs_scale + for (threads in c(1L, 2L)) { + result <- amgcl_solve(solver, scaled_rhs, threads = threads) + # Scale before both multiplication and squaring: this independent + # R calculation stays finite for the extreme RHS magnitudes. + difference <- as.numeric(large %*% (result$x / rhs_scale)) - normalized_rhs + independent <- sqrt(sum(difference^2) / sum(normalized_rhs^2)) + solution_error <- sqrt(sum((result$x / scale - reference)^2) / + sum(reference^2)) + stopifnot(result$converged, all(is.finite(result$x)), + is.finite(result$error), is.finite(result$residual), + result$residual <= 1e-10, solution_error < 1e-8, + abs(result$residual - independent) <= + 128 * .Machine$double.eps + 1e-5 * independent, + result$threads == min(threads, state$max_threads), + identical(amgcl_info()$current_threads, state$current_threads)) + } + } + for (threads in c(1L, 2L)) { + zero <- amgcl_solve(solver, numeric(large_n), threads = threads) + stopifnot(zero$converged, zero$residual == 0, zero$error == 0, + zero$iterations == 0L, all(zero$x == 0), + zero$threads == min(threads, state$max_threads), + identical(amgcl_info()$current_threads, state$current_threads)) + } + }) Error in eval(expr, p) : The computed residual is non-finite; check the matrix Calls: local ... eval -> eval -> eval -> amgcl_solve -> amgcl_solve_cpp Execution halted ==2361463== ==2361463== HEAP SUMMARY: ==2361463== in use at exit: 199,943,598 bytes in 38,833 blocks ==2361463== total heap usage: 74,395 allocs, 35,562 frees, 296,947,027 bytes allocated ==2361463== ==2361463== 400 bytes in 1 blocks are possibly lost in loss record 237 of 2,707 ==2361463== at 0x484962B: calloc (/builddir/build/BUILD/valgrind-3.27.1-build/valgrind-3.27.1/coregrind/m_replacemalloc/vg_replace_malloc.c:1616) ==2361463== by 0x40120BF: calloc (/usr/src/debug/glibc-2.43-9.fc44.x86_64/elf/../include/rtld-malloc.h:44) ==2361463== by 0x40120BF: allocate_dtv (/usr/src/debug/glibc-2.43-9.fc44.x86_64/elf/../elf/dl-tls.c:470) ==2361463== by 0x4012B81: _dl_allocate_tls (/usr/src/debug/glibc-2.43-9.fc44.x86_64/elf/../elf/dl-tls.c:722) ==2361463== by 0x569FA0E: allocate_stack (/usr/src/debug/glibc-2.43-9.fc44.x86_64/nptl/allocatestack.c:568) ==2361463== by 0x569FA0E: pthread_create@@GLIBC_2.34 (/usr/src/debug/glibc-2.43-9.fc44.x86_64/nptl/pthread_create.c:680) ==2361463== by 0x55E69CA: gomp_team_start (/usr/src/debug/gcc-16.2.1-3.fc44.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libgomp/../../../libgomp/team.c:859) ==2361463== by 0x55DC2F0: GOMP_parallel (/usr/src/debug/gcc-16.2.1-3.fc44.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libgomp/../../../libgomp/parallel.c:176) ==2361463== by 0x17641289: crs >&, const std::vector >&, const std::vector >&> > (/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL/src/../inst/include/amgcl/backend/builtin.hpp:132) ==2361463== by 0x17641289: _Construct, const std::tuple >&, const std::vector >&, const std::vector >&>&> (/usr/include/c++/16/bits/stl_construct.h:133) ==2361463== by 0x17641289: construct, const std::tuple >&, const std::vector >&, const std::vector >&>&> (/usr/include/c++/16/bits/alloc_traits.h:845) ==2361463== by 0x17641289: _Sp_counted_ptr_inplace >&, const std::vector >&, const std::vector >&>&> (/usr/include/c++/16/bits/shared_ptr_base.h:671) ==2361463== by 0x17641289: __shared_count, std::allocator, const std::tuple >&, const std::vector >&, const std::vector >&>&> (/usr/include/c++/16/bits/shared_ptr_base.h:1037) ==2361463== by 0x17641289: __shared_ptr, const std::tuple >&, const std::vector >&, const std::vector >&>&> (/usr/include/c++/16/bits/shared_ptr_base.h:1813) ==2361463== by 0x17641289: shared_ptr, const std::tuple >&, const std::vector >&, const std::vector >&>&> (/usr/include/c++/16/bits/shared_ptr.h:463) ==2361463== by 0x17641289: make_shared, const std::tuple >&, const std::vector >&, const std::vector >&>&> (/usr/include/c++/16/bits/shared_ptr.h:1066) ==2361463== by 0x17641289: amgcl::amg, amgcl::coarsening::smoothed_aggregation, amgcl::relaxation::spai0>::amg > const&, std::vector > const&, std::vector > const&> >(std::tuple > const&, std::vector > const&, std::vector > const&> const&, amgcl::amg, amgcl::coarsening::smoothed_aggregation, amgcl::relaxation::spai0>::params const&, amgcl::detail::empty_params const&) (/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL/src/../inst/include/amgcl/amg.hpp:201) ==2361463== by 0x17641573: make_solver >&, const std::vector >&, const std::vector >&> > (/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL/src/../inst/include/amgcl/make_solver.hpp:100) ==2361463== by 0x17641573: rcppamgcl::Solver::ImplementationFor, amgcl::solver::detail::default_inner_product> >::ImplementationFor(rcppamgcl::Matrix const&, double, int) (/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL/src/../inst/include/RcppAMGCL.h:221) ==2361463== by 0x17641CFD: rcppamgcl::Solver::Solver(rcppamgcl::Matrix, std::__cxx11::basic_string, std::allocator > const&, double, int, int) (/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL/src/../inst/include/RcppAMGCL.h:248) ==2361463== by 0x1762FC1E: amgcl_setup_cpp(Rcpp::S4_Impl, std::__cxx11::basic_string, std::allocator >, double, int, int) (/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL/src/solver.cpp:49) ==2361463== by 0x17627204: _RcppAMGCL_amgcl_setup_cpp (/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL/src/RcppExports.cpp:24) ==2361463== by 0x49AA05: R_doDotCall (/data/localhost/ripley/R/svn/R-devel/src/main/dotcode.c:783) ==2361463== ==2361463== LEAK SUMMARY: ==2361463== definitely lost: 0 bytes in 0 blocks ==2361463== indirectly lost: 0 bytes in 0 blocks ==2361463== possibly lost: 400 bytes in 1 blocks ==2361463== still reachable: 199,943,198 bytes in 38,832 blocks ==2361463== suppressed: 0 bytes in 0 blocks ==2361463== Reachable blocks (those to which a pointer was found) are not shown. ==2361463== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==2361463== ==2361463== For lists of detected and suppressed errors, rerun with: -s ==2361463== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) * DONE Status: 1 ERROR See ‘/data/localhost/ripley/R/packages/tests-vg/RcppAMGCL.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:33.75, 89.91 + 3.26