Repository navigation
gh-162705: Report QSBR progress during list and tuple scans - #162942
mehdipanjwani7-glitch wants to merge 1 commit into
Conversation
Report quiescence every 1024 iterations while preserving early returns. Use the out-of-line thread-state getter to keep TLS address resolution off short scan paths. Add native epoch-progress regression checks and a NEWS entry. Developed and technically reviewed with Codex AI assistance.
|
Thank you for your interest in contributing to Python. This is a community-driven project, and we want it to be a welcoming place to learn and collaborate. Contributors are responsible for reviewing and understanding what they submit, checking its claims, and being able to explain changes in their own words. This helps reviewers focus on the contribution and leaves more time to support other contributors. We believe this contribution does not meet our guidelines for using AI tools, so we're closing it. If you think we've misunderstood your contribution, please let us know. You're welcome to explain your approach or ask questions about the guidelines. Please read our guidelines for using AI tools. |
|
There is nothing actionable for now, a PR is premature. |
|
Edited to clarify attribution and update the validation results. I’m Muhammad Mehdi (mehdipanjwani7-glitch), the contributor behind this PR. I authorized the work and submission. Codex provided substantial assistance with implementation, technical investigation, test execution and documentation, including this clarification. The proposal addresses delayed reclamation during long list and tuple membership, index and count scans in free-threaded CPython. It adds periodic QSBR reports every 1,024 iterations, after temporary list-element references have been released on continuing paths. It follows the retention report and manual-quiescence proposal in #162705. The unresolved design question is whether callers also satisfy the quiescence contract; local reference-lifetime checks do not establish that for every native caller. The separate audit corrected a checker defect that missed reference uses inside acquisition initializers, tightened benchmark validation to reject incomplete worker overlap and missing build metadata, and enlarged concurrent-resize tests beyond the reporting interval. Those are improvements to the research tooling and evidence, not additional runtime fixes. All 31 checker/qualification tests pass; the nine native behavior tests pass on the five recorded build arms. The audit record contains the exact revisions, measurements and limits. The fork’s official CI run has finished: 39 jobs passed, two skipped, five could not acquire runners, and MSan plus the aggregate check failed. The MSan failure is an external-inspection source-location assertion; independence from the patch has not been established. The overall result is not green. I acknowledge the request for human design discussion first. The PR remains closed, and no replacement PR or renewed review is being requested. |
|
We are not interested in having an agent doing work autonomously. The issue needs disucssion first, by humans. |
Refs #162705. Long attached list and tuple scans can hold up reclamation of arrays retired by other threads. This reports QSBR progress every 1,024 iterations in membership, index and count scans.
Membership and index scans report on continuing paths, after temporary element references have been released. Count scans cover the identity-fast-path
continuetoo. Each report reloads the current QSBR record. The out-of-line thread-state getter keeps Clang's TLS address resolution off short scan paths; disassembly of the initial inline-getter version showed that lookup being hoisted before the loop.The native regression helper advances the write epoch after preparing arguments and observes the read sequence before returning to Python. Eight list/tuple subcases fail without the runtime change and pass with it. The index cases start at one, so a report only at index zero cannot satisfy them.
Validation on macOS arm64, Apple Clang 21, based on
ce50df41e3b9aa68b10bbe49cbb57382d6201ec8:Raw measurements, build settings and test logs, long-scan/pressure matrix, common cases, and baseline regression failure. Superseded variants and their unfavorable results are retained in the same directory.
This builds on the manual quiescent-reporting approach proposed in the original issue. It addresses these six scans; other long native calls and uncooperative threads remain outside this change, so it should not close the broader issue.
AI assistance: Codex was used for implementation, technical review, and the supporting test/benchmark scripts.