Skip to content

Match remaining native signatures and watchdog thread limits - #9808

Merged
youknowone merged 3 commits into
RustPython:mainfrom
youknowdot:fix/remaining-signatures-20261111
Nov 12, 2026
Merged

youknowone merged 3 commits into
RustPython:mainfrom
youknowdot:fix/remaining-signatures-20261111

Conversation

@youknowdot

@youknowdot youknowdot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Address five API paths not covered by the open signature PRs, based directly on main 4242849852:

  • Generate socket.sendmsg defaults and address from its argument declaration.
  • Generate SQLite adapt's protocol default and backup's 0.25 spelling.
  • Reuse the Connection parameter declaration for sqlite3.connect, preserving CPython's custom-factory forwarding, including missing or duplicate database arguments, unknown keywords, and unconverted values. The adapter moves the original arguments without binding or copying them again.
  • Implement the watchdog's keyword-only max_threads: negative caps truncate immediately, zero uses 100, positive caps limit emitted threads, and an exact count does not add an ellipsis.

No raw-text override is introduced. Existing #9758 handles Clinic line wrapping. #9775 independently corrects timeout keyword acceptance. When combining these branches, preserve both sets of tests in the newly added stdlib_faulthandler.py (an add/add conflict) and add max_threads: 100 to #9775's WatchdogState unit-test initializer.

Inventory

A fresh CPython 3.15.1 comparison of 16,227 observed API paths on Linux found 109 raw-signature differences with default features and 112 with sqlite. Additional RustPython signatures where CPython has none are allowed and excluded from those counts.

Existing PRs cover 105 of the 112 paths: #9758 (61 layout differences), #9756 (24 legacy groups/CSV), #9763 (14 interpreter functions), #9773 (four legacy signatures), and #9551 (two sched_param paths).

This patch changes the five remaining socket/SQLite/watchdog paths. It also exposes Connection's signature through the reused metadata, an allowed additional signature. On this independent branch, exact raw differences decrease 112 to 110: sendmsg and adapt become exact; connect/backup still need #9758's wrapping, and the watchdog still needs #9775's keyword correction plus wrapping. No observed paths are added or removed.

The two uncovered APIs after those PRs are combined are faulthandler.enable and register. They need signal-safe multi-thread dumping, and enable additionally needs a safe native C-stack path. Accepting ignored options or calling the allocation-based normal C-stack helper from a signal handler would not implement those APIs correctly.

Validation

  • Normal commit hooks and independent read-only review passed.
  • Workspace Rust tests passed: 1,543 passed, 20 ignored. Separate C-API tests passed: 149 passed, 2 ignored.
  • Strict workspace/all-target and separate C-API Clippy passed with -D warnings.
  • Final SQLite-enabled release build passed. The three changed snippets and the restored time snippet pass on RustPython and CPython 3.15.0/3.15.1. All eight selected pytest cases pass with each CPython version.
  • Supported release sendmsg tests (SendmsgUDPTest, SendmsgTCPTest) passed: 24 tests. The broader socket suite retains the baseline sandbox failures.
  • Release test_sqlite3 test_faulthandler test_time test_inspect: all four files passed, 1,009 tests run, 92 skipped.
  • Full extra_tests with CPython 3.15.1 and the matching debug implementation: 494 passed, 19 failed, 15 subtests passed. All 19 failure IDs reproduce using the main 4242849852 SQLite-enabled binary: restricted multiprocessing/socket/chown operations and existing CPython snippet/test-runner failures. This is not a full-suite pass.
  • Final release inventory: 16,227 paths retained, 112 → 110 raw mismatches, exactly the five intended API changes plus the allowed Connection signature, and zero existing exact matches regressed.

Review follow-up (370de1e849): moved the watchdog regression unchanged from stdlib_time.py into stdlib_faulthandler.py. The time snippet now exactly matches main. Workspace/C-API tests and both strict Clippy checks were rerun successfully, and all 19 full-suite failure IDs were freshly reproduced with the main SQLite-enabled binary.

CI follow-up (002c447f4e): CI pins CPython 3.15.0, whose sendmsg metadata still has <unrepresentable> defaults and raises ValueError in inspect.signature. Assert that exact older metadata separately while retaining the existing RustPython/CPython 3.15.1 checks. This is independent of #9758 line wrapping and changes no runtime code. Workspace/C-API tests and both strict Clippy checks were rerun successfully for this follow-up; independent review also passed the signature snippet on all three interpreters. The failure reproduces before the fix and passes afterward with CPython 3.15.0. Full extra_tests with that version: 497 passed, 16 failed, 15 subtests passed; all 16 failures reproduce with the main 4242849852 SQLite-enabled binary.

Hosted CI for 002c447f4e passed, including Linux/macOS/Windows snippets, Rust tests, Clippy, Miri, WASI, and cross-target checks. All 26 reported checks succeeded; the optional base/head/CPython comparison was skipped. The branch remains a draft.

AI assistance

Implementation, comparison with CPython, and validation were assisted by Codex.

Reuse connection parameter metadata without changing custom factory forwarding, expose SQLite and sendmsg defaults from their argument declarations, and enforce the watchdog max_threads option.

Assisted-by: Codex:unreported
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • 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 thread extra_tests/snippets/stdlib_time.py Resolved
Address the review by keeping faulthandler coverage in its own snippet. Preserve the existing regression body and restore stdlib_time.py to its original contents.

Assisted-by: Codex:unreported
@codspeed

codspeed Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:fix/remaining-signatures-20261111 (370de1e) with main (5713e58)2

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. ↩

  2. No successful run was found on main (4242849) during the generation of this report, so 5713e58 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

CI uses CPython 3.15.0, whose sendmsg metadata still contains unrepresentable defaults and cannot be parsed by inspect. Assert that older metadata and ValueError explicitly while retaining the existing exact checks for RustPython and CPython 3.15.1.

Assisted-by: Codex:unreported
@youknowone
youknowone marked this pull request as ready for review November 12, 2026 01:39
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-12T01:39:28.594511Z
We couldn’t complete this review. Comment @codex review to try again.
002c447 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@youknowone
youknowone merged commit 644c16e into RustPython:main Nov 12, 2026
28 checks passed
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