Skip to content

census: ordered startup input record and prefix cuts (instrumented builds only) - #14259

Draft
proggeramlug wants to merge 10 commits into
mainfrom
snap23-census-inputs
Draft

proggeramlug wants to merge 10 commits into
mainfrom
snap23-census-inputs

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Startup-snapshot census, instrumented builds only (cfg(perry_gc_instruments)), off by default. Follows #13935 toward the execution-prefix snapshot model: run init in its real order at build time up to the first input that cannot be guarded, image the heap there, and guard the inputs read before that point at startup.

What this adds

  • An ordered startup input record (env, argv, locale, tty, ids, files, clock, entropy) with values and instruction positions, streamed as it happens. A per-thread depth guard keeps the recorder from recording its own allocator's clock reads, and the clock/env hooks use fixed buffers.
  • Cut computation under R1/R2 (frames still open at the cut must be resumable), with replay counterexamples.
  • Census page policy fix: after first-write tracking ends, a rule-4 conflict could re-protect every tracked heap page while the policy said writable; the handler then did not take the next access. Bulk protection now follows the policy.

Gates

Supabase census (one run)

2,895 inits, 8,882.5 M init Ir. Cuts by the semantic input classes:

cut guards stops before % of init Ir
P1 env, argv, locale init 1230 (tty read) 61.4%
P2 + tty init 1488 (uid/gid read) 63.6%
P3 + ids init 2455 (directory read) 88.6%

undici's init (1652) falls inside P3. Draft: native reads that the semantic classes do not cover yet (exe path, /proc/self/maps, CPU affinity, cgroup cpu.max, clock reads) are being classified next; until then the cuts are upper bounds.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant