Skip to content

Constant propagation for individual fields through byte extract #6856

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 3 commits into from
Jun 30, 2022

Conversation

tautschnig
Copy link
Collaborator

Field sensitivity in goto symex updates the full object as well as
individual fields for divisible objects. The updates of individual
fields, however, previously used index or member expressions on that
full object. Consequently, constant propagation was only possible when
the full-object assignment had a constant as the right-hand side. In
some cases, however, only parts of the whole object might be constant.
We are now able to constant propagate the fields covering those
(constant) parts.

Fixes: #6846

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #6856 (6193534) into develop (577b0ec) will decrease coverage by 0.01%.
The diff coverage is 95.00%.

@@             Coverage Diff             @@
##           develop    #6856      +/-   ##
===========================================
- Coverage    77.81%   77.79%   -0.02%     
===========================================
  Files         1568     1568              
  Lines       179975   180039      +64     
===========================================
+ Hits        140044   140065      +21     
- Misses       39931    39974      +43     
Impacted Files Coverage Δ
src/goto-symex/goto_symex_state.cpp 91.71% <ø> (ø)
src/goto-symex/goto_symex_state.h 100.00% <ø> (ø)
.../goto-instrument/goto_instrument_parse_options.cpp 70.90% <73.33%> (-0.23%) ⬇️
src/ansi-c/c_typecheck_base.cpp 81.15% <95.23%> (+2.27%) ⬆️
src/goto-symex/field_sensitivity.cpp 91.27% <96.00%> (-0.24%) ⬇️
src/ansi-c/goto_check_c.cpp 91.55% <100.00%> (+0.07%) ⬆️
src/goto-symex/field_sensitivity.h 100.00% <100.00%> (ø)
src/goto-symex/symex_assign.cpp 81.29% <100.00%> (ø)
src/goto-symex/symex_main.cpp 87.00% <100.00%> (+0.03%) ⬆️
src/goto-symex/symex_target_equation.cpp 95.35% <100.00%> (+0.02%) ⬆️
... and 18 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 15d60af...6193534. Read the comment docs.

@tautschnig tautschnig force-pushed the feature/field-propagation branch 2 times, most recently from 0a8e99d to 6907f89 Compare May 14, 2022 19:49
Copy link
Contributor

@TGWDB TGWDB left a comment

Choose a reason for hiding this comment

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

Generally happy to approve this on the basis that it improves the constant propagation and the "failing" tests are (as discussed in #6101) doing things that are not necessarily well defined.

@tautschnig tautschnig force-pushed the feature/field-propagation branch 2 times, most recently from 7f0b372 to c36bd85 Compare May 26, 2022 18:52
8 seconds seemed arbitrary, and we have now seen a failure on one
platform, which might be just down to jitter. Increase the timeout to 15
seconds, which should be plenty.
The option --no-simplify should be honoured by field sensitivity. This
also made apparent that we have tests that only pass thanks to the
simplifier, and perhaps aren't even expected to pass. See diffblue#6101 for
further discussion.
Field sensitivity in goto symex updates the full object as well as
individual fields for divisible objects. The updates of individual
fields, however, previously used index or member expressions on that
full object. Consequently, constant propagation was only possible when
the full-object assignment had a constant as the right-hand side. In
some cases, however, only parts of the whole object might be constant.
We are now able to constant propagate the fields covering those
(constant) parts.

Fixes: diffblue#6846
@tautschnig tautschnig force-pushed the feature/field-propagation branch from c36bd85 to 6193534 Compare June 1, 2022 10:02
@tautschnig tautschnig added aws-high Kani Bugs or features of importance to Kani Rust Verifier labels Jun 1, 2022
@peterschrammel peterschrammel removed their assignment Jun 30, 2022
@tautschnig tautschnig merged commit b09b664 into diffblue:develop Jun 30, 2022
@tautschnig tautschnig deleted the feature/field-propagation branch June 30, 2022 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-high Kani Bugs or features of importance to Kani Rust Verifier Symbolic Execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missed Optimization: memcpy(a,b,sizeof(*a)) is slower than *a = *b
4 participants