Skip to content

Random Stability #221

Closed Answered by alwilson
felixdube asked this question in Q&A
Jul 10, 2024 · 6 comments · 2 replies
Discussion options

You must be logged in to vote

(Oh, there's a reply/thread option in discussions.)

Ah, I found it! Ordering constraints use toposort, which internally converts lists of dependencies into python sets, which don't guarantee order. I'm not sure how sets decide what order to take when converted back into a list, but I assume there's some address space randomization plus hashing that gives it back in a random order.

for fs in list(toposort(rs_deps)):

class wrapper():
    def __init__(self, idx):
        self.idx = idx

ws = set([wrapper(i) for i in range(10)])

print([w.idx for w in ws])

Output:

$ for i in {0..10}; do ./settest.py; done
[4, 7, 1,…

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@alwilson
Comment options

Answer selected by felixdube
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@alwilson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants