Skip to content

Fail the simulation of a binned shower without an event library or model instead of continuing or dereferencing the missing model - #212

Merged
jbeirer merged 1 commit into
mainfrom
binned-shower-missing-event
Nov 24, 2026
Merged

jbeirer merged 1 commit into
mainfrom
binned-shower-missing-event

Conversation

@jbeirer

@jbeirer jbeirer commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

TFCSBinnedShowerBase::simulate takes the shower of the event from get_event, which cannot report a failure:

  • TFCSBinnedShowerONNX::get_event calls m_ai_simulator->getEvent(...) unconditionally. m_ai_simulator is nullptr for a new object and after load_simulator failed (which deletes it), so the simulation dereferences nullptr.
  • TFCSBinnedShower::get_event logs an error for an empty event library and returns, and simulate goes on and reports FCSSuccess with no shower.

Change

  • TFCSBinnedShowerBase::get_event returns an FCSReturnCode: FCSFatal if there is no shower to take the event from, and simulate returns it.
  • TFCSBinnedShowerONNX::get_event fails with an error if no simulator is loaded. TFCSBinnedShower::get_event fails for an empty event library.
  • BinnedShowerTests: SimulateOnNewState now expects FCSFatal for the empty event library. The new SimulateWithoutModel simulates a TFCSBinnedShowerONNX without a model (on main it dereferences nullptr).

No persistent member changes. get_event is protected; nothing outside this repository overrides it (Athena main-FCSExternal checked). Simulation with a loaded library or model is unchanged.

Checks

Run on main (73c5cc7) with #205 to #213 together, against main:

  • GCC 15 (LCG_110, developer build): 0 warnings; ctest 138/138 passed (main: 128/128), incl. the unchanged AtlasTransportTests and AtlasSimTests references
  • AtlasBenchmark dump (BENCH_N=50): byte-identical to main
  • SliceCheck on the MC23 file TFCSparam_dev_Hybrid_Ha_v5_all_baryons_0_500.root (BENCH_N=20): byte-identical to main, max RSS 4.76 GB on both
  • clang-format 20.1.8
  • GCC 16 and Clang 22 with the CI flags: 0 warnings
  • Alma 10 ci-linux (clang-tidy 21, cppcheck): 0 warnings; its ctest 138/138 passed
  • Production files: TFCSparam_AF3_MC23_Sep23.root contains no TFCSBinnedShower or TFCSBinnedShowerONNX

…del instead of continuing or dereferencing the missing model
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d3911c6c-834d-4ed6-b226-83bb3bc93283
Commits

Reviewing files that changed from the base of the PR and between 73c5cc7 and 0e25997.

Files selected for processing: 7

  • include/FastCaloSim/Core/TFCSBinnedShower.h
  • include/FastCaloSim/Core/TFCSBinnedShowerBase.h
  • include/FastCaloSim/Core/TFCSBinnedShowerONNX.h
  • source/Core/TFCSBinnedShower.cxx
  • source/Core/TFCSBinnedShowerBase.cxx
  • source/Core/TFCSBinnedShowerONNX.cxx
  • test/source/BinnedShowerTests.cxx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot added the tests Issues affecting the CI tests label Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
source/Core/TFCSBinnedShower.cxx 66.66% 1 Missing ⚠️
source/Core/TFCSBinnedShowerONNX.cxx 80.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
include/FastCaloSim/Core/TFCSBinnedShower.h 80.00% <ø> (ø)
include/FastCaloSim/Core/TFCSBinnedShowerBase.h 45.45% <ø> (ø)
include/FastCaloSim/Core/TFCSBinnedShowerONNX.h 0.00% <ø> (ø)
source/Core/TFCSBinnedShowerBase.cxx 6.43% <100.00%> (-0.34%) ⬇️
test/source/BinnedShowerTests.cxx 100.00% <100.00%> (ø)
source/Core/TFCSBinnedShower.cxx 12.19% <66.66%> (-0.08%) ⬇️
source/Core/TFCSBinnedShowerONNX.cxx 37.03% <80.00%> (+37.03%) ⬆️

@jbeirer
jbeirer merged commit 151258d into main Nov 24, 2026
19 checks passed
@jbeirer
jbeirer deleted the binned-shower-missing-event branch November 24, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Issues affecting the CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant