larsc | lekernel: that the remaining non-deterministines is small enough, so I could verfiy that things still work | 09:27 |
---|---|---|
larsc | at least the generated code is the same | 09:28 |
lekernel | all non-determinism is bugs and should go... | 10:56 |
lekernel | I think I just found another one... let me check | 10:57 |
Action: lekernel is just back from TU | 10:57 | |
lekernel | larsc, better now? send me a diff of the changed lines if you still get problems | 11:21 |
GitHub44 | [migen] sbourdeauducq pushed 1 new commit to master: http://git.io/Zqjb1Q | 11:21 |
GitHub44 | migen/master 5adab17 Sebastien Bourdeauducq: flow/actor/filter_endpoints: deterministic order | 11:21 |
lekernel | there's still an issue in asmicon but I'm not sure you're using it now | 11:21 |
lekernel | grmbl I wish there were an option in python to make ids and iteration orders on sets/dictionaries deterministic | 11:28 |
lekernel | this thing is just super-annoying with migen | 11:28 |
lekernel | I wonder how much performance they get by dropping deterministic iteration orders... and it's not like python is optimized for performance to begin with | 11:32 |
wpwrak | does iteration over the same set/dict yield different orders ? or do you mean iteration over equivalent but not identical ones ? | 11:35 |
lekernel | the iteration order will be different between runs of the same program | 11:36 |
lekernel | if you don't modify the set/dict, and don't re-run the program, the order is the same | 11:36 |
wpwrak | hmm, you could sort by content if you really really need this sort of determinism ... | 11:37 |
wpwrak | it's interesting that order would change per invocation if everything else is identical | 11:38 |
larsc | I think there is a OrderedDict | 11:39 |
lekernel | sorting by content is basically what I'm doing right now, but I have to do it manually and spot problematic code | 11:39 |
larsc | http://docs.python.org/dev/library/collections#collections.OrderedDict | 11:39 |
wpwrak | may it's caused by some address space layout randomization. you could try to turn that off. ... or of course use lars' suggestion :) | 11:40 |
lekernel | also, sometimes you have dict/sets of other objects, then python uses the id() by default, which is whatever address it got from malloc() - another source of non determinism | 11:40 |
lekernel | migen has a HUID class that makes the id() an object creation counter instead, but again you have to use that manually | 11:41 |
lekernel | OrderedDict isn't the default, if you use the syntactic sugar you get a normal non-deterministic dict | 11:41 |
lekernel | and there's no ordered set | 11:41 |
lekernel | and object.__dict__ is not an OrderedDict but the crappy one | 11:41 |
lekernel | lots of time wasted to that little detail | 11:42 |
larsc | well, a set is a dict where all the values are None | 11:42 |
lekernel | yes, but again - if you build a set with {item1, item2, ...} that's not what you get | 11:43 |
larsc | yes | 11:43 |
larsc | because normally you don't need this | 11:43 |
lekernel | can't they just make all sets and dicts OrderedSet/OrderedDict and be done with that? | 11:44 |
larsc | send a patch ;) | 11:46 |
lekernel | yeh, a "PEP" with all the bureaucracy... | 11:46 |
lekernel | pick your evil | 11:46 |
lekernel | (and then, assuming it gets through, people like debian users will still have problems for years) | 11:52 |
lekernel | larsc, do you still have non-determinism problems after my last commit? | 12:21 |
larsc | lekernel: I'll test when I'm back home | 12:23 |
lekernel | http://benno.id.au/blog/2013/01/15/python-determinism | 12:48 |
lekernel | the unordered set/dicts really seem to cause more problems than they solve | 12:49 |
lekernel | ah: On Python 3.3 and greater, hash randomization is turned on by default. | 12:52 |
lekernel | I had Python 3.2 before... this explains some of the new problems | 12:53 |
lekernel | otoh this can be used as another argument in favor of orderedsect/ordereddict by default... anyone feels like writing a PEP? | 12:59 |
lekernel | they even get non-determinism in their own compiler now :-) | 13:00 |
lekernel | and then we could also (ab)use keyword arguments to replace .eq() | 13:04 |
larsc | found the cause for last non determinisic naming | 19:07 |
larsc | it's in the very core of migen itself | 19:07 |
lekernel | larsc, that is...? | 22:40 |
--- Fri Mar 15 2013 | 00:00 |
Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!