Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Selectors are not unique #717

Open
mhauru opened this issue Nov 14, 2024 · 0 comments
Open

Default Selectors are not unique #717

mhauru opened this issue Nov 14, 2024 · 0 comments

Comments

@mhauru
Copy link
Member

mhauru commented Nov 14, 2024

using DynamicPPL

function make_selectors()
    s1 = DynamicPPL.Selector()
    s2 = DynamicPPL.Selector()
    return s1, s2
end

for i in 1:10
    s1, s2 = make_selectors()
    println("$(s1.gid == s2.gid)")
end

Indeterministic example output:

true
true
true
false
false
true
true
false
true
true

This is causing indeterministic test failures over at TuringLang/Turing.jl#2328

The cause is this:

function Selector(tag::Symbol=:default, rerun=tag != :default)
    return Selector(time_ns(), tag, rerun)
end

Sometimes to calls execute within a nanosecond, sometimes they don't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant