Skip to content

Better world age handling #168

@maleadt

Description

@maleadt

There's currently two related problems with our current world age handling:

  • we index the compilation cache directly with the world age (by taking the hash of the compiler job); instead we should intersect, and handle invalidation
  • when creating the FunctionSpec, we should have a way to pass the world age of the calling code, as opposed to the current global world age, which makes e.g. cufunction always look up the latest version of a potentially shadowed kernel (whereas it should be consistent with the world age of the caller); this probably requires a new intrinsic as both the current world age getter and the PTLS entry always point to the latest world:
     julia> worlds() = (ptls=Int(unsafe_load(convert(Ptr{Csize_t}, Core.getptls() + 8))), runtime=Int(Base.get_world_counter()))
     worlds (generic function with 1 method)
     julia> worlds()
     (ptls = 29611, runtime = 29611)
     julia> bar() = 42
     bar (generic function with 1 method)
     julia> worlds()
     (ptls = 29612, runtime = 29612)
     julia> Int(first(methods(worlds, Tuple{})).primary_world)
     29611

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions