fix: correct non-circular tile placement and blending - #2088
Open
shawn-mengchen-xu wants to merge 1 commit into
Open
shawn-mengchen-xu wants to merge 1 commit into
shawn-mengchen-xu wants to merge 1 commit into
Conversation
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
Fix non-circular tile placement and blending so that the overlap used for blending matches the actual overlap between adjacent tiles.
The previous
src/runtime/tiling.cppimplementation could fail in two ways:The planned overlap could collapse at certain dimensions.
In particular, when the dimension is exactly twice the tile size, the planner could select two tiles and then reduce their overlap to zero. For example, a latent dimension of
150with tile size75resulted in two adjacent tiles with no overlap, producing a visible seam.The nominal overlap could differ from the actual overlap.
Tile execution used a uniform integer stride and repositioned the last tile when it exceeded the image bounds. The resulting last-tile overlap could therefore differ from the overlap calculated by the planner and passed to the blending code. In some cases this also produced uneven or multiple coverage near the end of the dimension.
The non-circular path now implements a Bresenham-like integer tiling scheme:
distributing tiles evenly across the full extent. The actual overlap with each neighboring tile is derived from these positions and used for per-edge blending.
For the
dimension = 150,tile size = 75case, the new placement uses three tiles at positions0, 37, 75, with overlaps of38and37, instead of two tiles with zero overlap.The new placement and per-edge blending logic is used for fully non-circular tiling; circular tiling continues to use the legacy executor.
Verification
112 × 150, tile size56 × 75106 × 158, tile size53 × 79