Skip to content

Conversation

@ytl0623
Copy link
Contributor

@ytl0623 ytl0623 commented Jan 16, 2026

Description

  • Modified pushpull_cpu.cpp and pushpull_cuda.cu.
  • Removed template instantiations for Scalar types (BoundType, InterpolationType).
  • Enforced BoundVectorRef and InterpolationVectorRef as the only supported input types for bound and interpolation parameters.
  • Simplified the PUSHPULL_INSTANTIATE macros.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

Refactors pushpull APIs to remove template parameters for BoundType and InterpolationType, replacing them with concrete monai::BoundVectorRef and monai::InterpolationVectorRef in header and in CPU/CUDA implementations. Updates the two- and three-argument overloads' signatures accordingly and replaces multi-tiered instantiation macros (PUSHPULL_INSTANTIATE3/2/1) with a source-driven instantiation pattern (PUSHPULL_INSTANTIATE_SOURCE), adjusting explicit instantiations for IntArrayRef and Tensor sources.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning Title does not match actual changes. PR removes template parameters and enforces vector references, not unused constructors. Update title to reflect the actual refactoring, e.g., 'Enforce BoundVectorRef and InterpolationVectorRef in pushpull' or 'Remove template parameters from pushpull signatures'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed Description is complete with required sections, accurately summarizes the template parameter removal and vector reference enforcement changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 69da7bf and cbd9305.

📒 Files selected for processing (2)
  • monai/csrc/resample/pushpull_cpu.cpp
  • monai/csrc/resample/pushpull_cuda.cu
🧰 Additional context used
🧬 Code graph analysis (2)
monai/csrc/resample/pushpull_cpu.cpp (1)
monai/csrc/resample/pushpull_cuda.cu (4)
  • pushpull (2184-2210)
  • pushpull (2184-2194)
  • pushpull (2215-2242)
  • pushpull (2215-2226)
monai/csrc/resample/pushpull_cuda.cu (1)
monai/csrc/resample/pushpull_cpu.cpp (4)
  • pushpull (2222-2242)
  • pushpull (2222-2232)
  • pushpull (2247-2268)
  • pushpull (2247-2258)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: quick-py3 (ubuntu-latest)
  • GitHub Check: packaging
  • GitHub Check: flake8-py3 (pytype)
  • GitHub Check: flake8-py3 (codeformat)
  • GitHub Check: build-docs
  • GitHub Check: flake8-py3 (mypy)
  • GitHub Check: quick-py3 (macOS-latest)
  • GitHub Check: quick-py3 (windows-latest)
  • GitHub Check: min-dep-os (ubuntu-latest)
  • GitHub Check: min-dep-py3 (3.10)
  • GitHub Check: min-dep-pytorch (2.8.0)
  • GitHub Check: min-dep-pytorch (2.7.1)
  • GitHub Check: min-dep-py3 (3.9)
  • GitHub Check: min-dep-py3 (3.11)
  • GitHub Check: min-dep-py3 (3.12)
  • GitHub Check: min-dep-os (windows-latest)
  • GitHub Check: min-dep-pytorch (2.6.0)
  • GitHub Check: min-dep-pytorch (2.5.1)
  • GitHub Check: min-dep-os (macOS-latest)
🔇 Additional comments (6)
monai/csrc/resample/pushpull_cpu.cpp (3)

38-38: Doc note is clear.


2190-2217: Macro consolidation looks fine.


2219-2232: Verify vector-only bounds/interp in the public API.
This drops scalar-type overloads; confirm no downstream callers rely on them or document the migration.

Also applies to: 2244-2258

monai/csrc/resample/pushpull_cuda.cu (3)

38-38: Doc note is clear.


2152-2180: Macro consolidation looks fine.


2181-2195: Verify vector-only bounds/interp in the public API.
This drops scalar-type overloads; confirm no downstream callers rely on them or document the migration.

Also applies to: 2212-2226

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ytl0623 ytl0623 force-pushed the fix-unused_constructors branch from cafa41a to 7bd9e9a Compare January 16, 2026 08:37
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@monai/csrc/resample/pushpull_cpu.cpp`:
- Around line 2190-2202: The PUSHPULL_INSTANTIATE_SOURCE macro emits two
explicit instantiations of the template function pushpull but the second (3-arg)
instantiation is missing one of the bool parameters, so it doesn't match the
actual template signature; update the macro PUSHPULL_INSTANTIATE_SOURCE to
include the same list of bool parameters in the second
template<std::deque<Tensor> pushpull(... )> instantiation so both explicit
declarations for pushpull (the multi-arg and the 3-arg overload) match the
template signature exactly.

In `@monai/csrc/resample/pushpull_cuda.cu`:
- Around line 2152-2164: The PUSHPULL_INSTANTIATE_SOURCE macro produces an
explicit instantiation for pushpull but the second template declaration for the
3-arg overload is missing one bool, so it doesn't match the template signature;
update the macro PUSHPULL_INSTANTIATE_SOURCE to include the missing bool in the
second template std::deque<Tensor> pushpull(...) declaration so both explicit
instantiations' parameter lists exactly match the pushpull template signature
(refer to the macro name PUSHPULL_INSTANTIATE_SOURCE and the function pushpull
to locate and correct the mismatched 3-arg overload).
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 57fdd59 and 69da7bf.

📒 Files selected for processing (3)
  • monai/csrc/resample/pushpull.h
  • monai/csrc/resample/pushpull_cpu.cpp
  • monai/csrc/resample/pushpull_cuda.cu
🧰 Additional context used
🧬 Code graph analysis (2)
monai/csrc/resample/pushpull_cpu.cpp (1)
monai/csrc/resample/pushpull_cuda.cu (4)
  • pushpull (2183-2209)
  • pushpull (2183-2193)
  • pushpull (2214-2241)
  • pushpull (2214-2225)
monai/csrc/resample/pushpull_cuda.cu (1)
monai/csrc/resample/pushpull_cpu.cpp (4)
  • pushpull (2221-2241)
  • pushpull (2221-2231)
  • pushpull (2246-2267)
  • pushpull (2246-2257)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: min-dep-pytorch (2.6.0)
  • GitHub Check: quick-py3 (windows-latest)
  • GitHub Check: min-dep-py3 (3.11)
  • GitHub Check: min-dep-pytorch (2.5.1)
  • GitHub Check: min-dep-os (macOS-latest)
  • GitHub Check: build-docs
  • GitHub Check: min-dep-os (windows-latest)
  • GitHub Check: min-dep-pytorch (2.8.0)
  • GitHub Check: min-dep-py3 (3.9)
  • GitHub Check: min-dep-py3 (3.12)
  • GitHub Check: quick-py3 (ubuntu-latest)
  • GitHub Check: min-dep-py3 (3.10)
  • GitHub Check: flake8-py3 (codeformat)
  • GitHub Check: min-dep-os (ubuntu-latest)
  • GitHub Check: min-dep-pytorch (2.7.1)
  • GitHub Check: packaging
  • GitHub Check: quick-py3 (macOS-latest)
  • GitHub Check: flake8-py3 (pytype)
  • GitHub Check: flake8-py3 (mypy)
🔇 Additional comments (5)
monai/csrc/resample/pushpull_cpu.cpp (2)

38-38: No review needed for comment-only update.


2219-2231: LGTM: vector-ref signatures align with header.

Also applies to: 2244-2257

monai/csrc/resample/pushpull_cuda.cu (2)

38-38: No review needed for comment-only update.


2180-2193: LGTM: vector-ref signatures align with header.

Also applies to: 2211-2225

monai/csrc/resample/pushpull.h (1)

23-49: API change properly implemented; all internal callers already updated.

The signatures in pushpull.h (lines 29-30, 42-43) correctly require BoundVectorRef and InterpolationVectorRef. All wrapper functions in the same file (e.g., lines 85-86, 101-102, 125-126) already construct these vector refs from scalar enum values before passing to underlying cuda::pushpull and cpu::pushpull implementations. CPU and CUDA implementations are consistent with the header declarations. No breaking changes to external callers detected.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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