From 3c6cec8a6ce8a6f6272139badb4f931cde905972 Mon Sep 17 00:00:00 2001 From: swapnil <78632212+swapnilpaliwal-sd@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:13:06 -0700 Subject: [PATCH 1/2] engine-package test: the stub include dir carries the header the seqlock overlay patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parallel-solve change gave run-souffle.sh a header overlay (souffle_overlay) that copies the install's include dir, seds the write-entry RMWs in souffle/utility/ParallelUtil.h to seq_cst, and refuses an include dir without that header — no unpatched cache entry may pass for a patched one. The engine-package test's stub include dir carried only CompiledSouffle.h, so every stubbed --prepare died at the overlay and the java suite failed on any branch, parser-only PRs included. The stub now ships a ParallelUtil.h with the acquire RMWs, as a real install's headers do, and the test asserts the prepare leaves the patched overlay (seq_cst present, acquire gone) in the cache — so a prepare that silently skipped the patch would fail too. Reproduced red on the branch tip (5 failures, the ones CI shows), green after the change. Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com> Co-Authored-By: Claude Fable 5 --- graph/test/tools/engine-package-test.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/graph/test/tools/engine-package-test.sh b/graph/test/tools/engine-package-test.sh index eec6de84..ec73cb8f 100755 --- a/graph/test/tools/engine-package-test.sh +++ b/graph/test/tools/engine-package-test.sh @@ -68,7 +68,12 @@ fake="$W/fake-engine" { echo '#!/usr/bin/env bash' echo 'while [ $# -gt 0 ]; do case "$1" in -D) D="$2"; shift 2;; -F) shift 2;; *) shift;; esac; done' cut -f2 "$ROOT/graph/$lang/souffle/export_manifest.tsv" | sed 's|^|: > "$D/|; s|$|"|'; } > "$fake" -mkdir -p "$W/stub" "$W/inc/souffle"; : > "$W/inc/souffle/CompiledSouffle.h"; : > "$W/cc-calls" +mkdir -p "$W/stub" "$W/inc/souffle/utility"; : > "$W/inc/souffle/CompiledSouffle.h"; : > "$W/cc-calls" +# the stub include dir must carry what souffle_overlay patches (the seqlock fix seds these +# write-entry RMWs and refuses an include dir without them), as a real install's headers do +printf '%s\n' 'version.fetch_or(0x1, std::memory_order_acquire);' \ + 'version.fetch_or(0x1, std::memory_order_acquire);' \ + 'version.fetch_or(0x1, std::memory_order_acquire);' > "$W/inc/souffle/utility/ParallelUtil.h" { echo '#!/usr/bin/env bash' echo "[ \"\$1\" = --version ] && { echo 'Version: $SOUFFLE_VERSION'; exit 0; }" echo 'while [ $# -gt 0 ]; do case "$1" in -g) : > "$2"; echo "// c++" > "$2"; shift 2;; *) shift;; esac; done'; } > "$W/stub/souffle" @@ -83,6 +88,9 @@ if prep; then [ -x "$W/cache/souffle-engine-$lang-$id" ] || bad "prepare left no binary under the run's cache name (souffle-engine-$lang-${id:0:12}…)" [ "$(calls)" = 1 ] || bad "prepare compiled $(calls) time(s), expected 1" grep -q "engine ready" "$W/log" || bad "prepare did not report the engine ready" + h="$W/cache/include-seqlock-fix-1/souffle/utility/ParallelUtil.h" + grep -q 'memory_order_seq_cst' "$h" 2>/dev/null && ! grep -q 'fetch_or(0x1, std::memory_order_acquire)' "$h" \ + || bad "prepare did not leave the patched overlay header (seqlock fix) in the cache" else bad "prepare failed:"; tail -8 "$W/log" | sed 's/^/ /'; fi prep || bad "a second prepare failed" grep -q "reusing cached binary" "$W/log" && [ "$(calls)" = 1 ] || bad "a second prepare compiled again ($(calls) compiles)" From c2a566b2c57c6b3a4fac366bf201bb48d101623c Mon Sep 17 00:00:00 2001 From: swapnil <78632212+swapnilpaliwal-sd@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:51:26 -0700 Subject: [PATCH 2/2] =?UTF-8?q?engine-package=20test:=20pin=20the=20solve?= =?UTF-8?q?=20flavor=20serial=20=E2=80=94=20the=20probe=20made=20prepare?= =?UTF-8?q?=20and=20the=20run=20disagree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parallel solve probes c++ for OpenMP before every invocation. Under this test the prepare runs with a stub c++ (the probe's compile is counted and, on linux, fails at chmod of /dev/null, so prepare caches the serial name) while the run after it sees the real c++ (the probe succeeds, so it looks for the -par name): the run cannot find the binary prepare just built, and the probe's extra c++ calls break every compile count. That is a harness artifact — a real prepare and a real run share one c++ — so the flavor is pinned serial for the whole test: what is under test is packaging and caching, not the solve. Control: with AXIOM_SOLVE_PARALLEL=1 forced, the test reproduces CI's four failures on darwin too; pinned, it is green on both. Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com> Co-Authored-By: Claude Fable 5 --- graph/test/tools/engine-package-test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graph/test/tools/engine-package-test.sh b/graph/test/tools/engine-package-test.sh index ec73cb8f..84b4c63f 100755 --- a/graph/test/tools/engine-package-test.sh +++ b/graph/test/tools/engine-package-test.sh @@ -11,6 +11,11 @@ # ───────────────────────────────────────────────────────────────────────────── set -u ROOT="$(d="$(cd "$(dirname "$0")" && pwd)"; while [ "$d" != / ] && { [ ! -f "$d/package.json" ] || [ ! -d "$d/graph" ]; }; do d="$(dirname "$d")"; done; echo "$d")" # the repository root, found by its marker +# This test counts compiles and asserts cache-entry names, and the parallel flavor is a per-machine +# question answered by probing c++ — under the stub c++ the probe and a later real-c++ run can answer +# differently, so prepare and the run after it would disagree on the -par cache name. The flavor is +# pinned serial: what is under test is packaging and caching, not the solve. +export AXIOM_SOLVE_PARALLEL=0 fail=0; bad(){ echo " ✗ $*"; fail=$((fail+1)); } [ -x "$ROOT/node_modules/.bin/tsx" ] || { echo "engine-package: SKIP (no node_modules/.bin/tsx — run npm install)"; exit 0; } W="$(mktemp -d)"; SHADOW=""; trap 'rm -rf "$W" ${SHADOW:+"$SHADOW"}' EXIT