Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of resources error reporting #5281

Merged

Conversation

keyboardDrummer
Copy link
Member

Description

  • When reporting a verification issue other than an assertion failure, such as running out of resources, use the token of the assertion batch, not of the entire verifiable symbol. This allows the user to figure out where the bad assertion is, and prevents duplicate error messages.
  • Report the result of verification when using the --progress option
  • Tweak the formatting of --progress

Examples

lemma{:resource_limit 10000000} L()
{
  assert true;
  assert f(10, 5) == 0; // runs out of resources
  assert true;
  assert f(10, 6) == 0; // runs out of resources
}

Results in

outOfResourceAndIsolateAssertions.dfy(4,18): Error: Verification out of resource (L)
outOfResourceAndIsolateAssertions.dfy(6,18): Error: Verification out of resource (L)

New look of --progress:

Verification part 7/9 of L, on line 6, verified successfully, taking 32ms and consuming 6.8E+003 resources
Verification part 8/9 of L, on line 4, ran out of resources, taking 23ms and consuming 1.0E+007 resources
Verification part 9/9 of L, on line 6, ran out of resources, taking 48ms and consuming 1.0E+007 resources

How has this been tested?

  • Add a CLI test outOfResourceAndIsolateAssertions.dfy
  • Update existing tests using --progress

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@keyboardDrummer keyboardDrummer enabled auto-merge (squash) April 1, 2024 11:32
@keyboardDrummer keyboardDrummer changed the title Out of resources debugging Out of resources error reporting Apr 1, 2024
MikaelMayer
MikaelMayer previously approved these changes Apr 1, 2024
Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

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

Knowing which single assertion times out will be very useful for verification debugging.

Verified part 1/3 of Foo, on line 5 (redacted, resource count: 8.7E+002)
Verified part 2/3 of Foo, on line 6 (redacted, resource count: 3.1E+003)
Verified part 3/3 of Foo, on line 7 (redacted, resource count: 2.8E+003)
Verification part 1/3 of Foo, on line 5, verified successfully, redacted and consuming 8.7E+002 resources
Copy link
Member

Choose a reason for hiding this comment

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

What does "redacted" mean?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the time taken is not consistent over runs, I replace it with "redacted" in tests using sed.

Copy link
Member

Choose a reason for hiding this comment

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

I know you replace it with "redacted", my question was really about the meaning of "redacted".
I don't know the rationale behind choosing "redacted" for that replacement. For me, "redacted" means "edit (text) for publication.".
If it was me, I would have just removed the variable part, so that the error would look like "verified successfully and consuming ...."
So my question is, why was the word "redacted" chosen here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm using it as a means to say "there was something else here, but it has been removed"

docs/dev/news/5281.feat Outdated Show resolved Hide resolved
Co-authored-by: Mikaël Mayer <[email protected]>
@keyboardDrummer keyboardDrummer merged commit c57be13 into dafny-lang:master Apr 2, 2024
20 checks passed
@keyboardDrummer keyboardDrummer deleted the outOfResourcesDebugging branch April 2, 2024 15:56
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.

2 participants