P * L_child under the row-generator
convention. Impossible parent states with zero posterior and zero
contribution send zero messages. Shared ACE fitting, transition
matrices, normalization and Delta MCMC kernels are reused.fast_hetero() clade selection, coverage,
trait-wise missing values, local/overall summaries and separate
signal/reference tests. K uses a BM reference; lambda uses an
approximate common-local-lambda Gaussian reference. D’s
count-conditioned ER test remains experimental. Delta is recommended for
local/overall description and MCMC diagnostics; its explicit
experimental heterogeneity options remain available.min_tips continues to enforce the observed-species
threshold. Automatic selection retains ordered size bounds and all
node/memory safety checks.statistic = "between_clades" tests
SD(log(local Delta)), reusing the existing native dispersion kernel.
Whole-tree Delta, local/global descriptions and all estimator/MCMC
calculations are still retained.nuisance_control$proposal_counts = TRUE mixes
the old proposal bank with a fixed count-universal sequential proposal
at equal total weights. Simulation and outward density evaluation share
their actual CDF kernel; no observed counts, fitted proposal or lgamma
density approximation is used. Existing Mk, mixture, likelihood and
continuous-domain bound kernels are reused.delta_control$reference_fit="multistart"
improves the search for common ARD Q with deterministic starts and
continuation of nlminb, reusing one prepared ACE objective. Attempts and
deviance gains remain visible; the best nonconverged fit is never
relabelled as converged. Observed Delta is unchanged.reference_unavailable="conservative" counts single-state
reference discrepancies in the upper tail without assigning Delta
values, dropping or replacing draws. Actual computation errors still
make P unavailable. Default nlminb and strict rules remain; neither
option corrects plug-in fitting bias.nsim_fit_warning column
now mirrors nsim_optimizer_warning.delta_control = list(model="ER", reference_fit="profile").
It reuses ACE prepared scratch, analytic ER transitions and the lambda
Brent implementation, compares zero/independent endpoints, and reports
fit diagnostics. Default nlminb fits, observed Delta estimators and
their RNG contract remain unchanged. The alternative changes reference Q
and probabilities; calibration remains exploratory. Infinite ER rates
use exact independent-state transitions.ACE fits now combine the exact repeated-length exponent cache with bounded parallel batches for uncached branches. A compact immutable worklist avoids computing cached exponents again and enables large mixed-length fits; the threshold depends on uncached work rather than total tree size. Batch widths may be odd, avoiding a separate parallel region for one leftover branch. Fully cached and small workloads keep their serial path. Pruning, optimizer and RNG order remain unchanged.
Large ACE likelihood-only fits with distinct branch lengths now
evaluate independent complex exponent vectors in bounded 2 MiB OpenMP
batches, using the existing ACE expression and serial pruning/reduction
order. The default uses at most two threads;
options(fastphylosig.ace_threads = 1L) selects serial
execution. Small fits and builds without OpenMP retain the serial path;
Delta PSOCK workers use serial inner fits. Full objective trajectories,
Delta outputs and RNG streams are checked against the preceding
development build.
Delta now uses a native V2 canonical graph/UTF-8 byte ordering path while retaining source IDs, descriptors and attributes. Rate fits reuse a private ACE workspace, transform repeated tip states once per objective, and cache exponent vectors for exactly equal branch lengths with bounded storage. MCMC caches accepted-state log-gamma values. The optimizer, floating-point expression order and random draw order are unchanged; strict result/trace/RNG checks accompany the optimization.
K crown signal tests now call the production C++ permutation kernel on the scan’s compiled NA-mask groups, removing repeated tree preparation. Automatic cuts jump whole selected/undersized traversal intervals and reserve extraction buffers. The shared ACE preflight uses the native topology validator; its ancestral downpass lazily evaluates repeated row normalizations, including floating-point fixed points/two-cycles, instead of scanning the entire matrix after every sibling pair. Paired checks retain estimates, tests and RNG streams.
Local K/lambda signal tests now respect crown eligibility
(min_tips and estimator status). Lambda returns local LRT
probabilities in the first scan, avoiding a second fit. Delta tests
reuse scan NA/ACE contexts and shuffle crown-sized vectors without
unused permutation trace diagnostics. Shared C++ reference summaries now
use the same plus-one Monte Carlo error for all methods; Mk simulation
pools exactly equal branch lengths to reduce cache memory and transition
preparation. Estimators and RNG order are retained.
Added multistate Delta to fast_hetero(), reusing ACE
likelihood workspaces, native entropy/MCMC and diagnostics.
Local/overall contrasts, categorical state counts/frequencies and
optional local signal tests accompany tree maps.
Added an optional new common-Mk reference check of RMS local/overall log Delta deviations, with native cached full-tree simulation, uniform-root likelihoods integrating NA tips, complete replicate accounting and fitted reference metadata. This tests signal deviations, not rate shifts; broad statistical calibration remains future work. Descriptive scans remain the default. Single-state crowns and failed replicates produce explicit status.
Tree plots use log Delta and reverse the default D palette so stronger signal has a consistent colour direction. D local signal tests reuse its normalization simulations without additional RNG draws.
Shared prepared D contrast factors across the public scalar/batch engines and heterogeneity; removed repeated branch adjustments and duplicate traversals. Batch columns use one OpenMP region and smaller scratch buffers.
Reused lambda likelihood scratch buffers in the specialist optimizer and heterogeneity bootstrap. D reuses conditional-likelihood/count workspaces, fitted transitions and sampling buffers; both bootstraps reuse branch standard deviations while retaining their existing RNG order.
Added lambda heterogeneity calibration with a fitted shared-lambda Gaussian reference and binary D scans/calibration with a conditional shared-rate ER reference. Both bootstrap engines run in C++ without dense covariances.
Added P_heterogeneity, Monte Carlo error, reference
summaries and fitted common parameters. K retains its P_BM
fields as compatible aliases.
D preserves each crown’s observed state count using polynomial
pruning and downward conditional sampling, reusing random/Brownian
normalization (d_nsim) and count probabilities across
draws. Plots distinguish overall D signal probabilities from ER
heterogeneity.
Named the heterogeneity API fast_hetero(); the
earlier development name has been removed.
Added optional complete-tree K/lambda estimates and signal tests
through overall/overall_test, reusing the
existing native engines. Plots annotate the complete-tree signal test
separately from the K BM dispersion test.
Added plot(h, tree = tree) to colour crown-clade
K/lambda estimates on the phylogeny, with source-node labels,
logarithmic K colours, grey unavailable regions, and deepest-crown
precedence for nested selections. Tree annotation uses a linear native
traversal and checks selected descendant identities.
Added fast_hetero() for continuous-trait K/lambda
scans on explicit crown clades or automatic disjoint clades with bounded
sizes. Reports original node identities, per-trait missingness/failures
and coverage.
Added an optional K dispersion calibration against Brownian motion, preserving local topology and missingness, using chunked tree simulations and the existing compiled K engine without dense covariance matrices. BM reference envelopes and the upper-tail probability have explicit model interpretations; nested scans remain descriptive.
Added print/plot methods, dense numerical and simulation oracles, and a Chinese guide separating signal heterogeneity from PVR prediction quality.
Accelerated clade scans with a lightweight checked tree path, grouped missing-data kernels and reuse of compiled crown subtrees. BM branch propagation now runs in C++, preserving R’s random draws and chunk semantics.
Moved clade indexing, selection, extraction, exact NA-mask grouping and batch signal orchestration into C++. Fused BM generation, prepared K evaluation and dispersion calibration retain serial R RNG ordering, reuse K factors/workspaces and cap dominant block buffers at 64 MiB. NA pruning retains ape’s established crown/root/unary behavior.
Removed obsolete native/R heterogeneity entry points, keeping independent reference implementations in test helpers. Removed unused K workspaces and duplicate shape checks, and omitted unused BM fit diagnostics. Complete-data scans defer loading ape.
tip.label,
Nnode, edge, and edge.length. A
package-owned protected record is checked before cached evidence or a
numerical kernel can be used.saveRDS()/readRDS() reuse across R sessions.
Missing, legacy, or unknown context schemas are rejected with an
instruction to run prepare_tree() again.fast_signal(tree, data, method, ...) dispatcher for K,
lambda, D, and Delta, with public fast_k() and
fast_lambda().fast_d(), fast_delta(), and
fast_ace() as specialist entry points; methods are never
inferred from trait values and no public numerical-engine selector was
added.match_tree_data() the documented matching API and
retained match_phylo_data() only as a deprecated
compatibility alias.status,
message, and note output for non-finite,
insufficient, single-state, constant, and undefined traits.fast_delta() implements a single-tree
statistic with local ACE and RNG paths. Cross-language parity and the
multiple-tree extension are outside the package contract.mcmc_sim = 10000,
thin = 10, and burn = 100. Added one
aggregated retained-sample warning and one aggregated ESS/R-hat/ MCSE
warning per batch; warnings do not rerun or lengthen chains.fast_ace() still computes
and returns standard errors.x/X inputs now fail for D and Delta, ACE
rejects invalid method values clearly, and unused Delta
nsim input is ignored when test = FALSE.
Prepared-tree fingerprint validation now also covers Nnode;
targeted regressions and the full local check were rerun without
changing numerical kernels.check_tree() for read-only, method-specific
readiness checks for K, lambda, D, and Delta. Diagnostics distinguish
global tree defects from the topology and branch-length contracts of
individual statistics.resolve_tree(). It standardizes edge
order and internal node numbering, rechecks the result, records
provenance, and refuses unsafe repairs such as random polytomy
resolution, branch jitter, or tip deletion.progress messages and stable
elapsed-time metadata to fast_signal(),
fast_d(), fast_delta(), and
fast_ace().prepare_tree() now compiles O(n) topology and traversal
data eagerly while creating VCV, Cholesky, and lambda spectral payloads
only on demand.cache_info().engine = "tree" for O(n p) observed
Blomberg K and engine = "validate" for explicit
tree-versus-dense comparisons.chunk_size and keep_null.