Skip to content

fix: iterate then wait potential out of bounds panic - #2282

Merged
McPatate merged 1 commit into
feat/train_encode_splitfrom
fix/iterate_then_wait
Aug 4, 2026
Merged

McPatate merged 1 commit into
feat/train_encode_splitfrom
fix/iterate_then_wait

Conversation

@McPatate

@McPatate McPatate commented Aug 4, 2026

Copy link
Copy Markdown
Member

Implementing IntoIterator on EncodeHandle gives us the compile time guarantee that we consume the handle on iteration and cannot call .wait on it later on, which won't mess up the indexing of the result vec.

This means the API is either iteration or waiting for all results.

@McPatate
McPatate requested a review from SBrandeis August 4, 2026 13:37
Signed-off-by: Luc Georges <luc.sydney.georges@gmail.com>
@McPatate
McPatate force-pushed the fix/iterate_then_wait branch from 2ba4fd6 to 3e44938 Compare August 4, 2026 13:38
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@McPatate

McPatate commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

@SBrandeis reviewed IRL :)

@McPatate
McPatate merged commit f3bf3e8 into feat/train_encode_split Aug 4, 2026
38 of 42 checks passed
@McPatate
McPatate deleted the fix/iterate_then_wait branch August 4, 2026 13:44
ArthurZucker pushed a commit that referenced this pull request Sep 2, 2026
Squashed from 3 commits:
  - refactor: make sure the pool is fork-safe (#2268)
  - feat: update `encode` signature (#2274)
  - fix: iterate then wait potential out of bounds panic (#2282)

Area: core-parallelism
ArthurZucker pushed a commit that referenced this pull request Sep 2, 2026
Squashed from 3 commits:
  - refactor: make sure the pool is fork-safe (#2268)
  - feat: update `encode` signature (#2274)
  - fix: iterate then wait potential out of bounds panic (#2282)

Area: core-parallelism
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.

3 participants