Skip to content

test: Compare math script baselines, not box tops - #26035

Merged
MartinZikmund merged 1 commit into
masterfrom
dev/xygu/20261103/richeditbox-math-wasm-flake
Nov 5, 2026
Merged

MartinZikmund merged 1 commit into
masterfrom
dev/xygu/20261103/richeditbox-math-wasm-flake

Conversation

@Xiaoy312

@Xiaoy312 Xiaoy312 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: related to #26016 (stabilizes the test; the WASM math-font nondeterminism and the fallback-service batching race described there are still open)

PR Type:

🏗️ Build or CI related changes (test stabilization)

What changed? 🚀

Given_RichEditBox.When_Advanced_Math_Layout_Is_Bounded_And_Maps_Scripts fails WebAssembly Skia Runtime Tests shard 3 in about 1 in 4 master builds since 2026-10-30, on preSup.Y < baseRect.Y.

The script assertions compared the tops of the caret rects of a base and its scripts. That depends on the math font's line box. On WASM, RichEditBox uses Noto Sans Math when an earlier test has already downloaded it, and Open Sans otherwise (see #26016 for why that happens). With Noto Sans Math, the base letter's box is tall enough that its top sits above the top of the raised, smaller superscript, so the assertion fails even though the layout is correct.

This PR compares baselines (MathParsedText.GetBaselineForIndex) instead. That is what the layout actually shifts:

  • A glyph's index baseline equals the baseline its box was arranged at.
  • ScriptBox and MultiScriptsBox move superscripts up and subscripts down by amounts that are never zero, including with the fallback metrics for fonts without a MATH table (0.55em up, 0.25em down).

Changes:

  • When_Advanced_Math_Layout_Is_Bounded_And_Maps_Scripts: the four mmultiscripts assertions compare baselines.
  • When_Structured_Math_Layout_Maps_Core_Markers: the msubsup pair had the same top comparison across scales, so it compares baselines too.

No product code changes.

Validation (runtime, local):

Run Math font Result
WASM, Given_CurrencyFormatter.When_FormatDoubleWithSpecialCurrencyCode first, Arabic font download delayed 1.5 s (this configuration failed with the old assertion) Noto Sans Math both tests pass
WASM, the two math tests alone Open Sans both pass
Skia Desktop (Windows) Cambria Math both pass

The delay in the first row came from local-only instrumentation that is not part of this PR.

PR Checklist ✅

🤖 Generated with Claude Code

@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Nov 4, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

The script assertions compared caret-box tops across scales, which
depends on the math font's line box: with Noto Sans Math (picked on
WASM when an earlier test already downloaded it) the base's top sits
above a raised superscript's top. Compare baselines instead, which is
what the layout actually shifts.

Refs #26016

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Xiaoy312
Xiaoy312 force-pushed the dev/xygu/20261103/richeditbox-math-wasm-flake branch from e70850a to 987eed2 Compare November 4, 2026 18:52
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 243720 found UI Test snapshots differences: skia-linux-screenshots: 2458, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 2458 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedIconPage.png-dark
    • AppBarButtonWithIconTest.png
    • ApplicationViewMode.png-dark
    • Application_DispatcherShutdownMode.png
    • AppWindowTitleBar Properties.png
    • Attributed_text_Simple.png
    • AuthenticationBroker_Demo.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_Relations.png-dark
    • AutomationProperties_Relations.png
    • AutoSuggestBox_Icons.png-dark
    • AutoSuggestBox_Icons.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png
    • Battery.png-dark
    • Battery.png
    • BindableDrawerLayout_ChangePane.png-dark
    • BindableDrawerLayout_ChangePane.png
    • BorderBottomwithmargins.png-dark
    • BorderBottomwithmargins.png
  • skia-windows-screenshots: 2458 changed over 2494

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png
    • AppBarButtonTest.png
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSizing.png
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png-dark
    • Arrange_Performance01.png-dark
    • Attributed_text_Supserscript.png-dark
    • AutoBorderStretchwithrightmargin.png
    • AutoBorderStretchwithtopmargin.png-dark
    • AutoSizedPathCentered.png-dark
    • AutoSizedPathCentered.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png
    • Battery.png-dark
    • Battery.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png

@MartinZikmund
MartinZikmund merged commit 6f30f15 into master Nov 5, 2026
46 of 52 checks passed
@MartinZikmund
MartinZikmund deleted the dev/xygu/20261103/richeditbox-math-wasm-flake branch November 5, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants