Skip to content

Retry ladder: time budget with forecast-based cap skipping - #53

Open
Autoplectic wants to merge 2 commits into
mainfrom
bidir-ladder-budget
Open

Autoplectic wants to merge 2 commits into
mainfrom
bidir-ladder-budget

Conversation

@Autoplectic

Copy link
Copy Markdown
Member

Summary

  • build_bidirectional_with_ladder and try_build_bidirectional take time_budget (seconds). Mixed-state construction cannot be interrupted, so before each cap after the first the ladder forecasts its cost as the previous cap's time times the squared cap ratio, skips the cap if the forecast would overrun, and sets BidirBuildResult.budget_exhausted.
  • resolve_bidirectional passes the budget through. generative_model and minimal_wyner_model now charge the build to their own time_budget and give the pipeline what is left.
  • Test: the ladder is driven with a fake clock to check which caps are attempted, with and without a budget.

Why

In the 80-topology 4-state survey (survey4_v3.jsonl), 8 cases timed out. For the ladder cases on one machine, the 10k and 50k caps took 9 s and 86 s, and the 200k cap had not finished after 15 minutes. That is well past the survey's hard timeout, before any bounds were reported.

Results

I reran the 8 timeouts with SURVEY_LADDER_BUDGET=300 (cpfci survey4_v4.jsonl):

  • 4 cases now stop at 50k with budget_exhausted and get future-window brackets.
  • 1 finishes with a full bracket, [1.449, 1.721].
  • 3 still time out. Their build takes 0.4 s (a truncated reverse machine), so the time goes to a pipeline stage that overruns its budget. That is a separate issue and not addressed here.

Survey totals went from 29 brackets / 30 window brackets / 8 timeouts to 30 / 34 / 3.

Test plan

  • tests/test_bidirectional_build.py (5 passed)
  • ruff check, ruff format --check

Made with Cursor

Ryan James and others added 2 commits November 12, 2026 22:36
The bidirectional build's retry ladder ran its 200k-state cap outside any
budget, so 8 of the 80 sampled 4-state processes hit the survey's hard
timeout before reporting bounds. build_bidirectional_with_ladder and
try_build_bidirectional take a time_budget; a cap is skipped when the
previous cap's time times the squared cap ratio would overrun, and
budget_exhausted is set. generative_model and minimal_wyner_model charge
the build to their own time_budget.

Co-authored-by: Cursor <cursoragent@cursor.com>
separating_optima has no deadline and dominated the 120 s wall-clock check
on the Ubuntu CI runners (about 158 s under coverage), failing main since #51.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Autoplectic

Copy link
Copy Markdown
Member Author

Also fixes the Ubuntu CI failure on main since #51: test_coupled_memory_and_targeted_searches_stop_at_an_expired_deadline timed separating_optima (no deadline) inside its 120 s check, which took about 158 s on the Ubuntu runners. The timer now covers only the deadline-bounded searches.

This branch has not been deployed

No deployments
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