Skip to content

TransferConsensus()#189

Open
ms609 wants to merge 17 commits intomainfrom
transfer-consensus
Open

TransferConsensus()#189
ms609 wants to merge 17 commits intomainfrom
transfer-consensus

Conversation

@ms609
Copy link
Owner

@ms609 ms609 commented Mar 19, 2026

  • Initial R-side prototype from Takazawa et al. 2026

Repository owner deleted a comment from github-actions bot Mar 20, 2026
@codecov

This comment was marked as outdated.

@github-actions
Copy link

github-actions bot commented Mar 20, 2026

⚠️ This benchmark result is outdated. See the latest comment below.

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD -1.47% 15.1 →
15.4, 15.3
ClusteringInfoDistance(tr50) ⚪ NSD 1.13% 11.6 →
11.5, 11.5
LAPJV(test2000) 🟠 Slower 🙁 -7.6% 86.3 →
91.3, 93.6
LAPJV(test40) ⚪ NSD 0.88% 0.0148 →
0.0147, 0.0146
LAPJV(test400) 🟠 Slower 🙁 -7.34% 2.86 →
3.08, 3.07
MutualClusteringInfo(tr200) ⚪ NSD 2.75% 23 →
22.4, 22.3
MutualClusteringInfo(tr50) ⚪ NSD 3.17% 24.4 →
23.3, 23.8
PathDist(postTrees) ⚪ NSD 4.72% 3.5 →
3.34, 3.34
PhylogeneticInfoDistance(tr200) ⚪ NSD -0.13% 229 →
230, 229
PhylogeneticInfoDistance(tr50) 🟣 ~same 1.64% 79.4 →
78.4, 77.9
RobinsonFoulds(tr200) ⚪ NSD 1.84% 2.89 →
2.83, 2.83
RobinsonFoulds(tr200) ⚪ NSD 2.99% 2.68 →
2.6, 2.61
RobinsonFoulds(tr50) ⚪ NSD 2.17% 4.43 →
4.32, 4.34

@github-actions
Copy link

github-actions bot commented Mar 20, 2026

⚠️ This benchmark result is outdated. See the latest comment below.

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD 1.34% 15.3 →
15.1, 15.2
ClusteringInfoDistance(tr50) ⚪ NSD -1.94% 11.3 →
11.5, 11.6
LAPJV(test2000) 🟠 Slower 🙁 -6.2% 82 →
86.4, 88
LAPJV(test40) ⚪ NSD -0.41% 0.0146 →
0.0146, 0.0146
LAPJV(test400) 🟠 Slower 🙁 -7.33% 2.86 →
3.06, 3.07
MutualClusteringInfo(tr200) ⚪ NSD -0.49% 21.4 →
21.7, 21.3
MutualClusteringInfo(tr50) ⚪ NSD -0.55% 21.3 →
21.5, 21.2
PathDist(postTrees) ⚪ NSD 4.18% 3.48 →
3.33, 3.35
PhylogeneticInfoDistance(tr200) ⚪ NSD -0.04% 228 →
228, 229
PhylogeneticInfoDistance(tr50) 🟣 ~same 1.59% 78.8 →
77.5, 77.7
RobinsonFoulds(tr200) ⚪ NSD 1.8% 2.84 →
2.78, 2.79
RobinsonFoulds(tr200) ⚪ NSD 2.37% 2.64 →
2.57, 2.58
RobinsonFoulds(tr50) ⚪ NSD 1.85% 4.37 →
4.3, 4.28

@ms609 ms609 marked this pull request as ready for review March 20, 2026 15:20
@github-actions
Copy link

github-actions bot commented Mar 20, 2026

⚠️ This benchmark result is outdated. See the latest comment below.

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) 🟢 Faster! 7.3% 16 →
14.9, 14.8
ClusteringInfoDistance(tr50) ⚪ NSD -4.56% 10.4 →
11.1, 10.6
LAPJV(test2000) 🟠 Slower 🙁 -4.73% 101 →
104, 107
LAPJV(test40) ⚪ NSD -2.19% 0.0141 →
0.0144, 0.0144
LAPJV(test400) 🟠 Slower 🙁 -5.76% 3.03 →
3.2, 3.21
MutualClusteringInfo(tr200) 🟢 Faster! 7.04% 22.5 →
21.2, 20.8
MutualClusteringInfo(tr50) ⚪ NSD -5.39% 20.7 →
21.8, 21.7
PathDist(postTrees) ⚪ NSD -0.18% 3.27 →
3.3, 3.27
PhylogeneticInfoDistance(tr200) 🟣 ~same 1.89% 231 →
226, 226
PhylogeneticInfoDistance(tr50) ⚪ NSD -0.35% 75.2 →
76.1, 75
RobinsonFoulds(tr200) ⚪ NSD -0.58% 2.68 →
2.71, 2.68
RobinsonFoulds(tr200) ⚪ NSD -1.46% 2.39 →
2.43, 2.41
RobinsonFoulds(tr50) ⚪ NSD -1.61% 4.03 →
4.15, 4.07

@github-actions
Copy link

github-actions bot commented Mar 20, 2026

⚠️ This benchmark result is outdated. See the latest comment below.

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD 0.33% 15.3 →
15.3, 15.3
ClusteringInfoDistance(tr50) ⚪ NSD 1.22% 11.7 →
11.6, 11.4
LAPJV(test2000) ⚪ NSD -0.01% 84 →
83.1, 84.4
LAPJV(test40) ⚪ NSD -3.02% 0.0146 →
0.0151, 0.015
LAPJV(test400) ⚪ NSD 0.11% 2.89 →
2.87, 2.9
MutualClusteringInfo(tr200) ⚪ NSD -1.17% 22.1 →
22.4, 22.3
MutualClusteringInfo(tr50) ⚪ NSD -0.57% 23 →
23.1, 23.3
PathDist(postTrees) ⚪ NSD 2.09% 3.53 →
3.45, 3.46
PhylogeneticInfoDistance(tr200) 🟣 ~same 0.18% 229 →
228, 228
PhylogeneticInfoDistance(tr50) ⚪ NSD 0.53% 80.2 →
80.4, 79
RobinsonFoulds(tr200) ⚪ NSD 1.91% 2.88 →
2.82, 2.82
RobinsonFoulds(tr200) ⚪ NSD 3.43% 2.68 →
2.59, 2.6
RobinsonFoulds(tr50) ⚪ NSD 3.53% 4.49 →
4.34, 4.32

ms609 added 7 commits March 20, 2026 16:46
Exported functions (thin wrappers) use Rcpp::stop() for input
validation — the exception is caught immediately by BEGIN_RCPP/END_RCPP
in the generated RcppExports wrapper.

Implementation functions retain Rf_error() for defensive guards that
should never be reached if wrappers validate correctly (LCOV_EXCL,

This pattern avoids C++ exception unwinding through complex stack frames,
which can cause std::terminate() on ARM.

Revert "Rf_error →Rcpp:stop()"

This reverts commit b20e03e.

Test R-level guards instead of C++ error paths (ARM safety)
These guards are unreachable when exported wrappers validate correctly.
ASSERT() is active in debug builds and compiles to nothing in release.
Rcpp::stop() causes std::terminate() on ARM regardless of call depth.
All input validation now happens in R wrappers before entering C++.
C++ functions use ASSERT() for debug-only invariant checks.

Tests updated to exercise R-level guards instead of calling C++ with
deliberately invalid input.
Commit 87e6cd8 removed Rcpp::stop() from C++ and replaced with
ASSERT() (compiled out in release). Tests still expected errors from
C++ calls. This commit:

- mismatch_size(), confusion(): Add R validation wrappers (nTip,
  nrow checks) shadowing RcppExports versions
- consensus_info(): Add R wrapper checking p range and CT_MAX_LEAVES
  (16383) limit
- HierarchicalMutualInfo(): Check tip count mismatch for phylo inputs
- test-hmi.cpp.R: Test EHMI() R guards instead of EHMI_xptr()
- test-tree_distance.R: Replace direct cpp_* error tests with
  .ValidateSplitArgs test (R-level validation path)

Fixes all 19 test failures from GHA.
@github-actions
Copy link

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD 1.86% 15.4 →
15.2, 15.1
ClusteringInfoDistance(tr50) ⚪ NSD -1.27% 11.3 →
11.5, 11.4
LAPJV(test2000) ⚪ NSD 2.56% 84.2 →
81.4, 84.9
LAPJV(test40) ⚪ NSD -0.77% 0.0144 →
0.0145, 0.0145
LAPJV(test400) ⚪ NSD 0.6% 2.89 →
2.87, 2.88
MutualClusteringInfo(tr200) ⚪ NSD 3.45% 22.1 →
21.1, 21.8
MutualClusteringInfo(tr50) 🟢 Faster! 7.4% 23.7 →
22, 22
PathDist(postTrees) ⚪ NSD -0.81% 3.46 →
3.48, 3.47
PhylogeneticInfoDistance(tr200) 🟠 Slower 🙁 -4.71% 229 →
239, 241
PhylogeneticInfoDistance(tr50) 🟣 ~same 2.67% 79.8 →
77.8, 77.5
RobinsonFoulds(tr200) ⚪ NSD 1.34% 2.86 →
2.81, 2.83
RobinsonFoulds(tr200) ⚪ NSD 2.59% 2.65 →
2.58, 2.58
RobinsonFoulds(tr50) ⚪ NSD 0.88% 4.36 →
4.3, 4.33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant