-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Cannot understand why certain expressions are not instrumented/reported as visited #423
Comments
I'm actually not immediately sure why some of those lines are instrumented to begin with. I'm not completely sure what the expectation is -- do you expect all lines to be marked? Bisect doesn't mark lines, but only essentially out-edges in the control-flow graph that MIGHT not be visited, and assigns each one some meaningful place in the source file to visually represent it. In the case of field assignment expression, IIRC it can't fail, so Bisect does not instrument it, because if the machine begins executing it (visit it in the CFG) it can't fail to proceed to the out-edge. |
The main complication here is that the presence of exceptions in the language generates additional out-edges, which can cause what would otherwise appear as straight-line code to have non-trivial structure in the CFG, but I don't think (IIRC) this applies to these field assignments. |
Actually, what is |
What's happening is that |
Bisect has a list of special function symbols that it assumes are bound to functions whose application evaluates to a value, like |
Thanks, I hadn't grasped this, which explains many of the issues here.
Sorry, I should have clarified that.
Yes, it is from the same file. |
I think it is actually fine, the
so it is OK for line 310 not to be instrumented. |
I think most of my questions have been cleared up. Thanks! |
Great! Indeed, then I think Bisect is instrumenting everything correctly here. The application expression at the end of a Thank you! |
Related to that, it may be a good idea to give the same treatment to TRMC calls as the instrumentation currently inhibits the transformation (and triggers a warning 71). |
Thank you! I was not aware this was added to the compiler. Created #424 to track it. |
Coming back to this after a chat with a colleague: can you explain why the current strategy (marking out-edges of the control flow graph) is used instead of a more naïve one (marking every executed expression)? There's probably a simple answer to this, but the current strategy seems a bit less intuitive and harder to explain, so I would like to understand the reason for this strategy better. Thanks! |
Marking every expression... (1) Makes the report difficult to present and read, because OCaml programs usually have a relatively large number of expressions on every line, nested within each other. Many of these expressions are executed if and only if their "predecessor" expressions are executed, so the points would be redundant anyway. (2) There is a small, but eventually significant, performance impact to instrumentation. Given that marking every expression would be redundant as suggested in (1), not marking every expression is a helpful performance improvement. |
Right, thanks! |
Hello, thank you for maintaining this nice tool!
I have been playing with it and am a bit puzzled why the HTML report does not show certain lines as being visited, eg 293, 297, 303 below. I looked at the code briefly but did not find anything that could explain the omission. For 293 at least the instrumentation is present:
Any ideas?
Another example in 313, 318 below, but in this case, the instrumentation on 313 at least is not present:
Any ideas?
Thanks!
The text was updated successfully, but these errors were encountered: