Skip to content

Remove the unused GANfreemem flag of TFCSEnergyAndHitGANV2, which shares its bit with RetryChainFromStart, and clear that bit when reading older files - #216

Merged
jbeirer merged 1 commit into
mainfrom
gan-retry-bit
Nov 24, 2026
Merged

jbeirer merged 1 commit into
mainfrom
gan-retry-bit

Conversation

@jbeirer

@jbeirer jbeirer commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

TFCSEnergyAndHitGANV2 derives from TFCSParametrizationChain and defines its flag kGANfreemem as BIT(17), the same bit as TFCSParametrizationChain::kRetryChainFromStart. The constructor sets it, so every GAN reports RetryChainFromStart(): all 564 TFCSEnergyAndHitGANV2 in TFCSparam_AF3_MC23_Sep23.root do. Athena upstream/main has the same clash.

GANfreemem() itself is never read, here, in Athena main-FCSExternal or in FastCaloSimAnalyzer. The comment about deleting m_input after reading is left over from TFCSEnergyAndHitGAN; this class has no m_input and no custom streamer. So the only effect of the bit is the chain one. simulate_and_retry hands a retry request of the parametrizations before and after the bins back to the caller instead of retrying, and TFCSEnergyAndHitGANV2::simulate, which never restarts its chain, then fails with FCSFatal. No production parametrization requests a retry there today, so simulation is not affected.

Change

  • kGANfreemem, GANfreemem(), set_GANfreemem(), reset_GANfreemem() and the stale comment are removed, and the constructor no longer sets the bit.
  • A custom Streamer (TFCSEnergyAndHitGANV2 - in LinkDef.h, as for TFCSPredictExtrapWeights) reads and writes the class buffer as before, and clears BIT(17) after reading, so older files read as new ones. The file format, the class version and the StreamerInfo do not change.
  • New GANStreamerTests: a new GAN does not report RetryChainFromStart(), and a GAN with BIT(17) set (as in older files) does not after writing and reading.

Files written from now on have the bit clear; older readers (Athena's own copy) ignore it there as well.

Checks

Against main (73c5cc7):

  • GCC 15 (LCG_110, developer build, incl. dictionary): 0 warnings; ctest 130/130 passed
  • AtlasBenchmark dump (BENCH_N=50): byte-identical to main
  • SliceCheck on the MC23 file TFCSparam_dev_Hybrid_Ha_v5_all_baryons_0_500.root (reads all its GANs through the new streamer, BENCH_N=20): byte-identical to main
  • clang-format 20.1.8, codespell
  • GCC 16 and Clang 22 with the CI flags: 0 warnings
  • Alma 10 ci-linux (clang-tidy 21, cppcheck): 0 warnings; its ctest 130/130 passed

…res its bit with RetryChainFromStart, and clear that bit when reading older files
@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 31 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: 915c8f6d-e013-4f59-8b64-bee29ffc71cd
Commits

Reviewing files that changed from the base of the PR and between 73c5cc7 and 5e0602d.

Files selected for processing: 4

  • include/FastCaloSim/Core/TFCSEnergyAndHitGANV2.h
  • include/FastCaloSim/LinkDef.h
  • source/Core/TFCSEnergyAndHitGANV2.cxx
  • test/source/GANStreamerTests.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
@jbeirer
jbeirer merged commit c36fcd5 into main Nov 24, 2026
16 checks passed
@jbeirer
jbeirer deleted the gan-retry-bit branch November 24, 2026 10:35
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
include/FastCaloSim/Core/TFCSEnergyAndHitGANV2.h 61.53% <ø> (-2.75%) ⬇️
source/Core/TFCSEnergyAndHitGANV2.cxx 76.00% <100.00%> (+1.00%) ⬆️
test/source/GANStreamerTests.cxx 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

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