Repository navigation
Preserve immutable bytecode provenance when cloning code - #9450
Draft
youknowdot wants to merge 1 commit into
Draft
youknowdot wants to merge 1 commit into
youknowdot wants to merge 1 commit into
Conversation
Extract the independent code-source, clone, co_code and fallible decoding foundation from RustPython#9439. Interpreter-local monitoring dispatch remains in the dependent original PR. Assisted-by: OpenAI Codex: model version unavailable
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
Contributor
Merging this PR will not alter performance
Comparing Footnotes
|
youknowone
reviewed
Oct 29, 2026
| pub struct CodeUnits { | ||
| // Construction provenance, never updated by runtime specialization. Keep | ||
| // original opcode identity: GET_ITER fixup does not apply to its specialized forms. | ||
| source: Box<[CodeUnit]>, |
Member
There was a problem hiding this comment.
really? disagree to this approach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep immutable construction provenance separate from mutable execution/cache storage. Clone fresh execution units, export source-backed co_code, and make external/frozen/marshal decoding reject wrappers with unavailable original operation metadata.
This is a functionality-based extraction from #9439, based on main
84d7afc2d59e05c66c92df3ce0854679d2b32b52. The original aggregate is being narrowed to monitoring. The extracted implementation is preserved exactly, except for the explicit provenance/monitoring hunk boundary described below where relevant.This PR is independent of the dict, CSV, mmap and syslog extractions. #9439’s interpreter-local monitoring implementation depends on it; until this lands, #9439 retains explicit overlapping provenance source. Native lifetime identity, virtual event metadata/dispatch and the successful-yield correction stay in #9439.
Validation and limits
Seven finite compiler-core structural fixtures belong to this unit. This external-wrapper behavior is an intentional narrow compatibility limit, not a claim of full CPython constructor or malformed-bytecode parity. Existing shared monitoring remains supported until the dependent dispatch PR lands.
Fresh standalone check and strict Clippy (
-D warnings) passed for compiler-core tests andrustpython-vm --lib --no-default-features --features compiler,threading,host_env,stdio,doc,importlibon the 84d7 base. A freshly built compiler-core test executable from this worktree passed exactly seven existing structural fixtures, one at a time. Source and protected executable hashes were verified; dependencies were locked/offline. No Python concurrency, profiling or crash tests were run locally. Exact-head hosted CI: pending. Old aggregate green checks are historical, not standalone validation of this extraction.