Skip to content

Add canonical Python 3.15 sampling collector sources - #9366

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:split/python315-profiler-canonical-sources
Oct 26, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:split/python315-profiler-canonical-sources

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

Complete another coherent slice of the Python 3.15 sampling-profiler source distribution, copied from CPython v3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc) through scripts/update_lib.

  • Add the canonical live-collector package, its upstream tests, advanced/blocking/integration/mode tests, and the remaining Python logo asset: 16 files.
  • Keep every imported file byte-for-byte canonical. No Rust runtime changes, new skips, compatibility shims, or newly implemented native capabilities.
  • Leave _child_monitor.py and test_children.py out. Adding the monitor would activate the existing --subprocesses route before native child discovery is supported.

This is source availability, not implementation or validation of live sampling, curses UI, subprocess profiling, or remote attachment. Existing canonical resource/capability gates are unchanged. The newly included PNG is available in the source tree; this change does not extend the fixed frozen-resource allowlist.

Validation

  • Verified exact CPython bytes for all 16 files and absence of the two excluded child-monitor files.
  • Reviewed internal source dependencies and unchanged upstream capability gating.
  • Host CPython 3.12 syntax-only compilation passes 14 files. Its grammar cannot compile the remaining file's Python 3.15 lazy import; Ruff 0.16.10 with Python 3.15 target parses all 15 Python files, with its experimental-support warning retained.
  • Normal affected repository hooks pass.
  • Default RustPython compile-only check passed: cargo check --locked --offline --bin rustpython.
  • Frozen-stdlib compile-only check passed: cargo check --locked --offline --features freeze-stdlib --bin rustpython. This compiles the added Python sources through RustPython without executing module decorators.

No profiler module imports or runtime tests were run. In particular, canonical remote-debugging decorators can themselves probe a process or launch a child; these were not executed. No claims are made about the full workspace/C API suites, live functionality, GUI/native backends, or cross-platform runtime behavior.

Part of #8954 decomposition; unrelated open offline-test work remains separate.

AI assistance: OpenAI Codex prepared the extraction, static review, validation orchestration, and PR text. Imported source files remain unchanged CPython code.

Copy the remaining live collector package, related canonical tests, and
Python logo asset from CPython v3.15.0 through update_lib. Keep source
availability distinct from supported live sampling or curses execution.

Exclude the child monitor and its tests: introducing that module would
activate --subprocesses before native child discovery is implemented.
Preserve all upstream resource gates without adding skips or shims.

Assisted-by: OpenAI Codex: model version unavailable
@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[ ] lib: cpython/Lib/profiling
[ ] test: cpython/Lib/test/test_profiling

dependencies:

  • profiling (native: main, _child_monitor, _css_utils, _format_utils, _lsprof, _remote_debugging, binary_collector, binary_reader, cli, collector, constants, display, dump, errors, gecko_collector, heatmap_collector, importlib.machinery, importlib.resources, importlib.util, itertools, jsonl_collector, live_collector, marshal, math, module_utils, opcode_utils, profiling.tracing, profiling.tracing._utils, pstats_collector, sample, stack_collector, string_table, sys, time, trend_tracker, widgets)
    • curses (native: _curses, _curses_panel, curses.ascii, has_key, sys)
    • io (native: _io, _thread, errno, msvcrt, sys)
    • opcode (native: _opcode, builtins)
    • platform (native: _wmi, itertools, sys, vms_lib, winreg)
    • site (native: _io, _pyrepl.main, _pyrepl.pager, _pyrepl.readline, _pyrepl.unix_console, _pyrepl.windows_console, atexit, builtins, errno, readline, sitecustomize, sys, usercustomize)
    • sysconfig (native: _sysconfig, _winapi, importlib.machinery, importlib.util, os.path, sys)
    • _colorize, abc, argparse, base64, collections, contextlib, dataclasses, functools, html, json, linecache, locale, optparse, os, pathlib, pstats, re, runpy, selectors, socket, statistics, subprocess, tempfile, threading, traceback, types, typing, uuid, webbrowser

dependent tests: (3 tests)

  • profiling: test_profiling
    • cProfile: test_cprofile test_pstats

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

@youknowone
youknowone marked this pull request as ready for review October 26, 2026 01:09
@youknowone
youknowone merged commit 163b8c5 into RustPython:main Oct 26, 2026
21 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-26T01:10:32.295511Z
We couldn’t complete this review. Comment @codex review to try again.
28567cc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

2 participants