Skip to content

1.13.0 pre-release review: candidate-bound fix, stress/fuzz tests, docs - #31

Merged
vietnguyentuan2019 merged 1 commit into
mainfrom
chore/1.13.0-final-review
Oct 10, 2026
Merged

vietnguyentuan2019 merged 1 commit into
mainfrom
chore/1.13.0-final-review

Conversation

@vietnguyentuan2019

Copy link
Copy Markdown
Contributor

Final review pass before publishing 1.13.0. Nothing is published or tagged.

Fix

_safeCandidateCharLimit (from #29) guessed the candidate-prefix bound from whether the first 32 characters contained CJK, and ignored the text scaler. A Latin run after one CJK character (<b>注</b>日本語 english …) was cut at ~83 characters, leaving the line up to 18 glyphs short. Before #29 the same input filled the line. The bound now comes from walking the actual text with each character's narrowest width. Reproduced with TextScaler.linear(0.5) at 800 px, because the test font (Ahem) makes every glyph 1 em wide and hides this class of bug.

Tests (+49)

  • line_breaking_stress_test.dart: narrow glyphs, no character lost or duplicated, 0 / 1 px widths, padding and floats wider than the container, intrinsic sizes in table cells and inline-blocks, 200,000-character paragraphs, a 100,000-character paragraph on the bounded fallback path.
  • fuzz/layout_fuzz_test.dart: lays mutated documents out at 0, 1, 37 and 300 px (the existing fuzz suite only parsed).
  • char_range_and_hooks_test.dart: ruby ranges, the ellipsis-only line, TextPainter layout hooks as a clock-free per-line bound.
  • Each was mutation-checked. Also passing on Chrome.
  • Coverage of lines changed since v1.12.0: 94.4% (322/341). The remaining lines are defensive branches that cannot be reached with the current fragment types.

Docs

  • CSS matrix claimed word-break: keep-all as supported; nothing implements it. Corrected, and overflow-wrap added.
  • ROADMAP: 1.13.0 marked "Release candidate" (flip to Shipped when published).
  • New doc/TESTING.md; test/integration/README.md listed six files that do not exist.

Checked, no change needed

  • All 7 other packages: lib/ is byte-identical to what is on pub.dev and their tests pass against core 1.13.0. Only core and root need a release.
  • dart pub publish --dry-run: core 0 warnings. pana on core: 160/160. Root pub downgrade + analyze clean.
  • Main CI on ef062d9: Ubuntu stable/beta, Windows, macOS all green.
  • Demo app: 44 widget tests; integration test opens 27 demo screens with 0 errors; RTL, CJK, mixed, float, break-all and ellipsis scenes rendered on macOS with real fonts and inspected.

…se review for 1.13.0

Line breaking
- _safeCandidateCharLimit guessed the bound from whether the first 32
  characters contained CJK and ignored the text scaler, so a Latin run after a
  single CJK character (e.g. `<b>注</b>日本語 english …`) was cut at ~83
  characters and the line ended up to 18 glyphs short. It now walks the text
  from the break position, adding each character's narrowest width (CJK 1em,
  other 0.25em, scaled by the text scaler). Removes the unused _isLeadingCjk.

Tests
- line_breaking_stress_test: narrow glyphs, no character lost or duplicated,
  zero/1px widths, padding and floats wider than the container, intrinsic
  sizes in table cells and inline-blocks, 200,000-character paragraphs and a
  100,000-character paragraph on the bounded fallback path.
- fuzz/layout_fuzz_test: lays mutated documents out at 0, 1, 37 and 300 px.
- char_range_and_hooks_test: ruby ranges, the ellipsis-only line, and the
  TextPainter layout hooks as a clock-free per-line bound.

Docs
- CSS matrix: word-break keep-all is parsed but not applied (was listed as
  supported); add overflow-wrap; drop stale line-number references.
- ROADMAP: 1.13.0 is a release candidate until published.
- New doc/TESTING.md; rewrite test/integration/README.md, which listed six
  files that do not exist; refresh stale version stamps.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Layout Regression — Budget exceeded (informational)

Fixture Budget (ms) Median (ms) P95 (ms)
❌ simple_paragraph 8 17 28
❌ mixed_inline 10 15 18
❌ float_layout 12 18 21
❌ table_20_rows 14 46 68
✅ cjk_ruby 14 10 12
❌ large_article 16 51 69

One or more fixtures exceeded the 16 ms budget.

Flutter 3.41.5 · ubuntu-22.04

Informational, does not block merge: CI runners use software
rendering and are 2-3x slower than the devices the budgets are
calibrated for. Compare against the base branch; if a fixture
regressed relative to it, profile with:

flutter test benchmark/layout_regression.dart --reporter expanded

and check _performLineLayout / _buildCharacterMapping for
any new O(N²) or O(N log N) paths introduced in this PR.

@vietnguyentuan2019
vietnguyentuan2019 merged commit 0fe2a6f into main Oct 10, 2026
9 checks passed
@vietnguyentuan2019
vietnguyentuan2019 deleted the chore/1.13.0-final-review branch October 10, 2026 09:03
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