feat(sector): implement the gocomb fuse recombination sub-step (default-off)#267
Merged
Merged
Conversation
Completes TNT combined analysis for large sectors: after the sectorCombStarts RAS+drift starts, recombine them with tree_fuse (best start as recipient, the others as donors) and keep the fused tree only if it beats every start. Previously gocomb was RAS+drift keep-best; the fuse step was deferred because tree_fuse re-roots the reduced tree at tip 0, dropping the (HTU, sr_mapped) synthetic-root layout reinsert_sector needs. Re-anchoring: parsimony is rooting-invariant, so reanchor_fused_at_htu simply re-roots the fused tree at the HTU pseudo-tip. The HTU represents the rest of the tree at the sector boundary and stays adjacent to the content root, so its sibling after re-rooting is the whole non-HTU clade -- exactly what reinsert_sector grafts back, with the content clade still rooted at sr_mapped. The fused tree is accepted only through the SAME root_ok gate + reinsert path as the drift starts (no reduced-score shortcut); if fuse ever floated the HTU into the interior -- the move the drift path already reverts -- root_ok fails and the best RAS+drift start stands, so a fused tree is reinserted only when its id mapping is already valid. Default-OFF (needs sectorGoComb > 0); env TS_SECT_FUSE=0 disables only the fuse step (drift-only comb) to isolate its marginal contribution in an A/B. Reuses the existing tree_fuse and ts_tbr's reroot_at_tip; no new scoring code. Local correctness gate (Zanol2014 74t, Giles2015 78t -- the wps>=2 regime): fuse fires and wins, and every reinserted tree's C++ score equals an independent by-label TreeLength. An initial permutation-remap for the HTU-float case was implemented, found empirically unreachable (the content root always keeps id sr_mapped), and removed to avoid shipping untested pointer surgery. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds dev/benchmarks/sector_fuse_ab.R: within each combStarts level the fuse and drift-only arms differ only by TS_SECT_FUSE, so any delta is fuse alone. Records the pre-committed decision rule (beat drift-only -> opt-in, else stay default-off). This is the harness behind the null marginal result. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ms609
added a commit
that referenced
this pull request
Jul 8, 2026
…#266) * feat(sector): TNT-style in-sector drifting for large sectors (opt-in) Large sectorial sub-problems have more reach but get stuck in their own local optima under plain RAS+TBR. Add TNT `sectsch godrift`/`gocomb`: sectors with >= sectorGoDrift real tips are re-solved by tree-drifting; >= sectorGoComb by combined analysis (sectorCombStarts RAS+drift starts, keep-best). Reuses the existing drift_search; default-OFF (both thresholds 0) so every current search is byte-identical. Anchoring: an unmasked drift on the HTU-anchored reduced sector tree floats the HTU (re-roots the sector vs the rest of the tree) in ~80% of solves, which the root-structure check then reverts to a NON-TBR'd topology -> net-negative. Fixed by threading an optional sector_mask through drift_search -> drift_phase and its internal tbr_search calls (additive, default nullptr; top-level driven_search drift unaffected): search_sector pins the synthetic root, HTU, content root and its two children per RAS start, cutting the HTU-float revert rate ~80% -> ~12%. Residual reverts stay safe via the existing root_ok check. Validated (Hamilton matched-wall A/B, 4 EW sector-resolve datasets x 5 seeds, rasStarts=3 both arms, sectorMaxSize=80): pinned godrift wins-or- ties every dataset with zero regressions for 3-cycle arms (sectorGoDrift 25-40, sectorDriftCycles=3). Shipped OPT-IN only; the recipe-default flip is gated on a separate preset-level (rasStarts- matched) A/B. The gocomb fuse recombination sub-step is deferred (sectorFuseRounds reserved/unused). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat(sector): implement the gocomb fuse recombination sub-step (default-off) (#267) * feat(sector): implement the gocomb fuse recombination sub-step Completes TNT combined analysis for large sectors: after the sectorCombStarts RAS+drift starts, recombine them with tree_fuse (best start as recipient, the others as donors) and keep the fused tree only if it beats every start. Previously gocomb was RAS+drift keep-best; the fuse step was deferred because tree_fuse re-roots the reduced tree at tip 0, dropping the (HTU, sr_mapped) synthetic-root layout reinsert_sector needs. Re-anchoring: parsimony is rooting-invariant, so reanchor_fused_at_htu simply re-roots the fused tree at the HTU pseudo-tip. The HTU represents the rest of the tree at the sector boundary and stays adjacent to the content root, so its sibling after re-rooting is the whole non-HTU clade -- exactly what reinsert_sector grafts back, with the content clade still rooted at sr_mapped. The fused tree is accepted only through the SAME root_ok gate + reinsert path as the drift starts (no reduced-score shortcut); if fuse ever floated the HTU into the interior -- the move the drift path already reverts -- root_ok fails and the best RAS+drift start stands, so a fused tree is reinserted only when its id mapping is already valid. Default-OFF (needs sectorGoComb > 0); env TS_SECT_FUSE=0 disables only the fuse step (drift-only comb) to isolate its marginal contribution in an A/B. Reuses the existing tree_fuse and ts_tbr's reroot_at_tip; no new scoring code. Local correctness gate (Zanol2014 74t, Giles2015 78t -- the wps>=2 regime): fuse fires and wins, and every reinserted tree's C++ score equals an independent by-label TreeLength. An initial permutation-remap for the HTU-float case was implemented, found empirically unreachable (the content root always keeps id sr_mapped), and removed to avoid shipping untested pointer surgery. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test(sector): matched-wall harness isolating the gocomb-fuse margin Adds dev/benchmarks/sector_fuse_ab.R: within each combStarts level the fuse and drift-only arms differ only by TS_SECT_FUSE, so any delta is fuse alone. Records the pre-committed decision rule (beat drift-only -> opt-in, else stay default-off). This is the harness behind the null marginal result. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #266 (base is that branch, so this diff is just the fuse commit — retarget to
cpp-searchonce #266 merges).What
Completes TNT combined analysis for large sectors: after the
sectorCombStartsRAS+drift starts, recombine them withtree_fuse(best start = recipient, the others as donors) and keep the fused tree only if it beats every start. Previouslygocombwas RAS+drift keep-best; the fuse step was deferred becausetree_fusere-roots the reduced tree at tip 0, dropping the(HTU, sr_mapped)synthetic-root layoutreinsert_sectorneeds.Re-anchoring (the deferral obstacle, resolved)
Parsimony is rooting-invariant, and the HTU pseudo-tip represents the rest of the tree at the sector boundary — so it stays structurally adjacent to the content root.
reanchor_fused_at_htujust re-roots the fused tree at the HTU (reusing ts_tbr's existingreroot_at_tip); its sibling is then the whole non-HTU clade, with the content still rooted atsr_mapped. The existingroot_okgate accepts it, and the fused tree is reinserted through the same gate + path as the drift starts (no reduced-score shortcut). If fuse ever floats the HTU into the interior — the move the drift path already reverts —root_okfails and the best RAS+drift start stands, so a fused tree is reinserted only when its id mapping is already valid. An initial permutation-remap for the float case was implemented, found empirically unreachable, and removed to keep untested pointer surgery out of the merge.Validation
TreeLength.comb_fuse − comb_drift= +0.00 (1/18/1) at combStarts=3, −0.15 (4/14/2) at combStarts=6. The drift path carries the whole gain (comb_drift − base= −1.55). Cause: fuse gets ≥2 distinct donors only ~1/20 comb solves — the RAS+drift starts converge, so there is usually nothing to recombine.Scope
Default-OFF (needs
sectorGoComb > 0); envTS_SECT_FUSE=0disables only the fuse step. Landed for TNT combined-analysis parity / completeness — not a wall-clock lever, and deliberately not enabled in any recipe. The wall-clock lever is godrift (#266). Reusestree_fuseandreroot_at_tip; no new scoring code.🤖 Generated with Claude Code