dev_best_score and dev_best_key are updated in two separate atomic operations inside the CUDA kernel (bruteforce.cu). There is no guarantee these two values are updated as an atomic pair, so a thread could read a best_score that belongs to a different best_key.
Impact: Low in practice — the brute-force covers the full keyspace so the correct key is always found. But the intermediate "best candidate" reported during search could briefly show an inconsistent key/score pair.
Fix: Use a single 64-bit atomic CAS to update both, or protect with a mutex/lock, or accept the minor inconsistency and document it.
dev_best_scoreanddev_best_keyare updated in two separate atomic operations inside the CUDA kernel (bruteforce.cu). There is no guarantee these two values are updated as an atomic pair, so a thread could read abest_scorethat belongs to a differentbest_key.Impact: Low in practice — the brute-force covers the full keyspace so the correct key is always found. But the intermediate "best candidate" reported during search could briefly show an inconsistent key/score pair.
Fix: Use a single 64-bit atomic CAS to update both, or protect with a mutex/lock, or accept the minor inconsistency and document it.