Skip to content

fix(combos): keep duplicated snapshot weights within 100 percent - #16942

Merged
diegosouzapw merged 1 commit into
release/v3.8.52from
fix/combo-snapshot-weights-1017
Oct 17, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.52from
fix/combo-snapshot-weights-1017

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Problem and change

Duplicating a scored auto-combo with 131 candidates assigned a minimum integer weight of 1 to each candidate, producing a total weight of 131 instead of 100. A smaller highly skewed pool could overflow as well (108 in the regression fixture).

Normalize overflowing distributions into positive fractional shares and assign the residual to the last candidate. Existing integer distributions remain unchanged when they fit the percentage budget. Preserve every candidate and its order; do not change scoring or routing strategy.

Validation

  • Reproduced all three failures before the fix: 131-candidate fixture, skewed fixture and the real duplicate route.
  • 16 focused tests pass, including HTTP 201 with all 131 models, total 100 and persisted weights equal to the response. Fractional weights survive JSON, schema validation and editable-combo normalization.
  • Core and normal route TypeScript checks, ESLint, engine, file-size, changelog and normal commit hooks pass.
  • An additional strict-null route compiler check reports three diagnostics in virtualFactory.ts (lines 355 and 902), which is unchanged from the pinned base. A separate compiler reproduction on that base was not run; this extra check is not claimed green.

Prepared and tested on release base 858d6022270b73489dfa8d89eee6fcc9a6a9e214. CI and Quality must pass on the final candidate before integration.

@diegosouzapw
diegosouzapw merged commit ce9563f into release/v3.8.52 Oct 17, 2026
33 of 51 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

@diegosouzapw
diegosouzapw deleted the fix/combo-snapshot-weights-1017 branch October 18, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant