Skip to content

Symex max depth default max #6222

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

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

TGWDB
Copy link
Contributor

@TGWDB TGWDB commented Jul 12, 2021

This PR implements the recommended fix in #2295.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #6222 (57afd55) into develop (141f3ce) will decrease coverage by 0.17%.
The diff coverage is 100.00%.

❗ Current head 57afd55 differs from pull request most recent head c344048. Consider uploading reports for the commit c344048 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6222      +/-   ##
===========================================
- Coverage    75.30%   75.13%   -0.18%     
===========================================
  Files         1458     1459       +1     
  Lines       161436   161449      +13     
===========================================
- Hits        121575   121305     -270     
- Misses       39861    40144     +283     
Impacted Files Coverage Δ
jbmc/src/jbmc/jbmc_parse_options.cpp 72.32% <100.00%> (+0.05%) ⬆️
src/cbmc/cbmc_parse_options.cpp 77.41% <100.00%> (+0.04%) ⬆️
src/goto-symex/symex_main.cpp 85.96% <100.00%> (ø)
src/util/find_symbols.h 0.00% <0.00%> (-100.00%) ⬇️
src/goto-instrument/accelerate/path.h 0.00% <0.00%> (-100.00%) ⬇️
src/goto-instrument/accelerate/polynomial.h 0.00% <0.00%> (-100.00%) ⬇️
...o-instrument/accelerate/polynomial_accelerator.cpp 0.00% <0.00%> (-78.13%) ⬇️
src/goto-instrument/accelerate/accelerator.h 7.69% <0.00%> (-46.16%) ⬇️
...ument/accelerate/enumerating_loop_acceleration.cpp 62.50% <0.00%> (-37.50%) ⬇️
...goto-instrument/accelerate/sat_path_enumerator.cpp 58.13% <0.00%> (-37.21%) ⬇️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 665abf7...c344048. Read the comment docs.

@TGWDB TGWDB force-pushed the symex_max_depth_default_max branch from 4599ffc to 973cad2 Compare July 12, 2021 12:45
@kroening
Copy link
Member

The default should be dealt with earlier, meaning when setting up optionst.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Daniel is correct; I should not have approved this. The correct fix is an else here:

which sets the correct value. It might be worth seeing if unwind has similar behaviour.

@TGWDB
Copy link
Contributor Author

TGWDB commented Jul 16, 2021

I tried changing the creation of the optiont and this now breaks unit tests (these can be fixed). I'm unclear why the "depth" option is a special case that should be handled outside, when other options passed in to the symex_config that are missing are handled in the constructor. (The main difference appears to be that "depth" has a different default value, but this is also handled in the constructor for the "max_field_sensitivity_array_size" option.)

@martin-cs
Copy link
Collaborator

@TGWDB It is a fair question. In an ideal world the *_parse_options.cpp file should read the cmdlinet and use it to populate an optionst along with default values if they are not 0 (or whatever optionst returns for the "asking for an option that hasn't been set" case). Unit tests can then simply create an appropriate optionst. However it is made, it is the optionst which gets passed to the actual code and used to configure things. Ideally this will be in a constructor, RAII-style. There is a little bit of a grey area about whether and how the constructors should handle cases when the configuration is complex and has multiple, non-orthogonal options.

Historically, this bit of design intent has not been as widely followed as maybe it should have been, so in the older parts of the code you do find configuration parameters lurking much deeper. These should be treated as a legacy issue and ideally modernised and moved into the "parse_options.cpp builds an optionst and that is it for configuration" world.

HTH

@TGWDB TGWDB force-pushed the symex_max_depth_default_max branch from 973cad2 to 0b3ac2b Compare July 16, 2021 15:20
@TGWDB
Copy link
Contributor Author

TGWDB commented Jul 16, 2021

Rather than an explicit else case I set the default value for the option in the creation of optionst. This seems like the cleanest solution.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Seems a reasonable solution.

@TGWDB
Copy link
Contributor Author

TGWDB commented Jul 20, 2021

@kroening Any chance of a codeowner review now?

This sets the default "depth" options to be UINT32_MAX in both
cbmc and jbmc. This removes the need for special case handling
and simplifies the depth checking.

Fixes diffblue#2295
@tautschnig
Copy link
Collaborator

@TGWDB Please cleanup the commit history on this one.

@TGWDB TGWDB force-pushed the symex_max_depth_default_max branch from 57afd55 to c344048 Compare August 4, 2021 08:35
@TGWDB
Copy link
Contributor Author

TGWDB commented Aug 4, 2021

@TGWDB Please cleanup the commit history on this one.

Commit messages tidied up. This should just be waiting on codeowner review now.

@martin-cs
Copy link
Collaborator

Paging @peterschrammel

@tautschnig tautschnig merged commit fc3d885 into diffblue:develop Aug 4, 2021
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.

5 participants