Skip to content

Improve A02 final acceptance and enforce solved checks for repro02/03/04 - #36

Draft
seveibar wants to merge 1 commit into
mainfrom
codex/fix-solver-implementation-in-repro02,-repro03,-repro04-hierk4
Draft

Improve A02 final acceptance and enforce solved checks for repro02/03/04#36
seveibar wants to merge 1 commit into
mainfrom
codex/fix-solver-implementation-in-repro02,-repro03,-repro04-hierk4

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Motivation

  • Prevent HighDensitySolverA02 from hard-failing near iteration limits and give it additional recovery passes so repro02/repro03/repro04 finish as solved rather than timing out or failing.
  • Preserve a baseline of all connection segments to allow deterministic fallback/restart sweeps when late-stage convergence stalls.

Description

  • Added a stronger final-acceptance routine by overriding tryFinalAcceptance() to run extra search budget, per-connection fallback attempts, and deferred fallback sweeps via a new tryBruteforceFallbackSweeps() helper.
  • Introduced allConnectionSegs to store the full set of connection segments and initialize unsolvedSegs from it for safe restarts and brute-force sweeps.
  • Made the search loop less fatal by changing the heap-empty and budget-exhausted paths to push the active segment back onto unsolvedSegs and clear temporary state instead of immediately setting failed.
  • Added a forceImmediateRipup flag to tryLastConnectionFallback() to control deferred ripup behavior during forced fallback attempts.
  • Updated repro tests tests/repros/repro02/repro02.test.ts, tests/repros/repro03/repro03.test.ts, and tests/repros/repro04/repro04.test.ts to assert solver.solved === true and solver.failed === false and refreshed the repro02 SVG snapshot at tests/repros/repro02/__snapshots__/repro02.snap.svg.

Testing

  • Ran targeted tests and snapshot update: BUN_UPDATE_SNAPSHOTS=1 bun test tests/repros/repro02/repro02.test.ts tests/repros/repro03/repro03.test.ts tests/repros/repro04/repro04.test.ts and then normal run; all three repro tests passed (snapshots updated where required).
  • Ran the same tests without snapshot update and they passed after the changes (bun test ...) for the three repro files.
  • Ran formatting with bun run format which succeeded.
  • Ran typecheck bunx tsc --noEmit which failed due to unrelated missing dataset module declarations in existing repo scripts/tests (pre-existing issue not introduced by this change).

Codex Task

@vercel

vercel Bot commented Mar 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
high-density-a01 Ready Ready Preview, Comment Mar 14, 2026 0:39am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant