Skip to content

Conversation

@0xkarmacoma
Copy link
Collaborator

surprisingly hard to figure out what the corresponding path_id/query was when we get an error, so for now let's make this optional in solver_output

this properly returns [ERROR] on tests that have solver_outputs with errors (could be PASS previously)

surprisingly hard to figure out what the corresponding path_id/query was when we get an error, so for now let's make this optional in solver_output

this properly returns [ERROR] on tests that have solver_outputs with errors (could be PASS previously)
@0xkarmacoma 0xkarmacoma marked this pull request as draft July 30, 2025 00:43
@0xkarmacoma 0xkarmacoma requested a review from Copilot July 30, 2025 23:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves error handling in the Halmos symbolic execution tool by ensuring that SolverOutput objects are created even when solver errors occur. This addresses an issue where it was difficult to determine the corresponding path_id and query when errors happened.

Key changes:

  • Adds a new from_error static method to SolverOutput class for creating error outputs
  • Refactors error handling in the solve callback to always create SolverOutput objects
  • Updates test configuration to use z3 solver instead of cvc5

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/halmos/solve.py Adds from_error static method to SolverOutput for creating error outputs
src/halmos/main.py Refactors error handling to always create SolverOutput objects and improves error reporting
tests/test_config.py Updates test configuration to use z3 solver instead of cvc5

@0xkarmacoma 0xkarmacoma marked this pull request as ready for review July 30, 2025 23:26
@0xkarmacoma 0xkarmacoma requested a review from daejunpark July 30, 2025 23:26
if not is_benign_solving_error(e):
error(f"encountered exception during assertion solving: {e!r}")
return SolverOutput.from_error(e, path_id=path_id, query_file=query_file)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

originally, other OSErrors were re-raised from the catch block, but now they aren't. does this not alter behavior because exceptions raised from callbacks are silently ignored anyway?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well I'm not sure why we re-raised, but it seems to me this is a good place to capture errors and keep track of errors

@daejunpark daejunpark merged commit ba94bdc into main Jul 31, 2025
75 checks passed
@daejunpark daejunpark deleted the fix/handle-solving-errors branch July 31, 2025 01:53
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.

3 participants