fix(desktop): retain unchanged boundaries on resize - #219
Merged
Conversation
besmpl
marked this pull request as ready for review
August 10, 2026 17:04
besmpl
force-pushed
the
agent/retain-boundaries-on-resize
branch
from
August 10, 2026 20:46
0a7ce06 to
060b742
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
kolkov
reviewed
Aug 11, 2026
kolkov
left a comment
Contributor
There was a problem hiding this comment.
APPROVE (pending lint fix)
Architecturally sound performance fix. The core insight is correct: a swapchain resize does not mean every boundary's physical size changed. The PR correctly separates surface lifecycle from boundary lifecycle.
Key changes:
- Removes global
releaseBoundaryTextures()+MarkRedrawInTree(root)from resize path ensureBoundaryTextureselectively replaces only entries whose size changed- New
surfaceResizePendingflag drives full surface composition without poisoningfullRedrawNeeded - Root scene invalidation handles the
RenderModeHostManagedpath withdirtySuppressorguard
Test quality is strong: fixed-size cache reuse, constraint-driven invalidation, selective texture replacement, and E2E software backend validation.
Lint issues (2, trivial):
desktop/desktop.go:526-- unused//nolint:nestifdirective. Remove the directive.desktop/resize_surface_e2e_test.go:113-- trailing newline. Remove the blank line before closing}.
Both are one-line fixes. Once lint passes, this is ready to merge.
besmpl
force-pushed
the
agent/retain-boundaries-on-resize
branch
from
August 12, 2026 06:52
508aaa5 to
bad5206
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
Why
Window resizing currently dirties every repaint boundary and releases every cached boundary texture, even when most boundaries keep the same dimensions. Allocating or resizing one boundary texture also contaminates the frame-global full-redraw flag. Together these behaviors defeat retained rendering and cause avoidable GPU allocation churn during live resize.
This change makes texture lifetime follow each boundary's physical size. Layout's existing constraint cache remains responsible for dirtying descendants whose constraints genuinely change, while unchanged fixed-size subtrees reuse their recorded scene and texture.
Canvas resize remains a distinct surface-only work reason. It admits an otherwise-clean live-resize frame and forces full-surface composition/damage without feeding root or child scene dirtiness, then clears only after a successful full render.
Verification
go test ./... -count=1go test -race ./app ./desktop ./widgetgo build ./...go vet ./...git diff --checkThe broad repository race run still reports the pre-existing animation-pumper test race in
mockWindowProvider.RequestRedraw; all other packages and the changed paths pass. Live Metal/RSS validation was not available in this environment.This is intentionally separate from #172, which handles cross-display device-scale changes and may require a small rebase after either PR merges.
Fixes #176
Local CI and Codecov preflight
main(273cc1e) and the prior conflict resolved while preserving the upstream pluggable debug-overlay pathgo test ./... -count=1with a full coverage profile: passTestWindow_AnimPumper_StartsOnInvalidationmock race noted abovego build ./...,go vet ./...,gofmt, and diff checks: passapp/window.go13/13,desktop/desktop.go26/26); overall coverage 87.0%Upstream CI run approval is still external to this branch: GitHub marked the fork workflow
action_requiredwith zero jobs (run31435378503). Agogpumaintainer must approve the workflow before Actions and the configured Codecov upload/bot can run.Review follow-up (2026-08-12)
Removed the obsolete
//nolint:nestifsuppression and the stray blank line, then rebased onto currentmain.