Record initialization failures when stepping a solver - #37
Open
ugin-man wants to merge 3 commits into
Open
Conversation
|
@ugin-man is attempting to deploy a commit to the tscircuit Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
_setup()throws duringstep()orsolve(), the exception currently escapes before the existing failure handler. The solver remainsfailed = falsewitherror = null, and a subsequentstep()retries initialization.step()also initializes a solver that was already marked solved or failed.Move initialization inside the existing step exception handler and check terminal state before initialization. Keep the post-setup terminal check, so setup may still finish or reject a problem without consuming an iteration. Rethrow the original exception and leave direct explicit
setup()calls and final-acceptance behavior unchanged.Nine regression/control tests cover setup exceptions through step/solve, no automatic retry, already terminal solvers, terminal states set during setup, successful one-time setup and existing step exceptions.
Verification
At head
d3a16d9183de027b280c8754f8c9be62bc677794, all three upstream checks passed:The initial CI run passed tests/typechecking and requested only assertion formatting; the follow-up commit resolves that check.
Local verification: the exact BaseSolver source was checked against Git blob
e071bf8c1fe3e2fb4eae73bbaa4e282871d15f02. With Node 22.16.0 type stripping, the new cases yielded 5 failures / 4 passes before, and 9 passes after. The local test copy only changes thebun:testimport tonode:testand adds.tsto the source import, using the same Node assert assertions without production mocks. The graphics-debug import is type-only. No build or browser test is claimed.Base:
a72b99f60680ffbe56a4c72e113ca52c9469921e; independent of pending #30, #35 and #36. Prepared with ChatGPT assistance and the account owner's authorization. No manual human testing is claimed.