Skip to content

Enable Woodcock tracking in nested regions - #724

Open
SeverinDiederichs wants to merge 2 commits into
apt-sim:masterfrom
SeverinDiederichs:wdt-subregions
Open

SeverinDiederichs wants to merge 2 commits into
apt-sim:masterfrom
SeverinDiederichs:wdt-subregions

Conversation

@SeverinDiederichs

Copy link
Copy Markdown
Collaborator

Following G4HepEm, this PR enables Woodcock tracking in nested regions, i.e., if Region A has a subregion B, both can now use Woodcock tracking, whereby the subregion B still uses the envelope volume of region A.
Note that now it is possible that a track is classified for Woodcock tracking, but then the envelope volume is not found (same as in G4HepEm), if the subregion B has parts that are outside of region A. This is a corner case that should not appear in any reasonable setup, but should be covered. In that case, the track is moved back to the normal queue at the beginning of the WDT kernel. For this, some code was moved into helpers, such that it is less code duplication.

In the construction it is checked that WDT regions are either pure CPU or pure GPU, nested regions where parts are on CPU and other parts on GPU are rejected as the boundary crossing from CPU to GPU would be ignored.

This PR gives bitwise identical results, it only enables a new feature. Multiple unit tests are added.

Note: this PR can only be tested and reviewed after G4HepEm is tagged again (expected very soon), and the LCG view that is used in the CI is updated.

Map inherited regions to their governing WDT envelopes, preserve local material-cut couples, and share region resolution between admission and containment. Share packed root spans and validate CPU/GPU envelope consistency.

Add focused helper/geometry coverage and a nested-region equivalence test under the existing advanced validation routing. Preserve failed-test artifacts and document nested-region support. Provide a valid WDT envelope in the upstream split step-start kill fixture.

Validation before rebase: eight exact mono/split drift comparisons, 28 focused unit checks, both nested equivalence comparisons, and clang-format 19. Paired resolver timings found no resolved slowdown on the nested fixture.

Post-rebase validation: all 28 split step-start kill cases and the WDT helper test pass against current master.
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