Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Halmos assert mode, which allows the tool to handle inline assertion failures in addition to standard [FAIL] lines. The changes enable proper detection and reporting of assertion failures that occur within target functions, improving coverage reporting accuracy.
Key changes:
- Enhanced parsing to detect inline assertion failures alongside standard [FAIL] lines
- Added target function signature parsing with full parameter information in reports
- Improved counterexample generation logic to avoid duplicates and filter by failed properties
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/reportBuilder/reportBuilder.ts | Updates regex patterns to capture full function signatures with parameters in property names |
| src/halmos/index.ts | Adds comprehensive logic for parsing target functions, handling inline assertions, and synthesizing results |
| src/halmos/functionGenerator.ts | Implements target function parsing and inline assertion failure detection with deduplication logic |
| package.json | Version bump to 0.0.38 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| // 2) Inline assertion failures | ||
| // Example: Assertion failure detected in CryticToFoundry.doomsday_increment_never_reverts() | ||
| const assertionRe = /Assertion failure detected in\s+[\w$]+\.([^\)]+)\(\)/g; |
There was a problem hiding this comment.
The regex pattern has an unescaped closing parenthesis ) inside the character class. This should be escaped as \) to match a literal closing parenthesis.
| const m1 = /^CALL\s+[^:]+::([^\(]+)\(/.exec(sanitized); | ||
| if (m1 && m1[1]) return m1[1].trim(); | ||
| const m2 = /^CALL\s+(0x[a-fA-F0-9]{8,40})::([^\(]+)\(/.exec(sanitized); | ||
| if (m2 && m2[2]) return m2[2].trim(); |
There was a problem hiding this comment.
[nitpick] The two regex patterns are very similar and could be consolidated into a single pattern. Consider using /^CALL\s+(?:[^:]+|(0x[a-fA-F0-9]{8,40}))::([^\(]+)\(/ and adjusting the capture group handling accordingly.
| const m1 = /^CALL\s+[^:]+::([^\(]+)\(/.exec(sanitized); | |
| if (m1 && m1[1]) return m1[1].trim(); | |
| const m2 = /^CALL\s+(0x[a-fA-F0-9]{8,40})::([^\(]+)\(/.exec(sanitized); | |
| if (m2 && m2[2]) return m2[2].trim(); | |
| const m = /^CALL\s+(?:[^:]+|(0x[a-fA-F0-9]{8,40}))::([^\(]+)\(/.exec(sanitized); | |
| if (m && m[2]) return m[2].trim(); |
sample output:
Recon Recap for create-chimera-app [WSL: Ubuntu]
Fuzzer overview
Results
Broken Properties
Broken property
doomsday_increment_never_reverts
Sequence