-
Notifications
You must be signed in to change notification settings - Fork 273
hide internal symbols in the goto trace #1272
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
Conversation
…est-gen-support
set internal for variable assignments related to dynamic_object[0-9],
dynamic_[0-9]_array, _start function-return step, and CPROVER
internal functions (e.g., __CPROVER_initialize). This PR fixes
diffblue/test-gen#20.
Added internal field to json output so that we set it to tru as we find some specific variable that is not supposed to be shown in the counterexample trace.
Fixes issue https://github.com/diffblue/test-gen/issues/334. The patch avoids marking any steps in _start whose source is a code_function_callt, which includes the main function call and its argument assignments. Internal function calls in _start (e.g. __CPROVER_initialize) are marked by previous checks. Includes a minimal test case from https://github.com/DiffBlue-benchmarks/java-test which sparked the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the function call check on 163 to 170 and the regression test. Both look good.
if(SSA_step.is_function_call()) | ||
{ | ||
if(SSA_step.source.pc->source_location.as_string().empty()) | ||
goto_trace_step.internal=true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps return
after setting internal to true?
if(goto_trace_step.type==goto_trace_stept::typet::OUTPUT || | ||
goto_trace_step.type==goto_trace_stept::typet::INPUT) | ||
{ | ||
goto_trace_step.internal=true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps return
after setting internal to true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the function call check on 163 to 170 and the regression test. Both look good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
To be honest, I'm failing to understand what these commits are trying to achieve. There may be a clue in https://github.com/diffblue/test-gen/issues/20, but it's not public so I can't tell. If it helps, #709 is the main original PR, but it doesn't have much of a discussion. My main question is: how is "internal" different from "hidden"? @lucasccordeiro @peterschrammel @pkesseli any insights? Thanks! As a side note: I would have additional cleanup ready to go, following @pkesseli's suggestions. But doing this work made me wonder what's actually going on here. Another note: this is blocking a series of further PRs to go into master. |
The management of 'hiding steps' on the trace appears to be way to late to me. This PR seems to be a hack to me. |
The UI team requested us to hide the dynamic_object and CPROVER internal functions (e.g., __CPROVER_initialize) from the CBMC counterexample. In order to keep compatibility, we decided to add the |
Thanks a lot for the input. I do not have sufficient state on customers to tell whether anyone does depend on those bits not being hidden and thus call out to @kroening for clarification. One of two things need to happen: either this feature needs to be documented properly to make clear what is "hidden" vs what is "internal", or "internal" should be removed and those bits simply be "hidden." Assigning to @kroening to request guidance. |
See also #1311 |
I investigated this further: Current sources of hidden:
Current uses of hidden:
The purpose of |
Ok, so "internal" is a property of a variable symbol, and not a property of a program step. Would it not be better to have a namespace for the internal symbols? Or we may wish to output a symbol table with the trace? |
@peterschrammel Would you be able to take a lead on this issue? This seems to be one that needs careful consideration within Diffblue. (And it is one of the blockers for progress on the develop->master transition.) |
@tautschnig, yes. |
@kroening, yes, it's true that We could output a list of non-internal symbols if this is less contentious. |
Had some further out-of-band discussion with @peterschrammel on this. Taking this onto my stack of tasks in order to clean it up/take it further. |
While the develop->master transition might not happen as originally planned, this PR still includes a significant discussion about "internal" symbols. To be resolved by @peterschrammel and myself. |
Hi @tautschnig, is that still something we want to push through? This looks in a relatively good state (no merge conflicts and approved by other contributors) but it will need some work still (it adds a file to |
Also, I just noticed - this is merging to Is that still something we want? |
@NlightNFotis the PR or the master branch in general. I think both are valid questions but I think the later one probably needs an issue of it's own. |
@martin-cs I'm talking about both.
By the way I looked into the code changes a bit, and they appear to be replicated in |
The comment at the top does suggest it is already in develop. I guess this might have been part of the "feeding changes back from develop to master" process. Maybe @tautschnig knows? |
There was once a plan to merge releases from develop into master so that the head of master is always the last (stable) release version, but we never really started doing that and created releases from develop instead. Atm the master branch is completely stale, so merging PRs into it is pointless. |
Based on #1272 (comment), #1272 (comment) and #1272 (comment) the management of hiding steps needs a complete overhaul. |
Based on this and the general concerns with this PR I'm closing it. While this does not resolve the question of hiding some |
None of this is my work - these are commits already merged into develop (test-gen-support).