Skip to content

Mark wrapper descriptors as method descriptors - #9286

Merged
youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:split/wrapper-method-descriptor-315
Oct 22, 2026
Merged

youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:split/wrapper-method-descriptor-315

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Mark wrapper_descriptor as METHOD_DESCRIPTOR, matching CPython 3.15.0. This is the isolated descriptor-flag hunk from the Python 3.15 upgrade work, not the wrapper lifetime/GC changes tracked separately in #8944.

The flag allows existing method lookup paths to retain the descriptor and prepend the receiver rather than allocate a bound wrapper. The existing direct, bound and vectorcall paths already perform the same receiver validation and slot argument dispatch. The only Lib change removes one obsolete RustPython expected-failure marker from test_monitoring.TestLoadSuperAttr.test_vs_other_type_call, regenerated through update_lib from pinned CPython 3.15.0. All canonical assertions and other local adaptations are preserved.

Validation

  • Fresh dedicated-target CLI build with freeze-stdlib passed. All 3,631 tracked source/symlink hashes matched before and after the build.
  • Two selected unchanged canonical methods passed on main baseline, candidate and pinned CPython 3.15.0: test_descr.OperatorsTest.test_lists and test_descr.ClassPropertiesAndMethods.test_pow_wrapper_error_messages.
  • One unchanged flag assertion extracted from canonical test_call failed on baseline and passed on candidate and CPython. This is an external observation, not execution of the CAPI-dependent enclosing test or canonical-suite coverage.
  • Candidate observation process completed within the fixed 15-second, sampled 512 MiB RSS, 6 GiB address-space and core-zero bounds.
  • Threaded VM check (170s), non-threaded VM check (46s), strict affected VM all-target Clippy (118s), and normal hooks (4s) passed.

These narrow controls do not establish correctness of every optimized dispatch path or a performance improvement. Full workspace/CAPI runtime gates and the release-mode whole-module command have not been run locally and remain outstanding; actual hosted executed steps will be tracked separately. The full CAPI-dependent method and whole test modules were not executed locally.

Monitoring CI repair

The original head 0af373cf failed hosted Ubuntu tests because the now-correct test_vs_other_type_call unexpectedly succeeded, including the workflow's built-in rerun. On the exact unchanged canonical selector, the sealed main baseline fails because int.__repr__ CALL/C_RETURN events report MISSING instead of receiver 0; the sealed candidate and pinned CPython both pass with zero skips. The updater-generated correction at 87db988c removes exactly that expected-failure decorator, with no native change or assertion weakening. All three local runs used the fixed 15-second / 512 MiB sampled-RSS guard; normal hooks passed. These are one-selector results, not a local full-module or full-suite claim. Fresh hosted CI is pending.

AI assistance

This change and its source review/validation were prepared with OpenAI Codex assistance. No human review is claimed by this disclosure.

Performance qualification for measured head 0af373cf

CodSpeed executed the benchmark and reported a passing gate, but comprehension_list.py increased from 803.995 to 891.509 µs (−9.8164% efficiency). The report exposes RELATIVE detection, allowedRegression=0.1, confidenceLevel=0.99, and no benchmark-specific override. Its NoChange classification therefore does not establish equal performance.

The comparison uses main bcfad3554ef66264d08c2d030d1fa13aaab5c03c and PR head 0af373cff4c5b603a3d723f28d3fcb5ba8f6c5e8, tested as merge 8c101451f39dd8d8e18c4bf393c0ed6f73aded0c. Both named environment fingerprints are ffdf350d53eb784b, but the baseline job used kernel 7.0.0-1017-azure and runner image 20261018.339.1, whereas the head used kernel 6.17.0-1022-azure and image 20261012.334.1. Both used CodSpeed runner 5.4.2. This is not a fully matched-environment comparison and does not establish a cause. Four other benchmarks were skipped with baseline results reused.

Match CPython 3.15 wrapper_descriptor flags so existing method lookup
can use the descriptor's direct receiver-prepending dispatch path.

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

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3d6f136f-cd4b-409d-b6d0-b30829c2df54
📥 Commits

Reviewing files that changed from the base of the PR and between bcfad35 and 87db988.

⛔ Files ignored due to path filters: 1
  • Lib/test/test_monitoring.py is excluded by !Lib/**
📒 Files selected for processing: 1
  • crates/vm/src/builtins/descriptor.rs
+---------------------------------------------------------------------------------------------------------------------------------------+
| Use tracer bullets to find the target. Tracer bullets let you home in on your target by trying things and seeing how close they land. |
+---------------------------------------------------------------------------------------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • 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.

@codspeed

codspeed Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:split/wrapper-method-descriptor-315 (0af373c) with main (bcfad35)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Regenerate test_monitoring from pinned CPython 3.15.0 with the updater, preserving every other adaptation. The METHOD_DESCRIPTOR flag now supplies the canonical receiver in int.__repr__ CALL/C_RETURN events.

Assisted-by: OpenAI Codex:model-version-unavailable
@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

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

[x] test: cpython/Lib/test/test_monitoring.py (TODO: 2)

dependencies:

dependent tests: (no tests depend on monitoring)

Legend:

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

@youknowone
youknowone marked this pull request as ready for review October 22, 2026 01:15
@youknowone
youknowone merged commit 3b87cbe into RustPython:main Oct 22, 2026
21 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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 ✅ Completed 2026-10-22T01:21:31.913355Z 87db988 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