Skip to content

Fix schedule_all chunking for small ranges#2117

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/static-thread-pool-schedule-all-small-ranges
Open

Fix schedule_all chunking for small ranges#2117
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/static-thread-pool-schedule-all-small-ranges

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

Fix static_thread_pool::schedule_all batching so small non-empty ranges always make progress when the pool has more workers than items. The batching code now asserts the existing non-zero worker invariant, clamps non-empty chunk sizes to at least one item, and resets the pending task count after each intermediate flush.

Testing

  • cmake --build build --target test.exec -j 8
  • ./build/test/exec/test.exec "schedule_all on static_thread_pool handles ranges smaller than available parallelism"
  • ./build/test/exec/test.exec "[types][static_thread_pool]"
  • ./build/test/exec/test.exec

@copy-pr-bot

copy-pr-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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