Skip to content

Conversation

@iiiian
Copy link
Contributor

@iiiian iiiian commented Dec 9, 2025

Description

Fix vertex id assignment logic in SweepAndTiniestQueue.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

The broadphase unit test now pass.

Test Configuration:

  • OS and Version: Fedora 42
  • Compiler and Version: gcc 15 + nvcc 13

Checklist

  • I have followed the project style guide
  • My code follows the clang-format style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

++unused_vert_id;
} else {
boxes->vertices[i].vertex_ids.z = vertex_boxes[i].vertex_ids[2];
}
Copy link
Member

Choose a reason for hiding this comment

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

If you want you can use the same logic as Scalable CCD:

Vertex Box: (i, -1, -1) -> (i, -i-1, -i-1)
Edge Box: (i, j, -1) -> (i, j, -i - 1)
Triangle Box: (i, j, k) -> (i, j, k) 

Copy link
Member

@zfergus zfergus Dec 9, 2025

Choose a reason for hiding this comment

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

const auto [vi, vj, vk] = vertex_boxes[i].vertex_ids;
assert(vi >= 0);
boxes->vertices[i].vertex_ids.x = vi;
boxes->vertices[i].vertex_ids.y = vj >= 0 ? vj : (-vi - 1);
boxes->vertices[i].vertex_ids.z = vk >= 0 ? vk : (-vi - 1);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can vi be 0? Maybe the assert should be assert(vi >= 0);

Copy link
Member

Choose a reason for hiding this comment

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

Yes you are right

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.41%. Comparing base (d2cb640) to head (87ab705).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #204   +/-   ##
=======================================
  Coverage   97.40%   97.41%           
=======================================
  Files         149      149           
  Lines       23748    23748           
  Branches      797      798    +1     
=======================================
+ Hits        23132    23133    +1     
+ Misses        616      615    -1     
Flag Coverage Δ
unittests 97.41% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zfergus zfergus merged commit 76c90f2 into ipc-sim:main Dec 9, 2025
18 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