Repository navigation
Match SIMD coverage rounding to scalar output - #606
Merged
Merged
Conversation
Only skip fully covered mask pixels when the mask is also opaque. Match the vector behavior in SSE2/AVX2/NEON scalar prefixes and tails and in the scalar fallback. Exercise normal, overwrite, and mask coverage on SSE2 and AVX2 across all coverage values, lengths 0 through 160, pixel and coverage alignments, mixed coverage lanes, translucent colors, and surrounding sentinels. Add a path-level mask regression for every backend and report AVX2 skips. Validated on Windows x64 (Ryzen 9 5900X, Nim 2.2.10): full C test suite; SIMD debug/release and C++ tests; SSE2-only tests; path mask tests with AVX2, SSE2, and scalar dispatch; ARM64 Nim static check. Confirmed the new mask tests fail before the shortcut fix.
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.
Partially covered pixels could differ between SIMD blocks and scalar prefixes or tails because SSE2 and AVX2 coverage multiplication truncated where the scalar code rounds. Add the same 127 bias before division by 255 in both helpers.
Add a regression for normal and overwrite blending across all 256 coverage values, four colors, and eight buffer offsets, checking scalar results and surrounding sentinel pixels. This moves the small fix already carried by Runway into Pixie.
Validation: the new regression failed before the fix at SSE2 coverage 1, then passed in debug and release x86-64 builds on this Mac.
nim check --cpu:amd64 tests/test_simd.nimpasses. AVX2 code compiles, but its runtime checks are skipped locally because Rosetta does not expose AVX2; the test runs that path on capable machines.