-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add custom "Satisfies" terms #330
Conversation
Nice! I'm not sure if there is more work to do since this is in a Draft state. One initial comment I have is that it seems like maybe the terms are backwards. My expectation is that this would work pretty much the same as This PR seems to treat "good" meaning it found the regression, which is the opposite of git's behavior. One of the reasons I suggested in #316 to use the old/new terminology is so that it is less ambiguous with good/bad. Good/bad could mean "good, I found the regression" or "good, it successfully compiles", which are opposites. I think with old/new, there is no ambiguity since there is only one direction of time. |
bd38135
to
e66020b
Compare
@ehuss Hmm you're right. When I look at it from that point of view it makes def. more sense, sorry for not applying cleanly your suggestion. Now it should work as expected. Can you check it one more time when you have a sec? Thanks The draft state was because this patch stlll needs some documentation (I will update the book) and the tests are giving me headaches (the |
8dd0ac0
to
ef37a65
Compare
@ehuss ok now tests are passing. Feel free to review when you have a sec. I especially want to be sure the documentation explains the logic correctly and clearly. thanks |
r? @ehuss when you have a chance |
src/least_satisfying.rs
Outdated
let msg_yes = if regress == &RegressOn::Error || regress == &RegressOn::Ice { | ||
// YES: condition satisfied, reproduces the regression | ||
term_old | ||
} else { | ||
// NO: condition not satisfied, does not reproduce the regression | ||
term_new | ||
}; | ||
|
||
let msg_no = if regress == &RegressOn::Error || regress == &RegressOn::Ice { | ||
// YES: condition satisfied, compiles successfully, does not reproduce the regression | ||
term_new | ||
} else { | ||
// NO: condition not satisfied, the regression still reproduces | ||
term_old | ||
}; |
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.
These messages still seem to be backwards to me.
For example, if I run cargo-bisect-rustc --term-old=compiles --term-new=errors
, it prints "errors" when it successfully compiles the old code and "compiles" when it fails to compile the new code.
Also, not a blocker, but I think it would be nice to customize the default old/new terms based on the RegressOn
setting. For example:
RegressOn | Old | New |
---|---|---|
Error | "Successfully compiles" | "Compile error" |
Success | "Compile error" | "Successfully compiles" |
Ice | "Did not ICE" | "Found ICE" |
NonIce | "Found ICE" | "Did not ICE" |
NonError | "Compile error (no ICE)" | "Successfully compiles" |
That way there is a clear indication of what cbr observed.
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.
@ehuss I have restarted this patchset from scratch. Flipped the previous logic wrong and corrected/clarified the commit message. Are we there?
if the new commit looks good, I will update in a second commit documentation and tests
thanks
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.
The new default messages are very nice and will implement them in a second patch
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.
Looks good, thanks!
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.
OK, so @ehuss now what's the next step? Merge? Or is there anything else to do in this PR?
EDIT: oh, I'll fix the tests
1292a3b
to
556a00b
Compare
556a00b
to
0859f47
Compare
cargo-bisect-rustc prints "Yes" or "No" on whether or not a build satisfies the condition that it is looking for (default: Yes = reproduces regression, No = does not reproduce the regression). However, this terminology is either confusing or backwards depending on what is being tested. For example, one can use one of `--regress` options (f.e. `--regress success`) to find when a regression was fixed. In that sense, the "old" is "regression found" and the "new" is "regression fixed", which is backwards from the normal behavior. Taking inspiration from git bisect, we are introducing custom terms for Satisfies. This is implemented with 2 new cli options: --term-old, will apply for Satisfy::Yes (condition requested is matched) --term-new, will apply for Satisfy::No (condition requested is NOT matched) This will allow the user to specify their own wording. Then, the --regress option could set the defaults for those terms appropriate for the regression type. Fixes rust-lang#316
dee4e39
to
ba7eb63
Compare
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.
Thanks!
The default values for --term-old and --term-new could use some reasonable defaults, here the mapping: | RegressOn | Old | New | | --------------------------------------------------------------- | | Error | "Successfully compiles" | "Compile error" | | Success | "Compile error" | "Successfully compiles" | | Ice | "Did not ICE" | "Found ICE" | | NonIce | "Found ICE" | "Did not ICE" | | NonError | "Compile error (no ICE)" | "Successfully compiles" | Suggested here: rust-lang#330 (comment)
The default values for --term-old and --term-new could use some reasonable defaults, here the mapping: | RegressOn | Old | New | | --------------------------------------------------------------- | | Error | "Successfully compiles" | "Compile error" | | Success | "Compile error" | "Successfully compiles" | | Ice | "Did not ICE" | "Found ICE" | | NonIce | "Found ICE" | "Did not ICE" | | NonError | "Compile error (no ICE)" | "Successfully compiles" | Suggested here: rust-lang#330 (comment)
cargo-bisect-rustc prints "Yes" or "No" on whether or not a build
satisfies the condition that it is looking for (default: Yes =
reproduces regression, No = does not reproduce the regression). However,
this terminology is either confusing or backwards depending on what is
being tested.
For example, one can use one of
--regress
options (f.e.--regress success
) to find when a regression was fixed. In that sense, the "old"is "regression found" and the "new" is "regression fixed", which is
backwards from the normal behavior.
Taking inspiration from git bisect, we are introducing custom terms for
Satisfies. This is implemented with 2 new cli options:
--term-old, will apply for Satisfy::Yes (condition requested is matched)
--term-new, will apply for Satisfy::No (condition requested is NOT matched)
This will allow the user to specify their own wording. Then, the
--regress option could set the defaults for those terms appropriate for
the regression type.
Fixes #316