Skip to content

TransferConsensus()#189

Merged
ms609 merged 24 commits intomainfrom
transfer-consensus
Apr 1, 2026
Merged

TransferConsensus()#189
ms609 merged 24 commits intomainfrom
transfer-consensus

Conversation

@ms609
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

This comment was marked as outdated.

* Surface headers for Linking To
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

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

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) 🟢 Faster! 8.25% 16.1 →
14.8, 14.8
ClusteringInfoDistance(tr50) ⚪ NSD -0.88% 10.6 →
10.6, 10.7
LAPJV(test2000) 🟠 Slower 🙁 -15.84% 103 →
117, 123
LAPJV(test40) 🟠 Slower 🙁 -19.73% 0.0141 →
0.0169, 0.0169
LAPJV(test400) 🟠 Slower 🙁 -6.08% 3.03 →
3.21, 3.22
MutualClusteringInfo(tr200) 🟢 Faster! 6.26% 22.6 →
20.9, 21.9
MutualClusteringInfo(tr50) ⚪ NSD -3.17% 21.9 →
21.9, 23.5
PathDist(postTrees) ⚪ NSD -1.14% 3.28 →
3.27, 3.34
PhylogeneticInfoDistance(tr200) 🟣 ~same 2.71% 232 →
225, 225
PhylogeneticInfoDistance(tr50) 🟣 ~same 2.27% 75.5 →
74, 73.7
RobinsonFoulds(tr200) ⚪ NSD 0.46% 2.67 →
2.64, 2.69
RobinsonFoulds(tr200) ⚪ NSD 2.35% 2.4 →
2.33, 2.36
RobinsonFoulds(tr50) ⚪ NSD 1.77% 4.03 →
3.95, 3.96

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

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

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD 1.26% 15.2 →
15.1, 15
ClusteringInfoDistance(tr50) ⚪ NSD 0.23% 11.4 →
11.4, 11.5
LAPJV(test2000) 🟠 Slower 🙁 -10.89% 80.6 →
87.5, 91.1
LAPJV(test40) 🟠 Slower 🙁 -16.37% 0.0146 →
0.017, 0.017
LAPJV(test400) 🟠 Slower 🙁 -8.54% 2.87 →
3.12, 3.12
MutualClusteringInfo(tr200) ⚪ NSD 1.31% 21.2 →
20.9, 21
MutualClusteringInfo(tr50) ⚪ NSD 1.74% 20.9 →
20.8, 20.3
PathDist(postTrees) 🟠 Slower 🙁 -45.07% 3.63 →
5.27, 5.27
PhylogeneticInfoDistance(tr200) 🟣 ~same 1.3% 228 →
225, 225
PhylogeneticInfoDistance(tr50) 🟣 ~same 1.81% 79 →
77.1, 78
RobinsonFoulds(tr200) ⚪ NSD -2.27% 2.81 →
2.87, 2.87
RobinsonFoulds(tr200) ⚪ NSD -2.34% 2.62 →
2.68, 2.68
RobinsonFoulds(tr50) ⚪ NSD -1.79% 4.3 →
4.35, 4.39

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

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

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD 0.59% 15.3 →
15.2, 15.3
ClusteringInfoDistance(tr50) ⚪ NSD -2.31% 11.5 →
11.5, 11.9
LAPJV(test2000) 🟠 Slower 🙁 -8.29% 84.7 →
94.6, 88.9
LAPJV(test40) 🟠 Slower 🙁 -18.11% 0.0146 →
0.0173, 0.0172
LAPJV(test400) 🟠 Slower 🙁 -8.62% 2.87 →
3.13, 3.11
MutualClusteringInfo(tr200) ⚪ NSD 0.36% 22.1 →
22.1, 22
MutualClusteringInfo(tr50) ⚪ NSD 1.51% 24.1 →
23.3, 24
PathDist(postTrees) 🟠 Slower 🙁 -52.95% 3.45 →
5.28, 5.28
PhylogeneticInfoDistance(tr200) 🟣 ~same 1.33% 230 →
227, 227
PhylogeneticInfoDistance(tr50) 🟣 ~same 1.95% 79.8 →
78.3, 78.2
RobinsonFoulds(tr200) ⚪ NSD -2.17% 2.86 →
2.92, 2.93
RobinsonFoulds(tr200) ⚪ NSD -2.83% 2.64 →
2.71, 2.72
RobinsonFoulds(tr50) ⚪ NSD -1.79% 4.39 →
4.48, 4.47

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

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

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD 0.35% 15.7 →
15.8, 15.5
ClusteringInfoDistance(tr50) ⚪ NSD -2.4% 11.9 →
12.4, 12.2
LAPJV(test2000) 🟠 Slower 🙁 -8.82% 87.4 →
95, 95.1
LAPJV(test40) 🟠 Slower 🙁 -17.63% 0.0147 →
0.0172, 0.0175
LAPJV(test400) 🟠 Slower 🙁 -8.21% 2.92 →
3.15, 3.16
MutualClusteringInfo(tr200) ⚪ NSD -0.01% 23.1 →
23, 23.1
MutualClusteringInfo(tr50) ⚪ NSD 0.14% 25 →
25, 25
PathDist(postTrees) 🟠 Slower 🙁 -50.27% 3.55 →
5.37, 5.32
PhylogeneticInfoDistance(tr200) 🟣 ~same 2.24% 234 →
231, 228
PhylogeneticInfoDistance(tr50) 🟣 ~same 1.03% 79.6 →
78.8, 78.8
RobinsonFoulds(tr200) ⚪ NSD -2.41% 2.9 →
2.96, 2.99
RobinsonFoulds(tr200) ⚪ NSD -2.44% 2.67 →
2.73, 2.74
RobinsonFoulds(tr50) ⚪ NSD -1.21% 4.49 →
4.6, 4.47

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

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

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD -1.19% 15.6 →
15.7, 16
ClusteringInfoDistance(tr50) ⚪ NSD -4.02% 11.6 →
11.8, 12.4
LAPJV(test2000) 🟠 Slower 🙁 -10.75% 89.8 →
98.2, 103
LAPJV(test40) 🟠 Slower 🙁 -21.14% 0.0153 →
0.0186, 0.0185
LAPJV(test400) 🟠 Slower 🙁 -12.62% 2.94 →
3.27, 3.35
MutualClusteringInfo(tr200) ⚪ NSD 2.78% 22.8 →
21.5, 23.5
MutualClusteringInfo(tr50) ⚪ NSD 13.44% 24.8 →
20.9, 24.7
PathDist(postTrees) 🟠 Slower 🙁 -42.46% 3.67 →
5.21, 5.25
PhylogeneticInfoDistance(tr200) ⚪ NSD 0.39% 237 →
236, 237
PhylogeneticInfoDistance(tr50) 🟣 ~same -2.09% 82.5 →
83.3, 84.3
RobinsonFoulds(tr200) ⚪ NSD 0.49% 2.98 →
2.94, 2.98
RobinsonFoulds(tr200) ⚪ NSD 0.29% 2.76 →
2.7, 2.81
RobinsonFoulds(tr50) ⚪ NSD 1.72% 4.59 →
4.47, 4.58

Slight performance win
@ms609 ms609 merged commit 8803015 into main Apr 1, 2026
20 checks passed
@ms609 ms609 deleted the transfer-consensus branch April 1, 2026 12:41
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Performance benchmark results

Call Status Change Time (ms)
ClusteringInfoDistance(tr200) ⚪ NSD -0.04% 15.3 →
15.4, 15.1
ClusteringInfoDistance(tr50) ⚪ NSD -1.97% 11.4 →
11.6, 11.5
LAPJV(test2000) ⚪ NSD 1.23% 93 →
89.8, 93.9
LAPJV(test40) ⚪ NSD -0.17% 0.0176 →
0.0177, 0.0176
LAPJV(test400) ⚪ NSD 0.42% 3.21 →
3.18, 3.22
MutualClusteringInfo(tr200) ⚪ NSD 2.67% 22 →
21.2, 21.8
MutualClusteringInfo(tr50) ⚪ NSD 0.25% 22.2 →
21.1, 24.2
PathDist(postTrees) ⚪ NSD 1.78% 3.4 →
3.39, 3.32
PhylogeneticInfoDistance(tr200) ⚪ NSD -0.38% 234 →
236, 234
PhylogeneticInfoDistance(tr50) 🟣 ~same -1.25% 80.8 →
81.2, 81.9
RobinsonFoulds(tr200) ⚪ NSD -0.12% 2.86 →
2.84, 2.87
RobinsonFoulds(tr200) ⚪ NSD -1.33% 2.61 →
2.65, 2.65
RobinsonFoulds(tr50) ⚪ NSD -1.1% 4.36 →
4.41, 4.39

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