Skip to content

Should removing one skipped candidate cost its source two scoring slots? #288

Backlog

Description

@Visual-Studio-Coder

With a fixed budget of 2,800, I can remove the last candidate from one source, a post the filter already skipped, and make two other posts from that source lose their slots. Is that an acceptable result of proportional allocation, or should a source lose at most one slot when its input shrinks by one?

Reproduce on the published code

From home-mixer/filters at commit 52d45989090e63992ba04e4f6cfccd73bf8cc05c, run the following in a shell with rustc installed. It compiles the fair_share_counts function directly from the checkout. Filter source

build_dir=$(mktemp -d)
{
  sed -n '/^fn fair_share_counts(/,/^}/p' fair_share_ranking_filter.rs
  cat <<'RS'
fn main() {
    for counts in [[1000, 200, 700, 950], [1000, 199, 700, 950]] {
        println!("{counts:?} => {:?}", fair_share_counts(&counts, 2800));
    }
}
RS
} | rustc --edition=2021 - -o "$build_dir/replay" && "$build_dir/replay"

Output, with the four sources in the same order in both runs.

[1000, 200, 700, 950] => [982, 197, 688, 933]
[1000, 199, 700, 950] => [983, 195, 688, 934]

Number each source’s candidates starting at 1. In the first run, selection_mask keeps the first 197 posts from the second source, so it already skips post 200. Remove only post 200 and keep every other candidate in its original order. The filter now keeps the first 195 posts from that source. Posts 196 and 197 lose their slots. Post 983 from the first source and post 934 from the fourth take them.

The second source’s exact share falls from about 196.491 to 195.577. It wins a slot on the first remainder comparison and misses on the second. Neither run has a remainder tie. Both fill all 2,800 slots.

I reproduced this with synthetic candidates. The result concerns which posts reach scoring. I have no live impression data for this case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions