|
38 | 38 | MAX_INDEX_SECONDS: '8' |
39 | 39 | MIN_NODES: '40' |
40 | 40 | MAX_PHANTOM_DROP_RATIO: '50' |
| 41 | + # Memory ceiling for `codeiq enrich` on fixture-multi-lang. Local |
| 42 | + # baseline post-Phase-A+B+C of the 2026-05-13 OOM-fix plan: ~108 MB |
| 43 | + # peak RSS. 300 MB ceiling gives ~2.7x headroom — tight enough to |
| 44 | + # surface real regressions, loose enough to absorb GC / scheduler |
| 45 | + # variance on CI runners. Bump only if a deliberate enrich-mem |
| 46 | + # regression is documented in a PR. |
| 47 | + MAX_ENRICH_RSS_KB: '307200' |
41 | 48 | steps: |
42 | 49 | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
43 | 50 | - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
@@ -108,3 +115,33 @@ jobs: |
108 | 115 | fi |
109 | 116 | fi |
110 | 117 | exit $fail |
| 118 | + # Enrich memory regression gate. Locks in the gains from the |
| 119 | + # 2026-05-13 OOM-fix plan (Phases A-C). Pre-Phase-A on the same |
| 120 | + # fixture peaked at ~600 MB; current main lives at ~108 MB peak. |
| 121 | + # If a refactor pushes peak past MAX_ENRICH_RSS_KB, fail the PR. |
| 122 | + - name: Enrich memory gate |
| 123 | + run: | |
| 124 | + set -euo pipefail |
| 125 | + # Run enrich against the already-indexed fixture; /usr/bin/time |
| 126 | + # -v reports peak RSS. |
| 127 | + /usr/bin/time -v /tmp/codeiq enrich /tmp/fm-perf \ |
| 128 | + > /tmp/perf-enrich.log 2> /tmp/perf-enrich.time |
| 129 | + RSS=$(awk -F': ' '/Maximum resident set size/ {print $2}' /tmp/perf-enrich.time) |
| 130 | + RSS=${RSS:-0} |
| 131 | + ELAPSED=$(awk -F': ' '/Elapsed \(wall clock\)/ {print $2}' /tmp/perf-enrich.time) |
| 132 | +
|
| 133 | + { |
| 134 | + echo "" |
| 135 | + echo "## codeiq enrich memory gate" |
| 136 | + echo "" |
| 137 | + echo "| metric | value | budget |" |
| 138 | + echo "|---|---:|---:|" |
| 139 | + echo "| peak RSS (KB) | $RSS | <= $MAX_ENRICH_RSS_KB |" |
| 140 | + echo "| wall-clock | $ELAPSED | — |" |
| 141 | + } >> "$GITHUB_STEP_SUMMARY" |
| 142 | + cat /tmp/perf-enrich.log >> "$GITHUB_STEP_SUMMARY" |
| 143 | +
|
| 144 | + if [ "$RSS" -gt "$MAX_ENRICH_RSS_KB" ]; then |
| 145 | + echo "::error::enrich peak RSS ${RSS} KB exceeds budget ${MAX_ENRICH_RSS_KB} KB" |
| 146 | + exit 1 |
| 147 | + fi |
0 commit comments