Skip to content

Add IdxRange boundary slicing coverage#13

Open
psychocoderHPC wants to merge 1 commit intodevfrom
pr-add-idxrange-boundary-slicing-coverage
Open

Add IdxRange boundary slicing coverage#13
psychocoderHPC wants to merge 1 commit intodevfrom
pr-add-idxrange-boundary-slicing-coverage

Conversation

@psychocoderHPC
Copy link
Copy Markdown
Owner

@psychocoderHPC psychocoderHPC commented Apr 8, 2026

Split from local commit 34b11403b2a4e529a55c8b7ae4dece6e1a96822f.

Base branch: pr-add-boundary-view-const-coverage.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected boundary range calculations for memory indexing operations to properly preserve bounds and stride values.
  • Tests

    • Enhanced test coverage for const correctness of memory views and boundary slicing behavior.
    • Added verification tests ensuring boundary slicing maintains proper bounds handling and stride preservation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Warning

Rate limit exceeded

@psychocoderHPC has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 35 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 35 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 669453b8-e139-4d72-9de9-2b13721cee13

📥 Commits

Reviewing files that changed from the base of the PR and between bd1ff5b and 5f05423.

📒 Files selected for processing (2)
  • include/alpaka/mem/IdxRange.hpp
  • test/unit/mem/idxRange.cpp
📝 Walkthrough

Walkthrough

The pull request modifies the initialization behavior of makeDirectionSubRange to derive subrange begin/end values from an existing range instead of zero-filled defaults, and extends test coverage with boundary view constness assertions and comprehensive boundary slicing validation.

Changes

Cohort / File(s) Summary
Core Dimension Subrange Logic
include/alpaka/mem/IdxRange.hpp
Modified makeDirectionSubRange to initialize m_begin and m_end from incoming range.m_begin and range.m_end instead of zero-filled values, changing how per-dimension boundary modifications are applied to derived subranges.
Boundary View Constness Testing
test/unit/mem/constCorrectness.cpp
Added test assertions validating that boundary view subranges respect const-correctness: writable access in mutable buffers and read-only access in const/outer-const buffer views.
IdxRange Boundary Slicing Validation
test/unit/mem/idxRange.cpp
Refactored vector literal formatting and introduced new test case validating boundary slicing behavior across LOWER/UPPER/MIDDLE directions, empty core scenarios, and signed coordinate ranges; verifies preservation of m_begin, m_end, m_stride, and iteration correctness.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Slicing boundaries with care and precision,
From range to subrange with new decision,
Begin and end now inherit their place,
While constness assertions guard every trace.
Dimensions aligned in their proper dimension! 🎯

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and accurately describes the main change: adding test coverage for IdxRange boundary slicing functionality.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr-add-idxrange-boundary-slicing-coverage

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

@psychocoderHPC psychocoderHPC force-pushed the pr-add-boundary-view-const-coverage branch from fb3ef0d to d4a9884 Compare April 8, 2026 18:10
@psychocoderHPC
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@psychocoderHPC psychocoderHPC force-pushed the pr-add-idxrange-boundary-slicing-coverage branch from 34b1140 to bd1ff5b Compare April 8, 2026 18:11
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
test/unit/mem/idxRange.cpp (1)

184-191: Optional: deduplicate collectVisited helper in this file.

This helper now appears in multiple test cases; extracting one shared local/static helper would reduce repetition.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/unit/mem/idxRange.cpp` around lines 184 - 191, The collectVisited lambda
is duplicated across test cases; replace the per-test local duplicate with a
single shared helper by extracting it as a static function or a single
file-scoped lambda named collectVisited (same signature using template parameter
T_Range and Idx type deduction) and update all tests to call that shared helper;
ensure the symbol name collectVisited is used so existing call sites compile
unchanged and keep its current behavior of returning std::vector<Idx> from the
supplied range.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/unit/mem/idxRange.cpp`:
- Around line 184-191: The collectVisited lambda is duplicated across test
cases; replace the per-test local duplicate with a single shared helper by
extracting it as a static function or a single file-scoped lambda named
collectVisited (same signature using template parameter T_Range and Idx type
deduction) and update all tests to call that shared helper; ensure the symbol
name collectVisited is used so existing call sites compile unchanged and keep
its current behavior of returning std::vector<Idx> from the supplied range.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2d03457b-d9f8-4afe-a90b-309fd2a62615

📥 Commits

Reviewing files that changed from the base of the PR and between d4a9884 and bd1ff5b.

📒 Files selected for processing (3)
  • include/alpaka/mem/IdxRange.hpp
  • test/unit/mem/constCorrectness.cpp
  • test/unit/mem/idxRange.cpp

@psychocoderHPC psychocoderHPC force-pushed the pr-add-boundary-view-const-coverage branch from d4a9884 to 3a72e41 Compare April 8, 2026 18:28
@psychocoderHPC psychocoderHPC changed the base branch from pr-add-boundary-view-const-coverage to dev April 8, 2026 18:31
@psychocoderHPC
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@psychocoderHPC psychocoderHPC force-pushed the pr-add-idxrange-boundary-slicing-coverage branch from bd1ff5b to 5f05423 Compare April 8, 2026 18:31
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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