When using the initial_cut parameter (eg when reusing a cut found from
a previous search), we were updating the cut after a first valid
implementation is found. Such an implementation would have a bound that
is less than the initial cut, but not necessarily (in fact, almost
never) an execution time lower than the initial cut -- thus we would in
fact make the cut worse by performing this update.
This patch instead changes it so that we only update the cut if it
improves it.
NB: An alternative fix for this issue would be to take the initial cut
into account in the monitor, but this means we would ignore
implementations that are not faster than the initial cut. This would
limit the usefulness of the initial_cut parameter -- in particular, it
wouldn't be possible to use it to optimisticaly cut branches with an
aggressive cut for which we don't have an implementation.
When using the
initial_cut
parameter (eg when reusing a cut found from a previous search), we were updating the cut after a first valid implementation is found. Such an implementation would have a bound that is less than the initial cut, but not necessarily (in fact, almost never) an execution time lower than the initial cut -- thus we would in fact make the cut worse by performing this update.This patch instead changes it so that we only update the cut if it improves it.
NB: An alternative fix for this issue would be to take the initial cut into account in the monitor, but this means we would ignore implementations that are not faster than the initial cut. This would limit the usefulness of the
initial_cut
parameter -- in particular, it wouldn't be possible to use it to optimisticaly cut branches with an aggressive cut for which we don't have an implementation.