-
Notifications
You must be signed in to change notification settings - Fork 661
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
Make tile building reproducible #2480
Conversation
Is this reproducible with a gurka test? If so it seems worth adding a simple test that builds tiles twice using the same input map and checking the resulting tiles are the same. |
Totally agreed! Didn't want to assign reviewers until I add tests. |
IMO, if a minimal fake map reproduces the issue it will be a lot simpler to write and understand that test, and it will run a lot faster in CI. |
77a328e
to
a83b0ba
Compare
a83b0ba
to
33f0dae
Compare
Hm, tests pass on my machine but fails in CI. Seems there're another UB somewhere in the code..
|
e01771f
to
48a652e
Compare
48a652e
to
709cfdd
Compare
@@ -502,6 +502,8 @@ void DirectedEdge::set_shortcut(const uint32_t shortcut) { | |||
void DirectedEdge::set_superseded(const uint32_t superseded) { | |||
if (superseded > kMaxShortcutsFromNode) { | |||
LOG_WARN("Exceeding max shortcut edges from a node: " + std::to_string(superseded)); | |||
} else if (superseded == 0) { | |||
superseded_ = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix of the failed build-release check a few days ago. If superseded == 0
then 1 << (superseded - 1)
produces UB
This fix will be committed in different PR with most UB fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! The Azure pipelines build is unrelated to your PR, and is failing for unrelated reasons.
@merkispavel actually I think you need to add an entry to the CHANGELOG as well, as part of this change. |
Thanks for the reminder! Done |
* 'master' of github.com:valhalla/valhalla: Make tile building reproducible (#2480) Fix install-script for ubuntu 18.04 (#2306) (#2486) nit(git): Configures changelog to resolve conflicts with union strategy (#2489) feat(traffictile.h): Adds versioning checks (#2484) Fix dereferencing of end for std::lower_bound and possible UB (#2488) Minor fixes to tests (#2483) nit: Missing changelog entry (#2478) Safiefy protobuf (#2477)
* master: Make tile building reproducible (#2480)
Issue
At the moment if you try to run
valhalla_build_tiles
a few times with the same input data(config, pbfs) you'll get different tilesets(tile hash sums are different). The PR fixes that behaviorExample of how to compare tilesets
Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?