Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1082 commits
Select commit Hold shift + click to select a range
973d483
chore(red-team): remove landed T-331 row (merged 7f9c1966)
ms609 Jul 3, 2026
00d4f22
Merge origin/cpp-search (T-330 HSJ/XFORM collapse fix) with local T-3…
ms609 Jul 3, 2026
57bae5d
merge(sector): rssPicks knob + closed sectorial-escape mission-gate r…
ms609 Jul 3, 2026
6c341bc
test(EasyTrees): repair AppDriver input ids + port v1 download coverage
ms609 Jul 3, 2026
6d6d64b
test(EasyTrees): retire legacy shinytest (v1) suite
ms609 Jul 3, 2026
7ea59d9
test(EasyTrees): harden AppDriver tests for CI
ms609 Jul 3, 2026
051de0b
ci: adopt MaxMin sense-check wave model + gated EasyTrees shiny job
ms609 Jul 3, 2026
f513533
Merge origin/cpp-search: integrate sector mission-gate work
ms609 Jul 3, 2026
0f39d99
Docfix
ms609 Jul 3, 2026
f241359
Merge branch 'main' into cpp-search
ms609 Jul 3, 2026
6672d70
Refs & spelling
ms609 Jul 3, 2026
a3409f3
Merge origin/cpp-search (PR #210 Update-branch sync from main)
ms609 Jul 3, 2026
4007f8e
perf(prune-reinsert): exact directional scorer in expand_and_reinsert…
ms609 Jun 20, 2026
0fb6de9
fix(prune-reinsert): thread_local probe accumulators — avoid parallel…
ms609 Jul 3, 2026
98122e5
test(prune-reinsert): NA + IW score-soundness regression (close revie…
ms609 Jul 3, 2026
74bc802
Merge claude/scoreapprox-land: exact directional scorer in prune-rein…
ms609 Jul 3, 2026
d3d2204
test(Parsimony): portable download-only shiny integration tests
ms609 Jul 3, 2026
e710031
test(Parsimony): expunge module-test rot (9 stale failures)
ms609 Jul 3, 2026
93adda7
test(shiny): adopt "consensus stable" note text; eliminate testthat W…
ms609 Jul 4, 2026
c9ea624
ci(asan): fix gcc-ASAN runner + deps, fix 3 bugs it surfaced (#264)
ms609 Jul 4, 2026
31d2a54
red-team(area 13): exhaustive T-327 constraint-repair guard validity …
ms609 Jul 4, 2026
3d50dfd
fix(constraint): make T-327 repair guard a complete structural valida…
ms609 Jul 4, 2026
2228c6a
fix(fitch-na): skip detached tips in NA uppass (prune-reinsert backbone)
ms609 Jul 4, 2026
3ba095e
chore(tbr): drop dead NA_INCR_AUDIT summary print + counters
ms609 Jul 4, 2026
61f7147
fix(wagner): guard tip_data values and addition_order at Rcpp boundar…
ms609 Jul 4, 2026
f1a1bbf
Suppress messages
ms609 Jul 4, 2026
bbf2dff
MaxMin reqd
ms609 Jul 4, 2026
521f125
fix(sector): guard zero-Fitch-words empty-vector UB (EW analogue of P…
ms609 Jul 4, 2026
994f19a
perf(iw): default IW x4-reroot + dirty-region ON (kill-switch TS_IW_N…
ms609 Jul 4, 2026
8c2989d
Grow catalog
ms609 Jul 6, 2026
e2ed7d3
Output capture
ms609 Jul 6, 2026
942bfe5
fix(fitch): correct parsimony overcount on multistate ambiguity
ms609 Jul 6, 2026
e95e0df
perf(large): default maxReplicates to 500 for the large preset
ms609 Jul 6, 2026
bef753b
perf(large): rebase large preset on thorough's provisioning
ms609 Jul 7, 2026
2bb9472
Golden values
ms609 Jul 8, 2026
10f25f1
Done!
ms609 Jul 8, 2026
53ffb05
{-+} ambiguity fix
ms609 Jul 8, 2026
1dcd5b1
feat(sector): TNT-style sector-size scaling for RSS (env-gated, defau…
ms609 Jul 8, 2026
1333c9e
feat(sector): TNT-style in-sector drifting for large sectors (opt-in)…
ms609 Jul 8, 2026
2de32ab
perf(thorough): enable in-sector drifting by default (rasStarts=3 + g…
ms609 Jul 8, 2026
23046b5
test: consolidate {-,X} ambiguity scoring into Tier-2 na-ambig
ms609 Jul 9, 2026
cf9f19b
Replace Morphy with native kernel for inapplicable data (#251)
ms609 Jul 9, 2026
775631b
docs: fix stale v2.0 documentation and remove LLM artefacts (#269)
ms609 Jul 9, 2026
5d5fbae
FixedTree, non Random
ms609 Jul 9, 2026
5add6ff
docs(dev): restore stash-era plans, red-team review, and TBR wall har…
ms609 Jul 9, 2026
634b02f
fix(profile): stop MaddisonSlatkin profile scoring hanging on macOS (…
ms609 Jul 12, 2026
941c4c3
docs: sort REFERENCES.bib alphabetically by key
ms609 Jul 10, 2026
d8c5999
feat(fitch): order characters by homoplasy within blocks for faster b…
ms609 Jul 13, 2026
a5029cc
docs(perf): land per-move investigation keeper docs + lever #6/#7 specs
ms609 Jul 14, 2026
f589483
fix(fitch): correct union-of-finals bound-direction comment
ms609 Jul 14, 2026
52d5114
perf(tbr): monomorphize plain-EW SPR scan (lever #7, exact)
ms609 Jul 14, 2026
5672129
perf(tbr): compile-gate lever-7 positive control; land whole-search m…
ms609 Jul 14, 2026
cd25127
docs(s7): anchor whole-search on the resolvable +1.3%; note fix compl…
ms609 Jul 14, 2026
0e0c6e1
perf(tbr): monomorphize plain-IW SPR scan (lever #7 IW extension, exact)
ms609 Jul 14, 2026
5d7e7c2
fix(tbr): refresh collapsed_all_zero at the legacy reroot site (#7 co…
ms609 Jul 14, 2026
2595da4
docs(plans): split the per-move investigation into two missions
ms609 Jul 14, 2026
ae62e0a
feat(spr,drift): exact directional EW scorer — spr_search default + d…
ms609 Jul 16, 2026
77938a8
feat(tbr): L3b incremental cross-clip edge-set maintenance (lever #6,…
ms609 Jul 14, 2026
6a7a45b
docs(l3b): record measured end-to-end result (wash) + honest verdict
ms609 Jul 14, 2026
cf229e2
docs(l3b): discriminate the end-to-end-wash cause (in-search fp=0.244)
ms609 Jul 14, 2026
d9e6515
feat(tbr): L3b base-incremental-update after SPR accept (follow-on) +…
ms609 Jul 14, 2026
e499a42
feat(tbr): default-ON lever #6 (L3b incremental edge-set) for n_tip>=150
ms609 Jul 14, 2026
2f9ee97
test(ratchet): de-flake macOS "upweight vs zero mode" (multi-seed)
ms609 Jul 16, 2026
74e2502
docs(mission-a): kick-anytime corpus null + rewrite falsified 5432 de…
ms609 Jul 16, 2026
4dbfa93
docs(mission-a): route #2 basin-hop schedule REFUTED (floor >=97 TBR …
ms609 Jul 16, 2026
4367eb0
ci(focus-test): standalone single-test run on one OS, bypassing wave …
ms609 Jul 16, 2026
2faf86c
docs(agents): encode campaign-hub memory maintenance rule
ms609 Jul 16, 2026
ceba633
bench(mission-b): dss size-axis probe — small-sector reach ceiling (n…
ms609 Jul 16, 2026
023b038
bench(mission-b): dss build script clones origin directly (TreeSearch…
ms609 Jul 16, 2026
01ea5a7
bench(mission-b): dss NEGATIVE confirmed at n=15 — no build; thread c…
ms609 Jul 16, 2026
b3f2711
bench(mission-b): correct overclaim — rev5 large-selectem handoff NOT…
ms609 Jul 16, 2026
89ebd87
perf(kernel): land per-block-local-alphabet packing default-ON
ms609 Jul 16, 2026
d6856bc
perf(kernel): x4 reroot-batch software-prefetch parity (default-OFF)
ms609 Jul 16, 2026
8ed13c4
perf(kernel): tighten EW/NA bail cutoff (drop the +1), default-on
ms609 Jul 16, 2026
e17bb16
docs(kernel): record the ~9% -mavx2 reduce-codegen gate (packing reop…
ms609 Jul 16, 2026
a241649
docs(kernel): resolve AVX2-codegen on EPYC — real 1.3-1.7x/cand, ~1-1…
ms609 Jul 17, 2026
7fd6127
build(hamilton): harden -march=native deploy recipe with -ffp-contrac…
ms609 Jul 17, 2026
3ebc9ef
docs(search): document targetHits as the (i) confidence-stop vs (ii) …
ms609 Jul 20, 2026
6a7fbac
dev(lever-b): over-search characterisation harnesses (uncapped never-…
ms609 Jul 20, 2026
aebf6dd
dev(red-team): union-construct lower-bound proof + gate harness
ms609 Jul 20, 2026
ccf5459
dev(profiling): kernel baseline/gate notes + state-heterogeneity scripts
ms609 Jul 20, 2026
dcf5af2
docs(5432): record cold-start construction CLOSED (Mission A angles #…
ms609 Jul 16, 2026
a42aa96
docs(mission-A): mark all three cold-start angles CLOSED so next phas…
ms609 Jul 16, 2026
4853e53
feat(mission-b): land POOL_RESEED probe + terminal-fuse pass (both op…
ms609 Jul 20, 2026
fd500dd
manual withR alternative
ms609 Jul 20, 2026
49c7fcf
docs(mission-a): persist project5432 best-known trees + shared-floor …
ms609 Jul 22, 2026
b1e9e09
Fix T-334: aggressive collapse flag reverted to conservative mid-search
ms609 Jul 24, 2026
ec8edd5
chore(red-team): record area 1 & 2 directed rounds (+ A1-OP-01 doc fix)
ms609 Jul 24, 2026
31b0627
chore(red-team): record area 3 directed round (T-335 filed)
ms609 Jul 24, 2026
9dbb30b
chore(red-team): record area 4 directed round (T-336 P1 filed)
ms609 Jul 24, 2026
f951df5
fix(T-336): per-worker ConstraintData copy in parallel_resample (data…
ms609 Jul 24, 2026
1863b2b
chore(red-team): mark T-336 FIXED (f951df5a) in findings + log
ms609 Jul 24, 2026
9c6f759
chore(red-team): record area 5 directed round (dry at opus)
ms609 Jul 24, 2026
a485581
chore(red-team): area 6 dual-tier round (opus+fable calibration) — T-…
ms609 Jul 24, 2026
ee91dac
feat(MaximizeParsimony): warm-start from a whole pool of trees
ms609 Jul 27, 2026
02de896
chore(red-team): directed round on the warm-start pool diff (T-345..T…
ms609 Jul 27, 2026
12bbb27
fix(ts_driven): don't credit the strategy bandit for warm-started rep…
ms609 Jul 27, 2026
6fa9776
fix(MaximizeParsimony): root unrooted start trees before the binary c…
ms609 Jul 27, 2026
430c461
Merge fix/unrooted-start-normalization into cpp-search
ms609 Jul 27, 2026
cb87c4d
fix(red-team): correct area-6 cost note (tokens != cost) + record mod…
ms609 Jul 27, 2026
4a238ac
chore(red-team): area 7 rotation round (Shiny wiring) — T-354..T-361
ms609 Jul 27, 2026
d9a08c3
chore(red-team): close T-361 in place; record findings.md open-count
ms609 Jul 27, 2026
5640366
perf(iw): deepen the thorough/large ratchet to 48 cycles; couple to t…
ms609 Jul 27, 2026
7359b16
chore(red-team): tidy pass — archive 21 landed findings, reconstruct …
ms609 Jul 27, 2026
d700bc9
Fix EasyTrees R-script download logging wrong thinning algorithm (T-3…
ms609 Jul 27, 2026
46c3806
fix(red-team): guard T-341/T-342/T-343 R-boundary validation gaps
ms609 Jul 27, 2026
bf09116
chore(red-team): mark T-341/T-342/T-343 fixed in findings.md
ms609 Jul 27, 2026
1cc93a9
chore(red-team): tidy follow-up — reconcile to-do.md, the coupled tra…
ms609 Jul 27, 2026
d14d4ea
chore(red-team): archive T-354/T-360 — fixed mid-pass by d700bc95
ms609 Jul 27, 2026
940e4af
chore(red-team): close T-346/T-348/T-350 (stale, already fixed in ee9…
ms609 Jul 27, 2026
e134e42
chore(red-team): record T-351 fix commit hash in findings.md
ms609 Jul 27, 2026
b148299
fix(rcpp): T-339/T-337 — nThreads=0 auto-detect + parallel resample c…
ms609 Jul 27, 2026
227d462
chore(red-team): close T-337, T-339 in place (b1482997)
ms609 Jul 27, 2026
a94c16d
fix(search): saturate the no-improvement stop limit instead of overfl…
ms609 Jul 27, 2026
dc00bcb
Fix T-340: normalize concavity in MaximizeParsimony() before dispatch
ms609 Jul 27, 2026
59073a5
Merge remote-tracking branch 'local-treesearch/cpp-search' into claud…
ms609 Jul 27, 2026
ef54f47
Rcpp crlf
ms609 Jul 27, 2026
de99e5c
chore(red-team): close T-346/T-351 for real, reconciling with the con…
ms609 Jul 27, 2026
ec3ce46
fix(rcpp): reapply T-339/T-337 fix lost in concurrent merge (ef54f473)
ms609 Jul 27, 2026
a10f5ee
chore(red-team): trim provenance comments from the T-351 test move
ms609 Jul 27, 2026
0d334c3
Merge remote-tracking branch 'local-treesearch/cpp-search' into claud…
ms609 Jul 27, 2026
f149cf2
Merge branch 'fix/t340-concavity-normalization' into cpp-search
ms609 Jul 27, 2026
5f8d055
Merge fix/t341-t342-t343-guards into cpp-search
ms609 Jul 27, 2026
a2c63f7
fix(shiny): red-team polish pass — T-356..T-359 (area 7)
ms609 Jul 27, 2026
95be1c1
Merge pull request #275 from ms609/claude/elegant-joliot-d637e5
ms609 Jul 27, 2026
e357e1b
chore(red-team): area 8 round (sonnet/Sonnet 5) — T-362, T-363 filed
ms609 Jul 27, 2026
e446e72
Merge remote-tracking branch 'origin/cpp-search' into cpp-search
ms609 Jul 27, 2026
897e31f
chore(red-team): tidy #2 — archive 6, clearing the last P2 from the o…
ms609 Jul 27, 2026
b84a13c
chore(red-team): tidy #2 follow-up — reconcile to-do.md's PR-named st…
ms609 Jul 27, 2026
c4ffb86
chore(red-team): note why two adjacent tidy entries cite different la…
ms609 Jul 27, 2026
6fc13b4
fix(red-team): T-362 — gate slow MaximizeParsimony() blocks, document…
ms609 Jul 27, 2026
9d3c656
chore(red-team): recover the orphaned inapplicable-IW residual (area …
ms609 Jul 27, 2026
4d8798b
feat(search): experimental flat replicate patience behind TS_STOP_PAT…
ms609 Jul 27, 2026
32435fd
refactor(PolEscapa): drop dead inappLevel assignment in LengthAdded()
ms609 Jul 27, 2026
d3500aa
docs(AdditionTree): correct the false "rooted on sequence[1]" return …
ms609 Jul 27, 2026
3c19b6b
refactor(wagner): drop dead ew_score; correct the false "final_ is cu…
ms609 Jul 27, 2026
f086f98
chore(red-team): area 9 round (opus/Opus 5) - T-364..T-371 filed, P1 …
ms609 Jul 27, 2026
9fc2b6e
test(AdditionTree): pin the constraint test's seed; log the T-366 sib…
ms609 Jul 27, 2026
db1fbfe
chore(red-team): correct the area-9 log — 4 inline fixes, and why T-3…
ms609 Jul 27, 2026
78bce8d
docs(wagner): note entropy scorer's weight-blindness is deliberate (T…
ms609 Jul 28, 2026
70ae4d5
fix(T-344): guard tip_states length in unpack_xform
ms609 Jul 28, 2026
0b5195d
docs(AdditionTree): clarify numeric concavity affects score only, not…
ms609 Jul 28, 2026
c1c6b30
Fix T-355: pair r$treeHash update with FirstHit's r$trees mutation
ms609 Jul 28, 2026
0e9d8a1
docs(red-team): T-335/T-338 tripwire comments at every cited hazard site
ms609 Jul 28, 2026
0667186
fix(red-team): T-367 — delete unsound Phase-2 uppass in wagner_increm…
ms609 Jul 28, 2026
1a94403
Mark T-355 fixed in red-team findings log
ms609 Jul 28, 2026
d94d76b
fix(T-366): score prune-reinsert backbone with fitch_score, not score…
ms609 Jul 28, 2026
0354b68
chore(red-team): file and close T-366 (prune-reinsert NA scoring mism…
ms609 Jul 28, 2026
547f6ab
fix(wagner): remove root-edge double-counting in random tree construc…
ms609 Jul 28, 2026
d16326a
Merge branch 'cpp-search' into t370-wagner-edge-fix
ms609 Jul 28, 2026
00126d1
test(T-363): stop silently skipping R-level API tests on CRAN
ms609 Jul 28, 2026
0cd5c29
chore(red-team): archive T-370 as fixed
ms609 Jul 28, 2026
c7a6eea
fix(red-team): T-365 — read PolEscapa index space after PrepareDataPr…
ms609 Jul 28, 2026
5edb979
chore(red-team): mark T-365 resolved; file T-372 (multiPhylo profile …
ms609 Jul 28, 2026
08a3820
Merge branch 'cpp-search' into t370-wagner-edge-fix
ms609 Jul 28, 2026
37bca4b
perf(wagner): T-368 — hoist constrained-start bookkeeping out of the …
ms609 Jul 28, 2026
03644e4
chore(red-team): mark T-368 fixed; log the AdditionTree constraint le…
ms609 Jul 28, 2026
5cffb18
test(char-ordering): replace the tautological order-invariance test w…
ms609 Jul 28, 2026
ede9b3d
Fix nocov block exclusion in rearrange.cpp (start not begin)
ms609 Jul 28, 2026
e4ab114
docs(AdditionTree): correct @return rooting claim, pin with a test
ms609 Jul 28, 2026
e23d83c
chore(red-team): area 10 round (opus/Opus 5) - T-373..T-382 filed, fo…
ms609 Jul 28, 2026
10f7d33
RcppChurninator
ms609 Jul 28, 2026
ab56155
chore(red-team): settle the HSJ design question from the paper; T-376…
ms609 Jul 28, 2026
323a0da
feat(search): ship stopPatience; deeper IW ratchet for sprint/default
ms609 Jul 28, 2026
97d5783
fix(T-372): TreeLength()/LengthAdded() on uninformative profile chara…
ms609 Jul 28, 2026
fae08ec
chore(red-team): record T-372 fix commit SHA
ms609 Jul 28, 2026
998891e
docs(search): state stopPatience's parallel-path limits; test them
ms609 Jul 28, 2026
73306ba
Merge origin/cpp-search into cpp-search
ms609 Jul 28, 2026
c72fa19
fix: check for user interrupt inside tree_fuse()
ms609 Jul 28, 2026
2abe28e
feat(search): intra-phase heartbeat; accept abbreviated strategy names
ms609 Jul 28, 2026
4152e9a
chore(red-team): port the T-373/T-376 repros into the repo before the…
ms609 Jul 29, 2026
8c43903
chore(spelling): clear the 9 unknown words blocking the sense-check
ms609 Jul 29, 2026
0856748
fix(T-380, T-381): Add dimension and invariant guards to prevent sile…
ms609 Jul 29, 2026
886a1cb
docs(red-team): record T-380 and T-381 fixes in findings.md
ms609 Jul 29, 2026
45a3a03
Merge claude/t380-t381-guards: fix T-380/T-381 (Rcpp dimension guard …
ms609 Jul 29, 2026
9033ea9
fix(collapse): stop reading stale local_cost for ratchet-zeroed block…
ms609 Jul 29, 2026
bf6ee77
Merge claude/t382-collapse-stale: fix T-382 (stale local_cost in coll…
ms609 Jul 29, 2026
35cfcdf
fix(tbr): key the NA optimum cache on the scoring regime; measure wha…
ms609 Jul 29, 2026
1aeba79
docs(red-team): settle the XFORM half of T-374 — keep the objective u…
ms609 Jul 29, 2026
6c1cc16
docs(red-team): correct T-374b's Q-C claim — incoherent, not refuted
ms609 Jul 29, 2026
7a18a4b
docs(red-team): T-374b's "blocker" is the already-filed T-377, not a …
ms609 Jul 29, 2026
2cf78f7
fix(xform): constrain -2 sentinel to known secondaries (T-379)
ms609 Jul 29, 2026
bbcca1b
docs(red-team): record T-379 fix commit SHA in findings.md
ms609 Jul 29, 2026
7685bf0
fix(T-364/T-370): enforce Wagner constraints through the split's comp…
ms609 Jul 29, 2026
796a29d
fix(T-364): re-root the constrained Wagner tree so the split mapping …
ms609 Jul 29, 2026
0a9e7c2
docs(red-team): close T-364/T-370; file T-384 (rooting-blind split ma…
ms609 Jul 29, 2026
52a417c
fix(T-373): mode-aware total_words==0 bail for HSJ/XFORM search kernels
ms609 Jul 29, 2026
7f27164
docs(red-team): record T-373 fix (921500a9) in findings.md
ms609 Jul 29, 2026
12a5866
docs(red-team): tighten T-373 fix note after advisor review
ms609 Jul 29, 2026
e7438cc
feat(tbr): add TBRParams::certify_unrooted, opt-in, plus the counters…
ms609 Jul 29, 2026
5cced68
bench(na): floor-attainment panel for the certify_unrooted gate
ms609 Jul 29, 2026
15ad1bf
fix(driven): do not start a final certification past the maxSeconds b…
ms609 Jul 29, 2026
56f05fb
docs(na-certify): record the panel job ids and the harvest order
ms609 Jul 29, 2026
ecb754e
fix(claude): import AGENTS.md as @../AGENTS.md
ms609 Jul 29, 2026
a84bb71
fix(T-370): verify the finished constrained Wagner tree instead of tr…
ms609 Jul 29, 2026
00f899d
red-team(T-377): convergence-level reach measurement for the Fitch-on…
ms609 Jul 29, 2026
1fdd795
docs(red-team): close T-377 on the convergence-level reach measurement
ms609 Jul 29, 2026
1be2002
fix(prune-reinsert): T-391 constraint compliance verify-and-revert
ms609 Jul 30, 2026
128f732
bench(T-364): three-arm battery — merged fix costs nothing; 1.43x rea…
ms609 Jul 30, 2026
be5dafa
fix(spr): T-390 constraint compliance verify-and-revert
ms609 Jul 30, 2026
32f76e2
docs(red-team): record T-390 fix in findings.md
ms609 Jul 30, 2026
26d8d93
test(AdditionTree): harden T-364 %in%-on-Splits assertions
ms609 Jul 30, 2026
cb2f59c
bench(na): certify_unrooted panel returns -- certification is OVER-SE…
ms609 Jul 30, 2026
aab1c74
docs(na-certify): scope the verdict -- the cap binds, and the loss is…
ms609 Jul 30, 2026
644b5b1
bench(na): second panel -- certification under the SHIPPED stopping r…
ms609 Jul 30, 2026
8bdf7e5
docs(na-certify): the practical recommendation, and the targetHits co…
ms609 Jul 30, 2026
4c66a55
fix(T-384): rooting-agnostic constraint mapping via mask-or-complement
ms609 Jul 30, 2026
041ccf0
docs(red-team): record T-384 fix, and the T-364 battery's reattribution
ms609 Jul 30, 2026
59ccd5c
fix(bench): no git operations inside an array task
ms609 Jul 31, 2026
29b62eb
Embrace `withr`
ms609 Jul 31, 2026
4f9f9ed
Merge remote-tracking branch 'origin/cpp-search' into cpp-search
ms609 Jul 31, 2026
419168d
feat(search): `effort` replaces `strategy`, as a RELATIVE offset
ms609 Jul 31, 2026
cfbf63d
ci: parallelise R dependency installation (Ncpus: 4)
ms609 Jul 31, 2026
12cfd57
DIAGNOSTIC (will revert): drop MaxMin/Remotes to test P3M binary fall…
ms609 Jul 31, 2026
897ba74
Revert "DIAGNOSTIC (will revert): drop MaxMin/Remotes to test P3M bin…
ms609 Jul 31, 2026
e3a5ba0
Revert "ci: parallelise R dependency installation (Ncpus: 4)"
ms609 Jul 31, 2026
2d871b4
fix(effort): drop the invented rung-8 ceiling; double both budget knobs
ms609 Jul 31, 2026
5a2af27
fix(ci): agent-check's arm64 leg was missing sense-check's R env vars
ms609 Jul 31, 2026
21b0800
docs: clear the three R CMD check items blocking sense-check
ms609 Jul 31, 2026
5a8a871
faster eg
ms609 Jul 31, 2026
a8fbba8
Update test-stop-patience.R
ms609 Jul 31, 2026
2bcf201
Revert "fix(ci): agent-check's arm64 leg was missing sense-check's R …
ms609 Jul 31, 2026
242bdd4
test(stopPatience): drop a score assertion that only held at this mac…
Jul 31, 2026
7d4d255
coord: queue the four live HSJ/XFORM P1s; record the T-385 repro on T…
ms609 Jul 31, 2026
9296e87
coord: retract the T-374/T-385 MPT-set refinement -- my measurement w…
ms609 Jul 31, 2026
14d6306
T-385: reproduce the XFORM reported-score / TreeLength disagreement
ms609 Jul 31, 2026
e6bc225
T-385: report the x-transformation score of the tree actually returned
ms609 Jul 31, 2026
18397db
docs: regenerate a MaximizeParsimony example left stale by the effort…
ms609 Jul 31, 2026
bcd5fed
coord: T-385 fixed; T-374's MPT-set residue CONFIRMED reachable
ms609 Jul 31, 2026
8cd5f6e
T-385: share one dataset generator between the two diagnostic scripts
ms609 Jul 31, 2026
90bc3b7
T-385: pin the residue warning, guard the scripts' relative paths
ms609 Jul 31, 2026
f13f0c3
coord: T-385 -> PR #278 (stacked on #277)
ms609 Jul 31, 2026
4b11b58
Merge branch 'cpp-search' into claude/t385-xform-report-agreement
ms609 Aug 1, 2026
bfc2ca8
Merge pull request #278 from ms609/claude/t385-xform-report-agreement
ms609 Aug 1, 2026
7b1b278
bench(na): panel 2 returns -- targetHits escalation is pure cost (0 o…
ms609 Aug 1, 2026
39ded17
fix(ci): project .Rprofile shadowed ~/.Rprofile, killing all binary r…
ms609 Aug 1, 2026
df19a56
perf(ci): pin the dependency snapshot and drop LaTeX from sense-check
ms609 Aug 1, 2026
840cf1c
perf(ci): ignore shinytest2 on Linux legs -- its chromium sysreq cost…
ms609 Aug 1, 2026
f40a170
probe(ci): time docker pull vs setup-r on arm64 (THROWAWAY -- delete …
ms609 Aug 1, 2026
0fedb53
probe(ci): self-trigger on push (workflow_dispatch needs the default …
ms609 Aug 1, 2026
db5c657
bench(na): retract the targetHits headline; panel 3 tests the actual …
ms609 Aug 1, 2026
9418602
probe(ci): remove container probe -- question answered
ms609 Aug 1, 2026
9259684
perf(ci): ignore MaxMin on fast Linux legs -- ~67s/run, no infra needed
ms609 Aug 1, 2026
92d2111
test(ci): bump agent-check cache-version to 3 for a cold-cache MaxMin…
ms609 Aug 1, 2026
3265655
revert(ci): drop throwaway cache-version bump used to verify MaxMin=?…
ms609 Aug 1, 2026
b0bf2ab
coord: T-375/T-376 -> PR #280
ms609 Aug 1, 2026
eb2d540
bench(vine): rule out embedding + NJ-decoder search for LS and for se…
ms609 Aug 1, 2026
117ed7e
ci: consume prebuilt MaxMin binaries from ms609/packages instead of ?…
ms609 Aug 1, 2026
dad1232
.build.timestamp
ms609 Aug 1, 2026
39fcefc
Merge branch 'gha-ccache': fix CI dependency resolution + cut prelimi…
ms609 Aug 1, 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
  •  
  •  
  •  
192 changes: 192 additions & 0 deletions .AGENTS/memory/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# 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) |
| `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++ | 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) |

---

## 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.
170 changes: 170 additions & 0 deletions .AGENTS/memory/benchmarking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# 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`.

**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