flutter/flutter#193388 and #193389: reproductions
coord.fragencodesFlutterFragCoord()in red and green (one period per 8 px), so every pixel's expected value is known.repro_193388.dartis the reproduction from #193388, verbatim.sweep.dartsweeps the fractional part of the rect's origin and prints the mean offset, in px, between the coordinate the shader saw and the pixel centre. It covers pixels at least 2 px inside a 40×16 rect. The SDF arm is the defaultisAntiAlias = true. The direct arm isisAntiAlias = falsewith the #193388 primer. The last column counts pixels where the two arms differ.
Setup: flutter create --platforms=macos --empty repro, put coord.frag in shaders/, and add to pubspec.yaml:
flutter:
shaders:
- shaders/coord.fragRun:
flutter build macos --release -t lib/sweep.dart
build/macos/Build/Products/Release/repro.app/Contents/MacOS/repromacOS 27.0, Apple M3 Max, Using the Impeller rendering backend (MetalSDF). Identical on stable 3.47.5 (6a19cca564, engine ab59836859) and on master fab991537b (engine f059d397f9). Each was run twice with the same result.
sweep.dart:
origin SDF path dx, dy direct path dx, dy pixels differing
(8.000, 8.000) +0.007, +0.005 +0.000, +0.000 326
(8.125, 8.000) +0.132, +0.005 -0.000, +0.000 640
(8.250, 8.000) +0.257, +0.005 +0.003, +0.000 656
(8.375, 8.000) +0.382, +0.005 +0.003, +0.000 656
(8.500, 8.000) -0.155, +0.004 +0.004, +0.000 654
(8.625, 8.000) -0.364, +0.004 +0.004, +0.000 656
(8.750, 8.000) -0.243, +0.004 +0.009, +0.002 652
(8.875, 8.000) -0.121, +0.004 +0.009, +0.002 652
(8.000, 8.250) +0.007, +0.250 +0.003, +0.002 680
(8.000, 8.500) +0.007, -0.404 +0.003, +0.002 675
(8.000, 8.750) +0.008, -0.250 +0.003, +0.002 670
(8.370, 8.610) +0.374, -0.389 +0.005, +0.002 695
repro_193388.dart, master fab991537b:
rect origin (8.0, 8.0), 40x16
interior error vs expected: aa=true 8, aa=false 8, aa=false primed 0
pixels differing: aa=false vs aa=false primed 326, aa=false vs aa=true 0, control aa=true vs aa=true primed 0
rect origin (8.37, 8.61), 40x16
interior error vs expected: aa=true 16, aa=false 16, aa=false primed 4
pixels differing: aa=false vs aa=false primed 696, aa=false vs aa=true 0, control aa=true vs aa=true primed 0
us per draw (64 rects in one picture): aa=true 112.8, aa=false 113.0, aa=false primed 7.3
On 3.47.5 the pixel lines are the same. The timing line reads 124.4 / 120.1 / 8.0.