Skip to content

test: assert all placement rotations preserve handedness#72

Open
olantwin wants to merge 1 commit into
mainfrom
test/rotations-right-handed
Open

test: assert all placement rotations preserve handedness#72
olantwin wants to merge 1 commit into
mainfrom
test/rotations-right-handed

Conversation

@olantwin

Copy link
Copy Markdown
Contributor

Motivation

Follow-up to #70. That PR fixed a left-handed placement frame in SBTStructureBuilder (columns (b, n, d) with b = d × n, giving det < 0), which GeoModel2G4 forwarded to CLHEP::HepRotation as an improper rotation — 180 ZMpvImproperRotation warnings per Geant4 job. Nothing in CI prevents that class of bug from returning, and the frame construction is duplicated across two sites in SBTStructureBuilder.cpp, so any future builder could reintroduce it.

Change

Add ConsistencyTest.AllRotationsRightHanded, which builds the full geometry via SHiPGeometryBuilder and recursively walks the entire world tree, asserting that the linear part of every getXToChildVol transform has positive determinant. A reflection anywhere in the tree fails the test, naming the offending volume path. This covers all subsystems, not just the SBT structure, and pins the 180 → 0 property permanently.

Verification

The walk visits all ~930k nodes and takes ~190 s, dominated by getXToChildVol materializing GeoSerialTransformer replicas. Global scope is intentional, to guard every current and future builder.

Recursively walk the assembled world tree and check that the linear part
of every getXToChildVol transform has positive determinant, so a reflection
(left-handed frame) fails the build. This pins the fix from #70 permanently
and covers any future builder, not just the SBT structure.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@olantwin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c077174f-23d2-4139-b524-1032cea339cc

📥 Commits

Reviewing files that changed from the base of the PR and between c6d866b and c83b7df.

📒 Files selected for processing (1)
  • tests/test_consistency.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/rotations-right-handed

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.

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