Skip to content

Fix flaky render snapshot tests caused by blinking caret - #943

Merged
johnml1135 merged 2 commits into
mainfrom
claude/fix-render-snapshot-caret-flakiness
Jun 10, 2026
Merged

Fix flaky render snapshot tests caused by blinking caret#943
johnml1135 merged 2 commits into
mainfrom
claude/fix-render-snapshot-caret-flakiness

Conversation

@jasonleenaylor

@jasonleenaylorjasonleenaylor commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The render-verification snapshot tests intermittently failed because the captured bitmap sometimes contained the text insertion-point caret and sometimes did not.

DummyBasicView.MakeRoot installs an insertion-point selection, and the capture passed fDrawSel: true to VwDrawRootBuffered.DrawTheRoot. The Views engine draws that selection via VwSelection::DrawIfShowing, gated on m_fShowing — which SimpleRootSite's 500 ms blink timer toggles. So whether the ~1px-wide caret landed in the snapshot was timing-dependent, producing diffs that crossed the 4px tolerance on some runs (e.g. medium differed by exactly 5px).

Change

  • Capture render snapshots with fDrawSel: false in both capture paths (RenderBenchmarkHarness.cs, CompositeViewCapture.cs). A correctness snapshot should capture content, not the transient caret.
  • Regenerate the 22 affected baselines, each verified pixel-identical to the prior baseline except for the removed caret.

rtl-script is left untouched (its RTL Arabic shaping is environment-sensitive) and will be regenerated on a matching machine if the caret removal trips its tolerance on CI.

🤖 Generated with Claude Code


This change is Reviewable

Pass fDrawSel: false when capturing render-verification bitmaps. The view's
insertion-point caret blinks on a 500ms timer, so drawing the selection
captured the caret non-deterministically and caused flaky pixel diffs.
Regenerate the affected baselines to match the caret-free capture.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actionsBot commented Jun 10, 2026

Copy link
Copy Markdown

Render comparison artifacts

Render snapshot failures were reported in a9370efc1932 run 27300040374.1, but the latest run a1e8ad3951f5 run 27307710408.1 is clean.

This comment will be replaced if a future run produces render snapshot failures again.

@github-actions

github-actionsBot commented Jun 10, 2026

Copy link
Copy Markdown

NUnit Tests

1 files 1 suites 10m 45s ⏱️
4 251 tests 4 178 ✅ 73 💤 0 ❌
4 260 runs 4 187 ✅ 73 💤 0 ❌

Results for commit c0f48f7.

♻️ This comment has been updated with latest results.

rtl-script and multi-ws rendered Arabic via the host's Segoe UI, whose
Arabic glyphs vary by Windows version — making those snapshots
non-deterministic across machines and CI. Download Scheherazade New
(pinned release, loaded privately, no system install) at build time and
tag Arabic runs with it, then regenerate the two affected baselines.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@johnml1135
johnml1135 merged commit 7b1269e into mainJun 10, 2026
6 checks passed
@johnml1135
johnml1135 deleted the claude/fix-render-snapshot-caret-flakiness branch June 10, 2026 23:44
jasonleenaylor added a commit that referenced this pull request Jun 11, 2026
* Fix flaky render snapshot tests caused by blinking caret
Pass fDrawSel: false when capturing render-verification bitmaps. The view's
insertion-point caret blinks on a 500ms timer, so drawing the selection
captured the caret non-deterministically and caused flaky pixel diffs.
Regenerate the affected baselines to match the caret-free capture.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Render Arabic snapshots with a pinned Scheherazade New font
rtl-script and multi-ws rendered Arabic via the host's Segoe UI, whose
Arabic glyphs vary by Windows version — making those snapshots
non-deterministic across machines and CI. Download Scheherazade New
(pinned release, loaded privately, no system install) at build time and
tag Arabic runs with it, then regenerate the two affected baselines.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit 7b1269e)
jasonleenaylor added a commit that referenced this pull request Aug 17, 2026
Narrows the PR's comment edits to the five commits that introduced the
bulk of them: the Avalonia conversion foundation (#964), the Views
render optimizations, the .NET tooling modernization (#678), the Charis
test font change (#945), and the blinking-caret snapshot fix (#943).
The eight files reverted here carried one to five edited comment lines
each, traced by git blame to unrelated commits going back to 2012. Each
file is restored to its merge-base content; all eight diffs were
comment-only, so no code changes are affected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto 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

@jasonleenaylor@johnml1135