PeachPy icon indicating copy to clipboard operation
PeachPy copied to clipboard

Deterministic output

Open dgryski opened this issue 7 years ago • 1 comments

Every time I regenerate the assembly for https://github.com/dgryski/go-highway with python3, some of the labels change. This makes it difficult to isolate a small change in the source file with a small change in the output.

dgryski avatar Jan 15 '18 17:01 dgryski

This is caused by iterating dict keys in https://github.com/Maratyszcza/PeachPy/blob/master/peachpy/name.py#L91 This could be fixed by assigning a function-global name id each time an object with a name (LABEL or instruction with Constant) is added in Function.add_instruction and sorting by these names in the loop. I don't have time to fix it now, but a PR would be welcome!

Maratyszcza avatar Jan 15 '18 20:01 Maratyszcza