From 1509dfa6def7bc2ee039a7c48833b9355d55e551 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 29 May 2026 20:18:03 -0500 Subject: [PATCH 1/4] ci: add peak RSS memory check to check-geometry-configs Wrap each checkGeometry invocation with /usr/bin/time -v to measure peak resident set size (RSS). The peak RSS is printed for every config on every run, providing a visible trend in CI logs. The job fails if any config exceeds MEMORY_LIMIT_KB (currently 4 GB), preventing silent growth of the geometry memory footprint. This is analogous to eic/containers#289 which caps compressed container image size: the limit is a hardcoded constant in the workflow file, so changing it requires a conscious, reviewable PR. The initial limit of 4 GB is deliberately generous. The first CI run will report actual peak RSS values for all configs; the limit will be tightened to baseline + ~20% headroom in a follow-up commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/check-geometry-configs.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-geometry-configs.yml b/.github/workflows/check-geometry-configs.yml index dad20c896..55f1f1565 100644 --- a/.github/workflows/check-geometry-configs.yml +++ b/.github/workflows/check-geometry-configs.yml @@ -23,9 +23,21 @@ jobs: setup: install/bin/thisepic.sh run: | export DETECTOR_CACHE=/opt/detector/epic-main/share/epic + MEMORY_LIMIT_KB=4000000 # 4 GB – update this deliberately when geometry grows IFS=, read -a configs <<< "${{inputs.detector_configs}}" + overall_rc=0 for config in ${configs[@]} ; do echo "::group::${config}" ; - checkGeometry -c ${DETECTOR_PATH}/${config}.xml ; + /usr/bin/time -v -o /tmp/time_${config}.txt \ + checkGeometry -c ${DETECTOR_PATH}/${config}.xml + rc=$? + peak_rss_kb=$(grep "Maximum resident set size" /tmp/time_${config}.txt | awk '{print $NF}') + echo "Peak RSS for ${config}: ${peak_rss_kb} kB (limit: ${MEMORY_LIMIT_KB} kB)" + if [ "${peak_rss_kb}" -gt "${MEMORY_LIMIT_KB}" ]; then + echo "::error::Memory limit exceeded for ${config}: ${peak_rss_kb} kB > ${MEMORY_LIMIT_KB} kB" + overall_rc=1 + fi + [ $rc -ne 0 ] && overall_rc=$rc echo "::endgroup::" ; done + exit $overall_rc From 3f53eb312c8c91c6bad3897df95c936634746ff1 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 29 May 2026 21:00:54 -0500 Subject: [PATCH 2/4] fix: limit memory to 1.2 GB --- .github/workflows/check-geometry-configs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-geometry-configs.yml b/.github/workflows/check-geometry-configs.yml index 55f1f1565..d3afe8fb1 100644 --- a/.github/workflows/check-geometry-configs.yml +++ b/.github/workflows/check-geometry-configs.yml @@ -23,7 +23,7 @@ jobs: setup: install/bin/thisepic.sh run: | export DETECTOR_CACHE=/opt/detector/epic-main/share/epic - MEMORY_LIMIT_KB=4000000 # 4 GB – update this deliberately when geometry grows + MEMORY_LIMIT_KB=1200000 # 1.2 GB – update this deliberately when geometry grows IFS=, read -a configs <<< "${{inputs.detector_configs}}" overall_rc=0 for config in ${configs[@]} ; do From f80625c246662db39d21055f29edb6cdc5196642 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sat, 30 May 2026 08:17:50 -0500 Subject: [PATCH 3/4] fix: print RSS errors outside config logging group --- .github/workflows/check-geometry-configs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-geometry-configs.yml b/.github/workflows/check-geometry-configs.yml index d3afe8fb1..869278cec 100644 --- a/.github/workflows/check-geometry-configs.yml +++ b/.github/workflows/check-geometry-configs.yml @@ -33,11 +33,11 @@ jobs: rc=$? peak_rss_kb=$(grep "Maximum resident set size" /tmp/time_${config}.txt | awk '{print $NF}') echo "Peak RSS for ${config}: ${peak_rss_kb} kB (limit: ${MEMORY_LIMIT_KB} kB)" + echo "::endgroup::" if [ "${peak_rss_kb}" -gt "${MEMORY_LIMIT_KB}" ]; then echo "::error::Memory limit exceeded for ${config}: ${peak_rss_kb} kB > ${MEMORY_LIMIT_KB} kB" overall_rc=1 fi [ $rc -ne 0 ] && overall_rc=$rc - echo "::endgroup::" ; done exit $overall_rc From 882dbf265a84a8c3d3dae3c9124c9fd3eb5b16ac Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Sat, 30 May 2026 08:52:35 -0500 Subject: [PATCH 4/4] fix: bump memory limit to also fit bic_6layers --- .github/workflows/check-geometry-configs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-geometry-configs.yml b/.github/workflows/check-geometry-configs.yml index 869278cec..d5633dff2 100644 --- a/.github/workflows/check-geometry-configs.yml +++ b/.github/workflows/check-geometry-configs.yml @@ -23,7 +23,7 @@ jobs: setup: install/bin/thisepic.sh run: | export DETECTOR_CACHE=/opt/detector/epic-main/share/epic - MEMORY_LIMIT_KB=1200000 # 1.2 GB – update this deliberately when geometry grows + MEMORY_LIMIT_KB=1300000 # 1.3 GB – update this deliberately when geometry grows IFS=, read -a configs <<< "${{inputs.detector_configs}}" overall_rc=0 for config in ${configs[@]} ; do