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 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-08 08:56:19 +00:00
parent f525c6887b
commit e2c54614aa

View file

@ -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];