Skip to content

refactor: establish reusable runtime lifecycle - #599

Open
domcyrus wants to merge 24 commits into
mainfrom
headless-runtime-foundation
Open

refactor: establish reusable runtime lifecycle#599
domcyrus wants to merge 24 commits into
mainfrom
headless-runtime-foundation

Conversation

@domcyrus

@domcyrus domcyrus commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Runtime lifecycle foundation for #602 and #606, related to #9.

  • Prepares privileged capture before sandboxed workers start, requires successful UID/GID dropping, retains worker ownership through shutdown, and finalizes outputs after producers stop.
  • Reuses packet-worker buffers and reduces work inside ordered commits without changing capture order or the 10,000-packet queue bound. Matched-capacity benchmarks improve selected TCP/HTTP workloads; DNS results are mixed and overload can still drop packets.
  • Retains idle-capture regressions, secure output ownership, and cross-platform workspace CI. Existing Windows API features cover file security; the unused regex dependency is removed. Adds panic/waiter and exact PCAPNG worker regressions.

@domcyrus

domcyrus commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Updated in 0045b9e, preserving ordering and the existing queue bound.

  • Linux verification: 1,058 default and 1,080 all-feature workspace tests passed, plus clippy and formatting. New tests cover waiter/panic recovery and exact PCAPNG bytes, order, and attribution.
  • Five interleaved matched-capacity trials improved four-worker TCP/HTTP throughput by 9.1%/15.4%. DNS was mixed, including a 6.7% lower four-worker median with overlapping ranges.
  • Live queue drops decreased in all four before/after pairs but remain nonzero. All eight independent PCAPs contained every generated datagram exactly once. TUI capture-drop fields were unavailable, so residuals remain unclassified. These virtualized results do not establish universal capacity or recovery of every cost relative to main.

@domcyrus

domcyrus commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Updated in 883bcd0. Follow-up cb1ffc3 fixes a new Rust 1.98 Clippy lint in a test fixture; 93c038b adds the privileged readiness regression to CI under its own watchdog. Runtime code and benchmark results are unchanged. Local tests and clippy passed again, and CI is rerunning.

  • Restore Linux capture readiness wakeups, streamline tracker lookups, group ordered commits and avoid single-worker DPI staging. Retain the 10,000-packet queue with a bounded 5 ms full-queue wait; add 23 regression tests and update all three language guides.
  • On one Linux ARM64 VM, three interleaved 5-million-packet repetitions versus main 747f265d show TCP/4-worker throughput +92.8%, HTTP/4-worker +79.5%, and UDP/50,000-flow -2.5%. Single-worker DNS remains -2.0% at the median with overlapping ranges. The original 1-million-packet HTTP repeat now shows +6.7% versus main. Native queue sizes differ; these are synthetic-workload results, not universal guarantees.
  • Final live stress trials: complete displayed coverage at 678k to 699k packets/s, and 99.962% to 100% at 50,000 flows. All six final-candidate runs had zero reported capture-backend drops; two retained 100 and 300 queue drops. Independent PCAPs were validated packet-by-packet. All-feature tests (1,102), three privileged checks, formatting, clippy and dependency audit passed locally. Fresh CI is running.

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