Commit 85ab2ba
committed
gate-based feed coalescing: eliminate cross-feed frontier spikes
Replace 8ms debounce gate with PlanningHorizon — a convergence-aware
gate that only permits new branches when the system has enough
converged queue to survive another branch cycle. safe_depth derived
from measured EMA costs (branch, backward, ruckig per-segment) and
scanned segment durations — no magic numbers.
Two-layer spike prevention:
- Gate prevents back-to-back branches (coalesces rapid slider changes)
- Gated snapshot returns committed_feed when gate closed, ensuring
backward+forward passes always use the same feed within a replan
Three feed entry points, all intentional:
1. evaluate() reads live HAL to detect changes
2. computeBranch() receives target_feed for transition profile
3. snapshot() feeds replanForward (sole source for bulk computation)
committed_feed ties them together: frozen at branch time, returned
by snapshot when gate closed, confirmed at merge.
STALE_PROFILE (step 5) now uses current_feed from evaluate path
instead of RT's canonical_feed_scale — eliminates the independent
feed entry point that RT wrote from live HAL (tp.c:3947,4972).
replanForward returns int (segments visited) for gate tracking.
Budget boosted to 90% when gate closed (vs 50% steady state).
Gate opens from continuation replan, never same cycle as branch,
guaranteeing at least one cycle of coalescing.1 parent 5af6c9b commit 85ab2ba
1 file changed
Lines changed: 340 additions & 155 deletions
0 commit comments