GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Prohibit AI PR submit by youknowone · Pull Request #6813 · RustPython/RustPython

Conversation

@youknowone

@youknowone youknowone commented Jan 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This PR is made by CI by accident. Try not to allow it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai

coderabbitai Bot commented Jan 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR introduces three new bytecode instructions (DictMerge, ListExtend, SetUpdate) with corresponding VM frame handlers and compiler codegen support. Additionally, it adds stdlib directory path tracking throughout the VM's runtime configuration and sys module, refactors collection construction in the code generator to optimize starred/unstarred elements via threshold-based branching, and improves Windows path resolution robustness.

Changes

Cohort / File(s) Summary
Configuration & Metadata
.cspell.dict/cpython.txt, .gitattributes, crates/vm/src/vm/setting.rs
Added three spell-check dictionary entries (kwnames, nkwelts, subkwargs), configured test resource attributes in git for importlib and email test data with binary/CRLF settings, and added new stdlib_dir: Option<String> field to Paths struct.
Compiler Codegen
crates/codegen/src/compile.rs
Reworked collection construction with threshold-based branching to choose between fast single-build path (no stars, small collections) and streaming path (stars or large sizes). Introduced new codegen_subkwargs helper for efficient keyword argument emission, and updated call/class building to support the new strategies with improved MapAdd handling.
Bytecode Instruction Definitions
crates/compiler-core/src/bytecode/instruction.rs
Updated stack effects for three instructions: DictMerge, ListExtend, and SetUpdate now have stack effect -1 (previously 0), reflecting the operations' consumption of values during execution.
VM Frame Execution
crates/vm/src/frame.rs
Added three new instruction handlers (DictMerge, ListExtend, SetUpdate) with validation and type checking; DictMerge enforces string keys and detects duplicates, while ListExtend and SetUpdate safely downcast and extend/update collections. Extended BuildList with intermediate size variable and renamed indexing variables (i → idx) in LoadDeref and LoadFromDictOrDeref.
Path Configuration & Initialization
crates/vm/src/getpath.rs, crates/vm/src/stdlib/sys.rs, src/interpreter.rs
Added new calculate_stdlib_dir function to compute platform-specific stdlib paths, exposed _stdlib_dir attribute in sys module, and refactored interpreter setup to move stdlib_dir configuration from sys module hacks to centralized state-based initialization for both frozen and dynamic stdlib scenarios.
Windows Build Path Handling
crates/pylib/build.rs
Rewrote Windows Lib path resolution to handle two cases: text files containing relative paths and symlinks/directories, with proper canonicalization and extended-length prefix stripping for robustness in Git-enabled environments.

Sequence Diagram(s)

sequenceDiagram
    participant Compiler as Compiler<br/>(codegen)
    participant Codegen as Codegen Helper<br/>(codegen_subkwargs)
    participant Bytecode as Bytecode<br/>(DictMerge instr)
    participant VM as VM Frame<br/>(Execution)
    participant Dict as Target Dict

    Compiler->>Codegen: compile dict merge<br/>with **kwargs
    Codegen->>Codegen: choose fast or<br/>streaming path
    alt Streaming Path (stars present)
        Codegen->>Codegen: emit MapAdd ops
    else Fast Path (no stars)
        Codegen->>Codegen: build single map
    end
    Codegen->>Bytecode: emit DictMerge<br/>{index}
    Bytecode->>Bytecode: stack effect: -1
    VM->>VM: execute DictMerge
    VM->>VM: validate source<br/>is mapping
    VM->>Dict: iterate keys & merge<br/>with validation
    VM-->>VM: return Ok(None)<br/>on success
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • Replace custom opcodes with CPython standard sequences #6794 — Implements the same codegen changes and VM instruction additions (DictMerge, ListExtend, SetUpdate, and codegen_subkwargs streaming patterns) for collection handling.
  • Add sys._stdlib_dir #6798 — Adds and wires sys._stdlib_dir across build.rs, getpath.rs, vm settings, sys.rs, and interpreter state initialization.
  • nt junction #6407 — Improves Windows Lib path handling by stripping the extended-length prefix and handling symlinks more robustly.

Suggested reviewers

  • ShaharNaveh

Poem

🐰 A hop through bytecode, paths aligned!
DictMerge, ListExtend, SetUpdate designed,
Stdlib paths now tracked with care,
Fast paths chosen, streaming paths fair,
Windows paths robust, no more despair! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Prohibit AI PR submit' is unrelated to the changeset, which contains CI fixes, opcode changes, stdlib_dir configuration, and keyword argument handling optimizations. Update the title to reflect the actual changes, such as 'Fix CI test failures from PR 6798' or 'Add stdlib_dir support and fix CI test failures'.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
youknowone marked this pull request as draft January 20, 2026 08:54
@youknowone
youknowone force-pushed the stdlib_dir branch from 7561e2c to f234343 Compare January 20, 2026 12:09
@youknowone youknowone changed the title Fix CI test failures from PR 6798 Prohibit AI PR submit Jan 20, 2026
@youknowone youknowone added the skip:ci Skip running the ci label Jan 20, 2026
@youknowone
Prohibit AI PR submit
30bbc49
@youknowone
youknowone force-pushed the stdlib_dir branch from f234343 to 30bbc49 Compare January 20, 2026 12:12
@youknowone
youknowone marked this pull request as ready for review January 20, 2026 12:12
@youknowone
youknowone merged commit 94ccfb8 into RustPython:main Jan 20, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
youknowone deleted the stdlib_dir branch January 20, 2026 12:13
@coderabbitai coderabbitai Bot mentioned this pull request Jan 24, 2026
Update urllib and windows libraries from v3.14.2 #6858
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Feb 3, 2026
Update _ast_unparse and fix unparse, type_comments #6961
Merged
@leehanjeong leehanjeong mentioned this pull request Aug 1, 2026
docs: drop stale crate paths from AGENTS.md #8425
Merged
2 tasks done
youknowone pushed a commit that referenced this pull request Aug 1, 2026
@leehanjeong
docs: drop stale crate paths from AGENTS.md (#8425)
bd653da
The "Repository Structure" section listed pre-`crates/` paths (`vm/`,
`compiler/`, `derive/`, etc.) that no longer exist; `CONTRIBUTING.md`
already documents the current layout under "Code organization". Replace
the stale list with a link to that section.

Also generalized the title and intro from "GitHub Copilot Instructions"
to "AI Agent Instructions" — the file was already renamed from
`.github/copilot-instructions.md` to `AGENTS.md` in #6813 to follow the
cross-vendor AGENTS.md standard (https://agents.md/), but the title text
was never updated to match.

Assisted-by: Claude Code:claude-sonnet-5
youknowone pushed a commit that referenced this pull request Sep 16, 2026
@leehanjeong
docs: drop stale crate paths from AGENTS.md (#8425)
457e195
The "Repository Structure" section listed pre-`crates/` paths (`vm/`,
`compiler/`, `derive/`, etc.) that no longer exist; `CONTRIBUTING.md`
already documents the current layout under "Code organization". Replace
the stale list with a link to that section.

Also generalized the title and intro from "GitHub Copilot Instructions"
to "AI Agent Instructions" — the file was already renamed from
`.github/copilot-instructions.md` to `AGENTS.md` in #6813 to follow the
cross-vendor AGENTS.md standard (https://agents.md/), but the title text
was never updated to match.

Assisted-by: Claude Code:claude-sonnet-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip:ci Skip running the ci

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@youknowone
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.