BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.67k stars 260 forks source link

Fix RDO non-determinism due to hashed padding #375

Closed zeux closed 1 day ago

zeux commented 1 month ago

During RDO, selector_bitsequence (16 bytes) had 4 bytes of uninitialized data that was hashed in the process. This resulted in run-to-run non-determinism with or without RDO multithreading.

For now fix this by explicitly zero initializing the padding; while more efficient hash functions are possible, this aims to be a minimal change that fixes the problem. ^ s.m_sel is redundant though so it is removed for clarity.

richgel999 commented 3 weeks ago

Thanks! I've merged into our HDR update (coming in Sept.) Will close once we get it approved for release.

richgel999 commented 1 day ago

Fixed_in v1.50