n_workers = 1 per process for
parallel execution across series. Existing fork warnings now clarify
that reducing the thread count cannot undo inherited library state and
does not guarantee safe fork-based execution.mstomp):
Added native high-performance C++ engine (mstomp_rcpp) with
multi-threading via RcppThread, properly sorting
must/exclusion dimensions, and fixing historical edge cases where must
dimensions could be omitted from accumulated distances. Delivers ~197x
speedup over legacy pure R execution.na_strategy & na.rm):
Implemented complete missing/non-finite value support across
mov_mean(), mov_sum(), mov_var(),
mov_std(), mov_min(), mov_max(),
movmean_std(), and muinvn() with explicit
na_strategy = c("window_na", "remove", "error") and
standard na.rm argument compatibility. Default
"window_na" returns NA_real_ strictly for
windows intersecting non-finite values without corrupting adjacent valid
windows or stopping execution.mass):
Extended multi-threading via RcppThread to all MASS
variants (v2, weighted,
non_normalized, absolute) in
mass() and C++ backend (mass2_rcpp,
mass_weighted_rcpp, mass_absolute_rcpp),
matching mass3_rcpp_parallel with identical numerical
output.mpdist_vect_rcpp and
mpdist_simple_rcpp) with multi-threaded parallel execution
via RcppThread.std::nth_element, replacing expensive R matrix and data
frame allocations and providing massive speedups (over 10x-100x).mpdist() API: Exported
mpdist(ref_data, query_data, window_size, type = c("simple", "vector"), thr = 0.05, n_workers = 1)
in R with dedicated unit test suite.inst/cuda/rfcp_gpu_poc.cu.rfcp_top_k() via query_block_size, dividing
long query streams into bounded blocks while preserving exact numeric
equivalence to monolithic execution.progress_callback reporting structured events
("round_start", "block_done",
"round_done") with execution timings and local block/Plato
metrics.checkpoint_callback and resume_state,
supporting idempotent recovery from both intra-round (query block) and
inter-round (Plato) interruptions.adaptive_max_freq support to
rfcp_top_k(), dynamically rescaling subsequent frequencies
based on observed Plato support (count of positive self-join neighbors
with distance below \(\sqrt{2 \cdot
\text{window\_size}}\)) with configurable min_freq
floor.rfcp_top_k(), an iterative Top-K Plato discovery
function for Relative Frequency Contrast Profiles (RFCP) that uncovers
multiple distinct contrasting patterns between a positive and negative
time series.[start - exclusion_radius, start + window_size - 1 + exclusion_radius])
and fusing overlapping intervals with NA barriers to
prevent boundary artifacts.max_freq specification across
Plato iterations via vectors
(e.g. max_freq = c(10, 3)).rfcp(..., backend = "cuda"), with full support for finite
and NA-barrier series, query subsetting, and full-profile matrix
extraction (return_profiles = TRUE).cub::DeviceSegmentedRadixSort and a
specialized CUDA exclusion kernel, eliminating PCIe bandwidth
bottlenecks and delivering up to 55x speedup over CPU-sorting GPU
baselines and over 12x speedup compared to single-threaded CPU
execution.inst/cuda/ and linked conditionally
via MATRIXPROFILER_ENABLE_CUDA, preserving standard
CUDA-free CRAN compatibility.mpx(..., backend = "cuda"), including finite and
NA-aware inputs.inst/cuda/ while preserving the default CUDA-free CRAN
build.query_begin, derives the tile size from
the query count and effective worker count, and reports
query_rows_per_task, n_tasks, and
effective_workers for diagnostics while preserving the
public rfcp() API.Added rfcp(), an exact parallel NA-aware Relative
Frequency Contrast Profile implementation with deterministic greedy
non-overlapping neighbor ranks, fixed-frequency RMSC semantics,
restartable positive-query blocks, and an allocation-guarded
full-profile validation mode.
Added the fused native
rfcp_na_segmented_native_rcpp_parallel() kernel, which
shares rolling normalization across AA and AB computations, initializes
large blocks with a MASS-style FFT convolution, advances subsequent
distance profiles with a STOMP-style covariance recurrence, respects
non-finite barriers and non-normalizable windows, and avoids
materializing the pairwise distance matrix.
Added independently selectable native finite-block segmentation
for NA-aware MPX self-joins and AB-joins through
na_strategy = "segmented_native" in mpx(),
while retaining the monolithic implementation as the default.
Added native diagonal-tile sampling for
s_size < 1, with explicit partial results
and adaptive tile subdivision based on the configured parallel thread
count.
Added global-coordinate reduction of native segmented profiles and indices, including cross-segment AB comparisons and exclusion-zone handling for AA joins.
Optimized native segmented scheduling for highly unbalanced segment lengths, added cache-bounded rectangular blocks for exact AA joins, and allowed it to mask constant or otherwise non-normalizable windows without reverting to the monolithic NA-aware kernel.
Set the native exact-AA block default to 8,192 windows and
documented MATRIXPROFILER_NATIVE_AA_BLOCK_SIZE for
cache-tuning large parallel NA-aware self-joins without changing the
public mpx() API.
Validated the native segmented implementation on the full
fixture: exact AA and AB runs completed with
partial = FALSE, identical validity masks, and substantial
wall-time reductions compared with the previous native and monolithic
NA-aware paths.
Added regression and stress coverage against the monolithic NA-aware MPX implementation and STAMP for non-finite barriers, one-window segments, distance, correlation, and sampled computations.
Clarified the MPX s_size semantics: values below
1 retain randomized anytime sampling, while
s_size = 1 processes all diagonals in monotone order and
may yield a less representative partial result if interrupted.
Added a numerically guarded finite fast path for NA-aware MPX and MPXAB, preserving the stable normalization path for constant or large-offset windows.
Reused parallel AB/BA worker scratch buffers per executor thread and limited mutex merges to ranges touched by each task.
Avoided allocating and writing profile-index vectors in parallel
self- and AB-joins when idxs = FALSE.
Added an opt-in AB/BA worker profiler with per-task counts for pairs, invalid blocks, scratch resets, merges, mutex wait, and observed threads.
Added a conservative native restart path that skips dense invalid blocks in parallel NA-aware AB/BA joins while preserving the original recurrence for sparse barriers.
Kept complete NA-aware AB/BA joins in monotone diagonal order to reduce parallel scratch resets and merges; sampled joins retain randomized work order.
Added reproducible fixture benchmarks and a persistent optimization workplan for NA-aware segmentation and parallel reductions.
SIGFPE crashes in parallel STOMP and MPX for
computations with fewer than 100 query windows or diagonals.left_right_profile native argument.s_size and added validation
for values outside the [0, 1] interval.mpx_na_rcpp() implementation, which
excludes windows containing NA, NaN, or
infinite samples while allowing later valid windows to recover, and
optimized its quadratic kernel to avoid costly Rcpp proxy accesses.mpx_na_rcpp_parallel() with the same missing-data
semantics as the serial implementation and support for partial
computations through s_size; its worker kernel uses direct
contiguous storage without R API calls.mpxab_na_rcpp() AB-join for
independently masking non-finite windows in both input series, with
direct storage access in its quadratic kernel.mpxab_na_rcpp_parallel() with matching
bidirectional masks and partial-computation behavior, using direct
contiguous storage inside its workers.mpx() to route self-joins and AB-joins
automatically to the serial or parallel missing-data implementation
whenever either input contains NA, NaN, or
infinite values.s_size, and calling unsafe R APIs from
worker threads.s_size; its diagonal
computation now shares the validated NA-aware MPX recurrence while
serial PRE-SCRIMP still seeds sampled distance profiles.s_size in the R-to-C++ call, rejecting unequal input
lengths, and failing to mask non-finite windows independently in both
series.Rcpp as specified by the PR #15 from Dirk @eddelbuetteltsmp.