Skip to content

ci: key the engine cache on CPU flags, drop a cached engine that dies with SIGILL (#1657) - #1664

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.5from
fix/ts-engine-cache-cpu-flags
Sep 28, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.5from
fix/ts-engine-cache-cpu-flags

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

Refs #1318, #1657

What was wrong

engine (typescript) on #1657 (run 36444733865) failed every case with solve client-only. The solve log says why: the cached engine binary died at startup with Illegal instruction (core dumped) on every fixture and case. The rules and the 0.1.5 branch are fine: other PRs into 0.1.5 at the same time passed the TypeScript suite (78/78) with a freshly compiled engine.

The driver compiles the engine with -march=native. The CI cache key for the compiled engine (added in #1318) covers the engine id, the driver, and the CPU, but it identifies the CPU by the model name line of /proc/cpuinfo only. Hosted runners that report the same model name do not all expose the same instruction set. #1657's earlier run compiled and saved the TypeScript engine on one runner (cache entry created 12:27 on refs/pull/1657/merge); the next run restored it onto a runner with the same model name but fewer instructions, and it crashed with SIGILL before solving anything. The cache step saw a hit, so the job never recompiled, and every later run on that PR would have failed the same way.

The change

  • .github/workflows/ci.yml: the CPU part of the key hashes the model name and flags lines of /proc/cpuinfo, which is what -march=native depends on. A binary is now only restored onto a CPU with the same instruction set.
  • graph/pipeline/run-souffle.sh: if a locally cached engine (not a packaged one) exits with 132 (SIGILL), the driver deletes it and reports that it was compiled for a different CPU. The next run recompiles, so one bad entry in a shared cache does not break every later run. Tested separately: a binary that raises SIGILL is removed and the exit code is passed through; a binary that succeeds, or fails with any other code, is left in place.

The key change means every language's engine recompiles once on the first run after this merges.

No engine rules changed, so there is no corpus smoke to report. Not yet measured on the full corpus or on held-out projects; the smoke numbers above are the only corpus numbers.

…p a cached engine that dies with SIGILL

The engine is compiled with -march=native, and the CI cache key named the CPU
by its model name only. Hosted runners that report the same model name do not
all expose the same instruction set, so a binary compiled on one was restored
onto another and died with an illegal instruction on every TypeScript case.

The key now hashes the model name and the flags line of /proc/cpuinfo. The
driver also removes a locally cached binary that exits with SIGILL, so a bad
entry in a shared cache kills one run, not every run after it.
@swapnilpaliwal-sd
swapnilpaliwal-sd force-pushed the fix/ts-engine-cache-cpu-flags branch from 97b0178 to a2276bd Compare September 28, 2026 15:58
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit c0c531a into 0.1.5 Sep 28, 2026
11 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the fix/ts-engine-cache-cpu-flags branch September 28, 2026 16:12
@swapnilpaliwal-sd swapnilpaliwal-sd mentioned this pull request Sep 28, 2026
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