Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
660 commits
Select commit Hold shift + click to select a range
a961fdf
chore: add T-269 fine-grained sectorial interleaving benchmark (P3)
ms609 Mar 27, 2026
4c756c8
fix: include <climits> for INT_MAX on Linux/ARM
ms609 Mar 27, 2026
4b27602
docs: regenerate SearchControl.Rd with pruneReinsert params
ms609 Mar 27, 2026
88ad4b5
chore: T-266 GHA run 3 after climits + Rd fixes (Agent A)
ms609 Mar 27, 2026
24bc323
chore: park T-150 — SPIC added (E), GHA 23636944848
ms609 Mar 27, 2026
d46302e
chore: S-COORD round 30
ms609 Mar 27, 2026
bdada25
chore: agent-A T-266 PR #235 opened; T-267 deleted (completed)
ms609 Mar 27, 2026
3dec740
chore: S-COORD round 31 — T-150 GHA failure, T-270/T-272 filed
ms609 Mar 27, 2026
d8f3c76
docs(T-270): vignette + AGENTS.md for post-ratchet sectorial (T-257)
ms609 Mar 27, 2026
540dda6
chore: T-270 complete (vignette + AGENTS.md docs)
ms609 Mar 27, 2026
d190205
chore: agent-A log T-270 done
ms609 Mar 27, 2026
ed5b351
Merge remote-tracking branch 'origin/cpp-search' into feature/prune-r…
ms609 Mar 27, 2026
42ae8a5
chore: S-PR round 31 — rebased #235/#216, closed #178 (T-272), noted …
ms609 Mar 27, 2026
7cff787
fix: precompute_profile_delta old_cost capping beyond info_max_steps …
ms609 Mar 27, 2026
6a3afcb
chore: S-RED focus 10 complete — profile delta fix logged
ms609 Mar 27, 2026
48c8b11
chore: agent-A log — S-RED focus 10, S-PR, T-270 complete
ms609 Mar 27, 2026
838b14c
chore(T-268): branch housekeeping — prune 11 stale local branches, up…
ms609 Mar 27, 2026
48af269
chore: T-268 done — remove from to-do, update agent-F log, completed-…
ms609 Mar 27, 2026
26c2406
chore: S-PR (T-204 GHA failure noted) + S-RED focus 1 (Fitch, AVX2, X…
ms609 Mar 27, 2026
de80d18
chore(T-252): add t252_v2.sh — fix lib paths (use lib-baseline for de…
ms609 Mar 27, 2026
8a0d3a9
chore: T-252 PARKED (SLURM 16599543) — t252_v2.sh submitted, fixed li…
ms609 Mar 27, 2026
addc46a
chore: S-RED focus 2 complete (F) — T-263 snapshot hoisting verified,…
ms609 Mar 27, 2026
2d902e9
chore: S-COORD round 32 (F) — T-273 filed, agent status updated, T-25…
ms609 Mar 27, 2026
de9e521
fix: add 'warmup' and 'config' to WORDLIST (CI spelling check R 4.1)
ms609 Mar 27, 2026
3221765
chore: T-204 re-dispatched (timing issue), T-266 spelling fix + re-di…
ms609 Mar 27, 2026
c91b00d
Merge pull request #235 from ms609/feature/prune-reinsert
ms609 Mar 27, 2026
c737fbe
chore: commit S-RED focus 2 notes to red-team.md; update settings.jso…
ms609 Mar 27, 2026
c4366f7
chore: T-266 complete; T-204 GHA redispatch (23643078732)
ms609 Mar 27, 2026
1ae972f
chore: claim T-273 (F), S-PR round 32 — PR branches updated from cpp-…
ms609 Mar 27, 2026
4454748
fix(T-273): sync flat_blocks.active_mask during ratchet perturbation
ms609 Mar 27, 2026
4e167a9
chore: T-273 complete (F) — flat_blocks sync, to-do/completed/agent-F…
ms609 Mar 27, 2026
8c53ba6
chore: S-PROF round 6 — NNI-perturb bottleneck at 75t (T-274 filed)
ms609 Mar 27, 2026
e1a34ab
chore: triage u.571 → T-274 (convergence summary in MaximizeParsimony…
ms609 Mar 27, 2026
ded9897
fix(T-275): block prune-reinsert for non-EW scoring modes
ms609 Mar 27, 2026
e219503
feat(T-277): ScoreSpectrum() Chao1 landscape coverage estimator
ms609 Mar 27, 2026
eabba8f
chore: T-277 GHA 23644927459 dispatched (B)
ms609 Mar 27, 2026
1905a98
chore: S-PR round 34 — fix T-150 GHA (Consensus case), claim T-274; u…
ms609 Mar 27, 2026
e6ad6e3
docs: generate ScoreSpectrum.Rd, add Chao to WORDLIST
ms609 Mar 27, 2026
3399b1e
chore: T-277 re-dispatched GHA 23645787062 (docs fix)
ms609 Mar 27, 2026
2bd9c64
chore: agent-B GHA run ID updated
ms609 Mar 27, 2026
fd98597
fix(T-274): set nniPerturbCycles=0 in thorough preset — 59-69% overhe…
ms609 Mar 27, 2026
9a08a07
chore: S-PR round 35 — T-204 deprecation warn fix (41ae291a), T-150 i…
ms609 Mar 27, 2026
40f760d
test: fix off-by-one in ScoreSpectrum NA-stripping test
ms609 Mar 27, 2026
13cc1ce
chore: T-277 re-dispatched GHA 23646841244 (test fix)
ms609 Mar 27, 2026
c0738b9
chore: S-PR round 36 — T-150 vignette Consensus fix (23d93f2e), re-di…
ms609 Mar 27, 2026
e1d0b1b
fix(driven): perturb-stop counter not reset on fuse improvement; add …
ms609 Mar 27, 2026
89678e9
chore: S-PR round 37 — T-204 test-Morphy.R fix (42051335), re-dispatc…
ms609 Mar 27, 2026
7f4aca2
feat(T-276): print convergence summary after MaximizeParsimony()
ms609 Mar 27, 2026
17c1fbd
chore: T-276 complete; update agent-F.md and completed-tasks
ms609 Mar 27, 2026
6ac6e5e
chore: B — T-277 GHA pass, PR #236 opened; agent-B IDLE
ms609 Mar 27, 2026
8ebc5ce
Merge pull request #236 from ms609/feature/score-spectrum
ms609 Mar 27, 2026
d7b89c7
fix(ci): pre-install rlang from GitHub to bypass PREXPR removal in R-…
ms609 Mar 27, 2026
28ea288
Merge remote-tracking branch 'origin/cpp-search' into cpp-search
ms609 Mar 27, 2026
ae3f4ab
chore: T-252 complete; update T-150/T-204 GHA IDs; add benchmark CSVs
ms609 Mar 27, 2026
1a640b7
fix: initialize and set result.perturb_stop in parallel driven search
ms609 Mar 27, 2026
faa7233
chore: S-RED focus 5 complete (ts_parallel.cpp perturb_stop bug)
ms609 Mar 27, 2026
05261c3
fix(ci): patch rlang-types.h PREXPR→R_PromiseExpr for R-devel ASAN co…
ms609 Mar 27, 2026
d05638e
chore: T-253 complete — gap characterization by dataset features
ms609 Mar 27, 2026
02ff61c
chore: S-COORD round 35 + agent-F update (T-253 done, T-150 WORDLIST …
ms609 Mar 27, 2026
8ab23af
fix(ci): ASAN continue-on-error for rlang PREXPR upstream blocker; up…
ms609 Mar 27, 2026
f2fa165
chore: S-PR round 38 + S-COORD round 34; E-001 done; T-204 failure noted
ms609 Mar 27, 2026
5f01db5
chore: S-RED focus 6 (ts_tbr.cpp) — T-278 filed; T-204 re-parked GHA …
ms609 Mar 27, 2026
74be77e
chore: fix duplicate Bugs section in to-do.md
ms609 Mar 27, 2026
b129d99
chore: T-150 vignette fix → new GHA 23650002703; agent-F update
ms609 Mar 27, 2026
e85ec84
fix: update_constraint after drift suboptimal-move rejection (T-279)
ms609 Mar 27, 2026
df3aa71
fix(tbr): re-sync constraint metadata after rejected constrained move…
ms609 Mar 27, 2026
c30130d
chore: S-RED focus 8 (ts_drift.cpp) — T-279 filed+fixed; agent-F update
ms609 Mar 27, 2026
7d45150
chore: T-278 done; update to-do, completed-tasks, agent-e; GHA 236503…
ms609 Mar 27, 2026
1b51ff1
chore: S-RED focus 9 (ts_fuse.cpp) — no bugs; agent-F update
ms609 Mar 27, 2026
6af2776
chore: T-204 GHA passed → PR#216; S-RED focus 10 (ts_driven.cpp); age…
ms609 Mar 27, 2026
658576c
chore: S-RED focus 11 (ts_sector.cpp) — no bugs; agent-F update
ms609 Mar 27, 2026
ceedf5d
chore: S-RED focus 12 (ts_pool.cpp) — no critical bugs; agent-F update
ms609 Mar 27, 2026
f1ad030
fix(sector): re-sync constraint metadata after accepted sector improv…
ms609 Mar 27, 2026
ef460f2
chore: E-003/sector fix + S-RED-13 + S-COORD-36 + S-PR-39; rename T-2…
ms609 Mar 27, 2026
b100b9d
fix: add maxOuterResets and enumTimeFraction to print.SearchControl (…
ms609 Mar 27, 2026
8e3728f
chore: E-002 done, F-013 S-RED focus 14 (ts_constraint.cpp), T-279 PR…
ms609 Mar 27, 2026
a4ad4dd
chore: F-014 S-RED focus 15 (ts_wagner.cpp, no bugs)
ms609 Mar 27, 2026
5b0c0ad
fix(T-289): use R_LIBS_USER pattern for Rscript invocation in Hamilto…
ms609 Mar 27, 2026
03e981f
feat(T-289): add prune-reinsert benchmark script
ms609 Mar 27, 2026
5d6cc16
chore: T-289 parked SLURM 16606222; S-COORD-37 start
ms609 Mar 27, 2026
ae6a352
fix(ratchet): re-sync constraint metadata after reverting to best_tre…
ms609 Mar 27, 2026
6bd021a
chore: S-COORD-37 + S-PR-40 + S-RED-16 (F-015 ratchet constraint fix)…
ms609 Mar 27, 2026
3f0a1b3
feat(T-269): add fine-grained sectorial interleaving benchmark
ms609 Mar 27, 2026
2f4f176
fix(nni_perturb): two missing update_constraint calls (F-016)
ms609 Mar 27, 2026
66865d1
chore: S-RED focus 17 (F-016 nni_perturb constraint); S-COORD-38; T-2…
ms609 Mar 27, 2026
79a90f3
chore: S-RED focus 18 (ts_resample.cpp — no bugs); T-269 committed
ms609 Mar 27, 2026
d4399e2
fix(prune_reinsert): two missing update_constraint calls (F-018)
ms609 Mar 27, 2026
ed8b060
chore: S-RED focus 19 (ts_prune_reinsert.cpp — F-018); GHA 23653782359
ms609 Mar 27, 2026
4215650
chore: S-RED focus 20 (ts_simplify.cpp — no bugs); coordination updates
ms609 Mar 27, 2026
a6ca856
chore: S-RED focus 21 (ts_search.cpp — no bugs)
ms609 Mar 27, 2026
59904d4
fix(hamilton): add CRAN dep pre-install; fix git pull divergence hand…
ms609 Mar 27, 2026
17c4f39
chore: update T-289/T-269 SLURM job IDs (resubmitted after TreeDist fix)
ms609 Mar 27, 2026
f7f8c8b
chore: S-RED focus 22 (ts_data.cpp — no bugs)
ms609 Mar 27, 2026
3861f07
chore: S-COORD-39; GHAs F-015/016/018 all PASSED
ms609 Mar 27, 2026
e59f930
chore: S-RED focus 23 complete (ts_fitch.cpp+ts_simd.h -- no bugs)
ms609 Mar 27, 2026
6a7a1cc
chore: S-RED focus 24 complete (ts_fitch_na.h + ts_fitch_na_incr.h --…
ms609 Mar 27, 2026
b8e180a
chore: S-RED focus 25+26 complete (ts_tree/splits/collapsed/hsj/sanko…
ms609 Mar 27, 2026
ef83e8d
fix: restore 'config' and 'warmup' to WORDLIST (R 4.1 spell-check CI)
ms609 Mar 27, 2026
ff3ac45
chore: S-COORD-40; F-027 WORDLIST fix parked GHA 23656560997; PRs #23…
ms609 Mar 27, 2026
0bb7a9e
chore: S-RED focus 27 complete (ts_rcpp.cpp, 2656L — no bugs; all mod…
ms609 Mar 27, 2026
22f929c
perf/feat(T-289): pruneReinsertTbrMoves param + build_postorder optim…
ms609 Mar 28, 2026
a9dd158
chore: add T-290 (Brazeau benchmark) and T-291 (bench_framework update)
ms609 Mar 28, 2026
1ce5e12
feat(T-289): add MISSING and COMBINED drop criteria for prune-reinsert
ms609 Mar 28, 2026
c56b395
chore(T-289d): Stage 3 benchmark scripts — new PR drop criteria
ms609 Mar 28, 2026
b8b9f83
feat(large-preset): enable prune-reinsert (c=5, d=5%, MISSING) [T-289]
ms609 Mar 28, 2026
7566c8a
chore: agent E progress — T-289 Stage 4 dispatched (SLURM 16621426)
ms609 Mar 28, 2026
fdf2567
docs: add pruneReinsertTbrMoves to SearchControl.Rd (codoc fix)
ms609 Mar 28, 2026
ab8b415
chore: E-003 codoc fix logged; agent-E.md updated
ms609 Mar 28, 2026
c818923
chore: S-COORD-41 (codoc fix; T-289 Stage 4 running; PR status)
ms609 Mar 28, 2026
35f8abc
chore: T-290 complete — Brazeau phase profiling + wagnerStarts analysis
ms609 Mar 28, 2026
f1ed5df
fix(T-291): update benchmark_run() to new ts_driven_search interface
ms609 Mar 28, 2026
d07f338
chore: T-291 complete; to-do.md updated
ms609 Mar 28, 2026
1387e62
chore: S-COORD-41 update — PR #210 CI status post-codoc-fix
ms609 Mar 28, 2026
c62cb69
docs: update AGENTS.md with T-290b Brazeau phase profiling findings
ms609 Mar 28, 2026
f14cad0
chore: E-005 S-RED ts_strategy.h + ts_temper complete (no bugs)
ms609 Mar 28, 2026
31d2c95
chore: re-remove T-290 (completed G-001; clobbered by concurrent d07f…
ms609 Mar 28, 2026
7469852
fix(T-289): disable pruneReinsert in large preset
ms609 Mar 28, 2026
8254c91
chore: T-289 complete; agent-E IDLE
ms609 Mar 28, 2026
2cef34d
chore: S-COORD-42; T-269 complete (no benefit from fine-grained inter…
ms609 Mar 28, 2026
927070a
chore: S-RED focus 28 complete — ts_mc_fitch, ts_tabu, ts_prune_reins…
ms609 Mar 28, 2026
038e00a
perf(T-245): TBR 4-wide candidate batch + flat-variant switch
ms609 Mar 28, 2026
34901c4
chore: agent-F T-245 ASSIGNED; GHA 23690208221 dispatched
ms609 Mar 28, 2026
09c9346
feat(T-289b): pruneReinsertNni + pruneReinsertFullMoves to reduce lar…
ms609 Mar 28, 2026
7943e60
fix: suppress covr false-positive from spell_check_test source-dir wa…
ms609 Mar 28, 2026
7ac5a7d
chore: S-COORD round 43 — spelling fix; T-245 parked; PR #210 re-trig…
ms609 Mar 28, 2026
aa3f16e
chore(T-289f): Stage 5 benchmark — PR NNI polish vs TBR polish vs bas…
ms609 Mar 28, 2026
f1e9c4c
docs: update large preset PR comment to reflect T-289 Stage 4 disable…
ms609 Mar 28, 2026
80ece4f
chore: S-COORD round 44 — T-245 GHA PASS; S-RED focus 29 clean; PR pe…
ms609 Mar 28, 2026
d67bed2
chore: T-245 status → PR #238; update S-COORD/S-PR notes
ms609 Mar 28, 2026
f6318da
chore: agent-e PARKED — T-289f NNI polish done, awaiting GHA + Hamilton
ms609 Mar 28, 2026
f9e59b4
chore: agent-F IDLE after T-245 + spelling fix + S-RED focus 29
ms609 Mar 28, 2026
93d000a
Merge pull request #237 from ms609/feature/drift-constraint-fix
ms609 Mar 28, 2026
7207e0b
Merge pull request #238 from ms609/feature/tbr-batch
ms609 Mar 28, 2026
c5d92af
chore: agent-e T-289f Stage 5 dispatched (SLURM 16622224)
ms609 Mar 28, 2026
5f047c9
chore: S-COORD round 45 — PRs #237+#238 merged; agent-G active; T-289…
ms609 Mar 28, 2026
8283afb
chore: S-RED focus 30 clean (ts_drift + ts_fitch/tbr post-merge); age…
ms609 Mar 28, 2026
2784432
fix(T-289f): update Hamilton script to use cpp-search — feature/tbr-b…
ms609 Mar 28, 2026
16842b2
chore: agent-G T-289f diagnosis + T-290c complete; resubmit pending
ms609 Mar 28, 2026
da8d24e
docs: update AGENTS.md wagnerStarts section with T-290c empirical fin…
ms609 Mar 28, 2026
9e79ec3
chore: S-RED focus 31 — ts_prune_reinsert.cpp; filed G-006 (nni_full …
ms609 Mar 28, 2026
6a7ded4
chore: T-289f Stage 5 analysis — pr_nni wins 7/10 EB, not preset-enabled
ms609 Mar 29, 2026
7aeff18
docs: add seed count benchmarking methodology to strategies.md
ms609 Mar 29, 2026
a159311
feat(diag): Phase 1 TBR clip-ordering diagnostic instrumentation
ms609 Mar 29, 2026
9c8a359
chore: record TBR clip-ordering experiment outcome (PA-001)
ms609 Mar 29, 2026
d0df608
chore: record XSS↔TBR cycling experiment results (PA-002)
ms609 Mar 29, 2026
4a549eb
feat(T-289f): enable pruneReinsertCycles=5 + NNI polish in large preset
ms609 Mar 29, 2026
70a3bd4
fix(G-006): skip NNI polish when constraints active in prune_reinsert…
ms609 Mar 29, 2026
589d27d
chore: add remote-jobs.md for tracking async Hamilton/GHA jobs
ms609 Mar 29, 2026
6aeac51
chore: record targeted post-clip sector search results (PA-003)
ms609 Mar 29, 2026
5a060b9
feat: TBR clip ordering strategies (Phase 2 — complete)
ms609 Mar 29, 2026
ca8f4f0
docs: add @param clipOrder to SearchControl; fix stale \usage block
ms609 Mar 29, 2026
3cf476d
chore: agent F — F-030 complete (PR #239 clip-ordering phase 2)
ms609 Mar 29, 2026
72fce2e
Merge branch 'cpp-search' into feature/weighted-clip-order
ms609 Mar 29, 2026
6972444
Merge pull request #239 from ms609/feature/weighted-clip-order
ms609 Mar 29, 2026
14ff3f9
chore: agent F — IDLE; TS-WeightClip worktree deregistered
ms609 Mar 29, 2026
f16e44c
Concordance doc
ms609 Apr 9, 2026
9b23311
Goloboff2021 [-b]
ms609 Apr 9, 2026
5d987a1
Goloboff2021-b
ms609 Apr 9, 2026
066fb14
Concordance refs
ms609 Apr 9, 2026
f675172
Handle DNA in QuartetConcordance
ms609 Apr 10, 2026
b99265d
ConcordanceTable margins
ms609 Apr 17, 2026
9ac78ba
characterwise
ms609 Apr 23, 2026
571ed05
Update .Rbuildignore
ms609 Apr 23, 2026
a4627d2
User issues
ms609 May 4, 2026
0b28d9e
memchex
ms609 May 6, 2026
a941956
Simplify AGENTS.md
ms609 May 6, 2026
d009425
a. triage
ms609 May 6, 2026
89fbd4e
v6
ms609 May 6, 2026
319194e
Fix T-293/T-300: guard concordance reactive against taxon mismatch
ms609 May 7, 2026
9a6ac50
Dynamic limit for perturbStopFactor
ms609 May 7, 2026
b189017
roxygen2 v8
ms609 May 7, 2026
1bd54d1
testthat/edition: 2
ms609 May 7, 2026
db92b71
Avoid full_rescore unless needed
ms609 May 7, 2026
17f49c3
Deglitch UI
ms609 May 7, 2026
73cb644
rm flicker
ms609 May 7, 2026
ef3cefa
Clarify intent
ms609 May 7, 2026
dbf4787
Reorder
ms609 May 7, 2026
190ec25
Top/right margins on ConcordanceTable
ms609 May 7, 2026
f006918
mod-consensus rogue floor
ms609 May 8, 2026
08ddc58
Merge branch 'cpp-search' of https://github.com/ms609/TreeSearch into…
ms609 May 8, 2026
c000e9f
/dispatch implementation
ms609 May 8, 2026
4e83fa9
Update dispatch.sh
ms609 May 8, 2026
055f5c2
rm positai old files (goods extracted)
ms609 May 8, 2026
8233902
Merge branch 'main' into cpp-search
ms609 May 11, 2026
bdb5454
Ignore *.sh
ms609 May 12, 2026
17c71bb
avoid with_pdf
ms609 May 12, 2026
b290809
python v
ms609 May 12, 2026
790278d
feat(T-301): enable testthat edition 3; fix expect_equivalent and con…
ms609 May 12, 2026
1ca3466
debug /dispatch
ms609 May 12, 2026
cc95479
restrict worktrees to ../worktrees/ and protect main checkout
ms609 May 12, 2026
91f36ec
reap: proactively poll GHA when nothing is ETA-ready
ms609 May 12, 2026
0a41b09
fix(T-301): resolve testthat edition 3 failures (64 → expected 0)
ms609 May 12, 2026
8b0884f
dispatch: replace with thin stubs pointing to shared skill
ms609 May 12, 2026
0f75d2c
fix(T-301): use unrooted swappers in Ratchet test for optimal tree di…
ms609 May 12, 2026
a25f181
chore: move T-301 to completed-tasks
ms609 May 12, 2026
fbc1a8c
fix(test-CustomSearch): remove undefined referenceTree assertions
ms609 May 12, 2026
f58eef3
Merge pull request #241 from ms609/feature/testthat-3
ms609 May 12, 2026
c5e8db7
memcheck needs
ms609 May 12, 2026
e2258eb
Concordance testing tidy
ms609 May 12, 2026
c5091a8
Shiny bugfixes
ms609 May 12, 2026
87f1abe
coord(d5): T-302 complete — LengthAdded negative delta fix queued GHA…
ms609 May 13, 2026
72dc274
coord(T-298): update status to PR #242 (d8)
ms609 May 13, 2026
93ec0ec
red-team log
ms609 May 13, 2026
72eff08
progress reporting
ms609 May 13, 2026
a204542
Accept fractional per-character weights via attr(dataset, "weight")
ms609 May 17, 2026
a573450
Add fractional-weights.R to DESCRIPTION Collate field
ms609 May 17, 2026
4eef5f9
Guard against int overflow when sum(weights) > INT_MAX
ms609 May 17, 2026
6516528
Fix R CMD check warnings: declare withr, add Rcpp to WORDLIST
ms609 May 17, 2026
ea44ea1
Replace withr::with_options() with base options()/on.exit()
ms609 May 17, 2026
cd0ba6e
Add missing #include <climits> for INT_MAX in ts_resample.cpp
ms609 May 17, 2026
3a02efb
lift 256-draw cap in MaddisonSlatkin ValidDrawsCache
ms609 May 18, 2026
cdbe8e3
ci(ASan): drop rlang continue-on-error shim
ms609 May 18, 2026
96e1c43
docs(pkgdown): index inapplicable and search-algorithm vignettes
ms609 May 18, 2026
f509c60
seed
ms609 May 18, 2026
e2be4e6
docs(vignette): drop phangorn from inapplicable example
ms609 May 18, 2026
77ac344
docs(vignette): gate Rogue chunks in tree-search
ms609 May 18, 2026
99e2467
docs(vignette): gate protoclust in tree-space
ms609 May 18, 2026
86dcea9
docs(vignette): gate Rogue calls in tree-space
ms609 May 18, 2026
e2e4a6f
1260 for 1/X fractions
ms609 May 18, 2026
0094db2
Merge pull request #243 from ms609/autopart/fractional-weights
ms609 May 18, 2026
3c9daa8
+shinylive
ms609 May 18, 2026
73ec750
optimize safety
ms609 May 18, 2026
b9aabb4
w_mult safety
ms609 May 18, 2026
7a996d6
sssshhh
ms609 May 18, 2026
995a13a
Merge branch 'main' into cpp-search
ms609 May 18, 2026
fde200b
/profile init
ms609 May 18, 2026
b186e80
fix(progress): guard R_FlushConsole behind R_Interactive
ms609 May 18, 2026
44d929a
perf(sector): copy flat_blocks and all_weight_one in build_reduced_da…
ms609 May 18, 2026
1e3fc9a
perf(tbr): incremental rescore for SPR accept moves (T-300)
ms609 May 18, 2026
b7303ee
revert(T-300): remove broken incremental rescore — diff=-3 + stack sm…
ms609 May 19, 2026
2832c06
test: fix data() isolation bug in stopping and xpiwe tests
ms609 May 19, 2026
c504ea8
fix(drift): restore topology before build_postorder on RFD re-apply f…
ms609 May 19, 2026
f531bbc
perf(T-300): dirty-set incremental rescore for SPR accept
ms609 May 19, 2026
b67db1a
chore(profile): round 2 — T-300 baseline (S-PROF area #4)
ms609 May 19, 2026
9b9b170
docs: update RESUME.md post T-300 (b67db1a1)
ms609 May 19, 2026
2be8228
test(T-300): DEBUG_NNI_RESCORE cross-check, EW-only
ms609 May 19, 2026
3df9088
fix(nni): correct IW score computation in incremental rescore
ms609 May 19, 2026
1bd1346
PaintCharacters() draft
ms609 May 19, 2026
44a4ebe
chore(T-300): remove DEBUG_RESCORE + DEBUG_NNI_RESCORE scaffolding
ms609 May 19, 2026
2148483
Concordance paint-swatch
ms609 May 19, 2026
014ccde
feat(T-300 NA): dirty-set rescore for NA datasets
ms609 May 19, 2026
df7dd54
docs(PaintCharacters): add ConcordanceTable example call
ms609 May 19, 2026
012b6d2
Remotes: ms609/TreeTools,
ms609 May 19, 2026
2b6b6be
fix(progress): replace non-API R_Interactive with portable isatty()
ms609 May 19, 2026
b2652a0
Spelling
ms609 May 19, 2026
d24cd7a
T-302: fix LengthAdded negative delta (qmApp scalar) (#244)
ms609 May 19, 2026
7185b54
spell
ms609 May 19, 2026
5b210fd
chore(T-300 NA): remove DEBUG_NA_RESCORE scaffolding
ms609 May 19, 2026
221a38a
docs(T-300): record Zhu2013 NA dirty-set perf baseline
ms609 May 19, 2026
f281356
test(nni): pin IW score returned by nni_search to independent recompu…
ms609 May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
198 changes: 198 additions & 0 deletions .AGENTS/memory/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Architecture Reference

Load this when: editing `src/ts_*.cpp`/`.h`, adding Rcpp exports, reading
the R-level API, or reviewing design decisions.

---

## R-level API

| Function | Engine | Purpose |
|----------|--------|---------|
| `MaximizeParsimony()` | C++ driven search | Primary search (EW, IW, profile, constraints) |
| `Morphy()` | R-loop + MorphyLib | Legacy search (custom stopping, per-iteration callbacks) |
| `MaximizeParsimony2()` | — | Deprecated alias for `MaximizeParsimony()` |
| `Resample()` | C++ | Jackknife/bootstrap resampling |
| `SuccessiveApproximations()` | C++ | Successive approximations weighting |
| `TreeLength()` | C++ `ts_fitch_score` | Score one or more trees |
| `FastCharacterLength()` | C++ `ts_char_steps` | Per-character step counts |
| `AdditionTree()` | C++ `ts_wagner_tree` | Wagner tree construction |
| `RandomTreeScore()` | C++ (phyDat) or MorphyLib (morphyPtr) | Score a random tree |
| `TaxonInfluence()` | C++ via `MaximizeParsimony()` | Per-taxon search |
| `SearchControl()` | — | Expert parameter constructor for `MaximizeParsimony()` |
| `ParsSim()` | Pure R | Simulate datasets under parsimony (EW/IW/profile) |

`MaximizeParsimony()` has a backward-compatibility shim: passing old
Morphy-style parameters (`ratchIter`, `tbrIter`, etc.) triggers a deprecation
warning and delegates to `Morphy()`. Scheduled for removal in 2028.

---

## C++ module map

| Module | Header/Source | Purpose |
|--------|--------------|---------|
| Fitch scoring | `ts_fitch.h/.cpp` | Downpass, uppass, incremental, indirect |
| NA scoring | `ts_fitch_na.h` | Three-pass inapplicable algorithm (Brazeau et al. 2019) |
| NA incremental | `ts_fitch_na_incr.h` | Incremental NA-aware scoring for TBR/drift |
| SIMD | `ts_simd.h` | SSE2/NEON portability layer for bit-parallel ops |
| Data | `ts_data.h/.cpp` | `DataSet`, `CharBlock`, `build_dataset`, simplification |
| Tree | `ts_tree.h/.cpp` | `TreeState`, topology manipulation, `PreallocUndo` |
| Constraint | `ts_constraint.h/.cpp` | Topological constraint enforcement |
| TBR | `ts_tbr.h/.cpp` | TBR search (with sector_mask for CSS) |
| SPR/NNI | `ts_search.h/.cpp` | SPR and NNI search (standalone, not in driven pipeline) |
| Ratchet | `ts_ratchet.h/.cpp` | Perturbation (zero/upweight/mixed, adaptive) |
| Drift | `ts_drift.h/.cpp` | Accept suboptimal moves within AFD/RFD limits |
| Wagner | `ts_wagner.h/.cpp` | Greedy addition tree (incremental scoring, NA-aware) |
| Sectorial | `ts_sector.h/.cpp` | RSS (conflict-guided), XSS, CSS; from-above HTU |
| Fuse | `ts_fuse.h/.cpp` | Tree fusing (in-place exchange) |
| Pool | `ts_pool.h/.cpp` | Dedup, eviction, consensus hash, split frequency table |
| Splits | `ts_splits.h/.cpp` | Bipartition computation, comparison, `hash_single_split()` |
| Driven | `ts_driven.h/.cpp` | Multi-replicate orchestrator |
| Resample | `ts_resample.h/.cpp` | Jackknife, bootstrap, successive approximations |
| Parallel | `ts_parallel.h/.cpp` | `std::thread` inter-replicate parallelism |
| RNG | `ts_rng.h/.cpp` | Thread-safe RNG (`thread_local` dispatch) |
| Simplify | `ts_simplify.h/.cpp` | Character compression and uninformativeness checks |
| Collapsed | `ts_collapsed.h/.cpp` | Zero-length edge detection for clip skipping |
| NNI perturb | `ts_nni_perturb.h/.cpp` | Stochastic NNI-perturbation (IQ-TREE-style topology escape) |
| HSJ scoring | `ts_hsj.h/.cpp` | Hopkins & St. John hierarchy scoring |
| Sankoff | `ts_sankoff.h/.cpp` | Sankoff step-matrix scoring (x-transform) |
| Rcpp bridge | `ts_rcpp.cpp` | All Rcpp-exported functions |

---

## Scoring modes

`ScoringMode` enum in `ts_data.h`: `EW`, `IW`, `PROFILE`, `XFORM`.
- **EW**: standard Fitch parsimony
- **IW**: implied weights via `e/(k+e)` where `e = steps - min_steps`
- **PROFILE**: lookup in `info_amounts` table (structurally identical to IW pipeline)
- **XFORM**: Fitch(non-hierarchy) + Sankoff(recoded composite characters)

Profile mode sets `ds.concavity = 1.0` (finite sentinel) so existing
`isfinite()` checks activate the weighted pipeline without code duplication.

---

## Parallelism design

- `std::thread` (not OpenMP) to avoid R memory allocator conflicts
- Per-thread: `DataSet` copy, `ConstraintData` copy, `std::mt19937` RNG
- Shared: `ThreadSafePool` (mutex-guarded), atomic stop flag
- Main thread: pre-generates seeds from R's RNG, polls
`R_CheckUserInterrupt()` and timeout every 200ms
- Worker threads make no R API calls — `ts_rng.h` provides `thread_local`
dispatch (null → R API for serial; set → thread-local for parallel)

---

## Scoring notes

- `.h` file changes (`ts_fitch_na.h`, `ts_fitch_na_incr.h`) may require
`touch src/ts_fitch.cpp` before rebuild if the build system doesn't track
header dependencies.
- Incremental scoring is a **screening heuristic** for candidate selection;
`full_rescore()` / `score_tree()` is always authoritative.
- See `.positai/expertise/fitch-scoring.md` for detailed invariants:
uppass correctness proof, NA staleness analysis, `upweight_mask` audit.

---

## Constraint enforcement

- `build_constraint()` reads R split matrix with **column-major** indexing:
`split_matrix[s + n_splits * t]`.
- Wagner uses LCA-based constraint mapping (`wagner_map_constraint_nodes`)
since splits aren't fully present during incremental construction.
- Wagner has a posthoc retry loop (up to 100 random addition orders) as a
safety net for edge cases.

---

## Exported Rcpp functions

All registered in `ts_rcpp.cpp` and `TreeSearch-init.c`. Run
`Rscript check_init.R` to verify consistency.

| Function | Module | Purpose |
|----------|--------|---------|
| `ts_fitch_score` | ts_fitch | Score a tree |
| `ts_char_steps` | ts_rcpp | Per-pattern step counts (with simplification offsets) |
| `ts_na_debug_char` | ts_fitch_na | Per-node debug for a single pattern |
| `ts_na_char_steps` | ts_fitch_na | Per-pattern step counts (raw, no offsets) |
| `ts_debug_clip` | ts_fitch | Debug SPR clip/regraft |
| `ts_test_indirect` | ts_fitch | Debug indirect length |
| `ts_nni_search` | ts_search | NNI hill-climbing |
| `ts_spr_search` | ts_search | SPR hill-climbing |
| `ts_tbr_search` | ts_tbr | TBR with plateau exploration |
| `ts_ratchet_search` | ts_ratchet | Ratchet perturbation |
| `ts_drift_search` | ts_drift | Drift search |
| `ts_wagner_tree` | ts_wagner | Wagner tree (specified addition order) |
| `ts_random_wagner_tree` | ts_wagner | Wagner tree (random order) |
| `ts_compute_splits` | ts_splits | Bipartition splits from edge matrix |
| `ts_trees_equal` | ts_splits | Compare two trees |
| `ts_pool_test` | ts_pool | Pool deduplication test |
| `ts_tree_fuse` | ts_fuse | Fuse two trees |
| `ts_sector_diag` | ts_sector | Sectorial search diagnostics |
| `ts_rss_search` | ts_sector | Random Sectorial Search |
| `ts_xss_search` | ts_sector | Exclusive Sectorial Search |
| `ts_driven_search` | ts_driven | Full driven search |
| `ts_resample_search` | ts_resample | One jackknife/bootstrap replicate |
| `ts_successive_approx` | ts_resample | Successive approximations |
| `ts_parallel_resample` | ts_parallel | Batch resample with parallelism |
| `ts_bench_tbr_phases` | ts_rcpp | TBR phase timing diagnostic |
| `ts_hsj_score` | ts_hsj | HSJ hierarchy scoring |

---

## Key design decisions

1. **PreallocUndo** (`ts_tree.h`): Pre-allocated flat buffers for TBR/drift
undo stack. Uses `grow()` to dynamically expand when capacity exceeded
(NA uppass saves both internal nodes and tips). Initial capacity `3 * n_node`.

2. **TBR symmetry breaking** (`ts_tbr.cpp`): FNV-1a hash deduplication of
`virtual_prelim` vectors to skip redundant rerooting evaluations.

3. **Bounded indirect scoring**: All search modules use `_bounded` variants
that bail out when accumulated score exceeds best candidate.

4. **Profile parsimony**: Reuses IW indirect pipeline unchanged; only delta
precomputation differs. `ds.concavity = 1.0` sentinel activates weighted
path. Max 2 informative states per character; inapplicable → ambiguous.

5. **MPT enumeration**: Post-search TBR plateau walk from all pool seeds.
`tbr_search()` accepts optional `TreePool* collect_pool` parameter.

6. **All-ambiguous phyDat guard**: `TreeLength()` and `MaximizeParsimony()`
check for `levels = NULL` / 0-column contrast matrix before calling C++.

7. **From-above HTU for sectorial search** (`ts_sector.cpp`):
`compute_from_above_for_sector()` computes `from_above[sector_root]` —
the Fitch state-set the rest of the tree sends *down* to the sector
boundary, excluding the sector's own contribution. Used instead of
`final_[parent]` in `build_reduced_dataset()`. O(depth × total_words).

8. **Split frequency table** (`ts_pool.h/.cpp`): `SplitFrequencyTable` maps
per-split FNV-1a hash → occurrence count across best-score pool trees.
Used by conflict-guided RSS to weight sector selection. The same FNV-1a
hash (`hash_single_split()` in `ts_splits.h`) is used by consensus
hashing and split frequency counting — must stay consistent.

9. **Consensus-stability hash** (`ts_pool.cpp`): XOR of FNV-1a hashes of
splits present in ALL best-score trees. Updated after each replicate.
Hash collision false-matches are conservative (over-count stability).

10. **Diversity-aware pool eviction** (`ts_pool.cpp`): When the pool is full
and a new tree ties the worst score, the entry most similar to the new
tree (most shared splits, counted via per-split FNV-1a hash set
membership) is evicted. Falls back to arbitrary worst entry when the
new tree is strictly better.

11. **Cross-replicate consensus constraint tightening** (`ts_driven.cpp`):
When `consensus_constrain = true` and no user constraint is supplied,
after ≥5 replicates, unanimous pool splits are extracted and enforced
as topological constraints via `build_constraint_from_bitsets()`. The
TBR/SPR search then avoids breaking established consensus clades.
Constraints are cleared and rebuilt whenever the best score changes.
Sector/fuse operations do not enforce auto-constraints.
174 changes: 174 additions & 0 deletions .AGENTS/memory/benchmarking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Benchmarks and Profiling

Load this when: running benchmarks, interpreting benchmark results,
doing VTune profiling, or selecting datasets for strategy validation.

See also: `search-algorithms.md` (NNI, biased Wagner, outer cycles results),
`search_strategy.md` (presets, ratchet tuning).

---

## VTune driver scripts — dry-run first

**Always test a VTune driver script with plain `Rscript` before launching
VTune.** Software-sampling overhead can be 5–20×; if the bare script takes
30s, VTune may need 10 min. Target < 5s bare run for a lite driver.

MaddisonSlatkin is exponential in tip count — even n=20 with k=3 can take
seconds per call. Use small n (≤15 for k=3, ≤12 for k=4, ≤9 for k=5)
and few iterations for VTune drivers.

---

## MorphoBank external benchmark corpus

The neotrans repo (`../neotrans/inst/matrices/`) contains ~800 MorphoBank
NEXUS matrices. Complement to the 14 bundled datasets and 1 large-tree dataset.

**Catalogue:** `dev/benchmarks/mbank_catalogue.csv` (659 usable matrices
after ntax≥20 filter and dedup). Regenerate with
`Rscript dev/benchmarks/build_mbank_catalogue.R`.

**Train/validation split:** Matrices whose MorphoBank project number is
divisible by 5 are **validation** (124 matrices, ~19%). All others are
**training** (535 matrices). The 7 `syab*` files are always training.

**Dedup:** Multi-file projects with ≥95% character identity on shared taxa
(≥80% taxon overlap) are flagged `dedup_drop = TRUE`. 24 near-duplicates excluded.

**IMPORTANT:** Validation results must **never** be used to guide strategy
tuning. They confirm generalization only. This is a one-way door.

**Fixed 25-matrix training sample:** `MBANK_FIXED_SAMPLE` in
`bench_datasets.R` — 7 small, 7 medium, 7 large, 4 xlarge. Selected via
max-min distance on standardized features. **Do not modify.** Used by
`benchmark_mbank_sample()`. Fitch track only.

**Fixed 20-matrix Brazeau-track sample:** `MBANK_BRAZEAU_SAMPLE` in
`bench_datasets.R` — 5 small, 6 medium, 6 large, 3 xlarge. Restricted to
training matrices with **pct_inapp ≥ 4%**. **Do not modify.**

**Key functions** (in `dev/benchmarks/bench_datasets.R`):
- `load_mbank_catalogue()` — loads metadata CSV (excludes dedup by default)
- `load_mbank_sample(cat, n, seed, split)` — stratified random sample
- `load_mbank_datasets(cat, keys)` — load specific matrices by key
- `load_mbank_brazeau_sample(cat)` — fixed 20-matrix Brazeau sample
- `has_meaningful_inapp(cat, threshold)` — filter to pct_inapp ≥ threshold

**Benchmark runners** (in `dev/benchmarks/bench_framework.R`):
- `benchmark_mbank_sample()` — fixed 25-matrix training sample (routine)
- `benchmark_mbank_sweep(split)` — full training or validation sweep
- `benchmark_mbank_validation()` — validation sweep with prominent warning

**Benchmark tracks:**

| Track | Scoring | Datasets | Purpose |
|-------|---------|----------|---------|
| **Fitch** | `fitch_mode()` | 14 bundled + `MBANK_FIXED_SAMPLE` | TNT comparison, core search quality |
| **Brazeau** | Default (Brazeau 2019) | `MBANK_BRAZEAU_SAMPLE` + bundled | NA-algorithm-specific strategy tuning |

TNT comparisons are Fitch track only.

**TNT comparison suite** lives in `../TS-TNT-bench/`. Key files:
- `dev/benchmarks/bench_tnt_compare.R` — runner (smoke/medium/full)
- `dev/benchmarks/tnt_comparison.qmd` — Quarto report
- Requires TNT 1.6 at `C:/Programs/Phylogeny/tnt/TNT-bin/tnt.exe`

Benchmark scripts in `dev/benchmarks/`. Key files:
- `bench_regression.R` — CI regression test (score quality + timing bounds)
- `bench_framework.R` — Dataset × strategy × replicate grid
- `strategies.md` — Strategy space documentation

---

## Benchmarking methodology notes

**Metric:** When comparing strategies with different time costs (e.g.
NNI→TBR vs TBR), use **time-adjusted expected best** (TAEB) — the expected
minimum score from k = budget / time_per_rep independent replicates. Median
per-replicate score is adequate only when comparing parameter changes on a
fixed pipeline (same time-per-rep). Bootstrap estimation: sample k scores
with replacement, take the min, repeat 5000×, take the mean.

**Brazeau vs EW scoring confound (T-265, 2026-03-26):** TreeSearch uses the
Brazeau et al. (2019) inapplicable algorithm by default, which penalizes
inapplicable-to-applicable transitions. TNT treats `-` as `?` (standard EW
Fitch). On 11 gap datasets, the apparent mean gap was +17.8 steps; the
actual EW-vs-EW gap is only +2.2 steps (5 datasets at 0 gap). **All TNT
comparisons MUST use `fitch_mode()` to convert inapplicable to missing**
for apples-to-apples scoring. `fitch_mode()` is defined in
`bench_intra_fuse.R` and `bench_t265_regression.R`.

**`maxTime` confound (2026-03-23):** `maxTime` (legacy Morphy parameter)
silently delegates to the R-loop `Morphy()` engine. Use `maxSeconds` for
the C++ driven search, which is ~10× faster at 180 tips.

**Early vs late search:** Early replicates are dominated by initial descent
quality (Wagner → local optimum); late replicates test ratchet/drift escape.
At ≤88 tips, 20s gives 10–40 replicates spanning both regimes. At 180 tips,
20s doesn't complete one replicate.

---

## Phase distribution baselines

**T-290b (2026-03-28, Brazeau-sample datasets, 30s, post-T-255 no-drift presets):**

| Phase | Fitch/EW/default | Fitch/EW/thorough | Brazeau/EW/default | Brazeau/EW/thorough |
|-------|:---:|:---:|:---:|:---:|
| Ratchet | 76% | 65% | 74% | 63% |
| TBR | 8% | 5% | 7% | 4% |
| XSS | 6% | 7% | 5% | 6% |
| RSS | 3% | 10% | 3% | 10% |
| CSS | — | 7% | — | 7% |
| Wagner | 4% | 3% | 9% | 7% |
| Final TBR | 2% | 2% | 2% | 2% |

*(Drift has been 0% in all presets since T-255.)*

**Brazeau / Fitch per-phase cost ratios (T-290b, EW):**

| Phase | default | thorough |
|-------|:-------:|:--------:|
| Wagner | **3.6×** | **3.9×** |
| Ratchet | 1.3× | 1.3× |
| RSS/CSS | 1.3× | 1.3× |
| TBR | 0.9× | 0.9× |

Wagner is the outlier. All other phases are within 0.9–1.4× of Fitch cost.

**wagnerStarts under Brazeau (T-290b/c, 2026-03-28):**
- *Multiple reps/budget*: wagnerStarts=1 and 3 equivalent; w3 marginally better.
- *~1 rep/budget* (60s at 86t/3660c): wagnerStarts=3 better by +564 steps.
- *0 reps/budget* (30s at 86t/3660c): wagnerStarts=1 **better** — Brazeau
Wagner is expensive (~4×), 3 starts consume budget.
Current presets correct: thorough (w3, gets ≥1 rep at 65–119t) ✓; large (w1) ✓.

Per-candidate indirect scoring is at memory-throughput limit (~23 ns at 75 tips).

---

## Ratchet tuning validation (2026-03-22)

Full 14-dataset comparison, optimized vs original defaults (10s budget, 3 seeds).

| Dataset | Tips | Original | Optimized | Delta |
|---------|:---:|:---:|:---:|:---:|
| Longrich2010 | 20 | 131 | 131 | 0 |
| Vinther2008 | 23 | 79 | 79 | 0 |
| Sansom2010 | 23 | 189 | 189 | 0 |
| DeAssis2011 | 33 | 64 | 64 | 0 |
| Aria2015 | 35 | 143 | 143 | 0 |
| Wortley2006 | 37 | 494 | 491 | +3 |
| Griswold1999 | 43 | 408 | 407 | +1 |
| Schulze2007 | 52 | 165 | 164 | +1 |
| Eklund2004 | 54 | 442 | 441 | +1 |
| Agnarsson2004 | 62 | 778 | 778 | 0 |
| Zanol2014 | 74 | 1338 | 1331 | +7 |
| Zhu2013 | 75 | 649 | 650 | −1 |
| Giles2015 | 78 | 720 | 716 | +4 |
| Dikow2009 | 88 | 1614 | 1614 | 0 |

Zhu2013 marginal regression at 10s resolves at 20s (median 649→644).
At 20s with 5 seeds: Zhu2013 645/643, Giles2015 712/710, Dikow2009
1611/1611 (all improvements).
Loading
Loading