Skip to content

feat: warn at enable time when a trace marker sits in a per-frame Unity message - #2280

Merged
hatayama merged 2 commits into
v3-betafrom
feat/pause-point-per-frame-trace-notice
Aug 20, 2026
Merged

hatayama merged 2 commits into
v3-betafrom
feat/pause-point-per-frame-trace-notice

Conversation

@hatayama

@hatayama hatayama commented Aug 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Enabling a pause point with capture mode trace on Update / FixedUpdate / LateUpdate / OnGUI now appends a notice that the target is a per-frame Unity message and that history can roll over quickly.

User Impact

  • Before: a trace marker on a per-frame message filled history within hundreds of milliseconds, and the first hint was a later status read.
  • After: the enable response states that the resolved method is a per-frame Unity message and suggests a conditional line or a larger --max-history. The wording does not claim overflow will happen.

Changes

  • Add BuildPerFrameTraceWarningOrEmpty: trace mode plus simple name Update / FixedUpdate / LateUpdate / OnGUI.
  • Interpolate Type.Method (including from Cecil FullName) and the effective max-history.
  • Append the notice after the other enable warnings.

Verification

  • dist/darwin-arm64/uloop compile → ErrorCount 0
  • uloop run-tests --filter-value PausePointPerFrameTraceNoticeTests → 12 passed / 0 failed (4 per-frame names, Cecil FullName, non-trace, non-matching names, concatenation order, file:line enable wiring)
  • scripts/check-file-length.sh and CODE_COMPLEXITY_FAIL_ON_EXCEEDED=true scripts/check-code-complexity.sh → no findings

Review in cubic

…ty message

Trace on Update/FixedUpdate/LateUpdate/OnGUI filled history before testers saw a status, and docs only recommended conditional lines after the fact. The enable notice states that fact without claiming overflow will happen.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6333bcca-0451-410b-b39a-2b61f6c5368a

📥 Commits

Reviewing files that changed from the base of the PR and between 14208da and e70b8fb.

📒 Files selected for processing (2)
  • Assets/Tests/Editor/PausePointPerFrameTraceNoticeTests.cs
  • Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs
🚧 Files skipped from review as they are similar to previous changes (2)
  • Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs
  • Assets/Tests/Editor/PausePointPerFrameTraceNoticeTests.cs

Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds trace-mode warnings for Unity per-frame message methods. It normalizes resolved method names, includes the configured history limit, merges the warning into pause-point enable results, and adds unit and end-to-end coverage.

Changes

Per-frame trace warning flow

Layer / File(s) Summary
Per-frame warning generation
Packages/src/Editor/FirstPartyTools/PausePoint/PausePointEnableWarnings.cs, Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointConstants.cs
The warning logic recognizes Update, FixedUpdate, LateUpdate, and OnGUI. It formats Cecil and dotted method names and includes the configured history limit.
Pause-point enable integration
Packages/src/Editor/FirstPartyTools/PausePoint/PausePointUseCase.cs
Source-location enablement merges the per-frame warning with existing enable warnings.
Warning and enablement validation
Assets/Tests/Editor/PausePointPerFrameTraceNoticeFixture.cs, Assets/Tests/Editor/PausePointPerFrameTraceNoticeTests.cs
Tests cover recognized and ignored methods, warning merging, end-to-end enablement, source lookup, and fake pause-controller behavior.

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

Merge Risk: ⚪ Minimal · up to e70b8

The PR adds an enable-time notice for trace markers on per-frame Unity messages without changing runtime tracing behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Test
  participant PausePointUseCase
  participant PausePointEnableWarnings
  Test->>PausePointUseCase: enable file-and-line trace pause point
  PausePointUseCase->>PausePointEnableWarnings: build warning from mode, method, and history
  PausePointEnableWarnings-->>PausePointUseCase: return per-frame notice
  PausePointUseCase-->>Test: return combined enable warnings
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 54.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the per-frame Unity message warning, implementation changes, user impact, and verification results.
Title check ✅ Passed The title clearly summarizes the main change: warning when a trace marker is enabled on a per-frame Unity message.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pause-point-per-frame-trace-notice

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.

…med as a Unity message

The notice asserted the method is a per-frame Unity message, which is false for a plain C# Update driven by a MonoBehaviour. Name-based matching stays so that delegation pattern is not a false negative.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama
hatayama merged commit a9c6679 into v3-beta Aug 20, 2026
14 checks passed
@hatayama
hatayama deleted the feat/pause-point-per-frame-trace-notice branch August 20, 2026 03:21
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.

1 participant