Make usage_item_array.data
stable
#1255
Merged
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.
Description
Previously the content of
usage_item_array.data
was processed withstd::sort
rather thanstd::stable_sort
. As a result, the content can easily vary depending on platforms (to be precise STL implementations).By switching to
std::stable_sort
, we can assume the same content will be generated across platforms, which would be a huge win when diagnosing conversion related issues.Note that
gen_usage_rewriter_dictionary_main.cc
runs as a build step. Thus there should be no major performance implications at runtime.Closes #1254.
Issue IDs
usage_item_array.data
is not stable due to the usage ofstd::sort
#1254Steps to test new behaviors (if any)
A clear and concise description about how to verify new behaviors (if any).
bazelisk //data_manager/oss:mozc_dataset_for_oss --config oss_windows
(on Windows)bazelisk //data_manager/oss:mozc_dataset_for_oss --config oss_macos
(on macOS)bazelisk //data_manager/oss:mozc_dataset_for_oss --config oss_linux
(on Linux)bazel-bin/data_manager/oss/usage_item_array.data
is the same.