Skip to content

feat(sector): implement the gocomb fuse recombination sub-step (default-off)#267

Merged
ms609 merged 2 commits into
claude/sector-drift-combfrom
claude/sector-comb-fuse
Jul 8, 2026
Merged

feat(sector): implement the gocomb fuse recombination sub-step (default-off)#267
ms609 merged 2 commits into
claude/sector-drift-combfrom
claude/sector-comb-fuse

Conversation

@ms609

@ms609 ms609 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Stacks on #266 (base is that branch, so this diff is just the fuse commit — retarget to cpp-search once #266 merges).

What

Completes TNT combined analysis for large sectors: after the sectorCombStarts RAS+drift starts, recombine them with tree_fuse (best start = 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 (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_htu just re-roots the fused tree at the HTU (reusing ts_tbr's existing reroot_at_tip); its sibling is then the whole non-HTU clade, with the content still rooted at sr_mapped. The existing root_ok gate 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_ok fails 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

  • Correctness (local, Zanol 74t + Giles 78t — the wps≥2 / fuse-reroot regime): fuse fires and wins, and every reinserted tree's C++ score equals an independent by-label TreeLength.
  • Marginal A/B (Hamilton 17833725, 100 cells, matched-wall, rasStarts=3): fuse adds no measured benefit over drift-only — 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); env TS_SECT_FUSE=0 disables 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). Reuses tree_fuse and reroot_at_tip; no new scoring code.

🤖 Generated with Claude Code

ms609 and others added 2 commits July 8, 2026 12:53
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 ms609 merged commit bfa5d30 into claude/sector-drift-comb Jul 8, 2026
@ms609 ms609 deleted the claude/sector-comb-fuse branch July 8, 2026 15:15
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant