From da68bdb68551b9b780894f2dd098b249ce61145b Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 15 Jun 2025 14:41:07 -0700 Subject: [PATCH] Write seed only during GPU dispatch. --- src/lib/generate/webgpu/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/generate/webgpu/index.ts b/src/lib/generate/webgpu/index.ts index d57837a..8eaca5b 100644 --- a/src/lib/generate/webgpu/index.ts +++ b/src/lib/generate/webgpu/index.ts @@ -212,7 +212,7 @@ async function dispatch (dispatchIndex: number, seed: bigint, effort: number): P // Copy seed into INPUT buffer inputDataView.setBigUint64(40, seed, true) logger.log('INPUT', inputDataView) - device.queue.writeBuffer(inputBuffers[dispatchIndex], 0, inputDataView) + device.queue.writeBuffer(inputBuffers[dispatchIndex], 40, inputDataView, 40) // Create command encoder to issue commands to GPU and initiate computation const commandEncoder = device.createCommandEncoder() @@ -280,7 +280,7 @@ export async function generate (hash: bigint, difficulty: bigint, effort: number timeout = true throw new Error('timed out') }, 60_000) - // logger.groupStart('NanoPow WebGPU work_generate') + logger.groupStart('NanoPow WebGPU work_generate') logger.log('generating') let found = false let result: { [key: string]: bigint } = {} -- 2.47.3