Skip to content

test(app): add long-session input lag perf guard#624

Merged
Astro-Han merged 3 commits into
devfrom
codex/i615-input-lag-guard
May 14, 2026
Merged

test(app): add long-session input lag perf guard#624
Astro-Han merged 3 commits into
devfrom
codex/i615-input-lag-guard

Conversation

@Astro-Han
Copy link
Copy Markdown
Owner

@Astro-Han Astro-Han commented May 14, 2026

Summary

  • Add a default-profile long-session-input-lag perf scenario.
  • Seed a long session, focus the composer, type a fixed draft, and capture the existing PR0 perf metrics window.
  • Lock the new scenario into the default profile with a unit test.

Why

#615 calls out typing lag in long sessions as a user-visible performance symptom, and #599 now tracks the May UI rewrite launch contract. Existing PR0 coverage protects streaming, tool expansion, scroll reading, timeline recompute, terminal open, and heavy default-open bash output, but did not directly measure composer typing inside a long session.

This PR adds that guard without changing UI behavior, message rendering, scroll ownership, virtualization, or diff rendering.

Related Issue

Related to #615 and #599.

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

Please focus on whether the scenario boundary is narrow enough: stable long-session fixture, reset after composer focus, fixed ASCII typing text, existing metrics capture, and default-profile routing only.

Risk Notes

Low. This only changes perf test coverage. It may add a small amount of runtime to the default perf probe workflow because the new scenario runs three browser samples.

How To Verify

Dependency install: bun install --frozen-lockfile completed successfully in the new worktree
TDD red: bun --cwd packages/app test ./e2e/perf/profiles.unit.ts failed before profile wiring because long-session-input-lag was not in the default profile
Profile unit: bun --cwd packages/app test ./e2e/perf/profiles.unit.ts -> 1069 pass, 0 fail
Focused perf e2e: bun --cwd packages/app test:e2e:local:perf -- --grep "long-session-input-lag" -> 1 passed
Typecheck: bun --cwd packages/app typecheck -> exit 0
Diff check: git diff --check -> exit 0

Screenshots or Recordings

Not required. This PR adds perf guard coverage only and does not change visible UI.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, primary area, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

  • Tests
    • Added performance testing scenario to measure input responsiveness in extended chat sessions.

Review Change Stack

@Astro-Han Astro-Han added P2 Medium priority app Application behavior and product flows ui Design system and user interface task Maintainer or agent execution task tech-debt Internal cleanup and maintainability debt labels May 14, 2026
@github-actions github-actions Bot removed the ui Design system and user interface label May 14, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Suggested priority: P3 (only low-risk paths changed (packages/app/e2e/perf/perf-probe.spec.ts, packages/app/e2e/perf/profiles.ts, packages/app/e2e/perf/profiles.unit.ts)).

P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.

@Astro-Han Astro-Han added the ui Design system and user interface label May 14, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 45 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2bcc0191-524f-43c9-84d5-261d5979fb67

📥 Commits

Reviewing files that changed from the base of the PR and between 70eab76 and 9d495a1.

📒 Files selected for processing (2)
  • packages/app/e2e/perf/perf-probe.spec.ts
  • packages/app/e2e/perf/timeline-fixture.ts
📝 Walkthrough

Walkthrough

This PR adds a new performance scenario named long-session-input-lag that measures input latency in sessions with timeline recompute overhead. The scenario is defined as a union type, wired into the default profile configuration, implemented as a 3-run e2e test with a prompt text verification helper, and validated via unit tests.

Changes

Long-session input lag performance scenario

Layer / File(s) Summary
Scenario type definition and profile wiring
packages/app/e2e/perf/profiles.ts
PerfScenarioName union adds "long-session-input-lag" and defaultScenarios set includes it for non-low-end profile runs.
Long-session input lag test scenario
packages/app/e2e/perf/perf-probe.spec.ts
Test constant inputLagText and helper readPromptText are added; the long-session-input-lag test case runs 3 times using a recompute-heavy session, types a prompt, asserts text match, and captures perf probe snapshots.
Profile coverage validation test
packages/app/e2e/perf/profiles.unit.ts
Unit test confirms long-session-input-lag scenario runs under default profile but not low-end profile.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Astro-Han/pawwork#609: Adds another perf-probe scenario test case (terminal-side-panel-open) to the same perf-probe test harness using shared helpers.
  • Astro-Han/pawwork#608: Modifies perf-probe scenario run handling, cooldown, and result aggregation at the same test harness level.
  • Astro-Han/pawwork#610: Extends the low-end perf-profile framework that this scenario wires into.

Poem

🐰 A scenario takes the stage, input lag measured through the page,
Prompt text flows with helper's grace, three runs trace the typing pace,
Default profile holds it tight, low-end skips it out of sight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The PR title clearly and specifically describes the main change: adding a new perf guard test for input lag in long sessions.
Description check ✅ Passed The PR description follows the template structure with all key sections completed: summary, why, related issues, review focus, risk notes, verification steps, and checklist fully filled out.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/i615-input-lag-guard

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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 and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new performance test scenario, "long-session-input-lag," designed to measure input responsiveness during long sessions with realistic message history. The changes include the test implementation in perf-probe.spec.ts, updates to the performance profile configurations, and a new unit test. Feedback was provided to replace the use of innerText with textContent in a helper function to avoid synchronous layout reflows that could introduce noise into the performance metrics.

Comment thread packages/app/e2e/perf/perf-probe.spec.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Perf delta summary

Comparator: pass

Profile / Scenario interaction median interaction worst long task max tbt frame gap p95 frame gap max jank count cls status
default / homepage-cold 48 -> 24 (-24) 48 -> 56 (+8) 73 -> 69 (-4) 23 -> 19 (-4) 33.3 -> 16.8 (-16.5) 133.3 -> 100.1 (-33.2) 3 -> 3 (0) 0 -> 0 (0) pass
default / long-session-input-lag 48 -> 40 (-8) 48 -> 40 (-8) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.7 (-0.1) 16.8 -> 16.8 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-streaming-long 40 -> 48 (+8) 80 -> 64 (-16) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.8 (0) 16.8 -> 16.8 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-call-expand 16 -> 24 (+8) 16 -> 24 (+8) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.7 (-0.1) 16.8 -> 16.7 (-0.1) 0 -> 0 (0) 0 -> 0 (0) pass
default / tool-default-open-heavy-bash 32 -> 24 (-8) 32 -> 24 (-8) 66 -> 64 (-2) 16 -> 14 (-2) 50 -> 49.9 (-0.1) 100 -> 100 (0) 3 -> 3 (0) 0 -> 0 (0) pass
default / terminal-side-panel-open 40 -> 48 (+8) 40 -> 56 (+16) 0 -> 0 (0) 0 -> 0 (0) 16.8 -> 16.8 (0) 16.8 -> 16.8 (0) 0 -> 0 (0) 0 -> 0 (0) pass
default / session-scroll-reading 24 -> 24 (0) 24 -> 24 (0) 0 -> 0 (0) 0 -> 0 (0) 16.7 -> 16.8 (+0.1) 16.7 -> 16.8 (+0.1) 0 -> 0 (0) 0.505 -> 0.505 (0) warn: cls
low-end / session-timeline-recompute 120 -> 120 (0) 136 -> 120 (-16) 110 -> 105 (-5) 165 -> 169 (+4) 83.3 -> 100.1 (+16.8) 166.7 -> 166.7 (0) 3 -> 3 (0) 0.081 -> 0.081 (0) pass

@github-actions github-actions Bot removed the ui Design system and user interface label May 14, 2026
@Astro-Han Astro-Han merged commit 93e73eb into dev May 14, 2026
24 of 25 checks passed
@Astro-Han Astro-Han deleted the codex/i615-input-lag-guard branch May 14, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows P2 Medium priority task Maintainer or agent execution task tech-debt Internal cleanup and maintainability debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant