Running ‘testthat.R’ [1s/1s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(gpboost)
  Loading required package: R6
  > 
  > test_check(
  +     package = "gpboost"
  +     , stop_on_failure = TRUE
  +     , stop_on_warning = FALSE
  + )
  
   *** caught segfault ***
  address 0x8, cause 'invalid permissions'
  
  Traceback:
   1: .Call(GPB_OptimLinRegrCoefCovPar_R, private$handle, y, X, private$num_covariates,     offset)
   2: gpmodel$fit(y = y, X = X, params = params, offset = offset, fixed_effects = fixed_effects)
   3: fitGPModel(gp_coords = coords, gp_approx = "vecchia", num_neighbors = 12,     matrix_inversion_method = method, y = y_gp, X = cbind(1,         x), likelihood = "gpd", params = params)
   4: eval(code, test_env)
   5: eval(code, test_env)
   6: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
   7: doTryCatch(return(expr), name, parentenv, handler)
   8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
   9: tryCatchList(expr, classes, parentenv, handlers)
  10: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  11: doWithOneRestart(return(expr), restart)
  12: withOneRestart(expr, restarts[[1L]])
  13: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  14: test_code(code, parent.frame())
  15: test_that("GPD covers grouped, crossed, Vecchia, and combined latent models",     {        n <- 80        x <- 2 * sim_rand_unif_egpd(n, 0.17) - 1        coords <- cbind(sim_rand_unif_egpd(n, 0.31), sim_rand_unif_egpd(n,             0.67))        group1 <- rep(seq_len(16), each = 5)        group2 <- rep(seq_len(10), times = 8)        b1 <- 0.3 * qnorm(sim_rand_unif_egpd(16, 0.73))        b2 <- 0.2 * qnorm(sim_rand_unif_egpd(10, 0.29))        gp_cov <- 0.12 * exp(-as.matrix(dist(coords))/0.25) +             diag(1e-10, n)        gp_effect <- drop(t(chol(gp_cov)) %*% qnorm(sim_rand_unif_egpd(n,             0.83)))        params_chol <- list(maxit = 25, delta_rel_conv = 1e-05,             init_aux_pars = c(0.05), init_coef_aux_pars_from_iid_model = FALSE)        params_iter <- list(maxit = 20, delta_rel_conv = 1e-04,             init_aux_pars = c(0.05), cg_preconditioner_type = "ssor",             num_rand_vec_trace = 200, cg_max_num_it = 300, cg_max_num_it_tridiag = 300,             cg_delta_conv = 1e-07, init_coef_aux_pars_from_iid_model = FALSE)        eta_group <- 0.2 + 0.35 * x + b1[group1]        y_group <- sim_gpd_lcg(eta_group, 0.1, 0.41)        fit_group <- fitGPModel(group_data = group1, y = y_group,             X = cbind(1, x), likelihood = "gpd", params = params_chol)        expect_equal(unname(fit_group$get_aux_pars()), -0.03752757247,             tolerance = 1e-04)        expect_equal(unname(fit_group$get_coef()), c(0.1767480618,             0.03703002668), tolerance = 1e-04)        expect_equal(unname(fit_group$get_cov_pars()), 0.2032628084,             tolerance = 1e-04)        expect_equal(fit_group$get_current_neg_log_likelihood(),             96.60467923, tolerance = 1e-04)        expect_equal(fit_group$neg_log_likelihood(unname(fit_group$get_cov_pars()),             y_group, fixed_effects = drop(cbind(1, x) %*% fit_group$get_coef()),             aux_pars = unname(fit_group$get_aux_pars())), 96.60467923,             tolerance = 1e-04)        pred_group <- predict(fit_group, group_data_pred = group1[1:3],             X_pred = cbind(1, x[1:3]), predict_response = TRUE,             predict_var = TRUE)        expect_equal(unname(pred_group$mu), c(1.4913611673, 1.4823656181,             1.4870656611), tolerance = 1e-04)        expect_equal(unname(pred_group$var), c(2.4511914239,             2.4217105525, 2.4370916272), tolerance = 1e-04)        eta_crossed <- 0.1 + b1[group1] + b2[group2]        y_crossed <- sim_gpd_lcg(eta_crossed, 0.1, 0.47)        expected_crossed <- list(cholesky = list(aux = -0.04344375872,             cov = c(0.07955212538, 0.1122116685), nll = 91.28575879,             eval = 91.28575879, mu = c(0.8475744992, 0.818141704,                 0.654439765), var = c(0.8326477476, 0.7846484255,                 0.5058407081)), iterative = list(aux = -0.04219820068,             cov = c(0.08797824184, 0.1042743589), nll = 91.31085537,             eval = 91.31085537, mu = c(0.8405726542, 0.8100799401,                 0.658135969), var = c(0.8244578115, 0.7747829283,                 0.5144882703)))        for (method in c("cholesky", "iterative")) {            fit <- fitGPModel(group_data = cbind(group1, group2),                 y = y_crossed, likelihood = "gpd", matrix_inversion_method = method,                 params = if (method == "cholesky")                   params_chol                else params_iter)            reference <- expected_crossed[[method]]            tolerance <- if (method == "cholesky")                 1e-04            else 0.01            expect_equal(unname(fit$get_aux_pars()), reference$aux,                 tolerance = tolerance)            expect_equal(unname(fit$get_cov_pars()), reference$cov,                 tolerance = tolerance)            expect_equal(fit$get_current_neg_log_likelihood(),                 reference$nll, tolerance = tolerance)            expect_equal(fit$neg_log_likelihood(unname(fit$get_cov_pars()),                 y_crossed, aux_pars = unname(fit$get_aux_pars())),                 reference$eval, tolerance = tolerance)            pred <- predict(fit, group_data_pred = cbind(group1[1:3],                 group2[1:3]), predict_response = TRUE, predict_var = TRUE)            expect_equal(unname(pred$mu), reference$mu, tolerance = tolerance)            expect_equal(unname(pred$var), reference$var, tolerance = tolerance *                 5)        }        eta_gp <- 0.15 + 0.3 * x + gp_effect        y_gp <- sim_gpd_lcg(eta_gp, 0.1, 0.53)        expected_vecchia <- list(cholesky = list(aux = 0.1280153215,             coef = c(0.2330672807, 0.2956505845), cov = c(0.01006370593,                 0.006742792854), nll = 108.5825156, eval = 108.5825156,             mu = c(1.197245466, 1.154883065, 1.161833531), var = c(1.963507856,                 1.82677478, 1.849281107)), iterative = list(aux = 0.08480078684,             coef = c(0.2625809123, 0.2747986863), cov = c(0.06770450802,                 0.02546282803), nll = 108.6881116, eval = 108.6881116,             mu = c(1.188597295, 1.259126496, 1.173604482), var = c(1.913616409,                 2.132313753, 1.881919813)))        for (method in c("cholesky", "iterative")) {            params <- if (method == "cholesky")                 params_chol            else within(params_iter, cg_preconditioner_type <- "vadu")            fit <- fitGPModel(gp_coords = coords, gp_approx = "vecchia",                 num_neighbors = 12, matrix_inversion_method = method,                 y = y_gp, X = cbind(1, x), likelihood = "gpd",                 params = params)            reference <- expected_vecchia[[method]]            tolerance <- 0.01            expect_equal(unname(fit$get_aux_pars()), reference$aux,                 tolerance = tolerance)            expect_equal(unname(fit$get_coef()), reference$coef,                 tolerance = tolerance)            expect_equal(unname(fit$get_cov_pars()), reference$cov,                 tolerance = tolerance)            expect_equal(fit$get_current_neg_log_likelihood(),                 reference$nll, tolerance = tolerance)            evaluated <- fit$neg_log_likelihood(unname(fit$get_cov_pars()),                 y_gp, fixed_effects = drop(cbind(1, x) %*% fit$get_coef()),                 aux_pars = unname(fit$get_aux_pars()))            expect_equal(evaluated, reference$eval, tolerance = tolerance)            pred <- predict(fit, gp_coords_pred = coords[1:3,                 ], X_pred = cbind(1, x[1:3]), predict_response = TRUE,                 predict_var = TRUE)            expect_equal(unname(pred$mu), reference$mu, tolerance = tolerance)            expect_equal(unname(pred$var), reference$var, tolerance = tolerance *                 5)        }        eta_combined <- 0.1 + 0.25 * x + b1[group1] + gp_effect        y_combined <- sim_gpd_lcg(eta_combined, 0.3, 0.59)        fit_combined <- fitGPModel(group_data = group1, gp_coords = coords,             gp_approx = "none", y = y_combined, X = cbind(1,                 x), likelihood = "gpd", params = params_chol)        expect_equal(unname(fit_combined$get_aux_pars()), 0.2086584656,             tolerance = 1e-04)        expect_equal(unname(fit_combined$get_coef()), c(0.2348555118,             0.6550444871), tolerance = 1e-04)        expect_equal(unname(fit_combined$get_cov_pars()), c(7.193903706e-06,             0.000533909672, 0.005044869741), tolerance = 1e-04)        expect_equal(fit_combined$get_current_neg_log_likelihood(),             112.08649465, tolerance = 1e-04)        evaluated <- fit_combined$neg_log_likelihood(unname(fit_combined$get_cov_pars()),             y_combined, fixed_effects = drop(cbind(1, x) %*%                 fit_combined$get_coef()), aux_pars = unname(fit_combined$get_aux_pars()))        expect_equal(evaluated, 112.08649465, tolerance = 1e-04)        pred_combined <- predict(fit_combined, group_data_pred = group1[1:3],             gp_coords_pred = coords[1:3, ], X_pred = cbind(1,                 x[1:3]), predict_response = TRUE, predict_var = TRUE)        expect_equal(unname(pred_combined$mu), c(1.0381680386,             0.9326345468, 0.9862718573), tolerance = 1e-04)        expect_equal(unname(pred_combined$var), c(1.853071281,             1.4954773708, 1.6724384879), tolerance = 1e-04)    })
  16: eval(code, test_env)
  17: eval(code, test_env)
  18: withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt)
  19: doTryCatch(return(expr), name, parentenv, handler)
  20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  21: tryCatchList(expr, classes, parentenv, handlers)
  22: tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal)
  23: doWithOneRestart(return(expr), restart)
  24: withOneRestart(expr, restarts[[1L]])
  25: withRestarts(tryCatch(withCallingHandlers({    eval(code, test_env)    new_expectations <- the$test_expectations > starting_expectations    if (snapshot_skipped) {        skip("On CRAN")    }    else if (!new_expectations && skip_on_empty) {        skip_empty()    }}, expectation = handle_expectation, packageNotFoundError = function(e) {    if (on_cran()) {        skip(paste0("{", e$package, "} is not installed."))    }}, snapshot_on_cran = function(cnd) {    snapshot_skipped <<- TRUE    invokeRestart("muffle_cran_snapshot")}, skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error, interrupt = handle_interrupt), error = handle_fatal),     end_test = function() {    })
  26: test_code(code = exprs, env = env, reporter = get_reporter() %||%     StopReporter$new())
  27: source_file(path, env = env(env), desc = desc, shuffle = shuffle,     error_call = error_call)
  28: FUN(X[[i]], ...)
  29: lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle,     error_call = error_call)
  30: doTryCatch(return(expr), name, parentenv, handler)
  31: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  32: tryCatchList(expr, classes, parentenv, handlers)
  33: tryCatch(code, testthat_abort_reporter = function(cnd) {    cat(conditionMessage(cnd), "\n")    NULL})
  34: with_reporter(reporters$multi, lapply(test_paths, test_one_file,     env = env, desc = desc, shuffle = shuffle, error_call = error_call))
  35: test_files_serial(test_dir = test_dir, test_package = test_package,     test_paths = test_paths, load_helpers = load_helpers, reporter = reporter,     env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     desc = desc, load_package = load_package, shuffle = shuffle,     error_call = error_call)
  36: test_files(test_dir = path, test_paths = test_paths, test_package = package,     reporter = reporter, load_helpers = load_helpers, env = env,     stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning,     load_package = load_package, parallel = parallel, shuffle = shuffle)
  37: test_dir("testthat", package = package, reporter = reporter,     ..., load_package = "installed")
  38: test_check(package = "gpboost", stop_on_failure = TRUE, stop_on_warning = FALSE)
  An irrecoverable exception occurred. R is aborting now ...