Skip to content

Fit plot font atlases to their glyph inventory - #24

Merged
imakris merged 3 commits into
masterfrom
memory/fit-plot-atlas
Oct 20, 2026
Merged

imakris merged 3 commits into
masterfrom
memory/fit-plot-atlas

Conversation

@imakris

@imakris imakris commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Purpose

Plot font atlases retain a fixed 2048-square bitmap even when their glyph inventory fits in a smaller canvas. Enable automatic sizing while preserving glyph scale, CPU bitmap lifetime, and the cache memory budget.

Changes

Enable options_t::auto_atlas_size and include that policy in the font digest. Accept the resulting power-of-two disk-cache extents from 1 through 2048 only when the RGBA byte count matches. Preserve the disk format, 128 MiB CPU retention budget, actual-size accounting, and bitmaps needed for renderer recreation. Extend disk-cache coverage for supported and malformed extents and payload lengths.

Add persistent compiler caches to the four native CI workflows. Use Visual Studio 2026 and MSVC v145 on Windows, with explicit environment/compiler checks and Ninja so the compiler launcher is effective. Reuse prebuilt Qt and preserve dependency declarations tracking master.

The prerequisite vnm_msdf_text PR #2 has merged with all checks passing.

Validation

  • All eight native CI jobs and CodeQL pass. Text suites pass 43 tests each on Linux, FreeBSD and macOS, and 44 on Windows, including FontDiskCache, FontAtlasCache, FontIdentity, FontRendererBounds, FontRendererDrawRanges and PlotRendererLifecycle.
  • Native D3D11 Release comparison used three interleaved baseline/candidate pairs at DPR 1 and 2, each with 300 measured frames through the production renderer and GPU completion. Atlas RGBA storage falls from 16 MiB to 4 MiB at both DPIs. Frame timings show no repeatable material regression; no universal speedup claim is made.
  • All 248 glyph metrics, kerning, coverage and glyph bitmap crops match. DPR 2 rendered pixels match exactly. DPR 1 differs at 16 of 864,000 pixels by at most one channel unit. Each variant recreates renderer resources with exact pixels, retained CPU atlas storage and one atlas upload per renderer.
  • Compiler-cache statistics prove persistent reuse and FreeBSD cache save/copyback. Individual Linux cache stores reported errors, affecting only future reuse; subsequent validation recorded 165 hits out of 173 requests with no compilation or test failure.

Independent source and validation review found no remaining product blocker. One-off benchmark instrumentation is retained outside the repository and is excluded from the shipped changes.

Opt into the automatic atlas sizing API proposed in vnm_msdf_text PR #2,
and include that policy in the font digest. Accept its bounded power-of-two
extents in the existing disk format and require the matching RGBA length.
Keep the current bitmap lifetime and actual-byte cache budget.

Extend disk-cache coverage for valid fitted sizes, mismatched lengths and
invalid extents. Native compilation and tests remain pending in the
maintained build lane; no runtime or timing acceptance is claimed.
The atlas change needs renewed native text validation after its provider API lands. Preserve compiler outputs between hosted runs so dependency and product compilation can be reused instead of repeating uncached builds.

Use the existing provider's GitHub-backed sccache setup on Linux, macOS and Windows, and restore/save a workspace ccache across the FreeBSD VM boundary. Print cache statistics even when a gate fails. Configure Ninja and bound builds to two workers so compiler launchers are effective on every lane.

Select Visual Studio 2026 with the MSVC 14.51 toolset for Windows and verify both the developer environment and configured compiler paths. Keep prebuilt Qt, dependency master declarations and existing test coverage.

Validation: actionlint 1.7.12, YAML parsing, embedded PowerShell parsing and git diff --check pass. Native validation follows publication with the merged provider API.
The Windows lanes fail before configuration because msvc-dev-cmd interprets vsversion 18.0 as the range 18.0 through 18.9. The hosted VS2026 image has version 18.10, so that range excludes the installed toolchain.

Use the action's latest-installation discovery, matching the provider's working setup. Keep the explicit VisualStudioVersion 18.0, MSVC 14.51 and configured compiler-root checks so another toolchain cannot silently satisfy the lane. Print compiler-cache statistics only after sccache setup succeeds.

Validation: both failed job logs establish the discovery error; upstream action source confirms the excluded version range. actionlint 1.7.12 and git diff --check pass, and the affected staged fix passed independent review.
@imakris
imakris marked this pull request as ready for review October 20, 2026 15:56
@imakris
imakris merged commit 96e2aa8 into master Oct 20, 2026
12 checks passed
@imakris
imakris deleted the memory/fit-plot-atlas branch October 20, 2026 15:56
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