]> zoso.dev Git - nano-pow.git/commitdiff
Fix threshold comparison in compute shader.
authorChris Duncan <chris@zoso.dev>
Tue, 11 Mar 2025 21:15:02 +0000 (14:15 -0700)
committerChris Duncan <chris@zoso.dev>
Tue, 11 Mar 2025 21:15:02 +0000 (14:15 -0700)
src/shaders/compute.wgsl

index 989a616ac861366ecff593e4fb14b3476bcf8090..54e744043017ea9ae7c7bca6061f06b6d22a4b3a 100644 (file)
@@ -1624,7 +1624,7 @@ fn main(id: vec3<u32>) {
        * Set nonce if it passes the threshold and no other thread has set it.
        * Only high bits are needed for comparison since threshold low bits are zero.
        */
-       if ((BLAKE2B_IV_0.y ^ v01.y ^ v89.y) > ubo.threshold && atomicLoad(&work.found) == 0u) {
+       if ((BLAKE2B_IV_0.y ^ v01.y ^ v89.y) >= ubo.threshold && atomicLoad(&work.found) == 0u) {
                atomicStore(&work.found, 1u);
                work.nonce = m0;
        }