Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,15 @@ jobs:
# Two things decide the binary that ENGINE_ID does not cover, so they are in the
# key too: the driver that compiles it (run-souffle.sh holds the compiler flags),
# and the runner's CPU, because the driver compiles with -march=native and a
# binary built on one CPU model can die with an illegal instruction on another.
# binary built on one CPU can die with an illegal instruction on another.
# The CPU part hashes the FEATURE FLAGS, not only the model name: hosted runners
# that report the same model name do not all expose the same instruction set, so
# a model-name key restored a binary that died with SIGILL on every case.
- name: this language's engine id
id: eid
run: |
echo "id=$(bash graph/pipeline/run-souffle.sh --language ${{ matrix.lang }} --print-engine-id)" >> "$GITHUB_OUTPUT"
echo "cpu=$(grep -m1 'model name' /proc/cpuinfo | sha256sum | cut -c1-12)" >> "$GITHUB_OUTPUT"
echo "cpu=$(grep -E '^(model name|flags)[[:space:]]*:' /proc/cpuinfo | sort -u | sha256sum | cut -c1-12)" >> "$GITHUB_OUTPUT"

- name: cache the compiled Soufflé engine
if: ${{ !inputs.fresh }}
Expand Down
13 changes: 12 additions & 1 deletion graph/pipeline/run-souffle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,18 @@ while [ "$iter" -lt 50 ]; do
echo "▶ solving with profiling -> $AXIOM_SOUFFLE_PROFILE"
"$PBIN" -F "$FACTS" -D "$RAW" -p "$AXIOM_SOUFFLE_PROFILE"
else
"$BIN" -F "$FACTS" -D "$RAW"
# A cached binary is compiled with -march=native. Restored onto a CPU without one of
# the instructions it uses (a shared cache, a CI cache keyed too coarsely), it dies
# with SIGILL (exit 132) before solving anything. Never leave it there to kill every
# later run the same way: drop the cache entry, so the next run recompiles, and say so.
rc=0; "$BIN" -F "$FACTS" -D "$RAW" || rc=$?
if [ "$rc" -ne 0 ]; then
if [ "$rc" -eq 132 ] && [ -z "$PACKAGED" ]; then
rm -f "$BIN"
echo "❌ the cached engine $BIN died with an illegal instruction: it was compiled for a different CPU. Removed it; the next run recompiles." >&2
fi
exit "$rc"
fi
fi
# No frontier declared for this language: the solve above is the whole answer. Break
# BEFORE the count, because the count is what misreported it. See issue #475.
Expand Down
Loading