Skip to content

Enable automatic limit for array-as-uninterpreted-function [depends-on: #1874] #2108

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

Closed
wants to merge 1 commit into from

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Apr 24, 2018

Previously, the command line permitted setting uninterpreted functions
to "never" or "always", where "never" actually was the default. The
"automatic" mode could not be enabled in any way.

This reverts #6232, but now includes additional changes to the array
theory to handle nested struct members no different from members of a
top-level struct.

Fixes: #2018

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 8089c08).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/108222857

@tautschnig
Copy link
Collaborator Author

Reviews would be appreciated, but still marking do-not-merge as benchmarking is required. (Initial benchmarking on ReachSafety-Arrays suggests that, as expected, the memory footprint grows.)

@tautschnig tautschnig changed the title Enable and use the automatic limit for array-as-uninterpreted-function Enable and use the automatic limit for array-as-uninterpreted-function [depends-on: #4673] May 19, 2019
tautschnig added a commit that referenced this pull request May 20, 2019
Record constraints of indexed access to array constants [blocks: #2108]
@tautschnig tautschnig changed the title Enable and use the automatic limit for array-as-uninterpreted-function [depends-on: #4673] Enable and use the automatic limit for array-as-uninterpreted-function May 29, 2019
@tautschnig tautschnig added the Needs data This PR claims improvements that require further data to substantiate the claims. label May 30, 2019
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 4615ed1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/113976199

@tautschnig
Copy link
Collaborator Author

I have now run this on SV-COMP, and did notice a speedup in some cases, but also a single-digit number of benchmarks newly running out of memory. That's not unexpected, but it does suggest we should put #1874 in place before merging this one.

@tautschnig tautschnig changed the title Enable and use the automatic limit for array-as-uninterpreted-function Enable and use the automatic limit for array-as-uninterpreted-function [depends-on: #1874] Jun 3, 2019
@tautschnig tautschnig added dependent - do not merge and removed do not merge Needs data This PR claims improvements that require further data to substantiate the claims. labels Jun 3, 2019
@TGWDB
Copy link
Contributor

TGWDB commented Jun 11, 2021

As discussed in #6130 it would probably be good to merge this PR soon. With that in mind, I've locally rebuilt, rebase, and run unit/regression tests and not seen any problems (or major performance changes). If there is no blocker remaining perhaps this can be rebased, pushed and reviewed for a merge to resole #6130.

@TGWDB
Copy link
Contributor

TGWDB commented Jun 15, 2021

As discussed in #6130 it would probably be good to merge this PR soon. With that in mind, I've locally rebuilt, rebase, and run unit/regression tests and not seen any problems (or major performance changes). If there is no blocker remaining perhaps this can be rebased, pushed and reviewed for a merge to resole #6130.

@tautschnig Any issues with merging this as is?

@kroening @peterschrammel @martin-cs Codeowner approval/disapproval?

TGWDB added a commit to TGWDB/cbmc that referenced this pull request Jun 15, 2021
This is a duplicate of PR diffblue#2108. This is here for alternative author
management.

Fixes diffblue#6130
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.

I am OK with this but there is some kind of bug in equality of unbounded arrays which I have yet to reliably trigger via C or locate. I figure that this might expose it so it would be good to have a few tests of what happens when an array is over MAX_FLATTENED_ARRAY_SIZE

if(total>(1<<30)) // realistic limit
throw analysis_exceptiont("array too large for flattening");

if(total < 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel l;ke maybe this would like to become an invariant?

TGWDB added a commit to TGWDB/cbmc that referenced this pull request Jun 21, 2021
This is a duplicate of PR diffblue#2108. This is here for alternative author
management.

Fixes diffblue#6130
@TGWDB
Copy link
Contributor

TGWDB commented Sep 13, 2021

Closing as I believe this has been covered by #6194 and fix in #6232. Please reopen if you believe this is erroneous.

Previously, the command line permitted setting uninterpreted functions
to "never" or "always", where "never" actually was the default. The
"automatic" mode could not be enabled in any way.

This reverts diffblue#6232, but now includes additional changes to the array
theory to handle nested struct members no different from members of a
top-level struct.

Fixes: diffblue#2018
@tautschnig tautschnig changed the title Enable and use the automatic limit for array-as-uninterpreted-function [depends-on: #1874] Enable automatic limit for array-as-uninterpreted-function [depends-on: #1874] Dec 8, 2022
@tautschnig tautschnig reopened this Dec 8, 2022
@tautschnig tautschnig marked this pull request as draft December 8, 2022 00:27
@tautschnig
Copy link
Collaborator Author

Note to self: cbmc regression/cbmc/bounds_check1/main.c --bounds-check --pointer-check is one of the examples now taking a lot longer, though really it is SSA conversion that is consuming a lot of time. To be debugged.

@TGWDB
Copy link
Contributor

TGWDB commented May 3, 2023

Closing due to age (no further comment on PR content), please reopen with rebase on develop if you intent to continue this work.

@TGWDB TGWDB closed this May 3, 2023
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Sep 24, 2024
Previously, the command line permitted setting uninterpreted functions
to "never" or "always", where "never" actually was the default. The
"automatic" mode could not be enabled in any way.

We previously attempted to do this in in diffblue#6194 (inspired by diffblue#2108, but
not picking up all its changes), but then reverted the gist of the
change in diffblue#6232 as `array-bug-6230/main.c` demonstrated lingering
issues. This PR now addresses the flaw in the array theory back-end.

We may still run into performance regressions as the threshold of 1000
bits of total size of the array object is possibly lower than where the
cost of bit-blasting exceeds the cost of constraints produced by our
current array theory implementation. Two of our existing regression
tests already demonstrate this problem, hence those now use
`--arrays-uf-never`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bv_cbmct::unbounded_arrayt::U_AUTO is never enabled
7 participants