Skip to content

Default Selectors are not unique #717

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

Closed
mhauru opened this issue Nov 14, 2024 · 1 comment
Closed

Default Selectors are not unique #717

mhauru opened this issue Nov 14, 2024 · 1 comment

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.

@yebai
Copy link
Member

yebai commented Mar 12, 2025

Selectors are no more. #779

@yebai yebai closed this as completed Mar 12, 2025
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

2 participants