Repository navigation
Conversation
|
Comment authored with AI assistance on behalf of @GDemay. All 37/37 checks passed on the full-matrix cold run (
Because this run was the first run with the new per-object rules and |
|
@DeusData hi, I think improving the speed of the ci cd would be a good benefit. I am running some optimization with Gemini neon . What do you think ? There is a lot of modification in the code so we need to carefully review it but from what I reviewed, there were no regressions at all. |
|
Comment authored with AI assistance on behalf of @GDemay; all commits carry Guillaume's DCO sign-off. All 49/49 checks (including Measured Live GitHub Actions Timings: Baseline vs PR #3210 (Warm Cache, Run
|
| Leg / Stage | Baseline Avg | PR #3210 Final (47597038729) |
Speedup |
|---|---|---|---|
changes (sparse-checkout) |
0m 46s | 0m 07s | 6.6× (-85%) |
lint / lint (cppcheck -j + cached .cppcheck-build) |
13m 50s | 1m 21s | 10.2× (-90%) |
lint / lint-mem |
1m 35s | 0m 37s | 2.6× (-61%) |
test-msan (2 shards, parallel + c_lsp_b isolated) |
57m 58s | 8m 09s / 7m 44s | 7.1× (-86%) |
test-diag (2 shards, clang-21 ccache fixed) |
56m 12s | 11m 46s / 7m 20s (Iter 6: 9m 14s / 8m 40s) | 4.8×–6.1× (-79% to -84%) |
test-unix (ubuntu-latest, x86) (3 shards) |
38m 04s | 7m 16s / 4m 49s / 5m 28s | 5.2× (-81%) |
test-windows (CLANG64) (6 shards) |
59m 02s | 4m 44s – 13m 39s (Iter 7: 6m 43s – 11m 35s) | 4.3×–5.1× (-77% to -80%) |
test-lsan-macos (2 shards) |
46m 18s | 12m 08s / 11m 35s | 3.8× (-74%) |
test-unix (macos-15) (2 shards) |
30m 44s | 11m 38s / 8m 40s | 2.6× (-62%) |
test-unix (macos-15-intel) (2 shards) |
54m 06s | 15m 59s / 19m 19s (Iter 6: 14m 31s / 14m 30s) | 2.8×–3.7× (-64% to -73%) |
test-unix (ubuntu-24.04-arm) (2 shards) |
25m 06s | 9m 32s / 6m 06s | 2.6× (-62%) |
test-tsan (x86 / arm / mac) |
14m 13s / 13m 34s / 13m 18s | 4m 41s / 6m 19s / 9m 58s | 3.0× / 2.1× / 1.3× |
pr-smoke (ubuntu / mac / win) |
13m 36s / 13m 30s / 18m 00s | 4m 57s / 5m 47s / 9m 37s | 2.7× / 2.3× / 1.9× |
codeql / analyze (c-cpp) (cached untraced vendored prebuild) |
20m 39s | 14m 53s | 1.4× (-28%) |
memwaste / event-linux / scaling-linux (cached builds) |
7m 42s / 25m 32s | 3m 41s / 15m 31s | 2.1× / 1.65× |
shard-completeness + ci-ok (sparse-checkout) |
0m 45s + 0m 40s | 0m 13s + 0m 13s | 3.3× (-69%) |
End-to-End PR Impact
- Typical C PR (T1/T2/T3 — ~95% of PRs, 16 jobs, zero runner-cap contention): drops from 75m 19s avg to ~13–15 min un-narrowed (100% of all C suites across x86, macOS, and Windows — ~5–6× faster / -80% to -83%), and ~5–7 min once
select-testsnarrows to impacted suites (also post-mergeselect-testsdrops from ~3m to ~1m oncemainpicks up per-object builds). - Full 51-job matrix (workflow /
Makefile.cbmPRs, uncontended): drops from 80m 04s avg to ~23–25 min (~3.3× faster / -70%), bounded by GitHub's 5-concurrent-macOS-runner limit across the 8 macOS legs.
Key Changes Summary
- Per-object
-c -MMD -MPbuilds +lsp_all.csplit (30 TUs) inMakefile.cbm: enablesccacheacross ~740 first-party, test, and LSP objects (95–98% cacheable; warm full builds drop to ~15–25s), plus fixed missing/usr/lib/ccache/clang-21symlinks intest-diag, untraced vendored caching incodeql.yml, andccachein_memwaste.yml. - Parallelized
cppcheck -j$(nproc)+ cached.cppcheck-buildin_lint.yml/scripts/lint.sh(13m 50s -> 1m 21s). - Parallelized Step 0 contracts (46 scripts), Step 5–6 prod guards (8 scripts, using temp log files to avoid Windows pipe-EOF hangs),
test_codeql_retrace.sh,test_makefile_ts_runtime_dependencies.sh, andtest_security_fuzz_harness.sh, plus excluded vendoredparser.cinStep 0wand fixed the 300ssmoke-test.shPhase 15 stdin-holder hang. - Deterministic LPT sharding + secondary-shard deduplication +
shard-completenessproof acrosstest-unix,test-windows(6 shards),test-diag(2 shards),test-lsan-macos(2 shards), andtest-msan(2 shards, withc_lsp_bisolated inTAIL_EXCLto eliminate swap thrashing under 4× MSan shadow RAM). - Long-tail suite splits (zero coverage/assertion changes) in
tests/(cli/cli_b,pipeline/pipeline_b/pipeline_c/pipeline_d,doc_mentions/doc_mentions_e/doc_mentions_b/doc_mentions_d,c_lsp/c_lsp_b,test_impact_git/test_impact_git_b/test_impact_git_c,stack_overflow_a/b/c,complexity/complexity_b,grammar_probe_f/grammar_probe_f_b,java_type_scope/java_type_scope_b,pipeline_semantic_manifest_repro/_b) + 2-phase TSan isolation inMakefile.cbm. - DAG critical-path trimming:
sparse-checkoutonchanges,shard-completeness, andci-ok(40s -> 7–13s), and startingselect-testsat T=0 in parallel withchanges.
Final warm-cache CI results (commit
|
| Job / Leg | Baseline (#3209/#3208/#3207 avg, or #3206/#3200 full-matrix avg) |
PR #3210 (ae770ac4, warm) |
Speedup |
|---|---|---|---|
changes |
0m 44s | 0m 05s | 8.8× |
lint / lint |
13m 50s | 0m 59s (0m 33s on prior run) | 14.1× |
lint / lint-mem |
1m 22s | 0m 57s | 1.4× |
select-tests |
5m 16s | 0m 47s | 6.7× |
pr-smoke (ubuntu) |
13m 57s | 3m 37s | 3.9× |
pr-smoke (macos) |
13m 50s | 5m 28s | 2.5× |
pr-smoke (windows) |
15m 34s | 7m 02s | 2.2× |
test-unix (ubuntu-latest x86) |
38m 04s | 7m 06s (1/2) / 5m 54s (2/2) | 5.4× |
test-unix (ubuntu-24.04-arm) |
25m 06s | 7m 04s (1/2) / 4m 49s (2/2) | 3.6× |
test-unix (macos-15) |
30m 44s | 9m 02s (1/2) / 8m 48s (2/2) | 3.4× |
test-unix (macos-15-intel) |
48m 33s | 14m 36s (1/2) / 10m 17s (2/2) | 3.3× |
test-windows (4 shards) |
59m 02s | 14m 18s / 11m 10s / 9m 54s / 8m 57s | 4.1× (5.4× on Run 47611644168: max 10m 58s) |
test-diag (2 shards) |
51m 17s | 8m 21s (1/2) / 6m 33s (2/2) | 6.1× |
test-msan (2 shards) |
57m 58s | 5m 36s (1/2) / 5m 48s (2/2) | 10.0× |
test-lsan-macos (2 shards) |
46m 18s | 10m 25s (1/2) / 9m 53s (2/2) | 4.4× |
test-tsan (x86 / arm / mac) |
14m 13s / 13m 34s / 15m 56s | 5m 49s / 5m 38s / 8m 59s | 1.8×–2.4× |
test-ui / test-package-wrappers |
2m 40s / 1m 53s | 2m 32s / 0m 43s (Linux), 1m 25s (Win) | 1.1×–1.5× |
shard-completeness + ci-ok |
1m 22s | 0m 07s + 0m 06s | 6.3× |
- End-to-end wall time (
created -> ci-ok):- Full-matrix PR (all 44 active jobs, workflow-touching PR): 80m 03s avg (
#320668m 15s,#320091m 51s) → 39m 15s (2.0× faster, −51%), bounded by GitHub's 3-concurrent-macOS-runner limit across 8 macOS jobs (macos-15-intel 1/2queued 21m 32s). - Typical C PR (16-lane scope like
#3209/#3208/#3207, zero macOS/Windows runner queuing): 75m 18s avg → ~12–16m toci-ok(~4.6×–5.8× faster, −78% to −83%; all C test legs complete in 6–14m, with parallelcodeql-cppat 16m 26s).
- Full-matrix PR (all 44 active jobs, workflow-touching PR): 80m 03s avg (
Every contract, sanitizer, platform, test case, and security gate remains 100% intact. Ready for review.
Comment authored with AI assistance on behalf of @GDemay; all commits carry Guillaume's DCO sign-off.
|
Thank you, @GDemay, there's a lot of careful engineering in here, and per-object builds with real dependency tracking would fix a stale-incremental-build trap we've hit ourselves. We reviewed it in full and compared the release binary, so here is everything at once. One blocker: a failing TSan run can come out greenIn [ "$$rc1" -eq 0 ] && [ "$$rc2" -eq 0 ];Under What we measured on the release binary (macOS arm64,
|
…guage-count grep - Makefile.cbm: compile first-party and test .c TUs independently with -c -MMD -MP into flavour-isolated object directories (t/, i/, s/, p/) while preserving -O2 on production link lines, keeping lsp_all.c as a single unity TU tracked via -MMD -MP (dropping manual LSP_UNITY_DEPS), including CC/CXX/STATIC in config stamps across first-party and vendored objects, keeping PROJECT_HDRS on binary link targets, and adding optional CPPCHECK_BUILD_DIR support to lint-cppcheck. - scripts/lint.sh: default CPPCHECK_JOBS to detected NPROC unless overridden. - .github/workflows/_lint.yml: cache .cppcheck-build strictly on pull_request (release and dry-run gates continue using a fresh ephemeral temp dir). - .github/workflows/pr.yml, _test.yml, test-impact-artifact.yml: add cross-ref ccache fallback on pr-smoke, wire content-verified ccache into test-impact-shadow and test-impact-artifact, export CCACHE_DIR and clang-21/Homebrew PATH masquerade on test-diag and test-lsan-macos, and raise test-leg CCACHE_MAXSIZE to 2500M. Leave select-tests untouched to preserve its merge-base trust boundary. - tests/test_language_count_contract.sh: exclude generated tree-sitter parser.c tables from git grep. Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
ae770ac to
74cfd7e
Compare
|
Comment authored with AI assistance on behalf of @GDemay; all commits carry Guillaume's DCO sign-off. Thank you for the thorough review and the release-binary comparison, @DeusData — really appreciate the clear breakdown and especially catching the Split index (all standalone on
|
…tests artifact Split out from DeusData#3210 per maintainer review (Piece 5: CI-only items). Addresses both Piece 5 review items from DeusData#3210: - select-tests trust (scripts/ci/test-impact-bundle.sh, test-impact-artifact.yml, pr.yml): publish the main-built selection engine binary + SHA-256 receipt (engine.json) as artifact test-impact-engine-<sha> from test-impact-artifact.yml on main, and fetch/verify it in select-tests via test-impact-bundle.sh --fetch-engine using the same main-branch workflow-run provenance check as test-impact-<sha>. No actions/cache, no PR cache scope, and CBM_NO_CCACHE=1 on the clean base-tooling fallback build. - CodeQL alert wait (.github/workflows/codeql.yml): keep sleep 60 + sleep 15 completely untouched. Keep only blobless sparse checkouts, upload-database: !inputs.light, wait-for-processing: true, and ccache strictly scoped to the untraced --vendored-only prebuild (traced CodeQL build keeps CBM_NO_CCACHE=1). Smoke & CI provisioning speedups: - scripts/smoke-test.sh, smoke-local.sh, smoke-wrappers.sh: fix Phase 15 300 s hang on non-UI PR smoke builds (track/kill stdin-holder sleep PID + 30 s wall-clock deadline + bounded curl timeouts + stderr early-exit), keep daemon warm across Phases 3b-5, use CoW binary copies, drop dead retired-install copy, use COPYFILE_DISABLE=1 GZIP=-1 for local tarball, and run wrapper suites in parallel. - .github/workflows/_lint.yml, _memwaste.yml, _test.yml, cache-warm.yml: add blobless sparse checkouts skipping unused vendored grammars/tools/graph-ui, merge duplicate apt-get updates, add npm cache + IPv4 DNS order on test-ui, add Homebrew bottle cache / HOMEBREW_NO_AUTO_UPDATE=1 on macOS legs, wire ccache into report-only _memwaste.yml, and warm cbm TEST_SEAMS=1 (2500M) in cache-warm.yml. Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
PR authored with AI assistance on behalf of @GDemay; all commits carry Guillaume's DCO sign-off.
Problem
Profiling recent PR CI runs (
#3207run47552191451at 82 min wall time;#3208run47561328853) showed four structural bottlenecks consuming the majority of build, lint, and pre-test wall time without adding any coverage:.cfiles (Makefile.cbm):test-runner,test-runner-tsan,test-repro-runner,codebase-memory-mcp,cbm-with-ui,cbm-fuzz, andtest-runner-image-probeall pass every source file to a single$(CC) -o binary ...invocation. That serializes compilation onto 1 core even undermake -j$(NPROC)and completely bypassesccache(multi-file link commands are uncacheable).cppcheckruns with hardcodedCPPCHECK_JOBS ?= 2and discards--cppcheck-build-dir(Makefile.cbm,scripts/lint.sh,_lint.yml):PR/lint / linttook ~14–16 min while leaving half of the 4-core runner idle and discarding.a1/.ctu-infostate every PR push.ccacheacross CI jobs (pr.yml,_test.yml,test-impact-artifact.yml):pr-smokelacked the cross-ref fallback restore key (ccache-smoke-${{ matrix.os }}-), causing cold misses on every new PR.test-impact-shadow(report-only PR-checkout build) andtest-impact-artifact(main-only) built withoutccache.test-diagandtest-lsan-macosrestored/saved.ccachewithout exportingCCACHE_DIR(test-diagalso lacked/usr/lib/ccache/clang-21symlinks, andtest-lsan-macosinvoked clang by absolute path, bypassing the ccache masquerade dir).Step 0w(tests/test_language_count_contract.sh) greps ~1.5 GB of generatedparser.ctables:git grep -IlEscanned all 164 generated tree-sitterparser.cfiles on every test leg (~3m29s ontest-windows).Change
Scoped to the 7 files matching the PR title (
+233 / -99lines):Makefile.cbm:.csources independently with-c -MMD -MPinto flavour-isolated object directories ($(BUILD_DIR)/{t,i,s,p}/...) while preserving-O2on the production link lines (codebase-memory-mcp,cbm-with-ui) and keeping$(PROJECT_HDRS)on binary link targets (repro_make_tracks_headers.sh).lsp_all.cas a single unity TU (prod_lsp_all.o,lsp_all.o,tsan_lsp_all.o), track its included.c/.hfiles via-MMD -MP, and drop the manualLSP_UNITY_DEPSlist.CCandCXX(plusSTATIC/ZSTD_EXTRA_CFLAGS) in.build-config,.test-build-config, and.tsan-build-configacross first-party and flavour-specific vendored objects so local builds cannot mix compilers or configs.cbm-third-partyand CodeQL retrace rules intact.CPPCHECK_BUILD_DIRsupport tolint-cppcheck(ephemeralmktemp -dremains the default when unset or empty).scripts/lint.sh: DefaultCPPCHECK_JOBS=$NPROCunless overridden via argument or environment..github/workflows/_lint.yml: Cache${{ github.workspace }}/.cppcheck-buildstrictly ongithub.event_name == 'pull_request', keyed on.cppcheck+Makefile.cbm. Release and dry-run gates never restore/save this cache and always runcppcheckin a fresh ephemeral temp dir..github/workflows/pr.yml,_test.yml,test-impact-artifact.yml:ccacherestore fallback and1500Mcap onpr-smoke.ccacheintotest-impact-shadowandtest-impact-artifact.select-testsuntouched to preserve its merge-base trust boundary.CCACHE_DIRandCCACHE_MAXSIZE: 2500Montest-diag(withclang-21/clang++-21ccache masquerade symlinks) andtest-lsan-macos(viaPATHmasquerade), and raiseCCACHE_MAXSIZEfrom1500Mto2500Montest-unix,test-tsan,test-windows, andtest-windows-guards.tests/test_language_count_contract.sh: Exclude generated**/parser.ctables underinternal/cbm/vendored/grammars/andtools/from thegit grepscan.Zero test coverage, sanitizer flags, compiler warnings, or security/venue/lane contracts are weakened or skipped.
Verification (Apple M3, 8 cores,
darwin/arm64,CC=cc CXX=c++,CBM_NO_CCACHE=1)main8633025avs this branch74cfd7e3, clean builds):cmpexit 0): SHA-2560ebdcd7d30936e3be7e5a551ef2057287633a2d8cf5214d3922b48662899b8eaon both.size -midentical across every segment/section (__text:23,740,636,__const:261,140,024,__cstring:1,369,631).nm -gUidentical (all 5,159 exported symbols and addresses).0files recompiled.-W src/cypher/cypher.h):2 / 267first-party.ofiles rebuilt (src/cypher/cypher.o,src/mcp/mcp.o).prod_lsp_all.d: tracks80included.c/.hfiles automatically (includinginternal/cbm/lsp/rust_lsp.c,internal/cbm/cbm.h, and transitivesrc/foundation/arena.h).CC=cc→CC=clang):.build-configinvalidates439 / 439compiled objects and removes the stale binary.lint-cppcheck: verified ephemeral temp dir cleanup whenCPPCHECK_BUILD_DIRis unset or empty (""), and persistence when set.repro_make_tracks_headers.sh,test_makefile_ts_runtime_dependencies.sh,test_codeql_retrace.sh,test_language_count_contract.sh,test_lane_wiring_contract.sh,test_venue_parity_contract.sh,test_build_dir_safety.sh,test_windows_bundle_contract.sh,test_script_exec_bit_contract.sh,test_shell_line_endings.sh,check-no-test-skips.sh,check-dco.sh,scripts/sanitizer-coverage-map.py static,scripts/memwaste-padding.pycommand parsing (439 TUs), andmake -nacross all build targets (test-runner,test-repro-runner,test-runner-tsan,codebase-memory-mcp,cbm-fuzz,cbm-with-ui).Checklist
git commit -s)74cfd7e3)