Skip to content

fix(descriptor): correct index tracking in combinations() function#453

Open
tnull wants to merge 1 commit intobitcoindevkit:masterfrom
tnull:2026-04-fix-combinations-index-bug
Open

fix(descriptor): correct index tracking in combinations() function#453
tnull wants to merge 1 commit intobitcoindevkit:masterfrom
tnull:2026-04-fix-combinations-index-bug

Conversation

@tnull
Copy link
Copy Markdown
Contributor

@tnull tnull commented Apr 23, 2026

Description

The combinations function was pushing new_index (the enumerate index relative to the skipped iterator) instead of index + 1 + new_index (the absolute index in the original vec). This caused duplicate and incorrect combinations to be generated for inputs larger than trivial sizes.

Checklists

All Submissions:

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

The combinations function was pushing `new_index` (the enumerate index
relative to the skipped iterator) instead of `index + 1 + new_index`
(the absolute index in the original vec). This caused duplicate and
incorrect combinations to be generated for inputs larger than trivial
sizes.

Co-Authored-By: HAL 9000
Signed-off-by: Elias Rohrer <dev@tnull.de>
@tnull tnull force-pushed the 2026-04-fix-combinations-index-bug branch from 2012f7c to 0dd6d08 Compare April 23, 2026 16:50
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.21%. Comparing base (fb7681a) to head (0dd6d08).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #453      +/-   ##
==========================================
+ Coverage   80.04%   80.21%   +0.17%     
==========================================
  Files          24       24              
  Lines        5336     5348      +12     
  Branches      242      242              
==========================================
+ Hits         4271     4290      +19     
+ Misses        987      980       -7     
  Partials       78       78              
Flag Coverage Δ
rust 80.21% <100.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant