Skip to content

Commit

Permalink
[EASY] Don't report encoding errors for merged solutions (#3084)
Browse files Browse the repository at this point in the history
# Description
The majority of solutions that get discarded due to failing
encoding/simulating/scoring are actually merged solutions. These
solutions get merged by the driver and not by the solver. The driver
does it naively so it's not really surprising that it tries to merge
solutions which are incompatible (e.g. they could use the same liquidity
source).

# Changes
To avoid alerting on false positives the solver has no control over we
now only report solutions that come directly from the solver in a
non-working state (i.e. only 1 sub-solution contained).
  • Loading branch information
MartinquaXD authored Oct 25, 2024
1 parent 516a4e0 commit 2c92f95
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crates/driver/src/domain/competition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ impl Competition {
})
.collect::<FuturesUnordered<_>>()
.filter_map(|(id, result)| async move {
result
.tap_err(|err| {
observe::encoding_failed(self.solver.name(), &id, err);
notify::encoding_failed(&self.solver, auction.id(), &id, err);
})
.ok()
match result {
Ok(solution) => Some(solution),
// don't report on errors coming from solution merging
Err(_err) if id.solutions().len() > 1 => None,
Err(err) => {
observe::encoding_failed(self.solver.name(), &id, &err);
notify::encoding_failed(&self.solver, auction.id(), &id, &err);
None
}
}
});

// Encode settlements as they arrive until there are no more new settlements or
Expand Down

0 comments on commit 2c92f95

Please sign in to comment.