Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1265 commits
Select commit Hold shift + click to select a range
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
871f125
feat(concordance): add unit="trit" (Nelson-Ladiges) to QuartetConcord…
ms609 Jul 10, 2026
b5226a0
feat(concordance): add normalize= chance correction to unit="trit"
ms609 Jul 10, 2026
1318e8f
fix(concordance): match cells in weight=FALSE trit re-zero; test mult…
ms609 Jul 10, 2026
2ac6a6c
feat(concordance): enable normalize= chance correction for unit="quar…
ms609 Jul 10, 2026
8461fc6
perf(concordance): port chance-baseline expectation to C++
ms609 Jul 10, 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
e2d3e0b
fix(hsj): translate token indices to state indices before comparison …
ms609 Aug 1, 2026
840cf1c
perf(ci): ignore shinytest2 on Linux legs -- its chromium sysreq cost…
ms609 Aug 1, 2026
7812a53
test(hsj): add regression coverage that permutes contrast rows, not l…
ms609 Aug 1, 2026
317a9d5
docs: regenerate MaximizeParsimony.Rd (roxygen sync, pre-existing drift)
ms609 Aug 1, 2026
a29ff1d
docs(hsj-paper-oracle): caveat that check [3] passing here isn't a T-…
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
4c96ec3
test(hsj): add a value-level T-375 regression test (secondary "?" res…
ms609 Aug 1, 2026
33702c9
fix(ts_hsj_score): validate tip_labels/absent_state bounds
ms609 Aug 1, 2026
71319a8
docs: promote T-374 caveat to printed output; log HSJ scoring change …
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
d2a2ebc
fix(hsj): validate tip_labels/absent_state on the production search p…
ms609 Aug 1, 2026
bd2c74b
perf(hsj): restore per-character tie-break array sizing, reuse ctz64()
ms609 Aug 1, 2026
a76338f
docs(hsj): fix review-flagged doc gaps -- NEWS accuracy, stale termin…
ms609 Aug 1, 2026
465be29
fix(news): reword to avoid an unlisted possessive-acronym spelling flag
ms609 Aug 1, 2026
93c81a9
Merge pull request #280 from ms609/feature/hsj-token-index-fix
ms609 Aug 2, 2026
b5c52be
fix(hsj): stop charging the inapplicable state as a secondary mismatc…
ms609 Aug 2, 2026
586c40d
fix(hsj): root the secondary labelling canonically at tip 0 (T-374)
ms609 Aug 2, 2026
1d3c5c9
test(hsj): cover T-374 rooting invariance and the reported-vs-returne…
ms609 Aug 2, 2026
1958f21
bench(na): hard-tail panel -- effort works, gating is refuted, notch …
ms609 Aug 2, 2026
6ab8fb8
docs(hsj): record that HSJ is now rooting-invariant; sharpen the pape…
ms609 Aug 2, 2026
c76638f
docs(red-team): T-374 HSJ half fixed in PR #281
ms609 Aug 2, 2026
5f5e5e3
fix(hsj): free a secondary only where its primary CANNOT be present
ms609 Aug 2, 2026
1da16f5
style(hsj): restore comment placement; drop the unused parent array
ms609 Aug 2, 2026
34eea58
Merge pull request #281 from ms609/feature/hsj-rooting-invariant-dp
ms609 Aug 2, 2026
11416f6
docs(red-team): T-374 HSJ half merged as 34eea581
ms609 Aug 2, 2026
bbab0f7
docs(na-certify): supersede the gating recommendation refuted by panel 3
ms609 Aug 2, 2026
e56161a
red-team: area 10 round 2026-08-03 (opus/Opus 5) — 8 filed, T-377 reo…
ms609 Aug 3, 2026
3d9ac49
docs(red-team): T-395/T-396 resolved — the paper decided both
ms609 Aug 3, 2026
5ac9e28
docs(maxinfo): close the maximum-information / concave-branch line
ms609 Aug 4, 2026
03dc565
red-team: area 11 round 2026-08-04 (opus/Opus 5) — 9 filed, 2 refuted
ms609 Aug 4, 2026
20e0e0b
red-team: migrate findings to agent-issues/TreeSearch issue tracker
claude Aug 4, 2026
45e5c88
red-team: pin the findings.md recovery point to a tag, fix two stale …
claude Aug 4, 2026
c8e6b6a
chore: retire file-based coordination for the issue tracker
claude Aug 4, 2026
40ee662
chore: delete dead coordination doc, trim AGENTS.md, complete the eff…
claude Aug 4, 2026
0af3ed0
chore(next-issue): drop issue-number examples, tighten to 111 lines
claude Aug 4, 2026
635a972
Merge branch 'cpp-search' into chore/retire-file-coordination
ms609 Aug 4, 2026
99b79d8
Merge pull request #40 from agent-issues/chore/retire-file-coordination
ms609 Aug 4, 2026
ec9053e
perf(tbr): finish T-300 — incremental rescore for rerooting accepts too
ms609 Aug 4, 2026
4964bf4
red-team: area 12 round 2026-08-04 (sonnet/Sonnet 5) — 2 filed, cover…
claude Aug 4, 2026
77158b9
ci: give the Windows and macOS legs a MaxMin url:: reference
claude Aug 4, 2026
ca007d6
ci: pin install-pandoc so pandoc auto-detect stops re-solving MaxMin …
claude Aug 4, 2026
f96c81e
fix: validate presence and shape at the HSJ/XFORM bridge
ms609 Aug 4, 2026
4e6adae
fix: enforce user constraints at the start-tree, pool-capture and col…
ms609 Aug 4, 2026
6a814a7
docs: fix GHA dispatch recipe to use absolute script paths
ms609 Aug 4, 2026
b19d460
Merge pull request #49 from agent-issues/feature/hierarchy-guards
ms609 Aug 4, 2026
e3c294d
test(EasyTrees): let the dataset load settle before setting treeRange
ms609 Aug 4, 2026
ea4d367
Merge branch 'cpp-search' into claude/exciting-greider-977d08
ms609 Aug 4, 2026
3917e94
docs: use C:/ path style consistent with rest of AGENTS.md
ms609 Aug 4, 2026
da88e53
Merge pull request #52 from agent-issues/claude/exciting-greider-977d08
ms609 Aug 4, 2026
2dde491
fix(wagner): pass real min_steps to AdditionTree()'s Wagner build; no…
ms609 Aug 4, 2026
73a0e87
branches: ["**"]
ms609 Aug 4, 2026
93f489d
Merge pull request #53 from agent-issues/ms609-patch-1
ms609 Aug 4, 2026
b332720
Merge branch 'cpp-search' into feature/shiny-debounce-wait
ms609 Aug 4, 2026
7c8c3ab
fix: reject non-binary trees at the TreeState boundary
ms609 Aug 4, 2026
a9f872c
fix(docs): correct the false $score claim; tighten and extend min_ste…
ms609 Aug 4, 2026
8cfbf3b
fix: address review findings on the constraint gates
ms609 Aug 4, 2026
7faf23a
Merge branch 'cpp-search' into feature/ci-maxmin-windows
ms609 Aug 4, 2026
f00478c
Merge pull request #45 from agent-issues/feature/ci-maxmin-windows
ms609 Aug 4, 2026
2c59965
Merge pull request #48 from agent-issues/feature/shiny-debounce-wait
ms609 Aug 4, 2026
9d8696a
Merge branch 'cpp-search' into feature/multifurc-oob
ms609 Aug 5, 2026
8f66fe9
Merge branch 'cpp-search' into feature/wagner-docs
ms609 Aug 5, 2026
2397620
fix: make the constraint standard one thing, and say what it is
ms609 Aug 5, 2026
4b0f740
Merge branch 'cpp-search' into feature/redteam-area12
ms609 Aug 5, 2026
174f65b
Merge pull request #44 from agent-issues/feature/redteam-area12
ms609 Aug 5, 2026
ca5c1c0
fix(hsj): skip the childless case before pointing into co.kids
ms609 Aug 5, 2026
7519527
Merge branch 'cpp-search' into claude/treesearch-issue-38-8103cc
ms609 Aug 5, 2026
bd0f70d
docs(red-team): move the skill in-repo, GitHub-issues only; close the…
ms609 Aug 5, 2026
76cec86
fix(red-team): the skill stays user-level — this branch carries rotat…
ms609 Aug 5, 2026
5928f7f
docs: record the local assertions-build route for HSJ/XFORM bounds bugs
ms609 Aug 5, 2026
25031cc
fix: loosen constraint matching to the documented free-taxa contract
ms609 Aug 5, 2026
44924e5
review(tbr): make n_reroot_accepts witness the arm it guards
ms609 Aug 5, 2026
38ded4d
review: correct the mechanism claim; land the CanonOrder evidence script
ms609 Aug 5, 2026
bf11273
test: pin the collapse pass's constraint protection
ms609 Aug 5, 2026
c054e3f
docs(news): name the mechanism that aborted, not the workflow that st…
ms609 Aug 5, 2026
720e423
fix: size the exact solver's guards to the work its gate admits
ms609 Aug 5, 2026
38115e4
Merge pull request #55 from agent-issues/feature/wagner-docs
ms609 Aug 5, 2026
3d3e3c2
Merge pull request #50 from agent-issues/feature/multifurc-oob
ms609 Aug 5, 2026
1d55546
Merge pull request #47 from agent-issues/claude/treesearch-issue-38-8…
ms609 Aug 5, 2026
72e25b7
fix(gitignore): narrow /.agent* to /.agent-* to stop matching .AGENTS…
ms609 Aug 5, 2026
57ee380
fix: address review of the loosened constraint contract
ms609 Aug 5, 2026
f8eab96
red-team(area 13): opus finder sweep, 12 findings filed (#61-#72)
ms609 Aug 5, 2026
88cf860
Merge pull request #74 from agent-issues/feature/gitignore-agents-col…
ms609 Aug 5, 2026
dfbd2d2
Merge branch 'cpp-search' into feature/constraint-holes
ms609 Aug 5, 2026
74d901d
docs: denominate the profile-scoring gate in work, not seconds
ms609 Aug 5, 2026
99ca3f0
fix: close the review's remaining gaps in the constraint contract
ms609 Aug 5, 2026
cdb21ee
fix: keep the 2 s budget as the binding limit; scale it only for sani…
ms609 Aug 5, 2026
e81354f
red-team(area 1): version-bump opus sweep, 8 findings filed (#76-#83)
ms609 Aug 5, 2026
d030640
Merge pull request #73 from agent-issues/feature/hsj-oob-read
ms609 Aug 5, 2026
688ec05
Merge branch 'cpp-search' into feature/constraint-loosen
ms609 Aug 5, 2026
51dfe38
red-team: enact area 14 (statistics/support-metrics) + first-ever opu…
ms609 Aug 5, 2026
f9c4e63
Merge pull request #59 from agent-issues/feature/constraint-holes
ms609 Aug 5, 2026
1fb915d
Merge remote-tracking branch 'origin/cpp-search' into feature/asan-quiet
ms609 Aug 5, 2026
3fa12e9
fix: scatter free taxa when building a random constrained start tree
ms609 Aug 5, 2026
53f3dc5
Merge pull request #57 from agent-issues/claude/red-team-skill-github…
ms609 Aug 5, 2026
17d7aaa
Merge cpp-search: resolve the two area-14 definitions in #57's favour
ms609 Aug 5, 2026
7b1a96a
red-team: restore the area-14 leads the merge resolution dropped
ms609 Aug 5, 2026
38a6ffd
Merge pull request #284 from agent-issues/cpp-search
ms609 Aug 5, 2026
e0629be
Merge pull request #75 from agent-issues/claude/red-team-07b219
ms609 Aug 5, 2026
2e50743
Merge branch 'cpp-search' into feature/constraint-loosen
ms609 Aug 5, 2026
3d5701f
Merge branch 'cpp-search' into feature/constraint-loosen
ms609 Aug 5, 2026
58d119c
Guard zero-length memcpy in StateSnapshot save/restore
ms609 Aug 5, 2026
9566d23
@
ms609 Aug 5, 2026
64bebf4
fix: sample every constraint-permitting topology, not one corner of them
ms609 Aug 5, 2026
f250b91
ci: add libstdc++ hardened-assertions leg to agent-check.yml
ms609 Aug 5, 2026
60a9a67
@
ms609 Aug 5, 2026
ba39c53
Merge pull request #84 from agent-issues/feature/constraint-loosen
ms609 Aug 5, 2026
867eb28
Merge pull request #123 from agent-issues/feature/asan-quiet
ms609 Aug 5, 2026
3e5cfc3
Fix six red-team findings in ClusterStrings.R and ParsSim.R
ms609 Aug 5, 2026
5409268
Fix four Consistency.R bugs: token-remapping, cache collision, matrix…
ms609 Aug 5, 2026
177f991
Fix seven small R-API bugs: #98, #114, #115, #116, #117, #119, #120
ms609 Aug 5, 2026
25ce60b
ci: gate the new leg's install failure and separate its cache
ms609 Aug 5, 2026
c72494e
Merge cpp-search: keep #59's constraint docs, add the sampler's
ms609 Aug 5, 2026
cd991cb
Merge pull request #127 from agent-issues/feature/expected-mi-underflow
ms609 Aug 5, 2026
5441b55
Merge branch 'cpp-search' into feature/clusterstrings-parssim
ms609 Aug 5, 2026
85b0dc9
Merge pull request #129 from agent-issues/feature/clusterstrings-parssim
ms609 Aug 5, 2026
b633968
Merge cpp-search into feature/tbr-memcpy-nonnull
ms609 Aug 5, 2026
3d647c1
Add 'etc' to inst/WORDLIST
ms609 Aug 5, 2026
b0a0461
Widen expected-MI cache keys to the full integer range
ms609 Aug 5, 2026
6b30f5c
Fix .SortTokens() crash for states only seen inside a polymorphism
ms609 Aug 5, 2026
0b5ca4f
Fix eight Concordance.R bugs from red-team area 14
ms609 Aug 5, 2026
304e389
Reword NEWS/test comments to avoid nonstandard "errored"/"erroring"
ms609 Aug 5, 2026
172fa82
Merge pull request #134 from agent-issues/feature/tbr-memcpy-nonnull
ms609 Aug 6, 2026
cb5540c
Guard ts_bench_tbr_phases against zero Fitch words
ms609 Aug 6, 2026
960dd7d
Fix fractional character weights truncated to zero before resampling
ms609 Aug 6, 2026
de8b397
fix(rearrange): break the root edge in all_tbr()
ms609-agent Aug 6, 2026
a9e2634
feat(effort): scale the MPT-enumeration ceiling, not poolMaxSize
ms609-agent Aug 6, 2026
ffb4bf0
Fix copy-paste error in SPRMoves() roxygen @return
ms609-agent Aug 6, 2026
5710409
Fix Ratchet() early-exit bookkeeping (A15-04)
ms609-agent Aug 7, 2026
6b6b004
Merge pull request #175 from agent-issues/claude/issue-136-assignment…
ms609 Aug 7, 2026
19ed719
Merge pull request #172 from agent-issues/claude/issue-139-a4d9d1
ms609 Aug 7, 2026
5169d04
Merge branch 'cpp-search' into feature/tbr-root-edge
ms609 Aug 7, 2026
de519af
Merge pull request #142 from agent-issues/feature/sorttokens-orphan-s…
ms609 Aug 7, 2026
85981b8
Merge branch 'cpp-search' into feature/consistency-fixes
ms609 Aug 7, 2026
9a62481
Merge branch 'cpp-search' into feature/r-api-fixes
ms609 Aug 7, 2026
abcc67e
Merge branch 'cpp-search' into feature/concordance-fixes
ms609 Aug 7, 2026
e0e4f42
Write the wider cache key through a pointer, not by appending
ms609-agent Aug 7, 2026
34e50b2
Canonicalize the ExpectedLength() cache key
ms609 Aug 7, 2026
de256de
Nest the length cache per tree, and document rhi's NA case
ms609 Aug 7, 2026
3a4fcdf
Merge pull request #133 from agent-issues/feature/ci-glibcxx-assertions
ms609 Aug 7, 2026
bff1937
Merge branch 'cpp-search' into feature/r-api-fixes
ms609 Aug 7, 2026
877efc7
Merge remote-tracking branch 'origin/cpp-search' into feature/mi-key-…
ms609-agent Aug 7, 2026
fd42a13
Record why the length cache keys on topology, not tree shape
ms609 Aug 7, 2026
33ecbe8
docs: correct the sampler's rationale; guard two boundaries
ms609-agent Aug 7, 2026
d7e3fcf
Key the length cache on tree shape rather than labelled topology
ms609 Aug 7, 2026
9f1018d
Merge pull request #173 from agent-issues/feature/tbr-root-edge
ms609 Aug 7, 2026
247a66f
Merge pull request #146 from agent-issues/feature/concordance-fixes
ms609 Aug 7, 2026
fea64d2
Merge pull request #140 from agent-issues/feature/r-api-fixes
ms609 Aug 7, 2026
72f595c
Merge pull request #174 from agent-issues/feature/bench-zero-words
ms609 Aug 7, 2026
a973fa8
Merge branch 'cpp-search' into feature/consistency-fixes
ms609 Aug 7, 2026
3c57427
Merge pull request #176 from agent-issues/feature/fix-sprmoves-doc
ms609 Aug 7, 2026
2aa25c6
Merge pull request #141 from agent-issues/feature/mi-key-cache-aliasing
ms609 Aug 7, 2026
8afbd73
Merge pull request #122 from agent-issues/feature/constraint-random-tree
ms609 Aug 7, 2026
73e96c1
Merge pull request #130 from agent-issues/feature/consistency-fixes
ms609 Aug 7, 2026
d6096b6
Re-audit degenerate-container UB, and put the class under CI
ms609-agent Aug 7, 2026
2774dad
Record what was checked about L3b, and what was not
ms609-agent Aug 7, 2026
5e6396b
Merge pull request #178 from agent-issues/feature/ub-class-audit
ms609 Aug 8, 2026
8b6e502
Merge pull request #285 from ms609/feature/enum-pool-ceiling
ms609 Aug 11, 2026
089b851
Follow the MaxMin -> Coreset package rename
ms609 Aug 17, 2026
fa703e4
Merge agent-issues/cpp-search into cpp-search
ms609-agent Aug 18, 2026
db894a7
Merge pull request #180 from agent-issues/claude/coreset-rename
ms609 Aug 18, 2026
0331a5c
Comment bla
ms609 Aug 18, 2026
ec079d2
-blather
ms609 Aug 18, 2026
4f25dfd
-blather
ms609 Aug 18, 2026
2b84f2f
Simplify
ms609 Aug 18, 2026
7b94145
Merge latest agent-issues/cpp-search into the sync branch
ms609-agent Aug 18, 2026
0c66278
test(constraint): match the reworded free-taxa warnings; fix Igoring …
ms609-agent Aug 18, 2026
dd1f1b9
Merge pull request #287 from ms609/sync/cpp-search-from-agent-issues
ms609 Aug 18, 2026
df97c05
refactor(concordance)!: name the chance correction and the NRQS currency
ms609 Aug 21, 2026
9ec3c00
Simplify @return
ms609 Aug 21, 2026
bbfc41e
Simplify param
ms609 Aug 21, 2026
5d5f325
refactor: follow the MaxMin package's rename to Coreset
ms609 Aug 21, 2026
cd0315e
Add concordance vocabulary to WORDLIST
ms609 Aug 21, 2026
f5b7f3a
Simplify chanceCorrect
ms609 Aug 21, 2026
c1cede6
docs: give chanceCorrect a single definition
ms609 Aug 21, 2026
b56e4d7
Simplify
ms609 Aug 21, 2026
b6416a3
Merge cpp-search into the concordance branch
ms609 Aug 21, 2026
009164f
Merge branch 'feat/quartet-concordance-trit-unit' of https://github.c…
ms609 Aug 21, 2026
984ba7d
docs: regenerate SiteConcordance.Rd for the reworded chanceCorrect
ms609 Aug 21, 2026
340e816
Redoc; no unneeded WORDLIST exceptions
ms609 Aug 21, 2026
c9b5792
Use bullets
ms609 Aug 21, 2026
83176f7
Merge pull request #276 from ms609/feat/quartet-concordance-trit-unit
ms609 Aug 21, 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
  •  
  •  
  •  
233 changes: 233 additions & 0 deletions .AGENTS/memory/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
# 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

- A constraint split names **two disjoint groups** plus a FREE remainder. A tree
satisfies it iff some edge separates the groups; free tips may fall either
side. This is what `?MaximizeParsimony`'s `constraint` documents and, since
agent-issues/TreeSearch#54, what every entry point enforces. `ts::node_displays_split()`
(`ts_constraint.h`) is THE shared predicate — `map_constraint_nodes()`,
`wagner_tree_displays_constraint()` and `ts_collapse_pool()` all call it.
Reintroducing an exact-clade test at any one of them freezes replicates.
- `build_constraint()` reads R split matrix with **column-major** indexing:
`split_matrix[s + n_splits * t]`. Values: `1` = together-group, `0` =
apart-group, **anything else (`NA_INTEGER`) = free**. A hand-built 0/1 matrix
therefore means "no free tips" and reduces to the exact-clade behaviour, which
is what `build_constraint_from_bitsets()` (consensus constraints) relies on.
- `ConstraintData` carries `split_zeros` (the apart-group) alongside
`split_tips`, and both ends of the displaying-node chain:
`constraint_node` (tightest, used for "must land outside") and
`constraint_node_hi` (highest, "must land inside"). Any writer of one must
write the other — `ts_wagner.cpp` pins hi to the tight anchor.
- `.PrepareConstraint()` drops (and warns about) a character whose `1` **or**
`0` group holds fewer than two taxa: vacuous under the documented contract,
since every tree separates such a group from the rest.
- A user constraint binds at three boundaries besides the per-move filter
(agent-issues/TreeSearch#59): the start tree is repaired by `impose_constraint()`
before it is scored, each replicate's finished tree is gated by
`capture_satisfies_constraint()` on its way into the pool, and the enforced
split is kept out of the final collapse. `impose_constraint()` is heuristic and
can fail, so every caller re-verifies. The collapse protects a realising node
only when no other realising node already survives — protecting
unconditionally would resolve a branch the constraint never asked for.
- `random_constrained_tree()` (`ts_wagner.cpp`, the `RANDOM_TREE` start
strategy) has TWO samplers. No free tips → the old group-nesting backbone,
which is then complete and uniform. Any free tip → tip-at-a-time insertion:
rejection first (uniform when it lands), then legality-filtered insertion
(always lands), then unnamed tips unfiltered. The backbone alone reaches only
15 of 35 compliant trees on 6 taxa / 1 character, and 105 of 1155 on 8 taxa /
2 characters; insertion reaches all. The filter is
`regraft_violates_constraint()` with a one-tip clip, over masks restricted to
the placed tips — unrestricted masks make every edge look illegal. Probe via
`ts_random_constrained_tree()`, not `MaximizeParsimony()`: TBR rearranges the
start, so the returned tree says nothing about the generator. The rejection
pass is wasted work when it cannot land (agent-issues/TreeSearch#128).
- A compliance checker built on `as.Splits()` MISSES pendant edges, so a
constraint whose group has one taxon reads as violated when every tree
satisfies it. Add the trivial splits before testing.
- 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.
Loading
Loading