Skip to content

Conversation

nsajko
Copy link
Member

@nsajko nsajko commented Aug 22, 2025

The only method of the __require_prelocked function in Base gets compiled with bad inference for two variables, path and reasons, which get pessimistically boxed (and inferred as Any), even though both of them are only assigned to once across both the method and the closure within (neither is assigned to within the closure).

My guess for what causes this would be either of these, or the combination:

  • (mis)use of GOTO

  • try-catch

The least demanding way to work around the issue is adding a let around the closure, as advised in the Performance tips. That is what this change does.

This change should fix several bad inference results within method instances such as __require_prelocked(::PkgId, ::Nothing) and __require_prelocked(::PkgId, ::String). Consequently, the sysimage should become less vulnerable to invalidation happening when loading certain packages.

The only method of the `__require_prelocked` function in `Base` gets
compiled with bad inference for two variables, `path` and `reasons`,
which get pessimistically boxed (and inferred as `Any`), even though
both of them are only assigned to once across both the method and the
closure within (neither is assigned to within the closure).

My guess for what causes this would be either of these, or the
combination:

* (mis)use of GOTO

* `try`-`catch`

The least demanding way to work around the issue is adding a `let`
around the closure, as advised in the Performance tips. That is what
this change does.

This change should fix several bad inference results within method
instances such as `__require_prelocked(::PkgId, ::Nothing)` and
`__require_prelocked(::PkgId, ::String)`. Consequently, the sysimage
should become less vulnerable to invalidation happening when loading
certain packages.
@nsajko
Copy link
Member Author

nsajko commented Aug 22, 2025

These invalidations in particular are eliminated:

Click to expand

{
    "method_instance": {
        "method": "joinpath(paths::AbstractString...) @ Base.Filesystem path.jl:346",
        "method_instance": "MethodInstance for joinpath(::String, ::AbstractString)"
    },
    "children": [
        {
            "method_instance": {
                "method": "_include_dependency!(dep_list::Vector{Any}, track_dependencies::Bool, mod::Module, _path::AbstractString, track_content::Bool, path_may_be_dir::Bool) @ Base loading.jl:2246",
                "method_instance": "MethodInstance for Base._include_dependency!(::Vector{Any}, ::Bool, ::Module, ::AbstractString, ::Bool, ::Bool)"
            },
            "children": [
                {
                    "method_instance": {
                        "method": "var\"#_include_dependency#900\"(track_content::Bool, path_may_be_dir::Bool, ::typeof(Base._include_dependency), mod::Module, _path::AbstractString) @ Base loading.jl:2241",
                        "method_instance": "MethodInstance for Base.var\"#_include_dependency#900\"(::Bool, ::Bool, ::typeof(Base._include_dependency), ::Module, ::AbstractString)"
                    },
                    "children": [
                        {
                            "method_instance": {
                                "method": "_include_dependency(mod::Module, _path::AbstractString; track_content, path_may_be_dir) @ Base loading.jl:2241",
                                "method_instance": "MethodInstance for Base._include_dependency(::Module, ::AbstractString)"
                            },
                            "children": [
                                {
                                    "method_instance": {
                                        "method": "_include(mapexpr::Function, mod::Module, _path::AbstractString) @ Base loading.jl:2913",
                                        "method_instance": "MethodInstance for Base._include(::typeof(identity), ::Module, ::AbstractString)"
                                    },
                                    "children": [
                                        {
                                            "method_instance": {
                                                "method": "include(mod::Module, _path::AbstractString) @ Base Base.jl:308",
                                                "method_instance": "MethodInstance for Base.include(::Module, ::AbstractString)"
                                            },
                                            "children": [
                                                {
                                                    "method_instance": {
                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                    },
                                                    "children": [
                                                    ]
                                                },
                                                {
                                                    "method_instance": {
                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                    },
                                                    "children": [
                                                    ]
                                                },
                                                {
                                                    "method_instance": {
                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                    },
                                                    "children": [
                                                    ]
                                                },
                                                {
                                                    "method_instance": {
                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                    },
                                                    "children": [
                                                    ]
                                                },
                                                {
                                                    "method_instance": {
                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                    },
                                                    "children": [
                                                    ]
                                                },
                                                {
                                                    "method_instance": {
                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                    },
                                                    "children": [
                                                        {
                                                            "method_instance": {
                                                                "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                            },
                                                            "children": [
                                                                {
                                                                    "method_instance": {
                                                                        "method": "__require(into::Module, mod::Symbol) @ Base loading.jl:2367",
                                                                        "method_instance": "MethodInstance for Base.__require(::Module, ::Symbol)"
                                                                    },
                                                                    "children": [
                                                                    ]
                                                                },
                                                                {
                                                                    "method_instance": {
                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId) @ Base loading.jl:2477",
                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId)"
                                                                    },
                                                                    "children": [
                                                                        {
                                                                            "method_instance": {
                                                                                "method": "__require(uuidkey::Base.PkgId) @ Base loading.jl:2476",
                                                                                "method_instance": "MethodInstance for Base.__require(::Base.PkgId)"
                                                                            },
                                                                            "children": [
                                                                            ]
                                                                        },
                                                                        {
                                                                            "method_instance": {
                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                            },
                                                                            "children": [
                                                                            ]
                                                                        },
                                                                        {
                                                                            "method_instance": {
                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::String, ::Module)"
                                                                            },
                                                                            "children": [
                                                                            ]
                                                                        },
                                                                        {
                                                                            "method_instance": {
                                                                                "method": "run_extension_callbacks(extid::Base.ExtensionId) @ Base loading.jl:1576",
                                                                                "method_instance": "MethodInstance for Base.run_extension_callbacks(::Base.ExtensionId)"
                                                                            },
                                                                            "children": [
                                                                                {
                                                                                    "method_instance": {
                                                                                        "method": "(::Base.var\"#retry_load_extensions##0#retry_load_extensions##1\")(extid) @ Base loading.jl:1640",
                                                                                        "method_instance": "MethodInstance for (::Base.var\"#retry_load_extensions##0#retry_load_extensions##1\")(::Base.ExtensionId)"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "method_instance": {
                                                                                                "method": "filter!(f, a::AbstractVector) @ Base array.jl:2999",
                                                                                                "method_instance": "MethodInstance for filter!(::Base.var\"#retry_load_extensions##0#retry_load_extensions##1\", ::Vector{Base.ExtensionId})"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "retry_load_extensions() @ Base loading.jl:1633",
                                                                                                        "method_instance": "MethodInstance for Base.retry_load_extensions()"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "method_instance": {
                                                                                        "method": "run_extension_callbacks(pkgid::Base.PkgId) @ Base loading.jl:1601",
                                                                                        "method_instance": "MethodInstance for Base.run_extension_callbacks(::Base.PkgId)"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "method_instance": {
                                                                                                "method": "run_package_callbacks(modkey::Base.PkgId) @ Base loading.jl:1433",
                                                                                                "method_instance": "MethodInstance for Base.run_package_callbacks(::Base.PkgId)"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_from_serialized(uuidkey::Base.PkgId, path::String, ocachepath::Union{Nothing, String}, sourcepath::String) @ Base loading.jl:2721",
                                                                                                        "method_instance": "MethodInstance for Base._require_from_serialized(::Base.PkgId, ::String, ::Nothing, ::String)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_from_serialized(uuidkey::Base.PkgId, path::String, ocachepath::Union{Nothing, String}, sourcepath::String) @ Base loading.jl:2721",
                                                                                                        "method_instance": "MethodInstance for Base._require_from_serialized(::Base.PkgId, ::String, ::String, ::String)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::String)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt128) @ Base loading.jl:1933",
                                                                                                        "method_instance": "MethodInstance for Base._tryrequire_from_serialized(::Base.PkgId, ::UInt128)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::String, ::Module)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "var\"#_require_search_from_serialized#898\"(reasons, DEPOT_PATH::Vector{String}, ::typeof(Base._require_search_from_serialized), pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool) @ Base loading.jl:1999",
                                                                                                        "method_instance": "MethodInstance for Base.var\"#_require_search_from_serialized#898\"(::Any, ::Vector{String}, ::typeof(Base._require_search_from_serialized), ::Base.PkgId, ::String, ::UInt128, ::Bool)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                        {
                                                                                                            "method_instance": {
                                                                                                                "method": "kwcall(::NamedTuple, ::typeof(Base._require_search_from_serialized), pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool) @ Base loading.jl:1999",
                                                                                                                "method_instance": "MethodInstance for Core.kwcall(::NamedTuple{(:reasons,), <:Tuple{Any}}, ::typeof(Base._require_search_from_serialized), ::Base.PkgId, ::String, ::UInt128, ::Bool)"
                                                                                                            },
                                                                                                            "children": [
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                                                "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId) @ Base loading.jl:2477",
                                                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                                {
                                                                                                                                                    "method_instance": {
                                                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId) @ Base loading.jl:2774",
                                                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId)"
                                                                                                                                                    },
                                                                                                                                                    "children": [
                                                                                                                                                        {
                                                                                                                                                            "method_instance": {
                                                                                                                                                                "method": "init_stdio(handle::Ptr{Nothing}) @ Base stream.jl:290",
                                                                                                                                                                "method_instance": "MethodInstance for Base.init_stdio(::Ptr{Nothing})"
                                                                                                                                                            },
                                                                                                                                                            "children": [
                                                                                                                                                                {
                                                                                                                                                                    "method_instance": {
                                                                                                                                                                        "method": "_reinit_stdio() @ Base libuv.jl:147",
                                                                                                                                                                        "method_instance": "MethodInstance for Base._reinit_stdio()"
                                                                                                                                                                    },
                                                                                                                                                                    "children": [
                                                                                                                                                                        {
                                                                                                                                                                            "method_instance": {
                                                                                                                                                                                "method": "reinit_stdio() @ Base libuv.jl:144",
                                                                                                                                                                                "method_instance": "MethodInstance for Base.reinit_stdio()"
                                                                                                                                                                            },
                                                                                                                                                                            "children": [
                                                                                                                                                                                {
                                                                                                                                                                                    "method_instance": {
                                                                                                                                                                                        "method": "__init__() @ Base Base.jl:370",
                                                                                                                                                                                        "method_instance": "MethodInstance for Base.__init__()"
                                                                                                                                                                                    },
                                                                                                                                                                                    "children": [
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                                                "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId) @ Base loading.jl:2477",
                                                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                                {
                                                                                                                                                    "method_instance": {
                                                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId) @ Base loading.jl:2774",
                                                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId)"
                                                                                                                                                    },
                                                                                                                                                    "children": [
                                                                                                                                                        {
                                                                                                                                                            "method_instance": {
                                                                                                                                                                "method": "load_InteractiveUtils(mod::Module) @ Base client.jl:399",
                                                                                                                                                                "method_instance": "MethodInstance for Base.load_InteractiveUtils(::Module)"
                                                                                                                                                            },
                                                                                                                                                            "children": [
                                                                                                                                                                {
                                                                                                                                                                    "method_instance": {
                                                                                                                                                                        "method": "load_InteractiveUtils() @ Base client.jl:399",
                                                                                                                                                                        "method_instance": "MethodInstance for Base.load_InteractiveUtils()"
                                                                                                                                                                    },
                                                                                                                                                                    "children": [
                                                                                                                                                                        {
                                                                                                                                                                            "method_instance": {
                                                                                                                                                                                "method": "exec_options(opts) @ Base client.jl:234",
                                                                                                                                                                                "method_instance": "MethodInstance for Base.exec_options(::Base.JLOptions)"
                                                                                                                                                                            },
                                                                                                                                                                            "children": [
                                                                                                                                                                                {
                                                                                                                                                                                    "method_instance": {
                                                                                                                                                                                        "method": "_start() @ Base client.jl:556",
                                                                                                                                                                                        "method_instance": "MethodInstance for Base._start()"
                                                                                                                                                                                    },
                                                                                                                                                                                    "children": [
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        },
                                                                                                                                                                        {
                                                                                                                                                                            "method_instance": {
                                                                                                                                                                                "method": "run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool) @ Base client.jl:501",
                                                                                                                                                                                "method_instance": "MethodInstance for Base.run_main_repl(::Bool, ::Bool, ::Symbol, ::Bool)"
                                                                                                                                                                            },
                                                                                                                                                                            "children": [
                                                                                                                                                                                {
                                                                                                                                                                                    "method_instance": {
                                                                                                                                                                                        "method": "repl_main(::Any) @ Base client.jl:593",
                                                                                                                                                                                        "method_instance": "MethodInstance for Base.repl_main(::Vector{String})"
                                                                                                                                                                                    },
                                                                                                                                                                                    "children": [
                                                                                                                                                                                        {
                                                                                                                                                                                            "method_instance": {
                                                                                                                                                                                                "method": "_start() @ Base client.jl:556",
                                                                                                                                                                                                "method_instance": "MethodInstance for Base._start()"
                                                                                                                                                                                            },
                                                                                                                                                                                            "children": [
                                                                                                                                                                                            ]
                                                                                                                                                                                        }
                                                                                                                                                                                    ]
                                                                                                                                                                                }
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                                                "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId) @ Base loading.jl:2477",
                                                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                                {
                                                                                                                                                    "method_instance": {
                                                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId) @ Base loading.jl:2774",
                                                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId)"
                                                                                                                                                    },
                                                                                                                                                    "children": [
                                                                                                                                                        {
                                                                                                                                                            "method_instance": {
                                                                                                                                                                "method": "load_REPL() @ Base client.jl:415",
                                                                                                                                                                "method_instance": "MethodInstance for Base.load_REPL()"
                                                                                                                                                            },
                                                                                                                                                            "children": [
                                                                                                                                                                {
                                                                                                                                                                    "method_instance": {
                                                                                                                                                                        "method": "run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool) @ Base client.jl:501",
                                                                                                                                                                        "method_instance": "MethodInstance for Base.run_main_repl(::Bool, ::Bool, ::Symbol, ::Bool)"
                                                                                                                                                                    },
                                                                                                                                                                    "children": [
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                                                "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId) @ Base loading.jl:2477",
                                                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                                {
                                                                                                                                                    "method_instance": {
                                                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId) @ Base loading.jl:2774",
                                                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId)"
                                                                                                                                                    },
                                                                                                                                                    "children": [
                                                                                                                                                        {
                                                                                                                                                            "method_instance": {
                                                                                                                                                                "method": "open(h::RawFD) @ Base stream.jl:330",
                                                                                                                                                                "method_instance": "MethodInstance for open(::RawFD)"
                                                                                                                                                            },
                                                                                                                                                            "children": [
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                                                "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId) @ Base loading.jl:2477",
                                                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                                {
                                                                                                                                                    "method_instance": {
                                                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId) @ Base loading.jl:2774",
                                                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId)"
                                                                                                                                                    },
                                                                                                                                                    "children": [
                                                                                                                                                        {
                                                                                                                                                            "method_instance": {
                                                                                                                                                                "method": "var\"#runtests#875\"(ncores::Int64, exit_on_error::Bool, revise::Bool, propagate_project::Bool, seed::Union{Nothing, Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}, julia_args::Cmd, ::typeof(Base.runtests), tests) @ Base util.jl:694",
                                                                                                                                                                "method_instance": "MethodInstance for Base.var\"#runtests#875\"(::Int64, ::Bool, ::Bool, ::Bool, ::Nothing, ::Cmd, ::typeof(Base.runtests), ::Vector{String})"
                                                                                                                                                            },
                                                                                                                                                            "children": [
                                                                                                                                                                {
                                                                                                                                                                    "method_instance": {
                                                                                                                                                                        "method": "runtests(tests; ncores, exit_on_error, revise, propagate_project, seed, julia_args) @ Base util.jl:694",
                                                                                                                                                                        "method_instance": "MethodInstance for Base.runtests(::Vector{String})"
                                                                                                                                                                    },
                                                                                                                                                                    "children": [
                                                                                                                                                                        {
                                                                                                                                                                            "method_instance": {
                                                                                                                                                                                "method": "runtests(; ...) @ Base util.jl:694",
                                                                                                                                                                                "method_instance": "MethodInstance for Base.runtests()"
                                                                                                                                                                            },
                                                                                                                                                                            "children": [
                                                                                                                                                                            ]
                                                                                                                                                                        }
                                                                                                                                                                    ]
                                                                                                                                                                }
                                                                                                                                                            ]
                                                                                                                                                        }
                                                                                                                                                    ]
                                                                                                                                                }
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::String)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                                                "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::String)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require(into::Module, mod::Symbol) @ Base loading.jl:2367",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require(::Module, ::Symbol)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "var\"#_require_search_from_serialized#898\"(reasons, DEPOT_PATH::Vector{String}, ::typeof(Base._require_search_from_serialized), pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool) @ Base loading.jl:1999",
                                                                                                        "method_instance": "MethodInstance for Base.var\"#_require_search_from_serialized#898\"(::Dict{String, Int64}, ::Vector{String}, ::typeof(Base._require_search_from_serialized), ::Base.PkgId, ::String, ::UInt128, ::Bool)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                        {
                                                                                                            "method_instance": {
                                                                                                                "method": "kwcall(::NamedTuple, ::typeof(Base._require_search_from_serialized), pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool) @ Base loading.jl:1999",
                                                                                                                "method_instance": "MethodInstance for Core.kwcall(::@NamedTuple{reasons::Dict{String, Int64}}, ::typeof(Base._require_search_from_serialized), ::Base.PkgId, ::String, ::UInt128, ::Bool)"
                                                                                                            },
                                                                                                            "children": [
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "var\"#_require_search_from_serialized#898\"(reasons, DEPOT_PATH::Vector{String}, ::typeof(Base._require_search_from_serialized), pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool) @ Base loading.jl:1999",
                                                                                                        "method_instance": "MethodInstance for Base.var\"#_require_search_from_serialized#898\"(::Nothing, ::Vector{String}, ::typeof(Base._require_search_from_serialized), ::Base.PkgId, ::String, ::UInt128, ::Bool)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                        {
                                                                                                            "method_instance": {
                                                                                                                "method": "_require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons, DEPOT_PATH) @ Base loading.jl:1999",
                                                                                                                "method_instance": "MethodInstance for Base._require_search_from_serialized(::Base.PkgId, ::String, ::UInt128, ::Bool)"
                                                                                                            },
                                                                                                            "children": [
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "(::Base.var\"#__require_prelocked##0#__require_prelocked##1\")() @ Base loading.jl:2657",
                                                                                                                        "method_instance": "MethodInstance for (::Base.var\"#__require_prelocked##0#__require_prelocked##1\"{Base.PkgId})()"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "var\"#maybe_cachefile_lock#919\"(stale_age, ::typeof(Base.maybe_cachefile_lock), f, pkg::Base.PkgId, srcpath::String) @ Base loading.jl:3872",
                                                                                                                                "method_instance": "MethodInstance for Base.var\"#maybe_cachefile_lock#919\"(::Int64, ::typeof(Base.maybe_cachefile_lock), ::Base.var\"#__require_prelocked##0#__require_prelocked##1\"{Base.PkgId}, ::Base.PkgId, ::String)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "maybe_cachefile_lock(f, pkg::Base.PkgId, srcpath::String; stale_age) @ Base loading.jl:3872",
                                                                                                                                        "method_instance": "MethodInstance for Base.maybe_cachefile_lock(::Base.var\"#__require_prelocked##0#__require_prelocked##1\"{Base.PkgId}, ::Base.PkgId, ::String)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                                "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                                "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                                "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                                "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                                "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                            ]
                                                                                                                                        },
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                                "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::String)"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "_tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt128) @ Base loading.jl:1933",
                                                                                                                        "method_instance": "MethodInstance for Base._tryrequire_from_serialized(::Base.PkgId, ::UInt128)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_tryrequire_from_serialized(pkg::Base.PkgId, path::String, ocachepath::Union{Nothing, String}) @ Base loading.jl:1959",
                                                                                                                                "method_instance": "MethodInstance for Base._tryrequire_from_serialized(::Base.PkgId, ::String, ::Nothing)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::String)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "_require_from_serialized(uuidkey::Base.PkgId, path::String, ocachepath::Union{Nothing, String}, sourcepath::String) @ Base loading.jl:2721",
                                                                                                                                        "method_instance": "MethodInstance for Base._require_from_serialized(::Base.PkgId, ::String, ::Nothing, ::String)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        },
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "_tryrequire_from_serialized(pkg::Base.PkgId, path::String, ocachepath::Union{Nothing, String}) @ Base loading.jl:1959",
                                                                                                                                "method_instance": "MethodInstance for Base._tryrequire_from_serialized(::Base.PkgId, ::String, ::String)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                                                                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::String)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                },
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "_require_from_serialized(uuidkey::Base.PkgId, path::String, ocachepath::Union{Nothing, String}, sourcepath::String) @ Base loading.jl:2721",
                                                                                                                                        "method_instance": "MethodInstance for Base._require_from_serialized(::Base.PkgId, ::String, ::String, ::String)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        },
                                                                                                        {
                                                                                                            "method_instance": {
                                                                                                                "method": "kwcall(::NamedTuple, ::typeof(Base._require_search_from_serialized), pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool) @ Base loading.jl:1999",
                                                                                                                "method_instance": "MethodInstance for Core.kwcall(::@NamedTuple{DEPOT_PATH::Vector{String}}, ::typeof(Base._require_search_from_serialized), ::Base.PkgId, ::String, ::UInt128, ::Bool)"
                                                                                                            },
                                                                                                            "children": [
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                        {
                                                                                                                            "method_instance": {
                                                                                                                                "method": "require_stdlib(package_uuidkey::Base.PkgId) @ Base loading.jl:2774",
                                                                                                                                "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId)"
                                                                                                                            },
                                                                                                                            "children": [
                                                                                                                                {
                                                                                                                                    "method_instance": {
                                                                                                                                        "method": "profile_printing_listener(cond::Base.AsyncCondition) @ Base Base.jl:331",
                                                                                                                                        "method_instance": "MethodInstance for Base.profile_printing_listener(::Base.AsyncCondition)"
                                                                                                                                    },
                                                                                                                                    "children": [
                                                                                                                                        {
                                                                                                                                            "method_instance": {
                                                                                                                                                "method": "(::Base.var\"#start_profile_listener##0#start_profile_listener##1\")() @ Base Base.jl:354",
                                                                                                                                                "method_instance": "MethodInstance for (::Base.var\"#start_profile_listener##0#start_profile_listener##1\"{Base.AsyncCondition})()"
                                                                                                                                            },
                                                                                                                                            "children": [
                                                                                                                                            ]
                                                                                                                                        }
                                                                                                                                    ]
                                                                                                                                }
                                                                                                                            ]
                                                                                                                        }
                                                                                                                    ]
                                                                                                                },
                                                                                                                {
                                                                                                                    "method_instance": {
                                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::String, ::Module)"
                                                                                                                    },
                                                                                                                    "children": [
                                                                                                                    ]
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "method_instance": {
                                                                                        "method": "run_extension_callbacks(pkgid::Base.PkgId) @ Base loading.jl:1601",
                                                                                        "method_instance": "MethodInstance for Base.run_extension_callbacks(::Base.PkgId)"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "method_instance": {
                                                                                                "method": "run_package_callbacks(modkey::Base.PkgId) @ Base loading.jl:1433",
                                                                                                "method_instance": "MethodInstance for Base.run_package_callbacks(::Base.PkgId)"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "method_instance": {
                                                                                        "method": "run_extension_callbacks(pkgid::Base.PkgId) @ Base loading.jl:1601",
                                                                                        "method_instance": "MethodInstance for Base.run_extension_callbacks(::Base.PkgId)"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "method_instance": {
                                                                                                "method": "run_package_callbacks(modkey::Base.PkgId) @ Base loading.jl:1433",
                                                                                                "method_instance": "MethodInstance for Base.run_package_callbacks(::Base.PkgId)"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "method_instance": {
                                                                                        "method": "run_extension_callbacks(pkgid::Base.PkgId) @ Base loading.jl:1601",
                                                                                        "method_instance": "MethodInstance for Base.run_extension_callbacks(::Base.PkgId)"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "method_instance": {
                                                                                                "method": "run_package_callbacks(modkey::Base.PkgId) @ Base loading.jl:1433",
                                                                                                "method_instance": "MethodInstance for Base.run_package_callbacks(::Base.PkgId)"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "method_instance": {
                                                                                        "method": "run_extension_callbacks(pkgid::Base.PkgId) @ Base loading.jl:1601",
                                                                                        "method_instance": "MethodInstance for Base.run_extension_callbacks(::Base.PkgId)"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "method_instance": {
                                                                                                "method": "run_package_callbacks(modkey::Base.PkgId) @ Base loading.jl:1433",
                                                                                                "method_instance": "MethodInstance for Base.run_package_callbacks(::Base.PkgId)"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "method_instance": {
                                                                                        "method": "run_extension_callbacks(pkgid::Base.PkgId) @ Base loading.jl:1601",
                                                                                        "method_instance": "MethodInstance for Base.run_extension_callbacks(::Base.PkgId)"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "method_instance": {
                                                                                                "method": "run_package_callbacks(modkey::Base.PkgId) @ Base loading.jl:1433",
                                                                                                "method_instance": "MethodInstance for Base.run_package_callbacks(::Base.PkgId)"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "_require_prelocked(uuidkey::Base.PkgId, env) @ Base loading.jl:2477",
                                                                                                        "method_instance": "MethodInstance for Base._require_prelocked(::Base.PkgId, ::Nothing)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "method_instance": {
                                                                                                        "method": "require_stdlib(package_uuidkey::Base.PkgId, ext::Union{Nothing, String}, from::Module) @ Base loading.jl:2775",
                                                                                                        "method_instance": "MethodInstance for Base.require_stdlib(::Base.PkgId, ::Nothing, ::Module)"
                                                                                                    },
                                                                                                    "children": [
                                                                                                    ]
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                },
                                                {
                                                    "method_instance": {
                                                        "method": "__require_prelocked(pkg::Base.PkgId, env) @ Base loading.jl:2600",
                                                        "method_instance": "MethodInstance for Base.__require_prelocked(::Base.PkgId, ::String)"
                                                    },
                                                    "children": [
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

Before this change, on master, they happen when executing something like this:

struct S <: AbstractString end
function Base.thisind(::S, ::Int) end

@nsajko nsajko marked this pull request as ready for review August 22, 2025 22:42
@nsajko nsajko added the backport 1.12 Change should be backported to release-1.12 label Aug 22, 2025
@nsajko
Copy link
Member Author

nsajko commented Aug 25, 2025

Some tests fail due to a network error.

@nsajko nsajko added the merge me PR is reviewed. Merge when all tests are passing label Aug 25, 2025
@LilithHafner
Copy link
Member

cross ref: #15276

@adienes adienes merged commit 547f858 into JuliaLang:master Aug 26, 2025
7 checks passed
@adienes adienes removed the merge me PR is reviewed. Merge when all tests are passing label Aug 26, 2025
@nsajko nsajko deleted the loading-__require_prelocked-closure_captures_inference_invalidations branch August 26, 2025 12:16
KristofferC pushed a commit that referenced this pull request Sep 1, 2025
…59367)

The only method of the `__require_prelocked` function in `Base` gets
compiled with bad inference for two variables, `path` and `reasons`,
which get pessimistically boxed (and inferred as `Any`), even though
both of them are only assigned to once across both the method and the
closure within (neither is assigned to within the closure).

My guess for what causes this would be either of these, or the
combination:

* (mis)use of GOTO

* `try`-`catch`

The least demanding way to work around the issue is adding a `let`
around the closure, as advised in the Performance tips. That is what
this change does.

This change should fix several bad inference results within method
instances such as `__require_prelocked(::PkgId, ::Nothing)` and
`__require_prelocked(::PkgId, ::String)`. Consequently, the sysimage
should become less vulnerable to invalidation happening when loading
certain packages.

(cherry picked from commit 547f858)
KristofferC pushed a commit that referenced this pull request Sep 2, 2025
…59367)

The only method of the `__require_prelocked` function in `Base` gets
compiled with bad inference for two variables, `path` and `reasons`,
which get pessimistically boxed (and inferred as `Any`), even though
both of them are only assigned to once across both the method and the
closure within (neither is assigned to within the closure).

My guess for what causes this would be either of these, or the
combination:

* (mis)use of GOTO

* `try`-`catch`

The least demanding way to work around the issue is adding a `let`
around the closure, as advised in the Performance tips. That is what
this change does.

This change should fix several bad inference results within method
instances such as `__require_prelocked(::PkgId, ::Nothing)` and
`__require_prelocked(::PkgId, ::String)`. Consequently, the sysimage
should become less vulnerable to invalidation happening when loading
certain packages.

(cherry picked from commit 547f858)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants