Remove the unused GAP sync machinery from JuliaInterface - #1412
Merged
Conversation
`THREADSAFE_GAP_JL` is never defined, so `BEGIN_GAP_SYNC` and `END_GAP_SYNC` always expanded to no-ops, and `BeginGapSync` and `EndGapSync` were compiled into the kernel extension without ever being declared or called. The one function that did run, `InitGapSync`, merely initialized a mutex nobody locks and set a flag nobody reads. It also declared `extern int jl_n_threads` itself, which since Julia 1.9 conflicts with the `_Atomic(int)` declaration in julia.h. That went unnoticed as long as julia.h was not in scope in this file, but it breaks the build once GAP's src/gasman.h includes julia.h, see gap-system/gap#6490. AI disclosure: Claude Code (Opus 5) diagnosed the issue, drafted the change, and verified it locally. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1412 +/- ##
==========================================
+ Coverage 83.28% 83.30% +0.01%
==========================================
Files 63 62 -1
Lines 5073 5049 -24
Branches 30 28 -2
==========================================
- Hits 4225 4206 -19
+ Misses 848 843 -5
🚀 New features to boost your workflow:
|
lgoettgens
approved these changes
Aug 6, 2026
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.
THREADSAFE_GAP_JLis never defined anywhere, soBEGIN_GAP_SYNCandEND_GAP_SYNCalways expanded to no-ops, andBeginGapSyncandEndGapSyncwere compiled into the kernel extension without ever being declared or called. The only function that actually ran,InitGapSync, initialized a recursive mutex nobody locks and set a flag nobody reads. The file's ownTODO: this is not actually fully implemented!!says as much.Had the toggle ever been flipped on, the code would not have worked as intended anyway: in
handle_jl_exceptiontheEND_GAP_SYNC()follows anErrorMayQuitthat never returns, andFunc_JuliaGetGlobalVariableByModulecanErrorMayQuitin the middle of the guarded region, longjmp'ing past the unlock.Removing it also gets rid of the local
extern int jl_n_threadsdeclaration, which conflicts with the_Atomic(int)declaration in julia.h since Julia 1.9. That went unnoticed as long as julia.h was not in scope in this file, but it breaks the build as soon as GAP'ssrc/gasman.hincludes julia.h, as proposed in gap-system/gap#6490 — that PR'sCI with GAP.jljobs currently fail with:Verified locally that JuliaInterface builds cleanly both against a GAP with that PR applied and against GAP without it, so this remains compatible with released GAP versions.
AI disclosure: Claude Code (Opus 5) diagnosed the issue, drafted the change, and verified it locally.