-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incremental precompile correctness issues #21307
Conversation
can any of the issues being fixed here be tested? |
78ce6c1
to
af61c4a
Compare
I tested this branch; is it supposed to work with, or without, the |
I'm only addressing the assertion failure. Reactive will need to be fixed separately. |
Is it going to have to stay I can work on the changes to Reactive, but I don't want to apply a bandaid if a deeper fix is necessary/coming. |
This is a bug in reactive. It needs to avoid starting its event loop before finishing loading code. |
af61c4a
to
61cdfc4
Compare
src/dump.c
Outdated
} | ||
} | ||
if (callee_mi->max_world == ~(size_t)0) { | ||
// if this callee is still valid, just add a backedege |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backedge misspelled
@nanosoldier |
src/dump.c
Outdated
return jl_main_module->primary_world; | ||
} | ||
|
||
// repeated look up older methods until we come to one that existed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be "repeatedly look up" ?
test/compile.jl
Outdated
end | ||
""") | ||
@test_throws ErrorException Core.kwfunc(Base.nothing) # make sure `nothing` didn't have a kwfunc (which would invalidate the attempted test) | ||
|
||
# Issue #12623 | ||
@test __precompile__(true) === nothing | ||
|
||
# Issue #21307 | ||
Base.require(Foo2_module) | ||
@eval let Foo2_module = $(QuoteNode(Foo2_module)) # use @eval to see the results of loading the compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supposed to be a comma here?
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels |
previously we just assumed that the user didn't load any other code now this actually keeps track of which method would have been visible in the precompilation process
…ation we need to restore not only backedges directly to the new methods, but also to any methods whos backedges have not been inferred but which might propagate invalidation changes to the new code fix #21141
61cdfc4
to
8d16ddd
Compare
I'm still wrapping my head around this, but if I understand your suggestion you're not talking about Reactive's code ( Perhaps this is an unworkable/stupid idea, but what about defining a compile hint function connect_map(f::LATEST, output, inputs...)
let prev_timestep = 0
for inp in inputs
add_action!(inp, output) do output, timestep
if prev_timestep != timestep
result = f(map(value, inputs)...)
send_value!(output, result, timestep)
prev_timestep = timestep
end
end
end
end
end
|
Yes, I think longer-term we should do something like that. My latest attempt at defining something like this is https://discourse.julialang.org/t/proposal-for-a-first-class-dispatch-wrapper/1127/2
Yeah, that wouldn't be good either. I think it would instead do something like have __init__() = @async backend_eventqueue()
function backend_eventqueue()
restart[] = false
while true
dispatch_events()
restart[] && (@async backend_eventqueue(); return)
end
end |
This should fix #21141, and includes some other correctness improvements that I've known were missing, but require rather convoluted situations to manage to trigger them.