Skip to content
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

Loss of invalidation-logging on master #48967

Closed
timholy opened this issue Mar 10, 2023 · 1 comment · Fixed by #48982
Closed

Loss of invalidation-logging on master #48967

timholy opened this issue Mar 10, 2023 · 1 comment · Fixed by #48982

Comments

@timholy
Copy link
Member

timholy commented Mar 10, 2023

SnoopCompile has tests that look like this:

PkgC.jl

 module PkgC

nbits(::Int8) = 8
nbits(::Int16) = 16

end # module PkgC

PkgD.jl:

module PkgD

using PkgC

call_nbits(x::Integer) = PkgC.nbits(x)
# The rest forces precompilation
map_nbits(list) = map(call_nbits, list)
nbits_list() = map_nbits(Integer[Int8(1), Int16(1)])

nbits_list()

end # module PkgD

and after precompilation,

using PkgC
PkgC.nbits(::UInt8) = 8
using PkgD

The method definition for UInt8 prepares the way to invalidate PkgD.call_nbits, but PkgD is not yet loaded at the time of the invalidation.

On 1.9rc1, one gets the following entries in the _jl_debug_method_invalidation log:

   Tuple{typeof(PkgC.nbits), Integer}
   "insert_backedges_callee"
 56
   Any[nbits(::UInt8) @ Main REPL[9]:4]
   MethodInstance for PkgD.call_nbits(::Integer)
   "verify_methods"
 56

whereas on nightly we get

  Tuple{typeof(PkgC.nbits), Integer}
  "insert_backedges_callee"
 7
  nothing
  MethodInstance for PkgD.call_nbits(::Integer)
  "verify_methods"
 7

(The specific integer values don't matter as long as they are internally consistent.)

The matches log went from a list that contains the method that caused the invalidation to being nothing. Consequently it's not possible to determine the cause of the invalidation.

@timholy
Copy link
Member Author

timholy commented Mar 11, 2023

git blame points to #48841

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 a pull request may close this issue.

1 participant