Skip to content

ci: verify trimming, Native AOT and WebAssembly on every target (#272) - #595

Merged
michaelstonis merged 2 commits into
spec/33-broadside-v1from
272-trim-aot-wasm-verification
Nov 20, 2026
Merged

michaelstonis merged 2 commits into
spec/33-broadside-v1from
272-trim-aot-wasm-verification

Conversation

@michaelstonis

Copy link
Copy Markdown
Owner

Closes #272

Summary

Most of #272 was already in CI (the aot-smoke job on three OSes, three trimmed Blazor publishes, the macOS size probes, the Blazor size budget). This closes the gaps:

  • Native AOT host (tests/Broadside.Rendering.AotSmoke): besides rendering against the reviewed snapshots, it now extracts the text of text-standard14.pdf, saves it and opens it again. Runs on linux-x64, win-x64 and osx-arm64.
  • Size budget on every runtime: size-probes is a matrix over macOS, Linux and Windows; each leg compares its own runtime identifier in bench/baselines/gate/sizes.json (1% tolerance, existing BenchGate sizes).
  • Blazor trim warnings fail the publish: TrimmerSingleWarn=false plus ILLinkTreatWarningsAsErrors=true in the sample's publish properties, so a warning is attributed to its assembly and fails all three builds (AOT, hot-AOT, interpreter). Today there are none.
  • WebAssembly equals desktop (PlatformParityTests): in both the AOT build and the interpreter build, seven corpus files (Standard 14 text, paths, clipping, DCT, Coons mesh, soft masks, an embedded font) are opened with the bundled Standard 14 fonts, page 1 rendered with the software rasterizer, text extracted, the document saved and reopened. The render hash, size, text, page count and diagnostics must equal what the test process computes on the desktop runtime.
  • Docs: getting-started says what CI checks, and has a new "Fonts in the browser" section: Standard 14 package or UseFontResolver, otherwise FontProgramNotFound (and FontSubstituted when a stand-in is used).

Size budgets

Target Budget
Native AOT probes, per runtime the recorded size in bench/baselines/gate/sizes.json + 1%
Blazor site 10 MB Brotli-compressed, 40 MB on disk, 129 files (unchanged, PublishedAppTests)
--hot-aot runtime module under 16,000,000 bytes (unchanged)

The linux-x64 and win-x64 baselines do not exist yet, so those two legs fail as "new probe" on the first run. I will record them from this PR's size-probes-Linux and size-probes-Windows artifacts and push that as a second commit.

Deliverables

  • Tests through the public seam (PlatformParityTests, AOT smoke checks)
  • XML docs: no new public types
  • Conformance map: no spec clause touched
  • PublicAPI.Unshipped.txt: no change
  • Fuzz target / benchmark: no parser, codec or hot path

Public API changes

None.

Verification

  • dotnet publish tests/Broadside.Rendering.AotSmoke -c Release --use-current-runtime then --require-aot on osx-arm64: all checks passed, including the two new ones.
  • Both Blazor builds published locally (publish-static.sh and --no-aot --runtime-folder framework): no trim warnings.
  • PlatformParityTests: passed; all 14 builds × files had the same hash as the desktop (for example text-standard14.pdf 13b69e3d9dc6 in both).
  • PublishedAppTests: passed (size budget).
  • dotnet format --verify-no-changes on the three changed projects: clean.

The Native AOT smoke host also extracts the text of a corpus file,
saves it and opens it again, on Linux x64, Windows x64 and macOS
Arm64. The size probes run on all three runtimes, each against its own
runtime identifier's baseline.

The Blazor sample's trimmed publish reports every trim warning against
its own assembly and treats it as an error. A new browser test runs the
same steps in the AOT and the interpreter builds (open with the bundled
Standard 14 fonts, render page 1 with the software rasterizer, extract
text, save and reopen) and requires the desktop runtime's render hash,
text and diagnostics on seven corpus files.

The getting-started guide says what CI checks and how fonts resolve
in the browser without operating-system fonts.

Signed-off-by: Michael Stonis <120685+michaelstonis@users.noreply.github.com>
Measured by this pull request's size-probes legs (run 44754946474).
Against osx-arm64, the probes are 4-17% larger on Linux and 1-13%
larger on Windows, except the empty app, which is smaller on Windows.

Signed-off-by: Michael Stonis <120685+michaelstonis@users.noreply.github.com>
@michaelstonis
michaelstonis merged commit 32c73c3 into spec/33-broadside-v1 Nov 20, 2026
40 checks passed
@michaelstonis
michaelstonis deleted the 272-trim-aot-wasm-verification branch November 20, 2026 15:35
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