You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When cbExiGen generates code, the order of types and functions in the generated code seems random. While the order is reproducible with a static version of cbExiGen, any change in the Python code will mangle the order.
This makes it difficult to compare the result. Committing changed code to the libcbv2g repository gives large diffs even for cosmetic changes.
To Reproduce
No response
Anything else?
If you look at the trees cbExiGen generates, you can see the differing order. (I think they can be enabled by setting generate_analysis_tree{,_20}.)
cbExiGen does do some sorting underways, and some order is required anyway to comply to code dependencies without forward declarations. This is all covered and continues to work. (It breaks if you try to sort the type arrays alphabetically.)
I thought this issue was due to Python's hash seed randomization. But even if I do export PYTHONHASHSEED=0; python3 src/main.py (you cannot disable from within a Python program), any change in the Python code shuffles order.
This may or may not be related to the order of elements handed out by xmlschema's API.
We probably need to create the data sets differently, e.g. by sorting at each branch point.
Describe the bug
When cbExiGen generates code, the order of types and functions in the generated code seems random. While the order is reproducible with a static version of cbExiGen, any change in the Python code will mangle the order.
This makes it difficult to compare the result. Committing changed code to the libcbv2g repository gives large diffs even for cosmetic changes.
To Reproduce
No response
Anything else?
If you look at the trees cbExiGen generates, you can see the differing order. (I think they can be enabled by setting
generate_analysis_tree{,_20}
.)cbExiGen does do some sorting underways, and some order is required anyway to comply to code dependencies without forward declarations. This is all covered and continues to work. (It breaks if you try to sort the type arrays alphabetically.)
I thought this issue was due to Python's hash seed randomization. But even if I do
export PYTHONHASHSEED=0; python3 src/main.py
(you cannot disable from within a Python program), any change in the Python code shuffles order.This may or may not be related to the order of elements handed out by xmlschema's API.
We probably need to create the data sets differently, e.g. by sorting at each branch point.
(See also https://stackoverflow.com/questions/51948243/why-is-the-order-of-python-sets-not-deterministic-even-when-pythonhashseed-0)
Any help appreciated.
The text was updated successfully, but these errors were encountered: