Repository navigation
Make booleans deterministic - #20
Merged
Merged
Conversation
Replace `HashMap` with `BTreeMap` and introduce sequence counters for tie-breaking in ear clipping, ensuring consistent output across runs regardless of memory allocation order.
Owner
|
Thanks for the fix, the determinism change itself looks good. |
Contributor
Author
|
Dropped src/par.rs, thanks! |
Owner
|
LGTM. Thank you for your PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #19
The same two inputs could produce different outputs from run to run, even
on one thread. Two changes, no change to the algorithm:
boolean45:HashMap→BTreeMapfor the edge-point maps, so faces gettheir new halfedges in key order (as
std::mapdoes in the C++ original).ear_clip.rs: ties in the ear and hole queues break by creation orderinstead of
Rcaddress.test_same_input_same_outputruns three cube booleans 30 times each andfails on
main. All existing tests pass with and withoutrayonandf32.Happy to adjust naming or style to match the crate.