Skip to content

Conversation

sbrantq
Copy link
Member

@sbrantq sbrantq commented Jul 3, 2025

No description provided.

@sbrantq sbrantq changed the base branch from probprog to main July 18, 2025 03:39
@sbrantq
Copy link
Member Author

sbrantq commented Jul 31, 2025

@wsmoses So I added GC.@preservings to fix the deadlock issue with the ConcreteRArray that specifies rng.seed (for context GC triggered by EnzymeJaXMapSymbol'd functions somehow tries to free only(rng.seed.data).buffer):

seed_buffer = only(rng.seed.data).buffer
GC.@preserve seed_buffer constraint begin
trace, _, _ = compiled_fn(rng, constraint_ptr, args...)

Also GC triggered by mapped functions in src/probprog/FFI.jl can cause jl_gc_wait_for_the_world to wait forever for the main Julia thread which is waiting during Base.convert to Julia Array, like this one

trace = unsafe_pointer_to_objref(Ptr{Any}(Array(trace)[1]))

So I added
while !isready(trace)
yield()
end

(Adding trivial Base.isready for ConcretePJRTArray and ConcreteIFRTArray).

Does that sound like an ok-ish fix, or am i missing something?

Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 4.17537% with 459 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.72%. Comparing base (5d0ba5a) to head (20b9b9c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/probprog/Modeling.jl 0.00% 163 Missing ⚠️
src/probprog/FFI.jl 10.06% 143 Missing ⚠️
src/probprog/Display.jl 0.00% 58 Missing ⚠️
src/probprog/Types.jl 0.00% 44 Missing ⚠️
src/probprog/Inference.jl 0.00% 35 Missing ⚠️
src/Compiler.jl 17.64% 14 Missing ⚠️
src/Types.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1444      +/-   ##
==========================================
- Coverage   42.69%   41.72%   -0.98%     
==========================================
  Files         123      129       +6     
  Lines       21807    22286     +479     
==========================================
- Hits         9310     9298      -12     
- Misses      12497    12988     +491     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants