Repository navigation
docs(rfc): record measured executor CPU, GIL holders and anon memory - #22065
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that §2.4.4's line "the stub stays the only measured Rust win" stays a finding and doesn't amend §1 or §7. The RFC keeps its [DESIGN-REVIEWED] 5416533 Description read[DESCRIPTION-READ] 8bdc85e27bf38298d78da2f7726bea2bdfe83b4bcc7c9001d4a98ee2dfece213 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
c04dd30 to
551fab9
Compare
|
Stacked follow-up: #22120 answers the two §7 packaging questions that block Phase 3 (Windows signing of an |
551fab9 to
ffd0d5b
Compare
ffd0d5b to
f1475cb
Compare
79c39a3 to
a0e1008
Compare
a0e1008 to
5943f11
Compare
5943f11 to
611fbbf
Compare
|
HOLD at 611fbbf. The code reads as sound and I would approve it, but the branch now conflicts with main. Once that clears, a fresh look can approve it. — crew-pr-reviewer (r114) |
|
Conflict with main cleared at e3a3fae: rebased, with main's newer RFC index notes kept. Docs-only, docs lint passes, and CI is re-running. |
The Python+Rust hybrid RFC left three unknowns in its section 2.3 that only an owner outside the agent sandbox could measure. A new section 2.4 records them, measured read-only on a second host that ran upstream b4cf148 for four days. Executor CPU goes to the mount-namespace sweep (mostly kernel time), the per-request /proc/net/tcp scan and transcript framing. The event loop itself holds the GIL in every caught stall, serializing the slot list. Most of the anonymous remainder is llama.cpp's per-token output buffer, which grows to the longest input and is never shrunk. None of these is a compute-heavy leaf that Rust would remove, so the stub stays the only measured Rust win. Phases, defaults and the accepted status are unchanged.
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at 5416533003ade48ad145c7ac1d084fb0129a1fb4.
Our r114 review found this docs change sound and blocked only on the merge conflict. The new head is a pure rebase onto 958316eea: the rfc-python-rust-hybrid-backend.md patch is byte-identical to e3a3fae, and the README row edit makes the same word-level change, with only the surrounding context updated from main. The change is docs only (2 files), so there is no runtime risk. Required checks are still running; auto-merge waits for them.
— crew-pr-reviewer (r115)
Problem / Motivation
Goal: Record measured answers to the three unknowns the Python+Rust hybrid RFC left open in §2.3, so the decision on how much Rust is worth its packaging cost rests on data.
rfc-python-rust-hybrid-backend.md(accepted 2026-10-13) lists three things only an owner outside the agent sandbox could measure: which functions burn the 69% executor-thread CPU, who holds the GIL during event-loop stalls, and what the 1.3-2.3 GB of unattributed anonymous memory is. §7 makes "any Rust beyond the stub" wait on them. Nobody had measured them.Why it matters
Phase 3 adds a native package to every platform, and the maintainer asked that packaging be settled before the Rust PRs (#19627, #19628) move. Without measurements, the size of the Rust payoff is a guess. With them, follow-up work goes to the language that actually removes each cost.
Not a goal
accepted, and §1 and §4 are untouched.PYTHONTRACEMALLOC=25.What changed (motivation → approach → change)
b4cf148542for four days (RSS 3.08 GB + 0.70 GB swapped). Every method was read-only and needed no sudo:py-spy record/dump --nonblocking, a 10 Hz/api/healthprobe that dumps stacks during a stall, per-thread CPU from/proc/<pid>/task/*/stat, an allocator-header scan of anonymous memory (smaps+pagemap+/proc/<pid>/mem, present pages only), the gateway's own 98-hour diag recorder, and an embedder replay at8fd2af91d9that pins each llama.cpp buffer byte for byte.rfc-python-rust-hybrid-backend.md:/proc/net/tcppeer-PID scan, and transcript framing.GET /api/chat/slotsfor 186-463 ms once a minute. No executor thread held it.[\r\n]regex.bytes.findframes the same bytes at 4.9 GB/s.ptrace_scope=0.last-audited/audited-atare bumped after every code reference was re-checked at207ed5ae4c.implementation-prsnow lists perf(mcp-gateway): Rust MCP stub, used by default when built #19627, the open draft that implements Phase 3's stub. The status line says nothing is on main, and that Phases 1 and 2 have no implementation PR.docs/request-for-change/README.md: the index row's verified commit and the perf(mcp-gateway): Rust MCP stub, used by default when built #19627 draft, plus the dated re-audit note other rows carry.Backwards compatibility
Compatible: documentation only.
Removes nothing: no phase, decision or reference is removed; §2.3's original commands stay as written.
Tests
N/A — documentation only.
scripts/docs-lint.shandscripts/check_brand_name.pypass.Manual verification
207ed5ae4c. The §2.4 paths still run there: the slot-list endpoint still serializes on the loop; the mount sweep, the transcript framing and the vendored embed loop are unchanged since the measured build;_linux_tcp_peer_pidnow lives inplatform_compat_ports.py.Related Issues
Follow-ups opened from these measurements, each linked from §2.4.4:
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.