Figure out a way to fill relatively low-flex buckets at low maxResultCounts
Categories
(Firefox :: Address Bar, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: bugzilla, Assigned: adw)
References
Details
Attachments
(1 file)
Follow-up bug based on this review comment.
The muxer calculates bucket fill by multiplying maxResultCount by the relative size of the flexed bucket, then rounding. In the case of the general bucket after bug 1712352, all child buckets are rounded to zero and no results are shown when maxResultCount is 1. This breaks a subtest in test_providersManager_maxResults.js
.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
The problem in this bug is that the sum of the available spans of child buckets
is not necessarily equal to the available span of the parent bucket. That's
because each child span must be an integer, but a child's ideal span may not be
an integer, so we have to round and an error can accumulate.
This fixes it by detecting that case and then tweaking child spans until their
sum is equal to the parent's available span. If the sum is smaller than the
parent span, then we increment child spans until it's equal; if the sum is
larger than the parent span, then we decrement instead. (The case where the sum
is larger isn't as much of a problem as when it's smaller. We still correctly
limit the total result span due to logic elsewhere, but the bucket's final
result composition may not reflect flex ratios as accurately as it could.)
I added some logic so that the child spans we choose to tweak are the ones that
minimize the mathematical error between the final integer spans and the ideal
unrounded spans. In other words, we pick the best spans possible given that they
must be integers.
We need to do this tweaking when we try to overfill buckets too, not only on the
first pass for a bucket. Currently the second pass is hardcoded in
_fillBuckets
. Rather than hardcoding the tweaking in both places, I added an
_updateFlexData
helper method. While I was doing that, I realized we may need
more than two passes per parent bucket in order to optimally fill the children.
So I modified _fillBuckets
so it recurses with the parent bucket itself when
we need to overfill any of its children.
Finally while I was here I switched from "bucket" to "group" in light of the
renaming in bug 1715484 and bug 1715822.
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Comment 6•4 years ago
|
||
bugherder |
Description
•