rust-lang / cargo-bisect-rustc

Bisects rustc, either nightlies or CI artifacts
https://rust-lang.github.io/cargo-bisect-rustc/
Apache License 2.0
177 stars 55 forks source link

Report an estimate of remaining steps. #178

Closed ehuss closed 2 years ago

ehuss commented 2 years ago

This adds some reporting to let the user know more about what cargo-bisect-rustc is doing, and provides an estimate of how many more steps it is going to do.

This is not perfect by any means, but seems to provide a decent enough approximation. Some limitations:

Fixes #143

oli-obk commented 2 years ago

The behaviour looks good to me. The only impl concern I have is that it distracts from the actual logic. Maybe move the two new fields into a struct and add named methods for all the cases. Then also move cache into the struct and predicate to be a method on the struct.

ehuss commented 2 years ago

I'm having a bit of difficulty fully understanding your suggestion. remaining and estimate need to be recomputed during each loop, so I'm not sure if they benefit from being in a struct.

Can you say more about what you are thinking?

I pushed a change to move the computation into the closure so that it does not distract from the central algorithm. I also removed the hack adjusting the estimate during an Unknown scan, since that estimate will jump around or otherwise be wrong since unknown_ranges is not considered.

Otherwise I'm having a hard time seeing a way to simplify it more.

oli-obk commented 2 years ago

Ah 🤦 I misread the logic. The new thing is much easier to grok, so mission accomplished!