Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge objects in alphabetical order for determinism #10

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

jblazquez
Copy link
Contributor

@jblazquez jblazquez commented Jan 19, 2025

As discussed in #9, making armerge's output deterministic is generally valuable. The main thing breaking determinism was the random merge order of objects due to the use of HashMap, which intentionally randomizes the order of entries. Using BTreeMap instead to always merge objects in alphabetical order helps maintain determinism.

There are still some sources of nondeterminism, but those are easier to manage by the user of the tool. For example, if an input library contains several objects with the same name, then the merge order of those objects is still nondeterministic because of the random suffix added to object names. The user could ensure there are no identically named objects in a given input library prior to calling armerge.

@tux3 tux3 merged commit cd68d77 into tux3:master Jan 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants