Skip to content

Update Lib free-threading core API tests to Python 3.15 - #9428

Merged
youknowone merged 3 commits into
RustPython:mainfrom
youknowdot:youknowdot/free-threading-core-tests-315-20261028
Oct 28, 2026
Merged

youknowone merged 3 commits into
RustPython:mainfrom
youknowdot:youknowdot/free-threading-core-tests-315-20261028

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Use scripts/update_lib migrate to add the canonical Python 3.15 free-threading package initializer and eighteen reviewed API test modules: bisect, exceptions, functions, functools, threading, types, string template races, methodcaller, enumerate, reversed, zip, itertools combinations/product, context, function annotations, list mutations, suggestions, system settings, and regular expressions.
  • All nineteen files (991 lines) are byte-identical to CPython 3.15.0 d220409a13b77de7a6c30abe16ea90db01528edc. No test edits, RustPython skips, native changes, or dependency changes.
  • This is a reviewed subset, not all free-threading tests. test_collections and test_csv remain deferred: deque mutation errors and CSV reader generation errors differ from canonical concurrency expectations. Their CPython critical-section semantics need separate native work; simply locking across arbitrary user callbacks risks reentrant deadlocks.

Runtime scope and limitations

RustPython advertises Py_GIL_DISABLED=1, so the canonical package gate does not skip these tests. Existing APIs and native locking paths were source-reviewed, but concurrency behavior has not been executed or proven compatible locally. There are 44 class test methods (approximately 46 cases by static inheritance, not runtime discovery; the combinatoric module's top-level test_concurrent_iteration function is only a helper).

Most workers have fixed loops or drain finite immutable inputs. List append/extend readers instead depend on successful completion of their 5,000-item writer; failure of that writer may strand readers. The list group has up to 11 simultaneous workers, and its reader iteration count is scheduling-dependent. The context writer is event-terminated: readers set the event in finally, and start_threads also calls its unlock callback to set it. Barriers and several direct joins/executor waits have no individual timeout. The existing native CI regrtest --timeout 600 provides outer subprocess containment, not a guarantee of termination, deadlock freedom, or runtime success.

Coverage is deliberately described narrowly: zip primarily checks concurrent exhaustion, not atomic tuple pairing or ordering; enumerate does not assert item/index pairing; combinations tests r=2, not the separate r=0 state path. Passing these tests would not prove general concurrent iterator atomicity. The regex scanner regression permits executions without a concurrent-entry error and checks neither ordering nor match counts: RustPython still lacks CPython's scanner execution guard, so this does not establish scanner concurrency equivalence. The canonical integer-string-limit test captures the final loop variable in its lambdas, so it exercises simultaneous setters rather than mixed getters/setters; the dlopenflags test retains its canonical capability skip. Those broader native semantics remain separate compatibility work.

Validation

  • Canonical Git-blob equality for all nineteen paths and static AST/native-source review, including independent review.
  • PYTHONPATH=scripts <CPython 3.15 host> -m unittest discover -s scripts/update_lib/tests: 228 passed after the four-file extension.
  • Applicable repository hooks passed on all nineteen files (merge-conflict check, ruff format/check, redundant test patch check); git diff --check passed.
  • No local concurrency test execution, native build, or full interpreter test run. Hosted CI is pending.

Migrate eight canonical files with scripts/update_lib. Defer deque and CSV concurrency tests pending native semantics work.

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

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 19
  • Lib/test/test_free_threading/__init__.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_bisect.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_context.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_enumerate.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_exceptions.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_func_annotations.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_functions.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_functools.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_itertools_combinatoric.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_list.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_methodcaller.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_re.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_reversed.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_string_template_race.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_suggestions.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_sys.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_threading.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_types.py is excluded by !Lib/**
  • Lib/test/test_free_threading/test_zip.py is excluded by !Lib/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • 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.

codex added 2 commits October 28, 2026 20:58
Migrate seven Python 3.15 modules using scripts/update_lib, preserving canonical assertions and package gates. Concurrency behavior remains for hosted CI verification.

Assisted-by: OpenAI Codex: model version unavailable
Migrate four unchanged Python 3.15 modules with scripts/update_lib. Preserve canonical coverage limits; scanner execution-guard parity remains separate native work.

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:

[ ] test: cpython/Lib/test/test_free_threading

dependencies:

dependent tests: (no tests depend on free_threading)

Legend:

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

@youknowone
youknowone marked this pull request as ready for review October 28, 2026 13:00
@youknowone
youknowone enabled auto-merge (squash) October 28, 2026 13:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T13:01:04.523332Z
We couldn’t complete this review. Comment @codex review to try again.
7416fab 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.

@youknowone
youknowone merged commit 95544a5 into RustPython:main Oct 28, 2026
21 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.

3 participants