Skip to content

Fix JaggedTensor.from_*_and_list_ids ldim=2 issue#357

Merged
swahtz merged 7 commits into
openvdb:mainfrom
swahtz:fix/from_data_ldim2
Dec 2, 2025
Merged

Fix JaggedTensor.from_*_and_list_ids ldim=2 issue#357
swahtz merged 7 commits into
openvdb:mainfrom
swahtz:fix/from_data_ldim2

Conversation

@swahtz

@swahtz swahtz commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Fix issue where 'from_*_and_list_ids' functions did not set mNumOuterLists correctly for the ldim==2 case. mNumOuterLists was being set to the total number of tensors, not the length of the first set of lists. Added tests for these functions

Fixes #356

…Lists correctly for the ldim==2 case.

Add tests for these functions

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
@swahtz swahtz requested a review from a team as a code owner December 1, 2025 09:12
@swahtz swahtz added bug Something isn't working core library Core fVDB library. i.e. anything in the _Cpp module (C++) or fvdb python module labels Dec 1, 2025
… list_Ids of dim 2

Fix documentation, add docstrings in JaggedTensor.h
Fix checks for the list_ids empty case

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the from_data_indices_and_list_ids and from_data_offsets_and_list_ids factory methods where mNumOuterLists was incorrectly set to the total number of tensors instead of the number of outer lists for ldim==2 JaggedTensors. The fix adds logic to detect when ldim==2 (by checking if mListIdx.size(1) == 2) and correctly computes the number of outer lists by finding the maximum value in the first column of list_ids. Additionally, comprehensive regression tests and improved documentation were added.

  • Added input validation checks for the factory methods to ensure proper tensor shapes
  • Fixed mNumOuterLists calculation for ldim==2 case by using max() on the first column of list_ids
  • Updated a related usage in the CUDA code to use the correct accessor

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/test_jagged_tensor.py Added comprehensive regression tests for both from_data_offsets_and_list_ids and from_data_indices_and_list_ids factory methods, testing both ldim=1 and ldim=2 cases
src/tests/JaggedTensorTest.cpp Updated test data to use proper 2D tensor format for list_ids parameter
src/fvdb/JaggedTensor.h Enhanced documentation for factory methods with detailed examples and parameter descriptions
src/fvdb/JaggedTensor.cpp Added input validation and fixed mNumOuterLists calculation for ldim==2 by computing max of first column in list_ids
fvdb/jagged_tensor.py Updated Python docstrings to match C++ documentation improvements and clarify parameter shapes
src/fvdb/detail/ops/gsplat/GaussianRasterizeContributingGaussianIds.cu Changed check from num_outer_lists() to joffsets().size(0) - 1 to correctly count tensors rather than outer lists

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread src/fvdb/JaggedTensor.cpp Outdated
Comment thread src/fvdb/JaggedTensor.cpp Outdated
Comment thread fvdb/jagged_tensor.py Outdated
swahtz and others added 2 commits December 2, 2025 12:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
…t 2 dimensions (not empty)

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread src/fvdb/JaggedTensor.h Outdated
…vice too

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread src/fvdb/JaggedTensor.h Outdated
Comment thread src/fvdb/JaggedTensor.h Outdated
Comment thread src/fvdb/JaggedTensor.h

@harrism harrism left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Big improvement!

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
@swahtz swahtz enabled auto-merge (squash) December 2, 2025 04:49
@swahtz swahtz merged commit 1563363 into openvdb:main Dec 2, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core library Core fVDB library. i.e. anything in the _Cpp module (C++) or fvdb python module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JaggedTensor.from_data_indices_and_list_ids ldim=2 issue

3 participants