Skip to content

Add TNT-style transient autoconstraint (default OFF, opt-in)#271

Open
ms609 wants to merge 4 commits into
cpp-searchfrom
claude/transient-autoconstraint-5432
Open

Add TNT-style transient autoconstraint (default OFF, opt-in)#271
ms609 wants to merge 4 commits into
cpp-searchfrom
claude/transient-autoconstraint-5432

Conversation

@ms609

@ms609 ms609 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adds transientAutoconst (+ transientAutoconstMinReps) to SearchControl() — a per-replicate, TNT-style transient autoconstraint, distinct from the existing rigid consensusConstrain. Default OFF, additive, flag-gated.

Each replicate:

  1. builds its Wagner start unconstrained;
  2. forms a constraint = strict consensus of the previous replicates' best-score pool trees ∩ this replicate's own Wagner-start splits (TNT's "previous and wagner");
  3. enforces it only over the early stages (initial TBR + first sectorial pass);
  4. releases it before ratchet / drift / later-sectorial / final-TBR.

The first replicate of each hit (rep 0, or any rep immediately after a new best) is left unconstrained. Because the constraint refreshes every replicate and is never permanently locked, it can guide early search without entrenching a basin — unlike the rigid path, which can permanently lock splits that forbid the optimum.

Constraint-mapping fix (valid-by-construction)

map_constraint_nodes matches a rooted node subtree exactly, so a split whose tip-0-free clade is not a rooted clade of the current tree fails to map (constraint_node == -1) and would then spuriously reject moves. Such splits are dropped and the constraint rebuilt from the mapped subset, so every enforced split maps to a real node. The unmappable fraction scales with tree depth (tip-0's ancestor count), so it is ~19% at 62 tips but only ~1% at 482 tips.

Safety / no-op-when-off

  • Default OFF; mutually exclusive with the rigid path and with a user constraint.
  • Env kill-switch TS_NO_TRANSIENT_AUTOCONST.
  • Off-path byte-identical to the prior engine (verified: identical replicate trajectories / candidate counts vs the pristine tip).
  • Existing constraint + SearchControl test suites pass unchanged.

Validation (why it's opt-in, not a default)

Built and A/B-tested on project5432 (482 tips) — the corpus's lone never-reached floor (optimum 1943; TS plateaus ~1948–1949). Matched engine, matched seeds, exact thorough + sectorMax45 + tbrMaxHits20 config:

  • Engages healthily: median 124 enforced splits/rep, enforced/kept ≈ 0.99 — a large, real constraint, so the result is interpretable (not a frozen artifact).
  • Clean null: no dose-response (a seed with 35 engaged reps returned the worst ON result; a seed with 13 returned the best), and nothing came within 4 steps of 1943; no matched-seed effect.
  • Mechanism of the null: the first-rep-of-hit rule makes it engage post-convergence, so the consensus it builds is the already-converged 1950-basin consensus — releasing late drops the search straight back into that basin.

Kept as a documented default-OFF opt-in knob (same disposition as other built-and-A/B'd TNT features that came up null).

🤖 Generated with Claude Code

ms609 and others added 4 commits July 10, 2026 12:54
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…t-in)

Add `transientAutoconst` (+ `transientAutoconstMinReps`): a per-replicate
TNT-style autoconstraint, distinct from the rigid `consensusConstrain`.
Each replicate constrains its early stages (initial TBR + first sectorial
pass) by the strict consensus of previous replicates' pool trees
intersected with its own Wagner start, then RELEASES the constraint before
ratchet/drift/late-sectorial/final-TBR. The first replicate of each hit is
left unconstrained ("hits are totally independent"). It refreshes per
replicate and never permanently locks a split, so it guides early search
without entrenching a basin (the rigid path can lock splits that forbid the
optimum).

map_constraint_nodes matches a rooted node subtree exactly, so a split
whose tip-0-free clade is not a rooted clade of the current tree fails to
map and would spuriously reject moves. Such splits are dropped and the
constraint rebuilt valid-by-construction; the drop scales with tree DEPTH
(~19% of splits at 62 tips, ~1% at 482 tips).

Default OFF; env kill-switch TS_NO_TRANSIENT_AUTOCONST; byte-identical to
the prior engine when off. Validated on project5432 (482t): engages with a
large, healthy constraint (~124 splits/rep) but does not help reach the
1943 optimum (clean null, no dose-response) — kept as an opt-in knob.

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