Skip to content

Memory footprint (alpha.18) + Windows CI fixes (alpha.19) - #2

Merged
239573049 merged 4 commits into
mainfrom
memory-footprint
Oct 17, 2026
Merged

239573049 merged 4 commits into
mainfrom
memory-footprint

Conversation

@239573049

Copy link
Copy Markdown
Collaborator

Summary

  • alpha.18 (a106aae) — memory: fallback fonts use only real faces (no synthetic copies), display-size image decode, disk thumbnails.
  • alpha.19 — fixes the Windows-only build-test failures on main:
    • IncrementalLayoutTests.StreamedLineBreaks_MatchFullLayout_AtEveryStep(styled: False): fallback fonts were chosen by the first character of the fetched run, so per-line relayout (which fetches from the line start) could pick a different CJK font than the full layout. Also Avalonia's TryMatchCharacter reuses previously matched fallbacks, making results history-dependent. Now matched by the start of the uncovered stretch and memoized per character.
    • DiffRenderingTests.Default_IsGitHubMarkdownStyle_TogglesToSplit: Windows checkout turns the raw string literal into CRLF; compare with LF.

Test plan

  • New StreamedMixedScripts_MatchFullLayout reproduces on macOS (fails 3/3 before the fix, passes after)
  • dotnet test StreamMark.slnx on macOS: 159 + 269 passed
  • CI on Windows / Linux / AOT smoke

🤖 Generated with Claude Code

239573049 and others added 4 commits October 17, 2026 17:41
…ls (0.1.0-alpha.18)

- Fallback fonts use only faces the family really has (FontFamily.FamilyTypefaces).
  Probing missing weights or styles made Avalonia 12 synthesize them, which copies
  the whole font file three times and keeps it resident (Apple Color Emoji: ~600 MB).
- ImagePipeline.DecodeDensity caps the decode density of document images. The default
  viewer opens at natural size, swaps in the original once it loads, and evicts it on close.
- Disk thumbnails: downscaled decodes and rasterized SVGs are written to the disk cache,
  keyed by bucket and source version (local file size+mtime, or the remote entry's
  validators). They are looked up before the original bytes are read. The IImageEncoder
  extension point is new, with WebPImageEncoder in StreamMark.Mermaid; without an
  encoder they fall back to PNG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….0-alpha.19)

- InlineTextSource matches a fallback font by the first character of the whole
  uncovered stretch, not of the run being fetched. Per-line layout fetches runs
  from the line start ("首" instead of "。"), and on Windows those can match
  different CJK fonts, so incremental breaks differed from the full layout.
- MatchFallback memoizes each character's first match: Avalonia's
  TryMatchCharacter prefers previously matched fallbacks (after "한", "。" maps
  to Apple SD Gothic Neo instead of PingFang SC), so results depended on history.
- IncrementalLayoutTests.StreamedMixedScripts_MatchFullLayout reproduces both on
  macOS (Hangul/Han without spaces); fails before, passes after.
- DiffRenderingTests compares copied text with LF: Windows checkouts turn the raw
  string literal into CRLF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- InlineStyles_Render: decide "a heavier weight exists" by loading the heaviest
  listed face; on macos-latest PingFang SC lists 600 but loads Medium.
- FallbackRuns_UseRealFaces_NotSyntheticCopies: only check fallback runs; on
  ubuntu-latest there is no CJK font and DejaVu Sans (no italic face) draws the
  text itself, so its italic is synthesized as for any primary-font italic.
- IncrementalLayoutTests: wait for the text segment before reading it; as the
  first test in the process on x64 Linux one frame was not enough.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Loading Typeface(...).GlyphTypeface for a listed weight is what the fallback code
avoids (synthesis, cache pollution); on Windows it made the following
FallbackRuns test see a synthetic Yu Gothic Bold/Italic. Decide from the already
resolved faces instead: if even the regular run resolved to Medium or heavier
(PingFang SC on macos-latest lists 600 but loads Medium), there is no weight to
compare.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@239573049
239573049 merged commit f36d637 into main Oct 17, 2026
13 checks passed
@239573049
239573049 deleted the memory-footprint branch October 18, 2026 16:16
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