Skip to content

Commit 0b22213

Browse files
author
Zachary DeBruine
committed
fix: address CRAN pretest issues — vignettes, Windows warnings, test skip
- Remove -Wno-ignored-attributes from Makevars.win (CRAN non-portable flag) - Remove unused n_threads variable in fit_cv.hpp (GCC -Wunused-variable) - Add default initializers in predictor.hpp (GCC -Wmaybe-uninitialized) - Skip RAM test on platforms returning 0 (Windows without windows.h) - Build tarball with vignettes (inst/doc now included) - Add .bak to .Rbuildignore
1 parent 1eeb975 commit 0b22213

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,4 @@
9797
^GuidedNMFManuscript$
9898
^NEWS\.md\.bak$
9999
^README\.md$
100+
^vignettes/.*\.bak$

inst/build_config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ cuda_version=
44
cuda_home=
55
nvcc_path=
66
gpu_arch=
7-
build_date=2026-03-14T19:31:56Z
7+
build_date=2026-03-14T20:21:49Z

inst/include/FactorNet/nmf/fit_cv.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,10 @@ ::FactorNet::NMFResult<Scalar> nmf_fit_cv(
358358
if (config.track_loss_history)
359359
result.history.reserve(config.max_iter);
360360

361-
const int n_threads = config.threads > 0 ? config.threads : 1;
362361
#ifdef _OPENMP
363362
const int actual_threads = config.threads > 0
364363
? config.threads
365364
: omp_get_max_threads();
366-
#else
367-
(void)n_threads;
368365
#endif
369366

370367
// ------------------------------------------------------------------

inst/include/streampress/model/predictor.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ namespace streampress {
3131
// The residual (actual_gap - predicted) has lower variance than raw gaps.
3232
// ============================================================================
3333
struct DensityModel {
34-
uint32_t n_blocks;
35-
uint32_t block_size;
34+
uint32_t n_blocks = 0;
35+
uint32_t block_size = 1;
3636
std::vector<uint16_t> block_density_q; // Quantized density × 65535
3737

3838
// Build from row nnz statistics
@@ -114,7 +114,7 @@ struct DensityModel {
114114
// ============================================================================
115115
struct ValuePredictor {
116116
std::vector<uint16_t> row_mean_q; // Quantized row means × 256
117-
double global_col_mean; // Mean col_nnz
117+
double global_col_mean = 1.0; // Mean col_nnz
118118

119119
void build(const MatrixStats& stats) {
120120
row_mean_q.resize(stats.m);

src/Makevars.win

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
PKG_CPPFLAGS = -I../inst/include/
22
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
33

4-
## Compiler flags for maximum performance
4+
## Compiler flags
55
## -Wa,-mbig-obj: Allow large object files (needed for heavily templated Eigen code on Windows)
6-
## -Wno-ignored-attributes: Suppress harmless Eigen SSE/AVX type-attribute warnings
7-
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DEIGEN_INITIALIZE_MATRICES_BY_ZERO -DEIGEN_NO_DEBUG -DSPARSEPRESS_USE_R -DFACTORNET_USE_R -Wa,-mbig-obj -Wno-ignored-attributes
6+
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DEIGEN_INITIALIZE_MATRICES_BY_ZERO -DEIGEN_NO_DEBUG -DSPARSEPRESS_USE_R -DFACTORNET_USE_R -Wa,-mbig-obj

tests/testthat/test_streampress_compat.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ test_that("auto-dispatch selects IN_CORE_CPU for small files", {
7878
expect_false(mode_info$streaming)
7979
})
8080

81-
test_that("Rcpp_get_available_ram_mb returns positive value", {
81+
test_that("Rcpp_get_available_ram_mb returns non-negative value", {
8282
ram <- RcppML:::Rcpp_get_available_ram_mb()
83+
# On platforms without /proc/meminfo or Win32 API (e.g. Windows builds
84+
# that avoid <windows.h>), RAM detection returns 0 — not an error.
85+
if (ram == 0) skip("RAM detection not available on this platform")
8386
expect_gt(ram, 0)
8487
})

0 commit comments

Comments
 (0)