Skip to content

Commit d237156

Browse files
committed
Merge branch 'main' into feature/freebsd-support
2 parents ec8c382 + 61b3b1b commit d237156

3 files changed

Lines changed: 32 additions & 28 deletions

File tree

‎.github/workflows/_smoke.yml‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ jobs:
7171
WIN=$(jq -cn --argjson a "$CORE_WIN" '$a')
7272
PORTABLE=$(jq -cn --argjson a "$CORE_PORTABLE" '$a')
7373
fi
74-
# Keep the UI marker explicit because the smoke wrappers use it to
75-
# require and validate the shipped content-addressed frontend pack.
76-
VARIANTS='["ui"]'
77-
UNIX_M=$(jq -cn --argjson a "$UNIX" --argjson v "$VARIANTS" '{include:[$a[] as $o | $v[] as $t | ($o + {variant:$t})]}')
78-
WIN_M=$(jq -cn --argjson a "$WIN" --argjson v "$VARIANTS" '{include:[$a[] as $o | $v[] as $t | ($o + {variant:$t})]}')
79-
PORTABLE_M=$(jq -cn --argjson a "$PORTABLE" --argjson v "$VARIANTS" '{include:[$a[] as $o | $v[] as $t | ($o + {variant:$t})]}')
74+
# One composition ships; the wrappers assert the embedded UI themselves
75+
# (SMOKE_REQUIRE_UI in scripts/ci/smoke-artifact.sh and below).
76+
UNIX_M=$(jq -cn --argjson a "$UNIX" '{include:$a}')
77+
WIN_M=$(jq -cn --argjson a "$WIN" '{include:$a}')
78+
PORTABLE_M=$(jq -cn --argjson a "$PORTABLE" '{include:$a}')
8079
echo "unix=$UNIX_M" >> "$GITHUB_OUTPUT"
8180
echo "windows=$WIN_M" >> "$GITHUB_OUTPUT"
8281
echo "portable=$PORTABLE_M" >> "$GITHUB_OUTPUT"
@@ -102,9 +101,8 @@ jobs:
102101

103102
- name: Extract release artifact
104103
run: |
105-
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
106104
mkdir -p "$RUNNER_TEMP/cbm-artifact"
107-
tar -xzf codebase-memory-mcp${SUFFIX}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \
105+
tar -xzf codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \
108106
-C "$RUNNER_TEMP/cbm-artifact"
109107
chmod +x "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
110108
@@ -116,10 +114,10 @@ jobs:
116114
# the wrapper (no env isolation, no user-PATH guard, fixed port).
117115
- name: Smoke test (shared wrapper)
118116
run: |
119-
scripts/smoke-local.sh \
120-
"$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp" ${{ matrix.variant }}
117+
scripts/smoke-local.sh "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
121118
env:
122119
CBM_SMOKE_ARTIFACT_DIR: ${{ runner.temp }}/cbm-artifact
120+
SMOKE_REQUIRE_UI: "1"
123121

124122
- name: Security audits
125123
run: |
@@ -195,11 +193,10 @@ jobs:
195193
- name: Extract release artifact
196194
shell: msys2 {0}
197195
run: |
198-
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
199196
ARCH=${{ matrix.arch }}
200197
ARTIFACT_DIR="$(cygpath -u "$RUNNER_TEMP")/cbm-artifact"
201198
mkdir -p "$ARTIFACT_DIR"
202-
unzip -o "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip" -d "$ARTIFACT_DIR"
199+
unzip -o "codebase-memory-mcp-windows-${ARCH}.zip" -d "$ARTIFACT_DIR"
203200
test -s "$ARTIFACT_DIR/codebase-memory-mcp.exe"
204201
# ONE executable per runtime set: a payload sibling would mean the
205202
# removed launcher split came back.
@@ -226,7 +223,7 @@ jobs:
226223
shell: msys2 {0}
227224
env:
228225
SMOKE_ARCH: ${{ matrix.arch }}
229-
SMOKE_VARIANT: ${{ matrix.variant }}
226+
SMOKE_REQUIRE_UI: "1"
230227
run: |
231228
export CBM_SMOKE_ARTIFACT_DIR="$(cygpath -u "$RUNNER_TEMP")/cbm-artifact"
232229
bash test-infrastructure/vm/vm-smoke.sh
@@ -288,9 +285,8 @@ jobs:
288285

289286
- name: Extract release artifact
290287
run: |
291-
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
292288
mkdir -p "$RUNNER_TEMP/cbm-artifact"
293-
tar -xzf codebase-memory-mcp${SUFFIX}-linux-${{ matrix.arch }}-portable.tar.gz \
289+
tar -xzf codebase-memory-mcp-linux-${{ matrix.arch }}-portable.tar.gz \
294290
-C "$RUNNER_TEMP/cbm-artifact"
295291
chmod +x "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
296292
@@ -301,10 +297,10 @@ jobs:
301297
# exactly the phases it most needs to run.
302298
- name: Smoke test (shared wrapper)
303299
run: |
304-
scripts/smoke-local.sh \
305-
"$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp" ${{ matrix.variant }}
300+
scripts/smoke-local.sh "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
306301
env:
307302
CBM_SMOKE_ARTIFACT_DIR: ${{ runner.temp }}/cbm-artifact
303+
SMOKE_REQUIRE_UI: "1"
308304

309305
# The -portable binary is what all linux install/update paths now deliver;
310306
# it MUST start on old glibc (Debian 11 / RHEL 8 / Ubuntu 20.04). Runs it

‎src/foundation/diagnostics.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,16 @@ static void write_diagnostics(void) {
528528
size_t page_faults = 0;
529529
mi_process_info(&elapsed_ms, &user_ms, &sys_ms, &current_rss, &peak_rss, &current_commit,
530530
&peak_commit, &page_faults);
531-
if (current_rss == 0) {
532-
current_rss = cbm_mem_rss();
533-
}
531+
/* Do NOT report mi_process_info's rss fields: on Linux mimalloc never sets
532+
* current_rss, so the field keeps mimalloc's internal committed-page
533+
* counter — deliberately tuned low here (purge_decommits=1, purge_delay=0)
534+
* and able to go transiently NEGATIVE under purge, which wraps through
535+
* size_t and printed rss_bytes of ~2^64 (soak read it as a 17-exabyte
536+
* "leak"). cbm_mem_rss()/cbm_mem_peak_rss() already encode the whole
537+
* lesson: /proc statm is authoritative on Linux, mimalloc is correct on
538+
* macOS/Windows, and peak is reconciled to never undercut current. */
539+
current_rss = cbm_mem_rss();
540+
peak_rss = cbm_mem_peak_rss();
534541

535542
int fds = count_open_fds();
536543
time_t now = time(NULL);

‎tests/test_py_lsp_bench.c‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,15 @@ TEST(pylsp_bench_resolution_ratio) {
255255
ASSERT_GTE(resolved * 2, calls);
256256
}
257257

258-
/* Time budget. ASan+UBSan instrumentation slows the parse ~5-10×, so
259-
* scale the budget when a sanitizer is active. Native: 150 ms for a
260-
* ~200-line fixture; sanitized: 1500 ms. */
261-
#if defined(CBM_SANITIZED_BUILD) || defined(__SANITIZE_ADDRESS__)
262-
ASSERT(ms < 1500.0);
263-
#else
264-
ASSERT(ms < 150.0);
265-
#endif
258+
/* Liveness backstop ONLY — not a perf gate. The perf content of this test
259+
* is the resolution-ratio assertion above; wall-clock on a shared CI
260+
* runner is not a property of the code (the 1500 ms sanitized budget was
261+
* exceeded twice on loaded ubuntu-24.04-arm runners by the SAME sha that
262+
* passed hours earlier). Absolute timings belong to
263+
* scripts/benchmark-*.sh, which record rather than gate. This bound
264+
* exists solely so a catastrophic hang fails the suite instead of the
265+
* 900 s shard wall clock. */
266+
ASSERT(ms < 30000.0);
266267
PASS();
267268
}
268269

0 commit comments

Comments
 (0)