@builtin(workgroup_id) workgroup_id: vec3<u32>,
@builtin(local_invocation_id) local_id: vec3<u32>
) {
- if (atomicLoad(&work.found) != 0u) {
- return;
- }
+ if (atomicLoad(&work.found) != 0u) { return; }
/**
* Flatten 3D workgroup and local identifiers into u32 for each thread
0x04BE4294u, 0xE07C2654u, 0x137E2179u, 0x5BE0CD19u
);
- for (var i: u32 = 0u; i < 0xFFFFu; i = i + 1u) {
+ for (var i: u32 = 0u; i < 0xFFu; i = i << 1u) {
+ m[0u] = m[0u] ^ i;
/**
- * Twelve rounds of mixing as part of compression step
+ * Twelve rounds of mixing as part of BLAKE2b compression step
*/
for (var r: u32 = 0u; r < 12u; r = r + 1u) {
G(&v, &m, 0u, 8u, 16u, 24u, SIGMA82[r * 16u + 0u], SIGMA82[r * 16u + 1u]);
work.nonce.y = m[1];
return;
}
-
- /**
- * If not found, move on to the next nonce candidate.
- * For example, increment by the total number of *active* threads,
- * or simply increment by 1.
- */
- m[0u] = m[0u] + 1u;
}
-
- // No valid nonce found by this thread in 'maxIterations' attempts
- // Exit. Another dispatch or CPU fallback might handle continuing.
+ /**
+ * Nonce not found in this execution context
+ */
return;
}
`;