Skip to content

Fix schedule_all chunking for small ranges#2117

Merged
ericniebler merged 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/static-thread-pool-schedule-all-small-ranges
Jul 5, 2026
Merged

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

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

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
Contributor 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

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 926e90c

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test bf7b958

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test 165a98d

@ericniebler

Copy link
Copy Markdown
Collaborator

@fallintoplace this PR has merge conflicts. can you pls resolve?

@fallintoplace

Copy link
Copy Markdown
Contributor Author

@ericniebler Sure, let me push this now.

@fallintoplace fallintoplace force-pushed the fix/static-thread-pool-schedule-all-small-ranges branch from 165a98d to b0c28cc Compare July 5, 2026 18:50
@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test b0c28cc

@ericniebler ericniebler merged commit ad5fd3c into NVIDIA:main Jul 5, 2026
37 checks passed
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