100 Commits
Author SHA1 Message Date
youknowdotandyouknowdot 058bebf0f0 Add canonical cross-interpreter serialization tests and fixture bridges (#9408)
* Add canonical cross-interpreter serialization tests and fixture bridges

Import the complete CPython test_crossinterp module and provide its capsule bridges using existing serialization and validation logic. Keep fixture modes private instead of expanding SharedValue or interpreter lifecycle APIs.

Assisted-by: OpenAI Codex: model version unavailable

* Simplify canonical cross-interpreter fixture dispatch

Match CPython 3.15.0 mode dispatch with one private constructor instead of six forwarding entry points. Keep generic marshal data distinct from code transport, preserve capsule ownership checks and pure-script validation, and leave the canonical tests unchanged.

Assisted-by: OpenAI Codex: model version unavailable

---------

Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-28 10:11:59 +09:00
b25ab5e76b Align XML backend and canonical libraries with Python 3.15 (#9197)
* Align XML parsing and libraries with Python 3.15

Retain the existing XML backend accounting changes and their explicit registry publication limitation. Preserve canonical XML tests and existing RustPython guards, including multiline marker explanations through update_lib.

Assisted-by: OpenAI Codex:model version unavailable

* Retire proven XML guards and sync canonical consumers

Assisted-by: OpenAI Codex:model version unavailable

* Rebase vendored xml onto 1.4.0

Replace the vendored crate sources with the published xml 1.4.0 archive
and reapply the amplification accounting patch on top of it. The two
lexer hunks that conflicted with the new line-ending normalization are
merged into the 1.4.0 read loop. The patch no longer normalizes CR in
entity values or collapses CRLF in attribute values, because the 1.4.0
lexer and attribute reader already do so.

Update the checksums, recorded upstream commit, archive hash and
provenance notes, and require version 1.4 for the path dependency.

Assisted-by: Claude Code:claude-opus-5-5

* Remove stale SAX external resolver expected failure

Linux and macOS canonical CI both demonstrate that the existing
unsupported-scheme resolver test passes. Retire only its expected-failure
decorator through update_lib, preserving its canonical assertions.
This does not implement external DTD parsing.

AI assistance: dot diagnosed CI, migrated the marker, and reviewed the
source delta and normal-hook validation; the model version is not exposed.

Assisted-by: dot: model version not exposed

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-27 21:02:59 +09:00
youknowdotandCodex 75df7a8c2e Implement PEP 798 comprehension unpacking (#9342)
* Support PEP 798 comprehension unpacking

Extract the remaining Python 3.15 comprehension unpacking implementation
from the integration branch. Use existing list/set/dict update operations
and an explicit inner iterator loop for generator unpacking. Align the
public DictComp AST representation and schema with CPython.

Migrate test_unpack_ex and test_unparse with scripts/update_lib from
CPython d220409a13b77de7a6c30abe16ea90db01528edc. Preserve existing Rust tests;
add no duplicate regression tests or snippets.

AI-assisted source extraction, canonical migration, and independent source
review with OpenAI Codex. Runtime validation is not yet complete.

Assisted-by: OpenAI Codex:model version unavailable

* Improve selected unpacking diagnostics and refresh canonical exception tests

Normalize six supported comprehension-unpacking diagnostics using existing parser context. Restrict the dictionary-spread hint to its first entry to avoid changing unrelated diagnostics.

Migrate the whole test_exceptions module from CPython d220409a13b77de7a6c30abe16ea90db01528edc with the existing updater, preserving only its two existing RustPython markers. Ruff sources and dependency pins are unchanged.

Six focused check/build/strict Clippy gates passed. A paired 34-input compile-only comparison retains six canonical diagnostic improvements, with eight of fifteen canonical cases still differing; this is not full test_exceptions or CI validation.

* Fix mapping-rest error locations and retire stale encoding xfail

* Match remaining unpacking diagnostics without changing Ruff

Use exact retained AST and error ownership to normalize the remaining CPython 3.15 unpacking diagnostics. Reparse only the owned call argument slice with the unchanged Ruff parser when its original recovery loses generator clauses.

Validated all 30 canonical compile-only cases in exec and doctest-style single modes against CPython 3.15.0, plus finite surrounding controls. Targeted compiler Clippy and source-bound builds passed. Full CI is pending. Cspell alone was omitted with the maintainer’s explicit one-commit approval because its npm bootstrap downloads returned HTTP 403; all other applicable configured commit hooks ran.

AI assistance: dot authored, reviewed, and validated the changes. The runtime does not expose its exact model version.

Assisted-by: dot: model version not exposed

---------

Co-authored-by: Codex <codex@openai.com>
2026-10-27 13:29:59 +09:00
youknowdotandyouknowdot b811715799 Remove one-off partial update_lib migration modes (#9394)
Keep whole-file and package migration with existing marker, doctest and explicit customization preservation. Retire copy-test and selected assignment/function/export import machinery rather than maintaining extra partial-file update paths.

Remove the separate historical-file deletion command after its migration use. This does not delete any Lib files or make whole-directory migration prune destination-only files; future obsolete-file removal still needs explicit review.

Preserve dependency handling and contributor content-comparison fixes. All 103 retained synthetic migration, patch and copy-library tooling tests pass under an isolated bounded host Python harness. No RustPython runtime or migrated Lib source was executed.

Assisted-by: OpenAI Codex:model version unavailable

Co-authored-by: youknowdot <youknowdot@users.noreply.github.com>
2026-10-26 21:07:23 +09:00
youknowdot 1052e613ed Preserve interpreter-boundary diagnostics and syslog restrictions (#9365)
* Preserve Unicode in thread unraisable messages

Keep the callable representation as WTF-8 for unraisable hooks and audit callbacks. Preserve the existing String entry point and stderr fallback; this does not claim lossless stderr rendering.

Assisted-by: OpenAI Codex:model unavailable

* Use the WTF-8 string conversion constructor

Use the existing From<&str> implementation to copy the message prefix without changing Unicode semantics.

Assisted-by: OpenAI Codex:model unavailable

* Preserve cross-interpreter marshal error causes

Wrap failures from existing code/function serialization helpers as NotShareableError, matching the CPython 3.15 marshal boundary while retaining the original exception cause. No new test C API or lifecycle behavior.

Assisted-by: OpenAI Codex:model-unavailable

* Enforce syslog interpreter boundaries and sync queue cleanup

Reject subinterpreter openlog/closelog before audit or host mutation, and
reject implicit syslog opening after audit when the process logger is not
already open, matching CPython 3.15 guard placement and error text.
Already-open logging and setlogmask remain unchanged.

Migrate concurrent/interpreters/_queues.py through scripts/update_lib to
CPython d220409a13b77de7a6c30abe16ea90db01528edc, removing unused eager
pickle import and exception targets. Native serialization imports pickle
on demand; module import timing and debug locals may nevertheless differ.

No new fixtures or interpreter lifecycle mechanisms are introduced.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-26 14:15:38 +09:00
youknowdotandCodex 084f5c7e7a Add native offline profiler codec invariant coverage (#9383)
Extract the unchanged Reader::open decode body into a private owned-buffer
parse helper and add native representation tests for varints, stack depth,
RLE count bounds, and repeated empty records. Preserve all existing tests.

This adds coverage, not a new production decoder fix. Test code passes
cargo check --tests and strict Clippy --tests, but has not been executed.
OpenAI Codex assisted extraction, review, and compile-only validation.

Assisted-by: OpenAI Codex:model version unavailable

Co-authored-by: Codex <codex@openai.com>
2026-10-26 14:14:10 +09:00
youknowdot 9f288b9f5a Enable rustyline read-ahead buffer preservation (#9382)
Enable buffer-redux on the workspace rustyline dependency and add its
locked buffer-redux 1.1.0 dependency. Keep existing dependency versions
and checksums, including nix, libc and rustix, unchanged.

RustPython retains a rustyline Editor across interactive prompts. On
Unix, this feature lets a successful readline submission save unread
buffered input for the next read instead of dropping the old reader's
buffer. This is based on the source call chain, not a runtime reproduction.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-26 14:13:46 +09:00
youknowdot 9710aa5162 Test native IR invariants and harden append-fold helper contract (#9370)
Retain direct IR coverage for constant-pool representations, malformed
append-sequence rejection, and vacated instruction-slot metadata reuse.
Reject non-unit terminal append depths at the private folding helper.
Existing production callers already require depth one; this is defensive
contract hardening, not a newly fixed reachable interpreter bug.

Preserve the existing helper structure and all pre-existing tests. The
three added native tests are unchanged from the Python 3.15 upgrade work.

Validation: codegen check and strict Clippy with --tests, a --lib --no-run
build, and exactly three bounded native IR tests (one pass, zero ignored
each). No Python, parser, VM or lifecycle payload was executed. The
symmetric SetAdd guard has no dedicated depth-two assertion.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-26 10:12:48 +09:00
youknowdotandCodex 557995b3e5 Sync canonical gated test sources and Lib metadata (#9369)
Assisted-by: OpenAI Codex: model version unavailable

Co-authored-by: Codex <codex@openai.com>
2026-10-26 10:12:14 +09:00
youknowdot dca9dfdf38 Add canonical Python 3.15 optional native integration sources (#9368)
Copy curses frontend sources and canonical curses, DBM, Tcl and DTrace
integration tests from CPython v3.15.0 through update_lib. Preserve
upstream optional-native/resource/configuration gates and canonical file
modes, without adding native implementations or custom skips.

Validate source identity, hooks and default/frozen compile-only checks.
Native runtime integration and probe execution remain unvalidated.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-26 10:10:47 +09:00
youknowdot 163b8c557c Add canonical Python 3.15 sampling collector sources (#9366)
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
2026-10-26 10:09:16 +09:00
youknowdot 1170a337cc refactor: share PyTime conversions with time.sleep (#9362)
Move the existing conversion helper into the production time module and reuse it from sleep, preserving conversion bodies and internal C-API argument binding.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-26 10:07:47 +09:00
youknowdot 0dca682e45 Update Python 3.15 test harness helpers and discovery (#9364)
Assisted-by: OpenAI Codex: model version unavailable
2026-10-25 15:14:33 +00:00
youknowdot d1c3cb745a Add canonical offline sampling profiler tests (#9360)
Import test_async.py and test_profiler.py with scripts/update_lib migrate
from CPython 3.15.0 at d220409a13b77de7a6c30abe16ea90db01528edc.

Validate the 37 existing offline async graph and statistics-rendering
tests without changing canonical assertions or markers.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-25 21:30:50 +09:00
youknowdot 901eb883a7 Add canonical sampling profiler CLI for offline replay (#9358)
Import the CLI, entry point, error type, coordinator dependency, and CLI
tests with scripts/update_lib migrate from CPython 3.15.0 at
d220409a13b77de7a6c30abe16ea90db01528edc.

This frontend follows the existing offline collector/codec support. Live
attach, run, and dump remain unsupported and unvalidated.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-25 10:16:32 +00:00
youknowdot 9bd84b2f13 Handle full-width operands in the None-return scanner (#9347)
Use decoded logical instructions rather than the preceding raw operand byte. Check referenced constants by None identity and decode common constants without panicking.

Assisted-by: OpenAI Codex:model unavailable
2026-10-25 15:12:50 +09:00
youknowdot 2efa217efe Restore canonical traceback Levenshtein coverage (#9346)
Import the unchanged Python 3.15.0 fixture with the official library updater
and retire the missing-fixture expectedFailure after validating the existing
distance and threshold tests. Preserve all assertions and unrelated markers.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-25 15:12:19 +09:00
youknowdot 65ee7bae8b Align Python 3.15 bytecode tooling (#9344)
Extract independent bytecode tooling from the Python 3.15 integration. Decode packed import-name arguments without changing older-interpreter fallback behavior, validate canonical opcode numbering, bound deoptimization families to the enum, and reuse parsed CPython analysis.

Validated generators reproduce tracked metadata exactly; normal, lazy and eager import fallback matches canonical disassembly. No interpreter, generated metadata or test changes.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-25 15:11:10 +09:00
youknowdotanddependabot[bot] 8c0c242dc8 Align profiler bindings and capability checks with Python 3.15 (#9340)
* Align offline profiler argument binding with Python 3.15

Accept the canonical keyword names for binary sample writes and native
context exits. Resolve the argument layout before numeric callbacks,
then preserve float-subclass payloads while accepting numeric protocols
for required and optional profile statistics.

AI-assisted source extraction, implementation, and source review with
OpenAI Codex. Runtime validation remains pending.

Assisted-by: OpenAI Codex:model version unavailable

* Restore the offline profiler capability flag

Preserve the original mega branch's zero-valued process_vm_readv
capability export. The native live unwinder remains unsupported; this
restores the public feature query without claiming live inspection support
or changing canonical test helpers.

AI-assisted source preservation and review with OpenAI Codex.

Assisted-by: OpenAI Codex:model version unavailable

* Restore finite-EOF table bounds for offline profiles

Match CPython's EOF-wide table count and decoding windows while retaining
checked offsets, allocation limits, cursor bounds, and replay checks.
This restores the original mega's finite-file contract without changing
canonical tests or the already validated argument-binding implementation.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve symtable warning exceptions and original filenames (#9282)

Keep warning-hook exceptions untouched instead of rewriting SyntaxError
subclasses. Thread the original Python filename through parser warning
emission and fresh warning-as-error SyntaxError construction, preserving
fsdecoded bytes paths and lone surrogates.

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

* build(deps): align the Cranelift 0.136 dependency family (#9341)

* build(deps): bump the wasmtime group across 1 directory with 2 updates

Bumps the wasmtime group with 2 updates in the / directory: [cranelift](https://github.com/bytecodealliance/wasmtime) and [cranelift-module](https://github.com/bytecodealliance/wasmtime).


Updates `cranelift` from 0.135.2 to 0.136.3
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)

Updates `cranelift-module` from 0.135.3 to 0.136.3
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)

---
updated-dependencies:
- dependency-name: cranelift
  dependency-version: 0.136.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: wasmtime
- dependency-name: cranelift-module
  dependency-version: 0.136.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: wasmtime
...

Signed-off-by: dependabot[bot] <support@github.com>

* Align cranelift-jit with the 0.136 dependency family

Update cranelift-jit alongside cranelift and cranelift-module so the JIT shares their LibCall, FuncId, and Module trait identities. Regenerate only the affected dependency lock entries, preserving the original dependency PR changes.

AI assistance covered the dependency diagnosis, alignment, and static review.

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Support selective canonical function migration

Add hash-pinned function selection to the official Lib migration tool,
preserving canonical source bytes and rejecting ambiguous dependencies.

Assisted-by: OpenAI Codex:model version unavailable

* Detect CPython runtimes for canonical inspection feature checks

Add native runtime-cookie detection and import the exact Python 3.15
inspection helpers and tests through the official Lib migration tool.
Preserve the offline profiler argument and finite-EOF corrections.

Assisted-by: OpenAI Codex:model version unavailable

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-25 15:09:49 +09:00
youknowdotanddependabot[bot] 5bccf31156 build(deps): align the Cranelift 0.136 dependency family (#9341)
* build(deps): bump the wasmtime group across 1 directory with 2 updates

Bumps the wasmtime group with 2 updates in the / directory: [cranelift](https://github.com/bytecodealliance/wasmtime) and [cranelift-module](https://github.com/bytecodealliance/wasmtime).


Updates `cranelift` from 0.135.2 to 0.136.3
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)

Updates `cranelift-module` from 0.135.3 to 0.136.3
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/commits)

---
updated-dependencies:
- dependency-name: cranelift
  dependency-version: 0.136.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: wasmtime
- dependency-name: cranelift-module
  dependency-version: 0.136.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: wasmtime
...

Signed-off-by: dependabot[bot] <support@github.com>

* Align cranelift-jit with the 0.136 dependency family

Update cranelift-jit alongside cranelift and cranelift-module so the JIT shares their LibCall, FuncId, and Module trait identities. Regenerate only the affected dependency lock entries, preserving the original dependency PR changes.

AI assistance covered the dependency diagnosis, alignment, and static review.

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-24 05:53:21 +00:00
youknowdot 5a0ded80dc Preserve symtable warning exceptions and original filenames (#9282)
Keep warning-hook exceptions untouched instead of rewriting SyntaxError
subclasses. Thread the original Python filename through parser warning
emission and fresh warning-as-error SyntaxError construction, preserving
fsdecoded bytes paths and lone surrogates.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 14:36:59 +09:00
youknowdotandCodex 413710c107 Complete PyTime conversion fixtures and repair existing helpers (#9317)
* Fix rounding and bounds in existing PyTime test helpers

Extract the already-exposed conversion helper prerequisite from the broader #9143 surface without adding new test C-API exports or changing time.sleep.

Assisted-by: Codex:unknown

* Complete PyTime conversion fixtures in _testinternalcapi

Stack the eight consumed conversion APIs on the existing-helper prerequisite in #9317. Keep the arithmetic local to the real fixture consumers; do not expose _testcapi or change sleep/lifecycle behavior.

Assisted-by: Codex:unknown

---------

Co-authored-by: Codex <codex@openai.com>
2026-10-24 11:29:06 +09:00
youknowdot a788de29da Fix interpolated string warning diagnostic locations (#9314)
* Use closing-token locations for interpolated body warnings

Track CPython string-parser fragment anchors separately from escape source offsets. Preserve scoped error-line text and mode-specific final newlines with lazy sparse location indexing.

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

* Fix lint checks for interpolated warning diagnostics

Assisted-by: OpenAI Codex (model version unavailable)

* Match CPython interpolated warning phases and fragment diagnostics

Reconstruct body and format-spec decoder fragments, preserve tokenizer/parser action order and pending Single/type-comment errors, and match Unicode protection plus scoped numeric and ordinary-token diagnostics.

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

* Use physical final-line locations for ordinary exec warnings

Keep warning and error coordinates consistent across bare CR, CRLF, and LF while retaining file-input synthetic newlines.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 11:28:44 +09:00
youknowdot 1cd1b5d09f Preserve tokenizer-only compiler warning order (#9316)
Use the collected lexical warning order for valid Exec/Eval inputs without parser-origin escape events. Keep tokenizer errors terminal and retain mixed-origin, invalid-source, and Single fallback behavior.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 08:11:22 +09:00
youknowdotandyouknowdot 01c65128e4 Replace syn-ext with native syn 3 macro helpers (#9333)
Migrate macro metadata and item handling to syn 3, preserving option diagnostics and doc trimming. Add focused parser and attribute-edit tests.

Assisted-by: OpenAI Codex:model version unavailable

Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-24 08:08:57 +09:00
youknowdot 0dc77faaab Fix busy interpreter test readiness race (#9328)
Publish readiness only after the main interpreter has completed its first operation, and bound the detached subinterpreter readiness wait. Preserve the original progress assertions, main deadline, and safepoint.

AI assistance covered diagnosis, source changes, review, and focused validation.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 01:00:20 +09:00
youknowdotandyouknowdot c70e9b8443 Sync selected Python 3.15 core library tests and repr type errors (#9321)
* Sync Python 3.15 core library tests and repr type errors

Synchronize ten selected library paths from CPython 3.15.0 at
d220409a13b77de7a6c30abe16ea90db01528edc using the canonical updater,
retaining existing RustPython adapters and failure markers.

Match generic __repr__ invalid-result errors to the qualified type-name
format required by the canonical ExceptionGroup regression, preserving
string results and exceptions raised by the implementation.

Implementation, source review, and validation were AI-assisted. The model
version identifier is unavailable; automated checks are not human
verification. Bounded validation covers 43 passes and one canonical skip,
not the full repository suites.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve original escape decoder consumed length after callbacks

Keep the original input length as consumed after successful unicode-escape
and raw-unicode-escape decoding, including error-handler input replacement.
Only report the current cursor when a non-final decode stops on incomplete
input, matching CPython's codec wrappers and incomplete exits.

Fix the canonical Unicode escape mutation regression that failed CI on
Linux, macOS and Windows. Preserve all Lib tests and existing assertions.
Bounded Linux validation: 55 passes and one canonical skip, CLI build and
strict common/VM Clippy passed. Full repository suites were not run.

Implementation, source review, and validation were AI-assisted. The model
version identifier is unavailable; automated checks are not human
verification.

Assisted-by: OpenAI Codex:model version unavailable

---------

Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-23 18:01:14 +09:00
youknowdotandyouknowdot afe5d9030a Separate constructor and instance vectorcall dispatch (#9320)
Keep constructor fast paths separate from per-instance vectorcall support.
Track automatic eligibility without discarding raw support required by
PyVectorcall_Call, and recheck eligibility in retained callable wrappers.

Implementation and source review were AI-assisted. The model version
identifier is unavailable; automated checks are not human verification.

Assisted-by: OpenAI Codex:model version unavailable

Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-23 17:59:19 +09:00
youknowdotandCodex ec299f3844 Avoid attaching C API worker templates under the interpreter lock (#9318)
Keep worker VM cloning separate from attachment and add a native structural regression test.

Assisted-by: OpenAI Codex

Co-authored-by: Codex <codex@openai.com>
2026-10-23 17:57:47 +09:00
youknowdot d8b8e47d74 Sync canonical asyncio, marshal and offline profiling libraries (#9315)
Migrate nine substantial stdlib and canonical test modules from CPython
v3.15.0 through scripts/update_lib, preserving RustPython adaptations.
Include offline stack formatting without live process inspection or
changes to the held profiling frontend and test-support closure.

Assisted-by: Codex:unknown
2026-10-23 17:56:04 +09:00
youknowdot 73b6806608 Limit single-input parser warning emission to the first logical input (#9304)
Keep later numeric warnings available after parser warning escalation. Preserve compound tokenizer warning emission and legacy malformed-source fallback.

Assisted-by: OpenAI Codex:gpt-6-astra
2026-10-23 17:54:12 +09:00
youknowdot 94f92e4ab8 Use final numeric character for warning error offsets (#9305)
Assisted-by: OpenAI: GPT-6.1
2026-10-22 23:24:53 +09:00
youknowdot 36f8e8937a Recover numeric warning errors in AST single mode (#9303)
Match ordinary single compilation by allowing later numeric warnings raised as errors to take precedence after a parser-origin escape warning. Preserve tokenizer-origin guards and the separate prompt path.

Assisted-by: Codex:unknown
2026-10-22 23:23:49 +09:00
youknowdot 6c171fffe1 Align mapping collection and call unpacking with Python 3.15 (#9302)
* Align mapping collection and call unpacking with Python 3.15

Preserve iterator exceptions and exact-list results when collecting mapping
methods, defer callable formatting, and retain exact-dict stored hashes.
Synchronize complete test_extcall with CPython v3.15.0.

Assisted-by: Codex:unknown

* Update pickle and pickletools libraries for Python 3.15

Synchronize the six coherent serialization modules with CPython v3.15.0
through update_lib, retaining existing RustPython adaptations.

Assisted-by: Codex:unknown
2026-10-22 23:23:15 +09:00
youknowdotandCodex 0b0a360764 Use __main__ when compiling filesystem scripts (#9301)
Forward script compiler warnings through the typed module-aware entry point. Sync canonical command-line script coverage from CPython d220409a13b77de7a6c30abe16ea90db01528edc with the existing RustPython marker preserved.

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

Co-authored-by: Codex <codex@openai.com>
2026-10-22 12:02:16 +00:00
youknowdot 4cb36ea8f2 Synchronize core language tests with Python 3.15 (#9300)
Regenerate eight canonical language and container test modules using
scripts/update_lib at CPython d220409a13b77de7a6c30abe16ea90db01528edc.
Retain RustPython adaptations except the formatting expected-failure
marker confirmed stale by an XPASS and a subsequent unmarked pass.

AI-assisted source selection, synchronization, dependency review and
bounded validation using OpenAI Codex.

Assisted-by: Codex:unknown
2026-10-22 11:14:40 +00:00
youknowdot eb03691084 Order parser warnings for valid source while preserving recovery boundaries (#9296)
Reuse the parser warning collector only for valid, recovery-eligible source. Preserve malformed-source and tokenizer-origin interpolation fallback.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:46:20 +00:00
youknowdot ccab27c12a Synchronize developer tools with Python 3.15 (#9298)
Regenerate bdb, pdb, codeop, modulefinder and the canonical modulefinder
test using scripts/update_lib at CPython 3.15.0
d220409a13b77de7a6c30abe16ea90db01528edc.

AI-assisted source selection, synchronization, dependency review and
bounded validation using OpenAI Codex.

Assisted-by: Codex:unknown
2026-10-22 09:36:51 +00:00
youknowdot 1ba1107115 Align ctypes call ownership and C error state with Python 3.15 (#9218)
* Align ctypes call ownership and C error state with Python 3.15

Keep native raised errors separate from handled exceptions and preserve them across teardown callbacks. Import the related canonical ctypes call and type contracts.

Assisted-by: OpenAI Codex: model version unavailable

* Enumerate ctypes shared libraries natively on Linux and Android

Copy loader-owned names before Python filesystem decoding and update the related canonical ctypes utility and discovery tests from CPython 3.15. Preserve existing platform paths and dllist test markers.

Assisted-by: OpenAI Codex: model version unavailable

* Enable canonical dllist system enumeration coverage on Linux

Regenerate the pinned test through update_lib patches with reviewed marker data. Preserve other platform conditions and the unavailable extension-fixture guard.

Assisted-by: OpenAI Codex: model version unavailable

* Match Python float and long-double C argument representations

Use the existing Python float formatter for float and double C argument representations. Keep long-double arguments on the canonical generic-address representation path. Preserve the unchanged canonical parameter repr assertions.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-22 18:16:22 +09:00
youknowdot 1ffba21557 Synchronize regression harness helpers with Python 3.15 (#9297)
Regenerate nine canonical modules using scripts/update_lib at CPython
3.15.0 d220409a13b77de7a6c30abe16ea90db01528edc. Keep the discovery
package split out until its missing test family is available.

AI-assisted source selection, synchronization, review and bounded
validation using OpenAI Codex. No native capability claims are added.

Assisted-by: Codex:unknown
2026-10-22 18:14:03 +09:00
youknowdot 580706fa19 Fix _interpreters shared and updates argument diagnostics (#9295)
Use parameter names in dictionary validation errors to match Python 3.15.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 18:11:58 +09:00
youknowdot e102ccdae1 Use globals module names for eval and exec warnings (#9294)
* Use globals module names for eval and exec warnings

Forward the supplied scope module through compilation warnings while
preserving typed compile entrypoints and missing-name filename fallback.

* Retire the resolved exec warning-filter expected failure

Regenerate test_builtin through update_lib with all other adaptations
preserved after hosted CI reports the canonical method succeeds.
2026-10-22 18:10:44 +09:00
youknowdot 308085dafc Preserve float-subclass values in time.sleep conversion (#9292)
Follow CPython PyFloat_AsDouble without calling float-subclass overrides.
Keep index precedence and other conversion behavior unchanged.

Assisted-by: OpenAI Codex
2026-10-22 14:50:34 +09:00
youknowdot 39bee673a9 Respect static-method binding in builtin __self__ (#9291)
Reuse get_self() so static builtin methods expose None rather than their
stored class receiver, while preserving bound and module receivers.
2026-10-22 14:08:03 +09:00
youknowdot 49f4771e91 Reuse shared awaitable validation for defaulted anext (#9290)
Match CPython 3.15 await-result diagnostics and reject coroutine results
from custom __await__ consistently with the nondefaulted path. Preserve
native-coroutine unwrapping and wrapper state handling.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 13:42:26 +09:00
youknowdot 43368209c5 Support signed numeric constants in match pattern ASTs (#9279)
Recognize numeric Expr::Constant values when validating signed literal
patterns, alongside parser-produced NumberLiteral nodes. Python AST
conversion uses the former representation. Accept unary plus as well as
minus and fold signed real/imaginary and complex patterns consistently.

Boolean and non-numeric constants remain excluded. Preserve the existing
parser-produced literal path and do not change source grammar.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 11:21:10 +09:00
youknowdot e50103281d Fix single-input multiple-statement diagnostic ranges (#9289)
Preserve comment spans and count a logical newline once when converting
single-mode multiple-statement diagnostics to character locations.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:17:41 +09:00
youknowdot f482e0c2cf Track Unpickler payload references during cyclic GC (#9288)
Traverse input callbacks, buffer iterators, memo slots and memo proxy owners.
Clear outgoing payload edges through deferred drops and retire successful
reinitialization state outside the state lock. Retain stream and buffers
payload-cycle regressions in the existing pickle snippet.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:17:06 +09:00
youknowdot 5aab0db07d Align duplicate-parameter diagnostics with Python 3.15 (#9287)
* Align duplicate-parameter diagnostics with Python 3.15

Preserve source names and locations in both symbol-table paths, and migrate
the existing canonical codeop expectation through update_lib.

Assisted-by: OpenAI Codex: model version unavailable

* Sync positional-only duplicate-parameter expectations

Migrate the full pinned CPython 3.15.0 test file through update_lib. Its only delta is six existing expected messages, completing the dependent canonical wording coverage.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-22 10:16:23 +09:00
youknowdot 3b87cbe559 Mark wrapper descriptors as method descriptors (#9286)
* Mark wrapper descriptors as method descriptors

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

* Retire fixed wrapper monitoring expected failure

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
2026-10-22 10:15:53 +09:00
youknowdot 5b2f898887 Fix Python 3.15 doc generation and add artifact-only mode (#9285)
Use inspect's raw own-doc helper on Python 3.15, retaining the old
pydoc helper for earlier versions. Separate artifact generation from
repository publication, with an explicit main-only artifact mode.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:15:30 +09:00
youknowdot 4bd4320932 Align coroutine await-result diagnostics with Python 3.15 (#9284)
Report the qualified awaitable and returned type when __await__ does not
produce an iterator, preserving the existing coroutine/iterator checks.
Migrate test_coroutines.py from pinned CPython v3.15.0 through update_lib.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:13:11 +09:00
youknowdot b976859e8d Sync canonical Python 3.15 GUI libraries and tests (#9283)
Refresh the IDLE, Tkinter and turtle family through update_lib, including
the direct canonical text-only helper and image fixture dependencies.
Preserve capability/display guards without changing native Tk support.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:12:45 +09:00
youknowdot 2be9389f2d Read native pickle file payloads incrementally (#9260)
Bound the initial file read, grow later requests geometrically, use fallible reservation for input buffers, and compare frame bounds without addition overflow.

Assisted-by: Codex:unknown (model version not exposed)
2026-10-22 01:11:26 +09:00
youknowdotandJeong YunWon 97bd4af533 Add interpreter-bound operation critical sections (#9215)
* Factor shared interpreter stop-the-world guard

Move the existing collector barrier into the VM without changing its stop, restart or ownership behavior, preparing reuse by fork.

Assisted-by: dot:GPT-6.1

* Add interpreter-bound operation section primitive

Prepare attached-only ownership acquisition and detached observer parking with private per-interpreter scope stacks. Lifecycle wiring follows separately; no profiler consumer is enabled by this commit.

Assisted-by: dot:GPT-6.1

* Suspend operation sections at VM lifecycle boundaries

Integrate detach, stop-the-world, shutdown and interpreter-switch boundaries. Reuse the all-interpreter barrier for fork repair and add focused native ownership invariants.

Assisted-by: dot:GPT-6.1

* Replace operation sections with PyMutex critical sections

Add PyMutex with the lock.c protocol: LOCKED/HAS_PARKED bits, a bounded
spin, direct handoff to waiters parked longer than 1 ms, and detaching
while parked.

Rebuild critical sections on PyMutex with the stack kept as a tagged
pointer in ThreadSlot: single and two-mutex sections, recursive
top-most skipping, locking skipped while the world is stopped,
SuspendAll on detach/suspend/shutdown and Resume of the top-most
section on attach. Fork carries the stacks into the replacement slots.

Assisted-by: Claude Code:claude-opus-5-5

* Check attachment around critical-section suspension

Assert that a thread entering a critical section is attached, and
suspend sections in do_suspend only while the slot is still ATTACHED.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-21 19:57:21 +09:00
youknowdot 70a2cb20b5 Preserve surrogates in ImportError repr (#9252)
Use the existing WTF-8 representation interface for the base exception and name/path fields, avoiding lossy conversion of legal Python __repr__ results.

AI assistance: OpenAI Codex prepared the correction and validation. Model version is not exposed in this session.

Assisted-by: Codex:unknown (model version not exposed)
2026-10-21 12:43:30 +09:00
youknowdot a96c0570a8 Avoid epoll alias ownership aborts (#9250)
Keep Python-visible epoll descriptors in a raw host wrapper, preserving fromfd aliasing and explicit close errors without OwnedFd drop aborts. Use native epoll event layout behind a transparent host-only type and align positive timeout overflow with CPython milliseconds.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-21 12:05:27 +09:00
youknowdot 587358ba5c Support private names in native pickle globals and bound methods (#9259)
Preserve WTF-8 dotted paths in protocol 4/5 global loading so private-name round trips also support surrogate-containing names.

Assisted-by: Codex:unknown (model version not exposed)
2026-10-21 11:57:16 +09:00
youknowdot bb97696c9c Include name and path in ImportError repr (#9247)
Extract the independent Python 3.15 ImportError representation change from the upgrade work. Preserve BaseException positional arguments and include explicitly present name/path attributes for ImportError and ModuleNotFoundError.

AI assistance: OpenAI Codex prepared the extraction and validation. Model version is not exposed in this session.

Assisted-by: Codex:unknown (model version not exposed)
2026-10-20 23:50:19 +09:00
youknowdotandJeong YunWon 70c3f6c06d Align signal wakeup errors and delivery with Python 3.15 (#9199)
* Align signal wakeup error handling with Python 3.15

Assisted-by: OpenAI Codex:model version unavailable

* Preserve CRT error state during signal wakeup writes

Assisted-by: OpenAI Codex:model version unavailable

* Represent nullable Windows CRT parameter handlers safely

Assisted-by: OpenAI Codex:model version unavailable

* Rework signal wakeup error delivery to follow signalmodule.c

- Report pending wakeup write/send errors after Python signal handlers
  and VM pending calls, and re-arm the eval breaker when a handler or
  pending call raises.
- Save and restore errno once in run_signal around trip_signal instead
  of inside each write path; stop preserving _doserrno.
- Add crt_fd::write_noraise and use it for the Unix and Windows wakeup
  writes, sharing the single-write helper with _write.
- Keep pending wakeup errors across fork.
- Revert the suppress_iph handler type change and the unrelated quote
  change in test_signal.

Assisted-by: Claude Code:claude-opus-5-5

* Represent nullable Windows CRT parameter handlers as Option

_set_thread_local_invalid_parameter_handler takes and returns a nullable
function pointer; declare it as Option<InvalidParamHandler> so a NULL
previous handler is restored as None.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-20 20:08:49 +09:00
youknowdot 145749e580 Keep regression collector tracebacks plain in JSON (#9245)
Normalize inherited exception formatting once so structured results and terminal details share uncolored traceback strings, even when colors are forced. Add synthetic ordinary and subtest failure/error coverage without changing existing assertions.

Implementation and focused validation were AI-assisted with OpenAI Codex.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-20 20:06:23 +09:00
youknowdot c3b8ce79c8 Preserve regression collector outcomes and canonical process context (#9234)
* Preserve regression collector outcomes and canonical process context

Record complete test identities, subtest diagnostics and fixture outcomes while keeping unittest event counts separate from once-per-case JSON totals. Reuse canonical process setup and avoid an unnecessary library-path override.

Assisted-by: OpenAI Codex: model version unavailable

* Fix regression runner subtest formatting and qualified discovery

Assisted-by: OpenAI Codex: model version unavailable

* Make runner traceback assertions independent of forced colors

Assisted-by: OpenAI Codex: model version unavailable

* Keep dev VM frames compact for stdlib imports

Carry the established integration VM optimization override into the regression runner split. Retain debug assertions, stack guards and Python recursion limits.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-20 18:07:54 +09:00
youknowdot 1be1628666 Report fatal explicit-home startup failures (#9227)
* Report fatal explicit-home encodings initialization failures

Retain explicit standard-library initialization errors for the command-line host, preserving default embedding fallback and the original exception cause.

Assisted-by: OpenAI Codex: model version unavailable

* Enable canonical fatal startup path configuration coverage

Retire the verified expected failure through update_lib, preserving the explicit local path-environment adaptation and all other markers.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-20 09:27:23 +09:00
youknowdot 58b54c4f40 Update ten storage and developer-tool modules to Python 3.15 (#9209)
* Update storage and developer-tool libraries to Python 3.15

Migrate eight behavioral modules and two related production cleanups with whole canonical suites, preserving the existing dynamic Windows DBM guard through the updater.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve the import required by the existing DBM platform guard

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 22:12:12 +09:00
youknowdot 073136a5ee Simplify library updates with explicit generic source blocks (#9214)
* Use explicit source blocks instead of module-specific updater adapters

Preserve reviewed local fragments through the existing target-bound migration metadata. Remove dedicated module rules, flags and test scaffolding while retaining generic marker and doctest handling.

Assisted-by: OpenAI Codex: model version unavailable

* Generalize selected assignment migration beyond test support

Use generic assignment/export flags and an explicit Lib Python target with existing source/destination hash checks. Retain the existing dependency-checked operation without module-specific aliases.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-19 21:41:17 +09:00
youknowdot 5235a893be Update asyncio libraries and ftplib cleanup to Python 3.15 (#9211)
Copy nine behavioral asyncio modules and the independent ftplib unused-assignment cleanup from CPython d220409a13b77de7a6c30abe16ea90db01528edc. Migrate their whole canonical suites with existing RustPython guards preserved.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:34:29 +09:00
youknowdot 7f5cc0e35c Align import, numeric and warning edge cases with Python 3.15 (#9210)
* Align import, numeric and warning edge cases with Python 3.15

Carry four independent compatibility fixes from the 3.15 upgrade: preserve import cache lookup errors, handle surrogate module names, qualify numeric conversion diagnostics, and accept frozen warning globals. Match pinned CPython d220409a13b77de7a6c30abe16ea90db01528edc.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve the integer contract of builtin module detection

Return -1 for the separately initialized sys/builtins core modules, 1 for registered definitions and 0 for absent or unencodable names, matching pinned CPython import.c and its initialization table.

Assisted-by: OpenAI Codex:model version unavailable

* Normalize successful index conversions to exact integers

Match PyNumber_Index after its internal protocol call: preserve exceptions and warning timing, then copy bool or int-subclass payloads to an exact int without calling __index__ again.

Assisted-by: OpenAI Codex:model version unavailable

* Retire passing surrogate-import expected failures

Canonical cases now pass on the repaired import paths, including hosted Windows validation. Preserve their bodies and platform guards through update_lib.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:34:04 +09:00
youknowdot 75e77c30e3 Update ten leaf stdlib modules to Python 3.15 (#9208)
* Update ten leaf standard-library modules to Python 3.15

Migrate mail, TOML, zoneinfo and CLI leaves in dependency order with canonical tests and preserved RustPython guards.

Assisted-by: OpenAI Codex:model version unavailable

* Defer warning initialization for lazy standard-library imports

Match CPython startup option processing and load the Python display helper on the first native warning.

Assisted-by: OpenAI Codex:model version unavailable

* Update the canonical webbrowser consumer for argparse colors

Copy the complete pinned CPython 3.15 webbrowser module and tests via update_lib. The canonical CLI test disables coloring while preserving all assertions. This consumer overlaps the pending HTTP/doc split #9193.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:31:03 +09:00
youknowdot c4681299c2 Honor Python 3.15 frozen-module startup configuration (#9202)
* Honor frozen module startup selection

Assisted-by: OpenAI Codex:model version unavailable

* Match frozen option configuration diagnostics

Assisted-by: OpenAI Codex:model version unavailable

* Preserve frozen option initialization precedence

Validate the first occurrence, then apply the final value as CPython does after getpath configuration normalization.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:26:02 +09:00
youknowdot dfa3a1ae66 Align process lifecycle libraries with Python 3.15 (#9201)
Migrate ten canonical production modules and fifteen complete canonical test files, retaining existing RustPython guards. Nine modules change behavior; heap removes duplicated allocation checks.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:24:52 +09:00
youknowdot c84d862711 Update REPL rendering and completion for Python 3.15 (#9200)
* Preserve pyrepl console mock guards during migration

Keep the existing three named-function decorator workarounds and their explanations at exact audited anchors. Reject changed canonical or local preambles, and retain canonical test bodies.

Assisted-by: OpenAI Codex:model version unavailable

* Update pyrepl rendering and completion for Python 3.15

Sync the complete _pyrepl package and rlcompleter with CPython d220409a13b77de7a6c30abe16ea90db01528edc using scripts/update_lib copy-lib. Migrate the complete test_pyrepl package and existing repl/completion consumers, preserving existing RustPython guards and canonical assertions.

This is a source checkpoint. Interpreter, PTY, native platform, workspace, C-API and Clippy validation remain pending; host updater tests and configured commit hooks passed.

Assisted-by: OpenAI Codex:model version unavailable

* Include lazy soft keyword for canonical REPL highlighting

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:24:24 +09:00
youknowdot fc853015d1 Keep functools Placeholder identity in interpreter state (#9198)
Fresh _functools imports must not replace the singleton returned for existing Placeholder objects. Share initialization within each interpreter and return the published winner under racing imports.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-19 20:14:16 +09:00
youknowdot 23da4ac248 Isolate GC ownership test from child automatic collection (#9196)
Disable automatic GC before creating the child cycle so the test measures only whether the parent forced collection can reach child-owned objects. Keep both assertions and the parent collection retry unchanged.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:12:21 +09:00
youknowdot c208352caf Guard regression data runner against multiprocessing re-entry (#9195)
Run discovery and result writing only from the script entrypoint. Spawn and forkserver imports as __mp_main__ must not recursively execute the complete test suite or remove the parent result file.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-19 20:11:55 +09:00
youknowdot 71eec23bee Align sys runtime metadata with Python 3.15 (#9194)
Expose ABI metadata, preserve the canonical sys.flags tuple order and named flags, and report the native lock implementation honestly. Refresh canonical test_sys while preserving RustPython guards.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:11:12 +09:00
youknowdot 170e772255 Refresh Python 3.15 HTTP, URL and documentation libraries (#9193)
* Refresh Python 3.15 HTTP, URL and documentation libraries

Import the connected documentation and HTTP/URL library closure from CPython d220409a13b77de7a6c30abe16ea90db01528edc using scripts/update_lib. Preserve surviving RustPython test guards; the upstream-removed CGI test class has no remaining marker target.

Assisted-by: OpenAI Codex:model version unavailable

* Retire obsolete wsgiref file-wrapper test forwarder

Canonical Python 3.15 removed the target method; migrate with an empty marker override rather than retain an expected-failure call to a nonexistent super method.

Assisted-by: OpenAI Codex:model version unavailable

* Adapt pydoc classification to the Cargo source layout

Expose the existing source-directory predicate as sys._is_python_build and regenerate pinned pydoc with the explicit updater transform shared with the mega repair. Installed layouts and explicit basedir arguments retain upstream behavior.

Assisted-by: OpenAI Codex:model version unavailable

* Expose source-directory classification on every platform

The existing platform-neutral Lib and Cargo.toml predicate is needed by sys._is_python_build on all platforms; preserve its algorithm unchanged.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-19 20:08:24 +09:00
youknowdot feca6f2004 Align collections and testing libraries with Python 3.15 (#9192)
* Align collections and testing libraries with Python 3.15

Refresh twelve production modules and canonical tests through scripts/update_lib at CPython d220409a13b77de7a6c30abe16ea90db01528edc. Preserve existing RustPython unittest helpers and test guards. Accept frozendict in native defaultdict and OrderedDict union slots, matching upstream PyAnyDict_Check without changing constructors, factories, or update order.

Validated as a local stack on the exact #9189 regex/dataclasses/typing prerequisite; this dependency avoids eager typing.ByteString deprecation during unittest warning tests.

Assisted-by: OpenAI Codex: model version unavailable

* Synchronize regression runner with doctest subtest reporting

Refresh the canonical test_regrtest consumer and its direct runner/pythoninfo closure through scripts/update_lib at CPython d220409a13b77de7a6c30abe16ea90db01528edc. Preserve both existing expected-failure markers. This aligns the runner test with doctest reporting two failed examples and one skipped example.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-19 20:07:29 +09:00
youknowdot db7519f01c Align filesystem archives and bytecode compilation with Python 3.15 (#9191)
Refresh the connected pathlib, glob, zipfile, tempfile, py_compile and compileall closure from CPython 3.15.0 while preserving existing RustPython test guards.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 22:38:49 +09:00
youknowdot 6e064e5842 Support import timing and cached import diagnostics (#9190)
* Implement import timing and cached import diagnostics

Support -X importtime and PYTHONPROFILEIMPORTTIME, including mode 2 cached imports. Track nested timing separately in each VM thread and share the output header per interpreter.

Assisted-by: OpenAI Codex:model version unavailable

* Enable canonical import timing coverage and align diagnostics

Retire only test_import_time expectedFailure after the independent runtime passes its canonical assertions. Preserve other cmd-line markers and align environment range errors with CPython.

Assisted-by: OpenAI Codex:model version unavailable

* Match encoded-byte padding for cached imports

Keep CPython cached-import minimum width semantics for UTF-8 and backslash-replaced surrogate names. Scope the diagnostic blank line to importtime without changing CPU-count errors.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 22:38:20 +09:00
youknowdot 7137540b93 Align regex, dataclasses and typing with Python 3.15 (#9189)
Expose Pattern.prefixmatch and Scanner.prefixmatch and refresh their canonical re consumers, dataclasses annotation handling, typing APIs and regression fixtures from CPython d220409a13b77de7a6c30abe16ea90db01528edc.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 22:37:35 +09:00
youknowdot 18c1358a61 Avoid duplicate AST initialization and eager import locals allocation (#9183)
Let type.__call__ own AST initialization, matching CPython generic allocation, and inspect existing frame locals without materializing them for lazy policy checks.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 22:34:31 +09:00
youknowdotandJeong YunWon 3f55cf4af0 Implement basic REPL execution and fix piped stdin handling (#9163)
* Preserve original main VM through C API execution

Run and finalize the original main VM while keeping the registered attachment template available without holding its mutex across Python callbacks.

Assisted-by: OpenAI Codex:model version unavailable

* Make unraisable reporting robust at hook boundaries

Keep the existing message API and traceback formatting while handling missing, disabled, audited and failing hooks without panicking.

Assisted-by: OpenAI Codex:model version unavailable

* Separate interactive warning collection from compilation

Retain ordinary warning behavior and typed module APIs while exposing record-local parser warnings and post-warning code generation. Add a source-only lazy future-import guard.

Assisted-by: OpenAI Codex:model version unavailable

* Evaluate native stdin with shared VM record semantics

Use one evaluator for basic REPL and root transports, preserve effective inspect snapshots and future flags, and carry owned host exit status through original-main finalization.

Assisted-by: OpenAI Codex:model version unavailable

* Refresh canonical REPL tests and retire fixed failures

Run update_lib migrate from pinned CPython 3.15.0, preserving three remaining platform/runtime markers and retiring the two traceback/startup failures verified on the native evaluator.

Assisted-by: OpenAI Codex:model version unavailable

* Keep the root compiler dependency for development targets

The native evaluator now compiles through the VM. Only root benchmarks and the parse_folder example use rustpython-compiler directly, so declare it as a dev dependency while preserving VM compiler features.

Assisted-by: OpenAI Codex:model version unavailable

* Validate explicit conditional failure marker retirement

Require exact selector and original decorator evidence for each conditional expected-failure marker retired by migrate. Preserve undeclared guards and reject missing, duplicate, modified or unconsumed declarations.

Assisted-by: OpenAI Codex:model version unavailable

* Refresh canonical stdin and exception audit tests

Migrate the pinned CPython 3.15.0 modules and their canonical helper fixtures through update_lib. Retire exactly four failure markers proven obsolete by hosted CI, preserving all other existing guards.

Assisted-by: OpenAI Codex:model version unavailable

* Synchronize runpy warning attribution and document remaining capabilities

Migrate whole canonical runpy.py to pass module names to compile. Use update_lib to annotate only reproduced missing-capability cases: absent _testcapi import-event tests, unsupported startup/import-time features, and the deferred frozen-loader module-attribution caller.

Assisted-by: OpenAI Codex:model version unavailable

* Propagate interrupted native stdin reads to signal dispatch

Preserve the shared input buffer and partial bytes while returning EINTR to the VM before retrying. Exercise the transport deterministically and verify a returning SIGINT handler while pipe stdin stays open.

Assisted-by: OpenAI Codex:model version unavailable

* Reject statements after a compound statement in single mode

single_mode_multiple_statements_error now reports "invalid syntax" at the
statement that follows a compound first statement, and interactive_input
runs it right after parsing as compile() does.

The lazy `from __future__` import check moved from lazy_future_import_error
into unsupported_grammar_error, so it applies to every compile mode.

Assisted-by: Claude Code:claude-opus-5-5

* Remove passing expected failure from test_runpy

test_run_module_filter_syntax_warnings_by_module passes.

Assisted-by: Claude Code:claude-opus-5-5

* Restructure stdin execution after Modules/main.c and pythonrun.c

- src/lib.rs follows pymain_run_python: pymain_run_stdin, pymain_repl,
  pymain_run_startup, pymain_run_interactive_hook and pymain_run_pyrepl
  return exit codes instead of raising SystemExit.
- VirtualMachine gains run_any_stdin (_PyRun_AnyFile),
  run_interactive_loop (_PyRun_InteractiveLoop) and run_simple_stdin;
  run_shell feeds rustyline lines into run_interactive_loop, and
  sys._baserepl calls run_any_stdin.
- print_uncaught_exception (PyErr_Print) replaces
  report_uncaught_exception, and handle_system_exit_and_keyboard_interrupt
  replaces handle_reported_exception.
- An unhandled KeyboardInterrupt is recorded and the process exits
  through SIGINT after finalization.
- Interpreter::run_main replaces run_with_exit_status and InterpreterExit;
  rustpython_capi::run_main_interpreter takes an exit-code callback.
- config_set_inspect audits cpython.PyConfig_Set and rebuilds sys.flags
  through set_flag_obj (_PySys_SetFlagObj); the inspect state is an
  AtomicBool and dict replace_by_identity is removed.
- add_main_module (PyImport_AddModuleRef("__main__")) is used by the
  interactive and simple-file paths.
- The interactive parser warning helpers take their state directly.

Assisted-by: Claude Code:claude-opus-5-5

* Exit through Py_Exit from PyErr_Print and run the basic REPL via stdin

- print_uncaught_exception (PyErr_Print) calls exit_process (Py_Exit) for a
  SystemExit when inspect mode is off, instead of returning the exception.
  run_interactive_loop no longer checks SystemExit itself and flushes after
  printing an error; sys._baserepl returns None.
- exit_process finalizes through VirtualMachine::finalize_ex, which holds
  the Py_FinalizeEx steps split out of Interpreter::finalize, and exits
  through host_env::os::exit_with_cleanup (C exit()).
- The basic REPL on a terminal (PYTHON_BASIC_REPL, or _pyrepl missing)
  runs run_any_stdin instead of the rustyline shell.
- run_shell saves the history after every line.

Assisted-by: Claude Code:claude-opus-5-5

* Display exceptions through PyErr_Display and track the main thread running __main__

- display_exception (PyErr_Display) and display_exception_to (_PyErr_Display)
  try traceback._print_exception_bltin before the native printer and flush
  the file. PyErr_Print's excepthook fallback, print_exception and
  sys.excepthook use them. A missing sys.stderr is reported with
  dump_object (PyObject_Dump); a None sys.stderr prints nothing.
- Paths gains program_name (argv[0]) from getpath. The "can't open file"
  message uses it with strerror(errno) and goes to sys.stderr.
- running_main holds the ident of the thread running __main__.
  pymain_run_python sets it around running the main code, Py_Exit clears it,
  the fork child reinitializes it, and _interpreters.is_running reads it
  instead of treating the main interpreter as always running.
- Interpreter::run_main clears the unhandled KeyboardInterrupt flag before
  running and applies exit_sigint after finalizing; finalize no longer
  does.
- run_interactive_loop returns a SystemExit raised outside inspect mode
  again and no longer flushes after printing an error; run_shell saves the
  history once after the loop.
- pymain_set_inspect reports its error through print_uncaught_exception.

Assisted-by: Claude Code:claude-opus-5-5

* Treat a parse error at the end of the source as incomplete input

A parser error that starts at the end of the source is reported as
_IncompleteInputError when incomplete input is allowed, so the
interactive loop and codeop keep reading after `try:` and its block or
after a decorator line.

Assisted-by: Claude Code:claude-opus-5-5

* Place syntax errors on tokens made up at the end of the input

A parse error on the NEWLINE, DEDENT or ENDMARKER the tokenizer makes up
at the end of the input now carries an EofToken: the number of lines
read and the last line. SyntaxError takes its lineno and text from it,
and its offset is that line's length with end_offset -1, or 0 for both
when the error is raised at the token itself (the generic syntax error
and a missing forced `:` or `(`). Exec input that does not end with a
newline is checked with one appended.

Assisted-by: Claude Code:claude-opus-5-5

* Slice the source with get when checking an indented block error at EOF

Assisted-by: Claude Code:claude-opus-5-5

* Rename the host exits after C exit() and fix wasi and Windows builds

- host_env::os::exit now calls the C exit() on every platform; on Windows
  std::process::exit ends in ExitProcess, so it flushes the Rust stdout
  and calls libc::exit there. The former exit, which calls _exit(), is
  now exit_immediately, used by os._exit, faulthandler and
  posixsubprocess.
- errno::strerror_string is available on wasi.
- PyGlobalState::reinit_running_main is built only where its fork caller
  is.

Assisted-by: Claude Code:claude-opus-5-5

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-18 09:22:12 +00:00
youknowdot 9f6f771965 Align lazy imports and f/t-string interpolation with Python 3.15 (#9179)
* Preserve interpolation source text and canonical metadata

Source-only checkpoint; candidate validation and the existing annotation expectation reconciliation remain pending.

Assisted-by: OpenAI Codex:model version unavailable

* Align existing annotation expectations with CPython metadata

Update only the nine existing expected strings confirmed against pinned CPython 3.15, with explicit user approval.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve template metadata through compilation and interactive input

Escape literal debug prefixes, retain None AST expression metadata internally, and continue incomplete triple-quoted t-strings in the existing shell.

Assisted-by: OpenAI Codex:model version unavailable

* Classify normalized unclosed brackets as REPL line continuations

Assisted-by: OpenAI Codex:model version unavailable

* Nest equivalent REPL parse-error alternatives for Clippy

Assisted-by: OpenAI Codex:model version unavailable

* Remove fulfilled annotation migration lint workaround

The canonical expected strings no longer trigger literal_string_with_formatting_args, so the previous lint expectation is obsolete.

Assisted-by: OpenAI Codex:model version unavailable

* Complete lazy-import exception and traceback library closure

Copy canonical traceback and legacy exception mappings with preserved RustPython guards. Copy explicit non-Python library assets by exact path so exception hierarchy data does not expand into the entire test package.

Assisted-by: OpenAI Codex:model version unavailable

* Provide Python 3.15 traceback metadata for missing modules and attributes

Preserve AttributeError context for missing class attribute deletion, matching type_update_dict. Expose canonical generated missing-stdlib messages through the native sysconfig modules without importing CPython build-specific disabled-module assumptions.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 17:11:26 +09:00
youknowdot 6e8e7e0481 Align startup paths and sysconfig/venv with Python 3.15 (#9174)
* Align startup home and venv paths with canonical sysconfig closure

Assisted-by: OpenAI Codex:model version unavailable

* Preserve selected stdlib and empty home prefix fallback

Assisted-by: OpenAI Codex:model version unavailable

* Collapse startup exec-prefix fallback condition

Assisted-by: OpenAI Codex:model version unavailable

* Preserve startup search order and freeze the ZIP bootstrap

Align zipimport and its tests with CPython 3.15.0 via update_lib, preserving inherited test guards. Keep build-time fallback paths after configured paths and the default ZIP, while respecting customized embedding paths.

Assisted-by: OpenAI Codex:model version unavailable

* Retire proven trace coverage guards through update_lib

Both canonical coverage-file tests execute successfully after preserving startup search order. Preserve the other two inherited guards and restore canonical Python 3.15 JIT optimizer decorators.

Assisted-by: OpenAI Codex:model version unavailable

* Align Windows symlink helper with canonical Python home layout

Import the pinned CPython 3.15 PythonSymlink class through a narrow, hash-pinned update_lib mode. Preserve canonical home/VPATH behavior and explicitly supply RustPython build stdlib to the Windows child without changing runtime PYTHONHOME semantics or skipping tests.

Assisted-by: OpenAI Codex:model version unavailable

* Reset surviving thread completion locks after fork

Reinitialize every live thread handle completion mutex and condition variable before skipping the surviving or not-yet-started handle. Preserve their completion payload and state, and retain the existing dead-thread cleanup.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 15:55:22 +09:00
youknowdot efa8c26929 Align code introspection and monitoring with Python 3.15 (#9178)
* Align code metadata and monitoring event semantics with Python 3.15

Preserve canonical qualified-name interning and subclass values, normalize valid debug-range tables, and correct event-specific monitoring disable and callback ownership boundaries.

Assisted-by: OpenAI Codex:model version unavailable

* Import canonical monitoring shutdown helper

Copy the missing test_monitoring dependency from pinned CPython 3.15.0 through scripts/update_lib, retaining existing suite guards.

Assisted-by: OpenAI Codex:model version unavailable

* Match observed monitoring source layers and tool release ordering

Model active source instrumentation across all subscribed tools instead of unconditional legacy edge pairing. Preserve tool names during unlocked callback finalization before releasing them.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve code qualnames and monitoring event-site identity

Retain decoded WTF8 qualnames, use exact-str marshal dispatch, and model wrapped branch dispatch with physical DISABLE sites. Retire the proven monitoring shutdown guard through update_lib.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 10:57:23 +09:00
youknowdot 65bbacae47 Keep optional OpenSSL CI on Linux (#9177)
Remove the macOS OpenSSL build and runtime expansion from #9173 while preserving the existing Linux checks and other macOS jobs.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-18 00:42:46 +09:00
youknowdot 7d15b50cd4 Align weak-reference collection with Python 3.15 finalization (#9168)
* Align weak-reference collection with Python 3.15 finalization

Trace and retain owned callback edges independently of weak referent links.
Clear callback-bearing weakrefs before finalizers, suppress callbacks from
unreachable weakrefs, and close remaining weakref ingress after resurrection
checks while the world is stopped. Publish and unlink intrusive nodes safely.

Refresh weakref and canonical weakref/GC/finalization tests through update_lib
from pinned CPython 3.15.0. Retire four obsolete guards only after fresh body
passes, retaining applicable RustPython limitations.

Assisted-by: OpenAI Codex:model version unavailable

* Refresh canonical IO tests for weakref finalization

Migrate the complete CPython 3.15.0 test_io package at d220409 with the
fail-closed legacy-map updater, preserving all ten existing guards. Retire
the seven consolidated standalone suites and update io/file dependency
paths with mapping regression tests.

The canonical GC tests ignore ResourceWarning without retaining its
source, so callback-free weakrefs correctly reflect surviving owners.
This closes the stale test dependency exposed by the lifecycle change.

Assisted-by: OpenAI Codex:model version unavailable

* Protect weakref callbacks with the original referent stripe

Follow CPython's free-threading weakref locking model instead of keeping
an independent callback RwLock. Retain the original referent stripe key
so callback access stays synchronized after GC clears the referent.
Unlink and steal callbacks under that stripe, then release ownership
outside the lock. Preserve synchronization for running-world GC paths
and gc.get_referents while keeping ordinary weakref upgrades unchanged.

Assisted-by: OpenAI Codex:model version unavailable

* Defer weakref GC tracking until referent publication

Keep freshly allocated weakrefs out of GC's object lists until they are
linked and their referent is published. Release the referent stripe before
tracking, since tracking can collect and invoke finalizers. Generic reuse
losers remain untracked.

Exercise the allocator boundary directly for reference, proxy, callable
proxy and subclass payloads, and ensure completed constructors track their
objects. This prevents observers from retaining a half-built dead weakref
that later becomes live.

Assisted-by: OpenAI Codex:model version unavailable

* Retain the original weakref stripe lock like CPython

Store a safe handle to the selected static weakref stripe instead of
retaining and rehashing the referent address. Keep the same lock after
referent clearing, matching CPython free-threaded weakrefs_lock. The
nonthreaded handle is zero-sized and introduces no locking.

Preserve lock selection, acquire/release ordering, fork reset, deferred
GC publication, and callback-owner release outside the stripe. No new
locks or unsafe code are needed.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 23:53:07 +09:00
youknowdot 51e886c224 Fix optional OpenSSL duplex I/O on Unix (#9173)
* Fix optional OpenSSL duplex I/O on Unix

Release connection locks before readiness waits while serializing native SSL
attempts and preserving owned write retries. Wake waiters on native progress
and socket identity invalidation, and construct callback/native exceptions
after unlocking.

Add regression coverage to the existing SSL snippet and run the optional
OpenSSL backend in the existing Unix CI matrix. Windows and AIX retain the
legacy transport pending a separate compatibility-safe driver.

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate OpenSSL runtime checks into the existing CI step

Keep the minimal system and vendored OpenSSL build checks, and run the
Unix SSL regressions in the existing system OpenSSL step. Preserve the
runtime feature set and enable its macOS dependency in that job.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 23:36:27 +09:00
youknowdot 75a2417043 Align type layouts and generic descriptors with Python 3.15 (#9175)
Import canonical descriptor tests through update_lib, preserving existing guards. Support tuple member slots, distinguish base reassignment from class layout compatibility, and share object-owned generic descriptors.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 14:13:50 +00:00
youknowdot fc9f4a9541 Update importlib to CPython 3.15 with native bootstrap callback (#9169)
* Refresh canonical importlib and preserve native import callback

Cache the original builtin __import__ callback so CPython 3.15 importlib's
hierarchical locking uses the existing native parent-initialization path.
Refresh the complete canonical importlib and related test/helper families
from CPython d220409a13b77de7a6c30abe16ea90db01528edc through update_lib.

Preserve both nondecorator importlib guards in the updater. Add explicit
hash-pinned removal of reviewed obsolete canonical files, with full
preflight, dry-run, idempotence and refusal tests. Preserve empty fixtures.

Assisted-by: OpenAI Codex:model version unavailable

* Complete canonical inspect and types closure for importlib metadata

Refresh whole canonical inspect/types production and related test families
through update_lib after hosted CI exposed stale __cached__ consumers.
Add coroutine and async-generator state getters, with closed-state priority
for reentrant frame-local finalizers, and expose the existing frame-locals
proxy type with its CPython class documentation.

Preserve the optional _datetime and unittest import blocks through a narrow
migration adapter. Retain canonical assertions and existing guards; record
the missing LazyImportType expectation before adding a conditional expected
failure, and capability-skip only the two absent-_testcapi CLI fixtures.

Assisted-by: OpenAI Codex:model version unavailable

* Reject canonical removal junctions and read UTF-8 manifests

Reject junctions alongside symlinks in the existing path-component preflight and revalidation. Decode removal manifests explicitly as UTF-8. Add regressions for whole-batch refusal, revalidation, and Unicode dry-run/apply/idempotence.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 14:40:13 +09:00
youknowdot 59570923c3 Align hashlib and HMAC with Python 3.15 (#9170)
Warn on the deprecated shared string keyword and refresh the complete
hashing libraries, canonical suites, and shared helper from CPython
v3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc) with update_lib.

Keep the six-file family independent and add no RustPython test guards.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 11:38:33 +09:00
youknowdot fb76135ec8 Align SSL APIs and transport behavior with Python 3.15 (#9167)
Refresh ssl.py and test_ssl.py through update_lib from CPython d220409a13b77de7a6c30abe16ea90db01528edc without local test changes. Implement rustls cipher-suite, group and signature policy, negotiated-group reporting, EOF and session-policy behavior.

Keep OpenSSL and wasm API imports compatible, with genuine version-gated queries and honest unsupported capabilities. Repair OpenSSL callback ownership and traversal, callback exceptions, EOF and shutdown, PHA, session destruction, and system-error decoding exposed by canonical coverage. Preserve existing I/O locking; the inherited optional-backend full-duplex hang remains a separate driver prerequisite.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 11:34:23 +09:00
youknowdot 19d2fe3af7 Align bytes and bytearray operations with Python 3.15 (#9165)
Correct quote escaping, replacement count keyword binding, signed-minimum hex grouping, and clear storage/export handling. Migrate canonical bytes coverage through fail-closed preservation of the existing RustPython customizations, and retire only two freshly verified formatting guards.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 11:33:14 +09:00
youknowdotandCodex 8720306805 Preserve function metadata and annotation callback lifetimes (#9162)
* Fix deprecated PyO3 code input import in benchmarks

Use the canonical code module path introduced in PyO3 0.30 without suppressing deprecation warnings.

Assisted-by: OpenAI Codex:model version unavailable

* Align runtime metadata and annotation cache contracts with Python 3.15

Preserve function name identity, implicit wrapper metadata and slice generic aliases. Match annotation dictionary and reentrant publication contracts, releasing displaced Python owners outside locks in the required phases. Refresh the matching canonical annotation tests through update_lib.

Assisted-by: OpenAI Codex: gpt-6.1-sol

* Refresh canonical generic alias coverage for slice

Migrate the complete Python 3.15 test_genericalias file through update_lib. Preserve the full canonical type list and capability guards so normal test runs cover slice subscripting.

Assisted-by: OpenAI Codex: gpt-6.1-sol

---------

Co-authored-by: Codex <codex@openai.com>
2026-10-16 23:45:57 +09:00
youknowdot b2b865aa90 Fix deprecated PyO3 code input import in benchmarks (#9161)
Use the canonical code module path introduced in PyO3 0.30 without suppressing deprecation warnings.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-16 23:43:41 +09:00
youknowdot 64330b80b9 Implement Unicode 17 grapheme iteration and properties (#9145)
* Implement native Unicode 17 grapheme iteration

Add the CPython extended grapheme state machine, full-codepoint properties, and traced Segment/iterator types with positional index handling. Refresh canonical unicodedata tests through update_lib while retaining pending markers. Include a losslessly range-compressed exact-final property oracle and differential test.

Source-reviewed implementation; candidate runtime validation remains pending. Reference property generation completed against the pinned CPython Unicode extension.

Assisted-by: OpenAI Codex:model version unavailable

* Bind grapheme Segment methods to the Python object

Use the required Py<Segment> receiver for native descriptors; preserve payload ownership and representation behavior.

Assisted-by: OpenAI Codex:model version unavailable

* Use explicit object receivers for Segment descriptors

Keep the inherent impl on the local payload and receive &Py<Self>, as required for stdlib classes outside the VM crate.

Assisted-by: OpenAI Codex:model version unavailable

* Mark grapheme property lookups as must-use

Satisfy strict Clippy for the three pure property functions without changing their behavior.

Assisted-by: OpenAI Codex:model version unavailable

* Enable validated Unicode grapheme canonical tests

Remove seven stale expected-failure markers through update_lib metadata after native property parity, canonical methods, full Unicode 17 grapheme corpus, and reference-cycle GC validation.

Assisted-by: OpenAI Codex:model version unavailable

* Accept platform line endings in grapheme oracle header

Compare the complete provenance line without its line ending so the same exact Unicode 17 reference is accepted after Windows checkout conversion. Keep the complete code-point property sweep unchanged.

Assisted-by: OpenAI Codex:model version unavailable

* Keep grapheme property regression in test module

Move the existing complete Unicode 17 property regression into the existing cfg(test) module to satisfy strict Clippy. Preserve the fixture, assertions, code-point coverage, and platform-independent provenance line check unchanged.

Assisted-by: OpenAI Codex:model version unavailable

* Qualify grapheme iterator return type for generated bindings

Assisted-by: OpenAI Codex:model version unavailable

* Fix deprecated PyO3 code input import in benchmarks

Use the canonical code module path introduced in PyO3 0.30 without suppressing deprecation warnings.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-16 23:40:26 +09:00
youknowdot fd5b30eb5e Align socket and socketserver with Python 3.15 (#9156)
Import the canonical socket libraries and tests through update_lib, preserving the existing AF_ALG expected failures. Match setsockopt index/buffer conversion and error ordering, mask optlen with the final CPython deprecation warning, reject oversized Windows buffers before the host call, and preserve arbitrary-precision getaddrinfo ports and empty canonical names.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-16 10:14:55 +09:00
youknowdot 1ee9a29062 Preserve explicit AST source positions through compilation (#9138)
* Preserve explicit AST column locations through code generation

Assisted-by: OpenAI Codex:model version unavailable

* Remove obsolete location bindings after span migration

Assisted-by: OpenAI Codex:model version unavailable

* Propagate inconsistent AST span provenance without panicking

Assisted-by: OpenAI Codex:model version unavailable

* Preserve mapped positions when exporting optimized Pass nodes

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate AST location regressions and satisfy strict compiler lints

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate equivalent AST literal location cases

Replace the six-way literal-only optimizer matrix with one optimized-AST round-trip, preserving all assertions. Keep the distinct normalized-range identity, explicit Pass provenance, and synthetic format-spec regressions.

Validation: all four appended location cases passed using the verified final-f6a RustPython binary with unchanged native sources. Ran normal pre-commit hooks; no Cargo build or full cyclic snippet suite.

Assisted-by: OpenAI Codex:model version unavailable

* Reuse Ruff source locations in AST conversion

Replace redundant PySourceLocation, Row, and Column wrappers with the compiler-core re-export of Ruff SourceLocation. Use UTF-8 byte coordinates and retain the empty-source fallback. Share the normalized range conversion while preserving caller validation and signed semantic metadata.

Validation so far: independent source and boundary review, rustfmt, and git diff --check. Runtime validation follows after the shared build target is released.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve the first AST preprocessing location error

Share first-error recording between generated-node allocation and synthetic-pass coordinate overflow. Exercise both real compiler-state failure paths in both orders using one MAX_ID location entry.

Validation: focused compiler-state regression, strict codegen all-target Clippy, unchanged full-source seals, rustfmt, and normal pre-commit hooks. No interpreter runtime or broad suite rerun for this error-only change.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-16 10:13:59 +09:00
youknowdot 1f4e9ffaf6 Align OS argument conversion and syscall handling with Python 3.15 (#9146)
* Align OS argument conversion and syscall handling with Python 3.15

Import canonical os tests through update_lib, retaining existing guards. Preserve raw descriptor validation, errno, audit ordering, signal retries and unlocked sendfile buffers.

Validation: independent source review passed; matching release build and nine bounded canonical cases pending.

Assisted-by: OpenAI Codex:model version unavailable

* Import canonical root-user test support for OS package

Add hash-pinned selective assignment migration within test.support and import the three Python 3.15.0 privilege helpers plus their public exports. Preserve unrelated support helpers and existing test markers.

Validation: 177 host updater tests pass; byte-identical canonical helper provenance verified. Independent source review passed. Native import validation pending integration onto current main.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-16 10:06:13 +09:00
youknowdot 8e5709e797 Align native threading and libraries with Python 3.15 (#9148)
Preserve lock ownership and elapsed timeouts during interruptible waits; reject RLock constructor arguments and use replacement encoding for thread names. Generate associated libraries and tests from CPython d220409a13b77de7a6c30abe16ea90db01528edc using update_lib, retaining five existing markers and retiring one proven removed test owner.

AI-assisted source preparation and review. Runtime validation remains pending.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-15 22:46:26 +09:00