Repository navigation
engine: generate the Souffle program once and hash that file for the engine id (#1593) - #1611
Merged
Merged
Conversation
…engine id (#1593) The engine id was computed from a second rendering of the program, made through printf pipelines whose writes were never checked. Under load a bash 3.2 pipe write interrupted by a signal lost a line with exit 0, the id changed, and a warm rebuild became a full C++ compile. The program is now assembled in the shell with no pipe, written once with a checked write, read back, verified against an independent derivation from the maps, and renamed into place. The id hashes that exact file and its includes (same definition, so every id is unchanged). A compiled engine is verified against the id before the atomic rename into the cache.
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
September 28, 2026 06:07
This was referenced Sep 28, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1593
What was wrong
graph/pipeline/run-souffle.shgenerated the Soufflé program twice: once into the file souffle compiles, and once more insideengine_id()only to hash it. Both renderings went throughprintfloops piped intosort, and no write inside those pipelines was checked. Under load, bash 3.2 (macOS/bin/bash) does not restart a pipe write interrupted by a signal, so a line was sometimes lost with exit 0 (printf: write error: Interrupted system call). Lost from the hashed copy, it gave a different engine id, the cached engine was missed, and a warm rebuild became a full C++ compile. Lost from the compiled copy, a program missing an.inputwould have been compiled and cached under the correct id.The change
readstraight from the map files, sorted in the shell. No subprocess and no pipe carries a line of it..inputand.outputline exactly once, nothing missing, nothing extra). Only then is it renamed onto the destination. A failed attempt is retried; three failures abort the run with an error.graph/test/tools/engine-id-lost-line-test.sh(wired into the Java suite besideengine-id): asortorcaton PATH that silently drops a line must leave the id and the emitted program unchanged, or fail the run. It has a control that the shim was reached..github/RELEASING.mdand in the script.Measurement
macOS,
/bin/bash3.2.57, Soufflé 2.5.33a53d0f…intact,c9a07c91…with a lost line, exit 0engine-id-lost-line-test.sh--print-engine-idruns (python, java, csharp) underyesx8, load average 150 to 220yesx8, load average about 175engine-id-test.shmutates a rule file, a map, the manifest and the pinned version, and each moves it.engine-id,engine-id-localeandengine-packagepass.