Skip to content

Reuse CI switches across compatible native library changes - #88

Merged
RCmerci merged 5 commits into
mainfrom
codex/ci-cache-compatibility-20261016
Oct 16, 2026
Merged

RCmerci merged 5 commits into
mainfrom
codex/ci-cache-compatibility-20261016

Conversation

@RCmerci

@RCmerci RCmerci commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

CI rebuilt OCaml and 170 dependencies when hosted image metadata or SQLite changed despite an unchanged OCaml/Xcode/SDK stack. The v4 cache now restores within an exact toolchain/locked-dependency family and validates native-provider changes with receipt/file hashes, actual compiler smoke builds, required symbols/install names, native/bytecode SQLite operations and GMP arithmetic. Compatible SQLite changes keep installed stubs; incompatible packages alone trigger an opam reverse-dependent rebuild.

Logs report specific cached/current input and critical-file hashes, distinguish audit-only/native changes and explicitly report when no prior comparison is available. Environment values are hashed and personal home names redacted. A newer PR head cancels only that workflow/PR's older run; main and controlled runs stay isolated. Locked install, full build, full regression and final sealing remain mandatory.

Real controlled comparison

Both jobs used head and actual checkout e54a1cf5ed51443d12dd15d6e95090b9a8ec2072 in run 38901040422.

Measurement Cold: SQLite 3.50.4 Compatible reuse: SQLite 3.49.2
ImageVersion 20261013.0424.1 20260907.0351.1
Job duration 22:58 5:47
Runner queue 9s 6s
OCaml setup 353s 41s
Compiler build group 288.99s absent
Locked install 648s / 170 installs 4s / Nothing to do
Base/compiler installs 11 0
Native repair roots none (cold) none
Full build / full regression 39s / 126s, passed 35s / 92s, passed

The warm job also prepended an empty PATH directory. It restored the cold variant by the same family prefix (source: compatible, raw exact cache-hit: false), retained identical compiler and SQLite stub SHA256 values, resolved pins and all 181 package versions, and actually loaded SQLite 3.49.2 in both native and bytecode probes. No installed package was rebuilt. The measured job saving is 17:11; warm dependency wait for the seed is excluded from runner queue.

Final integrated head

Head f35f1d6725651a20adf7d45c68656ad58a29143f includes main/PR87 3a7a6e6004ac956322505991899f06e30d10e17c. Final CI 38903964936 passed in 6:27 (8s queue), including the complete regression suite. It naturally reused the normal cold run's compiler/stubs across ImageVersion 20260907.0351.1 → 20261013.0424.1 and actual SQLite 3.53.4 → 3.54.0: zero installs/recompiles/repair roots, setup 64s, locked install 5s. This pair includes PR87 source changes and is not the controlled performance A/B above.

Automatic cancellation was observed on old head run 38898843552 and superseded run 38898896171, without manual cancellation. The push experiment continued through subsequent PR synchronize events.

Validation: 34 helper boundary tests pass locally and in CI; real offline opam tests verify selective reverse-dependent repair; actionlint passes; independent exact-head journal-code-review has no remaining findings. spec-dev-tool check --all still reports three existing decision-document formatting issues outside this diff. The temporary experiment caller has been removed; its reproducible provider helper and instructions remain in journal-build. No business, spec, Dune, lock, Apple provenance or repository security settings changed relative to main. Not merged.

Compatibility remains bounded by the exact compiler recipes, locked sources, selected Xcode/SDK/clang, architecture/OS major, effective tools/flags and absolute prefixes. Missing archives, changed families or failed probes still rebuild safely; GitHub cache scope and immutability still apply.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T12:20:38.911636Z be6291a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be6291a3bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +149 to +151
undefined = capture(['nm', '-u', path]).splitlines()
groups = {name: sorted({line.strip()[1:] for line in undefined if pattern.match(line.strip()[1:])})
for name, pattern in SYMBOL_GROUPS.items()}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse nm output before accepting native reuse

When a fallback cache contains zlib/zstd stubs, the macOS nm -u output has the form U _ZSTD_…; removing only its first character leaves a leading space and Mach-O underscore, so none of these regular expressions match and native_link_checks silently returns no checks or rebuild roots. Apple's nm documentation confirms that the default output places a symbol-type character before the name and that -j is required for name-only output. Consequently, a provider change that removes a required zlib/zstd symbol bypasses the intended repair and can instead fail the later build/test; parse the symbol column or invoke nm -uj and normalize the Mach-O underscore.

Useful? React with 👍 / 👎.

@RCmerci
RCmerci merged commit fc27cfd into main Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant