[issue15368] bytecode generation is not deterministic

2012-07-25 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 47e074f6ca26 by Meador Inge in branch '2.7': Issue #15368: fixing variable typo. http://hg.python.org/cpython/rev/47e074f6ca26 New changeset 1c46f2ede4cb by Meador Inge in branch '3.2': Issue #15368: fixing variable typo. http://hg.python.org/cpyth

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Meador Inge
Meador Inge added the comment: D'oh! Thanks for catching that Serhiy! Fixing now. Sorry about that. -- ___ Python tracker ___ ___

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Meador, you have forgotten to fix the error "PyList_GET_SIZE(src)". src is not list, should be "PyList_GET_SIZE(sorted_keys)". -- nosy: +storchaka ___ Python tracker __

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Meador Inge
Meador Inge added the comment: Committed. Thanks for the reviews y'all. -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed versions: +Python 2.7, Python 3.2 ___ Python tracker

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7eb0180c1734 by Meador Inge in branch '2.7': Issue #15368: make bytecode generation deterministic. http://hg.python.org/cpython/rev/7eb0180c1734 New changeset 79d54fba49b3 by Meador Inge in branch '3.2': Issue #15368: make bytecode generation deter

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Brett Cannon
Brett Cannon added the comment: Nah, you are a committer and thus qualify as the second review. =) As for backporting, it only affects regeneration of bytecode, so I don't see any major harm in it (might surprise some people, but there is a legitimate reason for fixing this). -- ___

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Meador Inge
Meador Inge added the comment: BTW, I think this should be committed on 2.7 and 3.2 as well since the same issue can happen when throwing -R. Any objections? -- ___ Python tracker ___

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Meador Inge
Meador Inge added the comment: I can commit today unless you think we need someone else to independently verify the patch. -- ___ Python tracker ___ ___

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Brett Cannon
Brett Cannon added the comment: So I think that just leaves one other person to verify the patch works as expected and then commit it. I can hopefully later this week, but no sooner than Friday, so if someone can get to it faster that would be great. -- __

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Nick Coghlan
Nick Coghlan added the comment: Agreed, so definite +1 from me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Brett Cannon
Brett Cannon added the comment: Yep, so I consider the performance worry dealt with. -- stage: needs patch -> commit review ___ Python tracker ___ __

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Meador Inge
Meador Inge added the comment: Oh, cool -- I didn't know about the importlib benchmarks. Thanks Brett. Here are the results (OS X 10.7.4, Dual 1.7GHz Core i5, 4 GB RAM): $ ./python.exe -m importlib.test.benchmark Measuring imports/second over 1 second, best out of 3 Entire benchmark run shoul

[issue15368] bytecode generation is not deterministic

2012-07-18 Thread Brett Cannon
Brett Cannon added the comment: You ran the benchmarks correctly, but I was more worried about compilation time than execution time (changing which index is for what really shouldn't make a difference in performance, and the benchmarks show that). If you want to test using the importlib bench

[issue15368] bytecode generation is not deterministic

2012-07-17 Thread Meador Inge
Meador Inge added the comment: New patch that addresses feedback from Brett's code review (thanks!). -- Added file: http://bugs.python.org/file26418/issue15368-v1.patch ___ Python tracker _

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Meador Inge
Meador Inge added the comment: I haven't done any benchmarking (yet), but here is a patch implementing the basic sorting approach. -- keywords: +patch Added file: http://bugs.python.org/file26409/issue15368-v0.patch ___ Python tracker

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Brett Cannon
Brett Cannon added the comment: OK, so it sounds like we need to do the equivalent of sorting those tuples when generating the bytecode. That would suggest that probably need to tweak Python/compile.c to make it deterministic. -- ___ Python tracker

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ditto. I think predictability of bytecode generation is useful, e.g. for make-like tools that examine content, or for unit testing. -- nosy: +pitrou ___ Python tracker __

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Nick Coghlan
Nick Coghlan added the comment: At least we know the hash randomisation is working :) Spurious changes when freezing modules seems like a legitimate reason to fix it - the import benchmarks would probably give the compiler enough of a workout to highlight if the sorting is excessively time co

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Meador Inge
Meador Inge added the comment: On Mon, Jul 16, 2012 at 8:11 AM, Brett Cannon wrote: > I might come to regret asking this, but so what? Is this actually causing you > issues, > or are you literally just finding "this behavior surprising" and that's it? I noticed it in the context of working o

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Brett Cannon
Brett Cannon added the comment: I might come to regret asking this, but so what? Is this actually causing you issues, or are you literally just finding "this behavior surprising" and that's it? I mean we could simply sort the tuples, but I don't know what kind of performance hit that would ca

[issue15368] bytecode generation is not deterministic

2012-07-16 Thread Meador Inge
New submission from Meador Inge : Consider this small example (you might have to run sample program multiple times to see a difference): $ cat dis-closure.py import dis def adder(a, b): def add(): return a + b return add print(dis.dis(adder(1, 2).__code__)) $ ./python.exe di