Repository navigation
upscale: EASU row bands, per-pixel analysis, vector packing (1.5x) + simd coverage gate - #145
Merged
Merged
Conversation
The 12 taps of an output pixel sit at fixed offsets from the "f" tap, whose column is the same for every output row. Expand each source row to output columns once (per dx in -1..2 and channel) in a ring of four rows, so the taps of a whole vector are contiguous loads and consecutive output rows reuse the expansion. Measured on fractal (core 13, EASU only, 720p to 1080p): 75.0 ms -> 57.7 ms. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…verage gate The edge direction and length analysis is computed once per source pixel (vectorised over source columns) and interpolated in x for each output pixel, as in the reference shader's structure. The opaque RGBA packing is vectorised (0xAABBGGRR words). On a Ryzen 9 7950X, one core, 720p to 1080p: EASU+RCAS 69.7 ms -> 54.6 ms from packing alone. A CI step under GOEXPERIMENT=simd enforces 100% statement coverage of ./upscale for the vector lane; a test swaps the scalar kernels back in so the fallback is covered there too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The per-source-pixel analysis loads vectors starting on the last pixels of the luma plane; on AVX-512 (16 lanes) a 2x2 source made the load run past the slice and panic (FuzzUpscale seed #1, caught by the simd CI lane). The plane now keeps vecSlack spare floats in its capacity. The suite was run on an AVX-512 machine (Ryzen 9 7950X) as well as on arm64. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Refs #141 (stays open: the gap to ffmpeg remains).
Algorithm-first speed-up of the EASU vector lane, one measured step at a time. Ryzen 9 7950X, one core (taskset), 720p to 1080p, GOEXPERIMENT=simd, 16 lanes, 20 iterations, rounds interleaved with the baseline build.
Step 2 is exact and cheaper in theory but measured no gain over step 1 (the profile shows the analysis is not the bottleneck); it is kept for the structure. Step 3 alone gives 14 ms.
Remaining profile (before step 3): scalar gather+lerp ~22%, input conversion (fromImage/finish) ~20%, EASU arithmetic ~31%. ffmpeg 6.1.1 same machine: bilinear 3.3 ms, bicubic 2.0 ms, lanczos 2.8 ms, so the gap is still about 20x. A generic 2D gather kernel is not added: the gather is not yet shown to be the single bottleneck.
Also: a CI step under GOEXPERIMENT=simd enforces 100% coverage of ./upscale for the vector lane; a test swaps the scalar kernels back in so the fallback is covered there. Vector output is tested against the scalar oracle within ErrorBound; packing is tested bit-exactly on NaN, infinities and quantisation edges.
🤖 Generated with Claude Code