Repository navigation
CI: unblock R 4.1 and benchmark legs - #227
Open
ms609-agent wants to merge 3 commits into
Open
ms609-agent wants to merge 3 commits into
ms609-agent wants to merge 3 commits into
Conversation
The 7-leaf NNIDist() bounds test (#222) called NNIDist() on all 945 trees: 446,040 pairs through CompareAll()'s R loop, c. 80 s locally and over an hour on the R 4.1 leg, which then hit its 60-minute limit. The test now calls cpp_nni_distance() on pre-ordered edges (c. 7 s); the 6-leaf case still checks that NNIDist() agrees. benchmark and rev-dep-check ran on ubuntu-latest, now 26.04, where setup-r apt-installs ~175 packages and timed out at 15 minutes; their RSPM serves noble binaries anyway, so pin ubuntu-24.04. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
On R 4.1, ape's [[.multiPhylo (class(x) <- NULL) copies the whole list on each access. CompareAll() built two multiPhylo objects with one element per pair and indexed each once per pair, so its time grew with the square of the number of pairs: 446,040 pairs of 7-leaf trees took over 50 minutes on the R 4.1 CI leg, against c. 80 s on R 4.6, where the access does not copy. It now indexes a plain list of the trees by pair indices. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #227 +/- ##
=======================================
Coverage 97.74% 97.74%
=======================================
Files 60 60
Lines 6575 6577 +2
=======================================
+ Hits 6427 6429 +2
Misses 148 148 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Use resolute RSPM binaries rather than noble ones on a 26.04 runner. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Performance benchmark results
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two CI legs have failed on main and on every PR since 23 October.
R 4.1 leg: testthat runs past the 60-minute job limit
Root cause: a base-R copy, made quadratic by
CompareAll(). ape's[[.multiPhylostarts withclass(x) <- NULL. On R ≤ 4.3 that assignment copies the whole list on every element access; R 4.4 and later avoid the copy. Here are 2,000 calls of a plainfunction(x, i) { class(x) <- NULL; x[[i]] }on a 500k-element list, without ape:CompareAll()built twomultiPhyloobjects with one element per pair, then indexed each of them once per pair. Its time therefore grew with the square of the number of pairs. #222's 7-leaf test callsNNIDist()on all 945 trees (446,040 pairs), which took over 50 minutes on 4.1.Fix:
CompareAll()now convertsxto a plain list once and indexes it with integer pair vectors. The code is no more complex than before: it builds two integer vectors instead of two pair-length tree lists, so it also uses less memory and makes fewer S3 dispatches. On GHA,NNIDist()on the 945 trees now takes 49 s on R 4.1 and 46 s on R 4.6.The 7-leaf test also calls
cpp_nni_distance()directly, because what it checks is the bounds, not the R wrapper. It now takes about 7 s instead of about 80 s. The 6-leaf case still checks the C++ results againstNNIDist().benchmark: "Set up R" times out after 15 minutes
ubuntu-latestnow resolves to Ubuntu 26.04, where setup-r apt-installs about 175 packages from a slow mirror. The job's RSPM serves noble (24.04) binaries anyway, sobenchmarkis now pinned toubuntu-24.04.rev-dep-checkuses the same setup, so it is pinned too.Verification
test-parallel.Rfails locally in the same way with and without this change: its worker processes load an older globally installed TreeDist.🤖 Generated with Claude Code