Skip to content

PANA-8613: Improve composition capture consistency and efficiency - #3977

Open
jonathanmos wants to merge 5 commits into
jmoskovich/03-sr-new-pipelinefrom
jmoskovich/03-sr-new-pipeline-optimizations
Open

jonathanmos wants to merge 5 commits into
jmoskovich/03-sr-new-pipelinefrom
jmoskovich/03-sr-new-pipeline-optimizations

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Updates the composition-based Session Replay pipeline to:

  • Copy native view state in one UI pass and build snapshots off-thread, avoiding inconsistent captures when the UI changes between slices.
  • Skip fully occluded native content across hierarchy branches, preserving visible content and accounting for drawable opacity.
  • Keep snapshot construction independent of slower downstream processing.
  • Fix window retention after recording stops.

Motivation

RUM-8613 — improve snapshot consistency, reduce unnecessary processing, and prevent removed windows from being retained.

Additional Notes

Additional Notes

Release-build benchmarks on a test device, using synthetic layouts with 2,500 native views, showed:

Content coverage Worker processing p95 Serialized record size
Fully covered 79% lower — 8.28 → 1.78 ms 83% smaller
Half covered 24% lower — 10.50 → 7.98 ms 41% smaller
Fully visible 4% higher — 9.92 → 10.34 ms Essentially unchanged

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed. Datadog automation helped this PR pass.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 1 test - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
• Patch Coverage: 84.75%
• Overall Coverage: 72.51% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0b5f4b7 | Docs | View more details | Give us feedback!

@jonathanmos

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-13T14:53:29.879651Z 0b5f4b7 New commits
🔒 Security Review ✅ Completed 2026-10-13T14:50:27.811099Z 0b5f4b7 New commits
ℹ️ 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: 72676e0aa2

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 72676e0aa2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@jonathanmos
jonathanmos marked this pull request as ready for review October 13, 2026 08:11
@jonathanmos
jonathanmos requested review from a team as code owners October 13, 2026 08:11

@datadog-prod-us1-5 datadog-prod-us1-5 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.

Bits Code Review: PASS

More details

The single-pass capture and worker handoff appear consistent with existing snapshot contracts. Occlusion filtering preserves partial visibility and inherited clipping in the reviewed paths.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit f30ee49

@jonathanmos
jonathanmos force-pushed the jmoskovich/03-sr-new-pipeline branch from a27f444 to b4e4f19 Compare October 13, 2026 14:33
Use weak keys for excluded decor views so lifecycle callbacks received while
recording is stopped cannot retain removed windows without a refresh loop.

Make composition draw listeners hold weak view references as defensive
hardening, while preserving explicit removal from the original observer.
Existing refresh and stop cleanup released the draw registration graph in
baseline tests; the reproduced retention was in the stopped exclusion set.

Add 13 retention regressions covering collection, original-observer cleanup,
removal failures, stopped activity callbacks, and exclusions across restart.
Keep the orchestration test's source view alive until its draw callback.

Validation: 480 composition tests, module ktlintCheck, and Detekt passed.
@jonathanmos
jonathanmos force-pushed the jmoskovich/03-sr-new-pipeline-optimizations branch from d1b3c6c to 0b5f4b7 Compare October 13, 2026 14:43
@jonathanmos jonathanmos changed the title RUM-8613: Improve composition capture consistency and efficiency PANA-8613: Improve composition capture consistency and efficiency Oct 13, 2026
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