Skip to content

Preserve loop LINE events with INSTRUCTION monitoring - #9231

Merged
youknowone merged 1 commit into
RustPython:mainfrom
1ndahous3:monitoring_line_targets
Oct 20, 2026
Merged

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

Conversation

@1ndahous3

@1ndahous3 1ndahous3 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolve wrapped instructions when locating line starts and jump targets. Enabling LINE and INSTRUCTION together now preserves loop-header LINE events.

Completes the combined-event case left after #9203.

AI assistance

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

Summary by CodeRabbit

  • Bug Fixes
    • Fixed line monitoring when line and instruction events are enabled together, including for loop branches and exception-handler targets.
  • Tests
    • Added regression coverage for combined monitoring events in a loop.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

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 ✅ Completed 2026-10-19T18:31:13.707423Z a641f81 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a641f817fc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extra_tests/snippets/stdlib_sys.py
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 49bd1928-2ce0-4b84-8cbe-7860131ff510
📥 Commits

Reviewing files that changed from the base of the PR and between c08375b and a641f81.

📒 Files selected for processing: 2
  • crates/vm/src/stdlib/sys/monitoring.rs
  • extra_tests/snippets/stdlib_sys.py

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

📝 Walkthrough

Line instrumentation now resolves original opcodes when instructions have instruction-monitoring wrappers. The regression test enables line and instruction events for a loop and checks the recorded line offsets.

Changes: Line instrumentation

Layer / File(s) Summary
Resolve wrapped opcodes during instrumentation
crates/vm/src/stdlib/sys/monitoring.rs, extra_tests/snippets/stdlib_sys.py
Line-start, jump-target, and exception-handler target classification use a resolver that unwraps instruction-monitoring wrappers. The regression test checks the loop result and exact line-event sequence with both event types enabled.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: youknowone

Merge Risk: ⚪ Minimal · up to a641f

No actionable issue remains from this review; the change is 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 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. 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 and concisely describes the main change: preserving loop LINE events when INSTRUCTION monitoring is enabled.
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.
  • Fix all pre-merge checks with AI
✨ 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 0d46e8a into RustPython:main Oct 20, 2026
21 checks passed
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