| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used 📚 Code guidelines (1)AGENTS.md — auto-discovered No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info ⚙️ Run configuration
Reviewing files that changed from the base of the PR and between ee8a4e7 and ddace94. 📒 Files selected for processing (2)
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 WalkthroughThe change adds Dict::move_to_end, exposes it through the exact-dictionary API and _imp, and adds tests for ordering, lookup behavior, callback-driven mutations, and iterator invalidation. ChangesDictionary Reordering
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to ddace This adds a private helper for reordering dictionary entries without briefly removing them from the module cache. No concrete merge-blocking risk was found in the supplied changes. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to ddace The new helper operates only on a dictionary supplied by its caller and preserves entries during relocation. No new privilege or isolation bypass was demonstrated. However, the production import-ordering code remains unchanged, and concurrent runtime behavior was not validated in this review. Retained concerns Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
❌ Failed checks (1 warning)
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. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/importlib dependencies:
dependent tests: (129 tests)
Legend:
|
Sorry, something went wrong.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sorry, something went wrong.
Add a private exact-dict move primitive and importlib dispatcher so shutdown-order updates never temporarily remove a module. Preserve current values and custom-mapping fallback behavior; validate reentrant equality probe witnesses, invalidate layout caches, and compact moved entries. Cover all four existing bootstrap reorder sites, including legacy-loader cleanup. Add deterministic trace-window, loader replacement/removal, reentrancy, cache, iterator and compaction regressions. The private native primitive uses true-move semantics; it does not promise arbitrary pop/set callback equivalence. Assisted-by: Codex:model-version-unavailable
Run legacy-loader cases when the bootstrap exposes that helper, preserving all four 3.14 paths and the two remaining 3.15 paths. Always retain modern load and exec regressions. Assisted-by: Codex:model-version-unavailable
Restore the exact CPython 3.14 bootstrap and retain only the private exact-dict relocation primitive and its direct native regressions. Remove the PR-added callback integration tests while preserving native helper assertions. This prepares a primitive only; imports do not call it and the import race remains unresolved. Assisted-by: Codex:model-version-unavailable
Merging this PR will not alter performance✅ 62 untouched benchmarks Comparing youknowdot:cpython-import-atomic-reorder (ddace94) with main (04d9990) Footnotes
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Keep exact dict entries in sys.modules present while importlib updates shutdown order. The old pop() / assignment pair exposes a temporary absence to other importing threads. This is independently based on current Python 3.14-targeting main; it does not switch the target or the cached importer callback.
Semantic scope
This is a true move rather than a universally equivalent pop / assignment pair. It hashes once, preserves the stored key object, pins one dictionary and lookup key, and makes an already-last entry a no-op. Exact-dict callback side effects that depended on a second hash, key replacement, or rebinding sys.modules between the two Python operations intentionally differ. The custom-mapping fallback preserves those original Python operations and is not atomic.
Deliberate module removal/replacement and whole-map rebinding remain possible; this eliminates the artificial gap caused by shutdown-order maintenance. Identity hits in the first bucket allocate no probe-prefix storage. Pathological reentrant colliding keys can require O(k²) prefix validation and O(k) retained references.
This is a prerequisite for the separately prepared Python 3.15 bootstrap and canonical importer callback migration. It does not claim to fix the pre-existing Python 3.14 hierarchical-import deadlock.
Validation
The standalone release was built from this branch, and its frozen/source bootstrap, private helper, target 3.14 and source-Lib provenance were checked.
Rust/Lib implementation and aggregate checks are at 2e30cbf. The final head only adds the independently rerun snippet availability guard; production source is byte-identical.
A shared-target stale VM test binary was detected because it lacked the new tests. That first aggregate run is discarded as validation. The reported fresh runs rebuilt the affected sources, verified the new test names, and checked the resulting binary provenance. No source content was changed to repair that cache issue.
AI assistance
Implemented, reviewed and tested with OpenAI Codex under the requesting RustPython maintainer's direction. No human code review or maintainer privilege is implied for this account. The runtime does not expose an exact model version; commits use Assisted-by: Codex:model-version-unavailable rather than inventing one.
Summary by CodeRabbit