-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
.ktx2 files vary from parallelism #2991
Comments
This is probably something worth opening as an Issue in the Basis-Universal project as well: https://github.com/BinomialLLC/basis_universal The ktx2 files should be using Zstd compression, and my understanding is that Zstd (or, at least, recent versions) is supposed to produce reproducible output given the same input, settings, and version of Zstd. Whether the basis-universal tool is passing different settings to it, or there's some other aspect of the earlier transcoding parts that is non-deterministic, I haven't yet had a chance to look into. Happy to accept any suggestions / insight, though. EDIT: Looking at the basis_tool options, it's possible that passing:
or
might do the trick. The first one sounds the most promising? |
Incidentally, I happen to be the openSUSE package maintainer for This makes it reproducible --- warzone2100.orig/data/CMakeLists.txt
+++ warzone2100/data/CMakeLists.txt
@@ -131,7 +131,7 @@ if(WZ_ENABLE_BASIS_UNIVERSAL)
set(_output_name "${TEXTURE_FILE_NAME_WE}.ktx2")
add_custom_command(OUTPUT "${_output_dir}/${_output_name}"
COMMAND "${BASIS_UNIVERSAL_CLI}"
- ARGS -ktx2 -uastc -uastc_level 2 -uastc_rdo_l 1.0 -mipmap -resample ${_terrain_max_size} ${_terrain_max_size} -output_file "${_output_dir}/${_output_name}" -file "${TEXTURE}"
+ ARGS -uastc_rdo_m -ktx2 -uastc -uastc_level 2 -uastc_rdo_l 1.0 -mipmap -resample ${_terrain_max_size} ${_terrain_max_size} -output_file "${_output_dir}/${_output_name}" -file "${TEXTURE}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/base/texpages"
DEPENDS "${TEXTURE}"
VERBATIM Do you think, basis_universal would take a patch to make it the default? |
|
Great! 🥳 I've added
I have no idea, unfortunately, but it can't hurt to ask. (Regardless, this should be fixed for WZ's build scripts.) |
This was fixed by commit 27218d7
|
filed new related BinomialLLC/basis_universal#374 |
Describe the bug
While working on reproducible builds for openSUSE, I found that
our
warzone2100
package started to vary inbase.wz/texpages/page-102-bottom-rockies.ktx2
and 19 other .ktx2 files.My tools tell me, that the results become reproducible if I run both builds on 1-core-VMs instead of varying cores from 1 to 4.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Build results should be fully deterministic
Screenshots or Videos
build log diff showed
Your System:
Additional context
Files are probably created by
3rdparty/basis_universal/basisu_tool.cpp
.Some compression methods (e.g. xz) are known to produce variations depending on number of threads. One workaround with .xz is to always use at least 2 threads, even on 1-core machines.
The text was updated successfully, but these errors were encountered: