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.

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 4321ae4

@fallintoplace

Copy link
Copy Markdown
Author

@ericniebler Clangformat is failing sadly, let me know if this needs an update from my side.

@ericniebler

Copy link
Copy Markdown
Collaborator

yes, you need to run clang-format over the two files you changed.

@fallintoplace fallintoplace force-pushed the fix/static-thread-pool-schedule-all-small-ranges branch from e129c17 to ea73a5d Compare July 4, 2026 21:55
@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test ea73a5d

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.

2 participants