Skip to content

enable apply cuts for PerformNuclear#589

Open
SeverinDiederichs wants to merge 1 commit intoapt-sim:masterfrom
SeverinDiederichs:enable_applycuts_for_nuclear_processes
Open

enable apply cuts for PerformNuclear#589
SeverinDiederichs wants to merge 1 commit intoapt-sim:masterfrom
SeverinDiederichs:enable_applycuts_for_nuclear_processes

Conversation

@SeverinDiederichs
Copy link
Copy Markdown
Collaborator

@SeverinDiederichs SeverinDiederichs commented Apr 22, 2026

Before the major cleanup in #540, the PerformNuclear was called when the leaked tracks where returned, not when the SD code was invoked. Therefore, ApplyCuts could not be used. Now, as the PerformNuclear is called directly before the SD code is invoked, we can apply the cuts also to PerformNuclear like G4HepEm and cut low energy secondaries.

This solves #541

Physics behavior changes:

This PR naturally changes all drift tests, as apply cuts is used in the CI, so edep and the full history is changed.

@SeverinDiederichs SeverinDiederichs added performance Type: Runtime and / or memory behavior cleaning improves code clarity, readability or other labels Apr 22, 2026
@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-test

@phsft-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-test

@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

This PR fails the validation ever so slightly:

Layer 48: Relative Error = 1.009609%, File1 = 14.551780, File2 = 14.406333

In fact, this is caused by pure bad luck.
When running with 10 different seeds, this PR fails the CI 2 times, just because the bar of 1% is relatively strict given the random fluctuations.

1234567: pass, 0.411247%
1234568: fail, 1.076262%
1234569: pass, 0.570841%
1234570: pass, 0.560200%
1234571: pass, 0.496087%
1234572: pass, 0.500329%
1234573: pass, 0.940292%
1234574: pass, 0.650887%
1234575: pass, 0.408893%
1234576: fail, 1.369465%

However, on master it is very similar:

1234567: pass, 0.407735%
1234568: fail, 1.038702%
1234569: pass, 0.561926%
1234570: pass, 0.556683%
1234571: pass, 0.509937%
1234572: pass, 0.500730%
1234573: pass, 0.944030%
1234574: pass, 0.642265%
1234575: pass, 0.410258%
1234576: fail, 1.347790%

Therefore, this PR is not causing a physics regression. The CI must be updated to run with higher statistics.

SeverinDiederichs added a commit that referenced this pull request Apr 23, 2026
As noted in #589, the current validation tests can fail by just changing
the random seed, as the fluctuations can lead to an error larger than
1%:

Seed, error:
```
1234567: pass, 0.407735%
1234568: fail, 1.038702%
1234569: pass, 0.561926%
1234570: pass, 0.556683%
1234571: pass, 0.509937%
1234572: pass, 0.500730%
1234573: pass, 0.944030%
1234574: pass, 0.642265%
1234575: pass, 0.410258%
1234576: fail, 1.347790%
```

Therefore, this PR increases the number of events from 400 to 600 to
increase the statistics and reduce the error more safely below 1%.

To accelerate the CI, the GPU settings on the self-hosted runner are
adjusted, such that the GPU is optimally used.
@SeverinDiederichs SeverinDiederichs force-pushed the enable_applycuts_for_nuclear_processes branch from 77eb501 to cafbecb Compare April 23, 2026 19:36
@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-test

@SeverinDiederichs SeverinDiederichs force-pushed the enable_applycuts_for_nuclear_processes branch from cafbecb to 095e9a6 Compare April 23, 2026 20:11
@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-test

@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-performance mono

@SeverinDiederichs SeverinDiederichs force-pushed the enable_applycuts_for_nuclear_processes branch from 095e9a6 to 4066045 Compare April 25, 2026 14:32
@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-performance

@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-performance mono

@SeverinDiederichs SeverinDiederichs force-pushed the enable_applycuts_for_nuclear_processes branch from 4066045 to eee2e96 Compare April 25, 2026 19:47
@SeverinDiederichs
Copy link
Copy Markdown
Collaborator Author

/run-performance mono

@github-actions
Copy link
Copy Markdown

Athena Performance Benchmark (mono)

  • AdePT: SeverinDiederichs/AdePT@eee2e96b661332776459d229610a3788ef6c714d
  • Athena base: https://gitlab.cern.ch/atlas/athena.git@main
  • Athena merged head: 83a0e21b2278056490ebaa0149756d50176a0d99
  • Athena GPU merge source: https://gitlab.cern.ch/elmsheus/athena.git@atlassim-6635-main
  • AtlasExternals base: https://gitlab.cern.ch/atlas/atlasexternals.git@21.1.X-simGPU
  • AtlasExternals benchmark commit: 9da85ba801f2723ec948b0a383882943a77c08d0
  • Build command: ./Projects/AthSimulation/build_gpu.sh -b ../gpu_build_Mono_NoLeaks_eee2e96 > output_build.txt
  • Run command: bash -lc 'source /tmp/adept-athena-performance/run-24939182436-mono/gpu_build_Mono_NoLeaks_eee2e96/setup_run.sh && cd /tmp/adept-athena-performance/run-24939182436-mono/runs/Mono_NoLeaks && ./run_all_5.sh 96 5'
  • Configured repetitions: 5
  • Runtime extraction: per-run average of Real= measurements with the first measurement skipped, matching grep 'Real=' ... | sed ... | awk 'NR>1 { sum += $1; n++ } ...'.
  • Build log: /work/AdePT/athena-performance-results/run-24939182436-mono/output_build.txt
Run log Average real time (s) Measurements
log.AtlasG4Tf_AdePT_T96_run1 1228.364 96
log.AtlasG4Tf_AdePT_T96_run2 1204.351 96
log.AtlasG4Tf_AdePT_T96_run3 1211.807 96
log.AtlasG4Tf_AdePT_T96_run4 1221.874 96
log.AtlasG4Tf_AdePT_T96_run5 1198.221 96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleaning improves code clarity, readability or other performance Type: Runtime and / or memory behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants