Repository navigation
Conversation
…guage-count grep Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
|
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 |
…oke Phase 15 hang
Follow-up CI speed optimizations targeting ~10-15 min end-to-end wall time
with zero quality or coverage reduction:
- scripts/smoke-test.sh: fix Phase 15 300 s hang on non-UI PR smoke builds
(track and kill stdin-holder sleep PID; use a 30 s wall-clock deadline with
bounded curl timeouts so Windows refuses don't turn 150 iterations into 300 s)
- Makefile.cbm: consolidate 4 compiler -dM -E probes into 1 CC_DEFINES probe
and make LLVM_BIN lazy (4x faster make startup on Windows Step 0f/0z1);
run non-daemon and daemon TSan suites concurrently in test-tsan
- scripts/test.sh + tests/test_{makefile_ts_runtime_dependencies,codeql_retrace,security_fuzz_harness}.sh:
run all 46 Step 0 contract scripts in parallel (LPT order, isolated process
groups, deterministic canonical output, CBM_CONTRACTS_SEQUENTIAL=1 fallback)
and parallelize slow Windows contract internals
- scripts/msan.sh + scripts/ci/msan-lane.sh: run MSan suites in parallel via
run-test-wave.py with union guard and wire content-verified ccache
- scripts/run-tests-parallel.sh + tests/test_{c_lsp,doc_mentions,test_impact_git,java_type_scope,main}.c:
split the 4 heaviest parallel suites in half (matching pipeline_b) and use
deterministic LPT bin-packing with separate PAR/FLEX/EXCL sharding
- .github/workflows/_test.yml + _lint.yml + scripts/ci/require-all-green.sh:
wire inputs.skip_perf to diag/lsan-macos/msan (matching unix/windows),
shard unix/windows/diag/lsan-macos with full verify-shard-union proofs,
cache MSan ccache, and add .cppcheck-scoped fallback key for cppcheck-build
Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
|
@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. |
…msan Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
…ne macos slots Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
…in sharding Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
…late TSan, sparse-checkout gates Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
…e EOF hang) and calibrate MSan/LSan weights Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
…balance daemon/perf shard weights Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
|
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.
… speedups Deep multi-layer CI acceleration with zero coverage/sanitizer reduction and zero production src/internal changes: 1. Compiler, linker & sanitizer codegen (Makefile.cbm, Dockerfile.msan, cache-warm.yml): - Compile vendored + first-party test/TSan/MSan objects at -O2 (keeping test-suite TUs tests/*.c at -O1 via GNU Make 3.81 rule ordering) and -g1 (DEBUG_INFO ?= -g1, portable line tables + inline frames). - Auto-probe -fuse-ld=lld on Linux LDFLAGS_TEST/LDFLAGS_TSAN and install lld/lld-21 (added as a late Docker layer with buildx restore-keys so cached libc++/zlib layers are preserved). - Suppress dead ASan UAR prologues only on vendored non-diag test objects (diag keeps full UAR). - Warm cbm TEST_SEAMS=1 (2500M) in cache-warm.yml. 2. Test-fixture 500-800 MB copy/hash/git-spawn elimination (tests/): - Use 1.9 MB test-runner-image-probe instead of 500-800 MB test-runner in macOS cli update tests, daemon_runtime blocking-git probe, and test_impact_git diff-driver probes. - Arm existing runtime fingerprint hash stub for same-binary lifecycle tests in daemon_bootstrap, daemon_frontend, cli_scope, and daemon_runtime Phase 1; reorder daemon_runtime cache-reset tests to the end so real hashing runs once. - Template-cache immutable base SHA-1/SHA-256 repos in test_impact_git (~2,600 git spawns -> ~150). - Add 10s TSParseOptions.progress_callback cap on Windows so_parse_crashes matching POSIX alarm(10). - Split SUITE(mcp) into PAR-wave mcp (422 in-process tests) and FLEX-tail mcp_supervisor (22 fork/worker/deadline tests). 3. Harness, tail scheduling, Windows ACLs & smoke speedups (scripts/): - Move per-suite-isolated daemon/cli/mcp_supervisor suites from TAIL_EXCL (jobs=1) to FLEX_FILE (jobs=2), keeping only extraction (+ MSan c_lsp_b) exclusive. - Cap PAR-wave CBM_WORKERS=2 (exempting default-core-count suites) to avoid 4x oversubscription. - Fast Windows stamp_windows_build_dir (native whoami.exe SID + cached SID + *.exe only without /T over 1,500 .o/.d files). - Smoke: COPYFILE_DISABLE=1 GZIP=-1 local archive, CoW binary copies, drop dead retired-install copy, warm daemon across Phases 3b-5, parallel smoke-wrappers, Phase 15 stderr early-exit. - Parallelize leg K and leg 2K in memwaste-scaling.py (deterministic counter counts unchanged). 4. GitHub Actions DAG, sparse checkouts & caching (.github/workflows/): - Cache merge-base selection binary by HEAD^1 SHA in pr.yml (saved by test-impact-artifact.yml). - Blobless sparse checkouts on _lint.yml (excluding 1.28 GB parser.c), test-package-wrappers, test-ui (+ npm cache), codeql.yml, and memwaste scaling-linux; merge duplicate apt-get updates; Homebrew bottle cache + no-auto-update on macOS legs. - Right-size PR shard counts (N_X86=2, N_WIN=4) to fit GitHub's 20-runner cap without starvation. - CodeQL: wait-for-processing: true + upload-database: !inputs.light + sleep 5+5 (was 60+15). Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
…RM drain, and LPT weights - Include install.ps1, install.sh, and LICENSE in test-package-wrappers sparse checkout (windows-launcher.test.js reads install.ps1). - Set NODE_OPTIONS=--dns-result-order=ipv4first on test-ui to avoid transient Ubuntu runner IPv6 ENETUNREACH against registry.npmjs.org. - Drain any queued SIGALRM via SIG_IGN before restoring SIG_DFL in subprocess_spawn_backoff_resumes_after_eintr (fixes intermittent exit 142 under macOS TSan). - Re-calibrate LPT weights and Shard-1 bias (90/25) from live -O2/-g1 CI measurements. Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
Keep src/ and scripts/ in the test-ui and test-package-wrappers sparse checkouts (still skipping 1.48 GB of vendored grammars and tools) so UI security policy tests can read src/ui/httpd.c. Calibrate MSan/Shard-1 LPT weights in run-tests-parallel.sh from warm-cache -O2/-g1 runs, and restore sequential leg execution in memwaste-scaling.py to avoid dual-indexer RAM/atomic-counter contention on 4-vCPU runners. Signed-off-by: Guillaume Demay <guillaumedemay@hotmail.fr>
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.
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(474.cfiles),test-runner-tsan(474),test-repro-runner(340),codebase-memory-mcp(267),cbm-with-ui(267),cbm-fuzz(267), andtest-runner-image-probe(37) all 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). Ontest-windows(47552191451), buildingtest-runner+ Step 5codebase-memory-mcpspent 16m42s despite a 90.6%ccachehit rate on vendored objects.cppcheckruns with hardcodedCPPCHECK_JOBS ?= 2and discards--cppcheck-build-dir(Makefile.cbm,scripts/lint.sh,_lint.yml):PR/lint / linttook 14m09s–16m07s (21s for formatting/policy checks + ~14m40s forcppcheck) while leaving half of the 4-core runner idle and discarding.a1/.ctu-infostate every run — serially blockingtest(needs: [changes, lint, select-tests]) from starting for ~15 minutes.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 cache misses on every new PR.select-tests(5m30s),test-impact-shadow(5m02s), andtest-impact-artifactbuilt withoutccache.test-diagandtest-lsan-macosrestored/saved.ccachewithout exportingCCACHE_DIR(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, taking 3m29s ontest-windows(18:32:46 -> 18:36:15), 16s on Ubuntu, and 7.7s (35.8s CPU) on Apple M3.Change
Makefile.cbm: Compile first-party and test.csources independently with-c -MMD -MPinto flavour-isolated object directories ($(BUILD_DIR)/{t,i,s,p}/...) backed by config stamps (.build-config,.test-build-config,.tsan-build-config) while keeping$(PROJECT_HDRS)on binary link targets (repro_make_tracks_headers.sh) and leavingcbm-third-party/ CodeQL retrace rules untouched. Add optionalCPPCHECK_BUILD_DIRsupport tolint-cppcheck(ephemeralmktemp -dremains the default when unset).scripts/lint.sh: DefaultCPPCHECK_JOBS=$NPROCunless explicitly overridden by the caller..github/workflows/_lint.yml: Cache${{ github.workspace }}/.cppcheck-buildkeyed oncppcheck-build-2.20.0-${{ hashFiles('.cppcheck', 'Makefile.cbm') }}(so any suppression, flag, orLINT_SRCSfile-list change invalidates cleanly while unchanged TUs reuse verified.a1/.ctu-infostate and cppcheck still runs full whole-program CTU analysis)..github/workflows/pr.yml,_test.yml,test-impact-artifact.yml: Add the cross-refccacherestore fallback topr-smoke; wire content-verifiedccacheintoselect-tests,test-impact-shadow, andtest-impact-artifact; exportCCACHE_DIRontest-diagandtest-lsan-macos(routing Homebrew clang throughPATHmasquerade); raiseCCACHE_MAXSIZEon test legs from1500Mto2500Mso cached test + prod + vendored objects fit without eviction.tests/test_language_count_contract.sh: Exclude generated**/parser.ctables underinternal/cbm/vendored/grammars/andtools/from thegit grepscan (still scanningMANIFEST.md, docs, manifests, scripts, and all source files; verified identical match set).Zero test coverage, sanitizer flags, compiler warnings, or security/venue/lane contracts are weakened or skipped.
Local Benchmark Evidence (Apple M3, 8 cores,
darwin/arm64, no ccache)cbm267 first-party.c+ link (cold-j8)cbm1-file edit (touch src/main.c)test-runner474.c+ link (cold-j8)test-runner1-file edit (touch tests/test_arena.c)test-runnernarrow header touch (src/cypher/cypher.h).crebuilt.orebuilttests/test_language_count_contract.sh(Step 0w)On CI runners with warm content-verified
ccacheand cached.cppcheck-build, unchanged TUs become cache hits (build + lint overhead drops from ~32+ min on the critical path to ~2–3 min).Local Validation
bash tests/test_venue_parity_contract.sh— OK (26 workflows, 11 venue workflows, 23--helpprobes, 3 ASAN_OPTIONS cases)bash tests/test_lane_wiring_contract.sh— OK (27 lanes served)bash tests/test_codeql_retrace.sh— OK (13/13 cases)bash tests/test_makefile_ts_runtime_dependencies.sh— PASSbash tests/repro/repro_make_tracks_headers.sh— PASSbash tests/test_language_count_contract.sh— PASS (identical 10-file match set)bash tests/test_shell_line_endings.sh— PASS (168 files)bash tests/test_build_dir_safety.sh— PASSbash tests/test_prod_allocator_contract.sh build/c— PASSbash tests/test_harness_test_only.sh&bash tests/test_harness_selection.sh&bash tests/test_git_env_isolation_contract.sh— PASScodebase-memory-mcp,test-runner(arena,hash_table: 63 passed),test-repro-runner, andtest-runner-tsan(mem: 72 passed)git diff --check,bash scripts/check-dco.sh upstream/main..HEAD,bash scripts/check-no-test-skips.sh,make -f Makefile.cbm lint-no-suppress lint-memory-core lint-vendored-scanners— all passedyaml.safe_load) on all 4 modified workflow files &bash -non both modified shell scripts — all passedAuthored with AI assistance on behalf of @GDemay; commits carry Guillaume's DCO sign-off.