Skip to content

Do not invoke bulk_chunked for zero shape - #2210

Merged
ericniebler merged 2 commits into
NVIDIA:mainfrom
fallintoplace:fix/bulk-chunked-empty-shape
Aug 17, 2026
Merged

Do not invoke bulk_chunked for zero shape#2210
ericniebler merged 2 commits into
NVIDIA:mainfrom
fallintoplace:fix/bulk-chunked-empty-shape

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

What changed

bulk_chunked currently calls the function once with (0, 0) when the shape is zero. exec.bulk requires each chunk to satisfy b < e, so an empty shape has no valid chunk.

  • Skip the callback when shape <= 0.
  • Still forward the value completion.
  • Add regressions for zero and signed negative shapes.

The exposition-only default implementation in the same section currently calls f(0, shape, args...) unconditionally. That looks inconsistent with the non-empty chunk requirement. This change follows the behavioral requirement.

Test

  • build/test/test.stdexec "[adaptors][bulk]" (363 assertions, 59 test cases)
  • ctest --test-dir build --output-on-failure (953 passed)

See exec.bulk.

@copy-pr-bot

copy-pr-bot Bot commented Aug 16, 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.

@fallintoplace
fallintoplace force-pushed the fix/bulk-chunked-empty-shape branch from 4804e2e to ffcb102 Compare August 16, 2026 13:24
@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test ffcb102

@ericniebler

Copy link
Copy Markdown
Collaborator

/ok to test ef2bf69

@ericniebler
ericniebler merged commit bdde14c into NVIDIA:main Aug 17, 2026
67 of 68 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