test: assert all placement rotations preserve handedness#72
Conversation
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.
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Motivation
Follow-up to #70. That PR fixed a left-handed placement frame in
SBTStructureBuilder(columns(b, n, d)withb = d × n, givingdet < 0), which GeoModel2G4 forwarded toCLHEP::HepRotationas an improper rotation — 180ZMpvImproperRotationwarnings per Geant4 job. Nothing in CI prevents that class of bug from returning, and the frame construction is duplicated across two sites inSBTStructureBuilder.cpp, so any future builder could reintroduce it.Change
Add
ConsistencyTest.AllRotationsRightHanded, which builds the full geometry viaSHiPGeometryBuilderand recursively walks the entire world tree, asserting that the linear part of everygetXToChildVoltransform 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
/SHiP/decay_volume/sbt/structure_SF9_Bot_C1_BFat determinant −1) — matching the count fix: make SBT beam placement frames right-handed #70 removed.main(with the fix), the full suite passes 40/40.The walk visits all ~930k nodes and takes ~190 s, dominated by
getXToChildVolmaterializingGeoSerialTransformerreplicas. Global scope is intentional, to guard every current and future builder.