From e2c54614aa9b3690bce97a87d64d2c04104bef53 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Thu, 8 Oct 2026 08:56:19 +0000 Subject: [PATCH] class v5 kit (OpenCL host): gFlipLeafWord declared before parseArgs (the kit's C99 build read it undeclared; the 22:10 zip predated the option) Co-Authored-By: Claude Fable 5.1 --- proto-opencl/host.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/proto-opencl/host.c b/proto-opencl/host.c index 985495545..563e8d81b 100644 --- a/proto-opencl/host.c +++ b/proto-opencl/host.c @@ -273,6 +273,13 @@ static void usage(void) { static int isPow2(long long v) { return v > 0 && (v & (v - 1)) == 0; } static int log2u32(uint32_t v) { int n = 0; while (v > 1u) { v >>= 1; ++n; } return n; } +/* --flip-leaf-word N (the kit's known-failed case for the fingerprint, class v5): after pf_load_leaves has checked the + * pack's leaves, bit 0 of 32-bit word N of the DEVICE copy is flipped before the upload (packLeavesBuffer), so the run + * proceeds on a dataset keyed by one wrong leaf word; the dataset self-test must then fail (head, last word or a sample) + * and, run through, the fingerprint must differ from the pack's. -1 = off. Declared before parseArgs, which sets it (the + * first form sat after it and the kit's C99 build read it undeclared, 8 October 2026). */ +static long gFlipLeafWord = -1; + static Options parseArgs(int argc, char** argv) { Options o; int i; @@ -1192,12 +1199,6 @@ static cl_int setBuildArgs(cl_kernel k, cl_mem ds, cl_mem cache, cl_mem leaves, /* The leaves of a pack directory as a device buffer (NULL with *nLeaves 0 for a pack of another class): read and checked * against the pack's count and FNV-1a 64 by pf_load_leaves before the upload. The caller releases the buffer after the * build (the leaves are not needed while hashing). Returns 1, or 0 with err set. */ -/* --flip-leaf-word N (the kit's known-failed case for the fingerprint, class v5): after pf_load_leaves has checked the - * pack's leaves, bit 0 of 32-bit word N of the DEVICE copy is flipped before the upload, so the run proceeds on a dataset - * keyed by one wrong leaf word; the dataset self-test must then fail (head, last word or a sample) and, run through, the - * fingerprint must differ from the pack's. -1 = off. */ -static long gFlipLeafWord = -1; - static int packLeavesBuffer(Device* dv, const char* packDir, cl_mem* leaves, cl_uint* nLeaves, char* err, size_t errCap) { PfPack pk; char perr[700];