Repository navigation
feat(nsgotest): render native drawings without a macOS window - #1871
Merged
Merged
Conversation
1 of 7 tasks
houko
force-pushed
the
feat/windowless-render-565
branch
2 times, most recently
from
November 22, 2026 04:56
abb9178 to
1e62d48
Compare
Collaborator
Author
|
Reviewed. Checked the windowless resolver (per-render image cache keyed by source and ratio, offscreen cycle detection, release of every CGImage and bitmap, premultiplied RGBA copy out of |
houko
enabled auto-merge
November 22, 2026 05:28
houko
force-pushed
the
feat/windowless-render-565
branch
from
November 22, 2026 08:15
1e62d48 to
11bba43
Compare
houko
added this pull request to the merge queue
Nov 22, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 22, 2026
houko
force-pushed
the
feat/windowless-render-565
branch
from
November 22, 2026 10:36
11bba43 to
3c4ea6e
Compare
houko
enabled auto-merge
November 22, 2026 10:36
houko
added this pull request to the merge queue
Nov 22, 2026
houko
force-pushed
the
feat/windowless-render-565
branch
from
November 23, 2026 00:42
3c4ea6e to
456c133
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Headless tests can now measure native text, register fonts and render a recorded canvas on macOS without creating a window.
nsgotest.PlatformTextEngine,RegisterFontandRenderreuse CoreText and the existing Apple canvas player;Renderreturns owned transparent RGBA pixels suitable for PNG export or golden comparisons.Rendering uses a private synchronous image resolver, including nested offscreen drawings, instead of the view caches or main queue. It releases native resources per call, preserves output scale and premultiplied alpha, and reports image failures, offscreen cycles, unresolved view paints/animations and invalid sizes. Image loading has a 30-second context and output is bounded to 16 Mi pixels. Concurrent renders keep independent image state.
Refs #565. This is its macOS test-utility stage. Windows/Linux native helpers and the runtime scope service on devices remain explicit roadmap work; other targets return
ErrNoPlayerand have no platform text engine from this helper. The dependency graph explicitly allows nsgotest to reach the shared Apple player while core remains independent of backends. Public testing docs and the app-author skill are updated.Targets
nsgotesthelpers and dependency rules)Screenshots
None; no app interface changes. Native bitmap probes cover the output.
Verification
Rebased onto main
782a97b2fand migrated the release note into a dedicatedchangelog.dfragment, preserving the tested implementation. Earlier CI failures below describe historical runs; current checks run on the rebased head.go tool nsgo test ./nsgotest -- -count=1: 163 passed, one existing skip.-targetor a window: all five shared canvas sample groups, scale equivalence, transparent premultiplied pixels, nested and malformed images, cycle/size failures, concurrent PNG rendering, native metrics and registered-font PUA glyphs distinct from fallback output.go tool nsgo test ./internal/platform/apple -run '^(TestCanvasSamples|TestRegisteredFontsLayOut|TestAFontRegisteredLaterReplacesItsFallback)$' -- -count=1: three passed, no skips, including all six existing Apple canvas sample groups.go tool nsgo check -target all -jobs 2passed with a task-owned cache after unrelated shared-cache removal interrupted the first attempt; all targets selected by the tool passed.TestPublicAPINamesNoInternalTypeImageSampling allowance andTestMinimalAppLinkson macOS/Linux, tracked by fix(platform): keep net/http out of minimal apps #1797.driver.ImageSamplingallowance; temporarily applying that existing one-line correction from fix(platform): keep net/http out of minimal apps #1797 makes it pass. That separate correction is excluded from this PR.Checklist