Priority: P3 · Former status: PARKED (d7, other ) · Blocks: —
Lazy apply_tbr_move rescore in tbr_search. After the score_fresh flag was wired (companion to T-187/PSF work), the trailing full_rescore at function exit is now skipped when states are coherent. The remaining redundancy is the full_rescore(tree, ds) call at ts_tbr.cpp:1134, run after every successful apply_tbr_move to obtain the authoritative score for the acceptance check. Each call is O(n_node × total_words). Since the move is local (clip + reroot + regraft), the indirect-evaluation pre-check at ts_tbr.cpp:767-772 already shows that fitch_incremental_downpass/uppass from the join point gives the correct score in O(affected_subtree_depth × total_words) instead. Plan: make apply_tbr_move push touched nodes onto the prealloc_undo stack, return the join node, and replace line 1134's full_rescore with fitch_incremental_downpass from that node. Estimated savings: O(n_char) per accepted move × ~10–100 accepted moves per replicate. Risk: medium — apply_tbr_move is the hot correctness-critical path; need careful unit tests covering NA/non-NA, IW/EW, constrained/unconstrained, equal-accept paths. Validate by comparing scores against current unconditional rescore on a battery of datasets before committing.
Migrated 2026-08-04 from the retired to-do.md; former task id T-300. Full original row: git show findings-md-final:to-do.md. Task state now lives in this tracker — see dev/red-team/migration-map.tsv for red-team ids.
Priority: P3 · Former status: PARKED (d7, other ) · Blocks: —
Lazy
apply_tbr_moverescore intbr_search. After thescore_freshflag was wired (companion to T-187/PSF work), the trailingfull_rescoreat function exit is now skipped when states are coherent. The remaining redundancy is thefull_rescore(tree, ds)call atts_tbr.cpp:1134, run after every successfulapply_tbr_moveto obtain the authoritative score for the acceptance check. Each call is O(n_node × total_words). Since the move is local (clip + reroot + regraft), the indirect-evaluation pre-check atts_tbr.cpp:767-772already shows thatfitch_incremental_downpass/uppassfrom the join point gives the correct score in O(affected_subtree_depth × total_words) instead. Plan: makeapply_tbr_movepush touched nodes onto the prealloc_undo stack, return the join node, and replace line 1134'sfull_rescorewithfitch_incremental_downpassfrom that node. Estimated savings: O(n_char) per accepted move × ~10–100 accepted moves per replicate. Risk: medium —apply_tbr_moveis the hot correctness-critical path; need careful unit tests covering NA/non-NA, IW/EW, constrained/unconstrained, equal-accept paths. Validate by comparing scores against current unconditional rescore on a battery of datasets before committing.Migrated 2026-08-04 from the retired
to-do.md; former task id T-300. Full original row:git show findings-md-final:to-do.md. Task state now lives in this tracker — seedev/red-team/migration-map.tsvfor red-team ids.