Skip to content

Preserve symtable warning exceptions and original filenames - #9282

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix/symtable-warning-propagation
Oct 24, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix/symtable-warning-propagation

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Preserve warning-hook exception identity and attributes, including SyntaxError subclasses. Only compiler-generated syntax errors enter the filename-rewriting path.
  • Preserve the original fsdecoded Python filename in parser warnings and newly created warning-as-error SyntaxError objects, including byte paths and lone surrogates.
  • Rebase after Fix interpolated string warning diagnostic locations #9314 while retaining its parser-warning diagnostics, ordering, recovery, and type-comment handling. Other compilation entry points keep their existing filename behavior.
  • No Lib, test, warning-threshold, or skip changes.

Validation of 26005cf386111e95197857a940d7afef5338df6c

  • Correctness CI passed: 14 successful jobs and two skipped matrix placeholders. The published rebase has no merge conflicts with current main.
  • Local checks passed: threaded and non-threaded VM library checks, strict threaded VM library Clippy (-D warnings), default-feature CLI build, independent source review, and normal commit hooks.
  • Six unchanged canonical test_symtable methods passed without skips. All 14 bounded filename/exception-identity observations passed against the preserved CPython 3.15 reference from source d220409a13b77de7a6c30abe16ea90db01528edc.
  • Eight of those 14 complete raw records match CPython. The six warning-as-error records differ only in SyntaxError.args; their recorded filename and location fields match. No normalization or complete diagnostic-metadata parity is claimed.
  • Four existing compile-only TYPE_COMMENTS observations exactly match every recorded field of landed Fix interpolated string warning diagnostic locations #9314. Its existing differences from CPython remain, including syntax-error ranges under the always filter and exception argument representations. These are preservation checks, not a claim of full CPython parity.
  • Full workspace and separate CAPI suites were not run locally; the focused checks are not a substitute for those suites.

Windows CI on this head passed the formerly failing RustPython stdlib_io_blocking_buffer snippet. The snippet summary is 502 passed, four skipped, and 15 subtests passed; the CPython test step also succeeded. The historical GC timing failure still has no established root cause; this PR does not alter its timing threshold or claim a GC fix.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 98a78ef and 26005cf.

Files selected for processing: 1
  • crates/vm/src/vm/compile.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Compilation warning paths now preserve an optional original filename for warning emission and exception construction. Symbol-table compilation handles compile errors separately from warning-hook exceptions.

Changes: Compilation filename handling

Layer / File(s) Summary
Propagate original filenames in warnings
crates/vm/src/vm/compile.rs
Compilation warning data and dispatch paths carry an optional original filename. Warning emission and exception filenames use it when present, and otherwise use the internal filename.
Handle symbol-table compilation outcomes
crates/vm/src/stdlib/_symtable.rs
Symbol-table compilation assigns the filename to compile errors. It propagates warning-hook exceptions without modifying their attributes.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

  • RustPython/RustPython#9304: Both changes modify parser-warning emission in compile.rs; this change forwards original filenames, while #9304 filters warnings by single-input boundaries.
  • RustPython/RustPython#9316: Both changes modify warning collection and emission in compile.rs; this change forwards original filenames, while #9316 changes the standard exec and eval warning path and tokenizer-recovery decision.

Suggested reviewers: youknowone

Merge Risk: Minimal · up to 26005

No actionable issue was found in the changed filename and exception-handling paths. The reviewed head is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main changes: preserving symtable warning exceptions and original filenames.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@youknowone
youknowone marked this pull request as ready for review October 22, 2026 02:21
@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-24T04:31:33.367390Z 26005cf New commits
ℹ️ 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.

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
@youknowdot
youknowdot force-pushed the fix/symtable-warning-propagation branch from 98a78ef to 26005cf Compare October 24, 2026 04:31
@youknowone
youknowone merged commit 5a0ded8 into RustPython:main Oct 24, 2026
20 checks passed
youknowdot added a commit to youknowdot/RustPython that referenced this pull request Oct 24, 2026
Integrate main at 5bccf31 without replacing the existing Ruff vendor.
Preserve the landed Cranelift dependency family and RustPython#9282 original filename
handling, including surrogate/bytes filenames and arbitrary warning-hook
exceptions. Thread the same filename object through remaining mega numeric
and relative-lazy warning/recovery paths without changing event ordering.

The preceding signal correction restores RustPython#9199 pending-error preservation;
it does not claim immediate post-fork delivery. Keep all tests unchanged.

Assisted-by: OpenAI Codex: model version unavailable
youknowone pushed a commit that referenced this pull request Oct 25, 2026
* 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] <[email protected]>

* 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] <[email protected]>
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] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants