Skip to content

Compare update_lib contents and benchmark CPython parsing consistently - #9393

Merged
youknowone merged 1 commit into
RustPython:mainfrom
1ndahous3:tooling_measurement
Oct 26, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
1ndahous3:tooling_measurement

Conversation

@1ndahous3

@1ndahous3 1ndahous3 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Compare actual file contents when checking stdlib dependencies, including nested directories and files whose size and timestamps match. Do not reuse cached equality after a file changes.
  • Make the CPython parse_to_ast benchmark return an AST with PyCF_ONLY_AST, matching the work measured on the RustPython side instead of also compiling bytecode.

AI assistance

Written with Codex (GPT-6), reviewed by a human before submission.

Summary by CodeRabbit

  • Bug Fixes
    • File and directory comparisons now check file contents directly, including when timestamps match, and report paths as unequal when files are missing, types differ, or access fails.
  • Documentation
    • Benchmark documentation now clarifies that parsing benchmarks stop at AST generation.
    • The CPython parsing benchmark now requests an AST rather than compiling source into bytecode.

@chatgpt-codex-connector

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-26T09:04:56.878325Z ce68eec PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 26, 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 30b8239 and ce68eec.

Files selected for processing: 4
  • benches/README.md
  • benches/execution.rs
  • scripts/update_lib/file_utils.py
  • scripts/update_lib/tests/test_deps.py

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

Walkthrough

The CPython parsing benchmark now requests an AST without compiling bytecode. The update_lib path comparison logic now checks file contents, matching path types, and comparison errors, with a test for content changes despite matching timestamps.

Changes: AST-only Parsing Benchmark

Layer / File(s) Summary
AST-only benchmark behavior
benches/README.md, benches/execution.rs
The documentation states that parsing stops at the AST. The CPython benchmark passes ast.PyCF_ONLY_AST to compile.

update_lib Path Comparison

Layer / File(s) Summary
File and directory comparison
scripts/update_lib/file_utils.py, scripts/update_lib/tests/test_deps.py
File comparison reads bytes in chunks. Directory comparison rejects unmatched or funny entries. The test checks that changed contents are unequal even when timestamps match.

Priority: Low

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

Change: Bug fix

Possibly related issues

Possibly related PRs

  • RustPython/RustPython#9264 — It changes the same benchmark and file_utils areas, including AST-only parsing and byte comparison.

Suggested reviewers: youknowone, moreal

Merge Risk: Minimal · up to ce68e

The benchmark and file-comparison changes are 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 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (1 skipped: 1… 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 summarizes both main changes: comparing update_lib contents and aligning the CPython parsing benchmark with AST-only parsing.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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 merged commit 248f334 into RustPython:main Oct 26, 2026
20 checks passed
@1ndahous3
1ndahous3 deleted the tooling_measurement branch October 28, 2026 07:34
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