• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package gen_tasks_logic
6
7import (
8	"fmt"
9	"sort"
10	"strconv"
11	"strings"
12
13	"github.com/golang/glog"
14	"go.skia.org/infra/task_scheduler/go/specs"
15)
16
17// keyParams generates the key used by DM for Gold results.
18func keyParams(parts map[string]string) []string {
19	// Don't bother to include role, which is always Test.
20	ignored := []string{"role", "test_filter"}
21	keys := make([]string, 0, len(parts))
22	for key := range parts {
23		found := false
24		for _, b := range ignored {
25			if key == b {
26				found = true
27				break
28			}
29		}
30		if !found {
31			keys = append(keys, key)
32		}
33	}
34	sort.Strings(keys)
35	rv := make([]string, 0, 2*len(keys))
36	for _, key := range keys {
37		rv = append(rv, key, parts[key])
38	}
39	return rv
40}
41
42// dmFlags generates flags to DM based on the given task properties.
43func (b *taskBuilder) dmFlags(internalHardwareLabel string) {
44	properties := map[string]string{
45		"gitHash":              specs.PLACEHOLDER_REVISION,
46		"builder":              b.Name,
47		"buildbucket_build_id": specs.PLACEHOLDER_BUILDBUCKET_BUILD_ID,
48		"task_id":              specs.PLACEHOLDER_TASK_ID,
49		"issue":                specs.PLACEHOLDER_ISSUE,
50		"patchset":             specs.PLACEHOLDER_PATCHSET,
51		"patch_storage":        specs.PLACEHOLDER_PATCH_STORAGE,
52		"swarming_bot_id":      "${SWARMING_BOT_ID}",
53		"swarming_task_id":     "${SWARMING_TASK_ID}",
54	}
55
56	args := []string{
57		"dm",
58		"--nameByHash",
59	}
60
61	configs := []string{}
62	skipped := []string{}
63
64	hasConfig := func(cfg string) bool {
65		for _, c := range configs {
66			if c == cfg {
67				return true
68			}
69		}
70		return false
71	}
72	filter := func(slice []string, elems ...string) []string {
73		m := make(map[string]bool, len(elems))
74		for _, e := range elems {
75			m[e] = true
76		}
77		rv := make([]string, 0, len(slice))
78		for _, e := range slice {
79			if m[e] {
80				rv = append(rv, e)
81			}
82		}
83		return rv
84	}
85	remove := func(slice []string, elem string) []string {
86		rv := make([]string, 0, len(slice))
87		for _, e := range slice {
88			if e != elem {
89				rv = append(rv, e)
90			}
91		}
92		return rv
93	}
94	removeContains := func(slice []string, elem string) []string {
95		rv := make([]string, 0, len(slice))
96		for _, e := range slice {
97			if !strings.Contains(e, elem) {
98				rv = append(rv, e)
99			}
100		}
101		return rv
102	}
103	suffix := func(slice []string, sfx string) []string {
104		rv := make([]string, 0, len(slice))
105		for _, e := range slice {
106			rv = append(rv, e+sfx)
107		}
108		return rv
109	}
110
111	// When matching skip logic, _ is a wildcard that matches all parts for the field.
112	// For example, "8888 _ _ _" means everything that is part of an 8888 config and
113	// "_ skp _ SomeBigDraw" means the skp named SomeBigDraw on all config and options.
114	const ALL = "_"
115	// The inputs here are turned into a --skip flag which represents a
116	// "Space-separated config/src/srcOptions/name quadruples to skip."
117	// See DM.cpp for more, especially should_skip(). ~ negates the match.
118	skip := func(config, src, srcOptions, name string) {
119		// config is also called "sink" in DM
120		if config == "_" ||
121			hasConfig(config) ||
122			(config[0] == '~' && hasConfig(config[1:])) {
123			skipped = append(skipped, config, src, srcOptions, name)
124		}
125	}
126
127	// Keys.
128	keys := keyParams(b.parts)
129	if b.extraConfig("Lottie") {
130		keys = append(keys, "renderer", "skottie")
131	}
132	if b.matchExtraConfig("DDL") {
133		// 'DDL' style means "--skpViewportSize 2048"
134		keys = append(keys, "style", "DDL")
135	} else {
136		keys = append(keys, "style", "default")
137	}
138	args = append(args, "--key")
139	args = append(args, keys...)
140
141	// This enables non-deterministic random seeding of the GPU FP optimization
142	// test.
143	// Not Android due to:
144	//  - https://skia.googlesource.com/skia/+/5910ed347a638ded8cd4c06dbfda086695df1112/BUILD.gn#160
145	//  - https://skia.googlesource.com/skia/+/ce06e261e68848ae21cac1052abc16bc07b961bf/tests/ProcessorTest.cpp#307
146	// Not MSAN due to:
147	//  - https://skia.googlesource.com/skia/+/0ac06e47269a40c177747310a613d213c95d1d6d/infra/bots/recipe_modules/flavor/gn_flavor.py#80
148	if !b.matchOs("Android") && !b.extraConfig("MSAN") {
149		args = append(args, "--randomProcessorTest")
150	}
151
152	threadLimit := -1
153	const MAIN_THREAD_ONLY = 0
154
155	// 32-bit desktop bots tend to run out of memory, because they have relatively
156	// far more cores than RAM (e.g. 32 cores, 3G RAM).  Hold them back a bit.
157	if b.arch("x86") {
158		threadLimit = 4
159	}
160
161	// These bots run out of memory easily.
162	if b.model("MotoG4", "Nexus7") {
163		threadLimit = MAIN_THREAD_ONLY
164	}
165
166	// Avoid issues with dynamically exceeding resource cache limits.
167	if b.matchExtraConfig("DISCARDABLE") {
168		threadLimit = MAIN_THREAD_ONLY
169	}
170
171	if threadLimit >= 0 {
172		args = append(args, "--threads", strconv.Itoa(threadLimit))
173	}
174
175	sampleCount := 0
176	glPrefix := ""
177	if b.extraConfig("SwiftShader") {
178		configs = append(configs, "vk", "vkdmsaa")
179		// skbug.com/12826
180		skip(ALL, "test", ALL, "GrThreadSafeCache16Verts")
181		// skbug.com/12829
182		skip(ALL, "test", ALL, "image_subset")
183	} else if b.cpu() {
184		args = append(args, "--nogpu")
185
186		configs = append(configs, "8888")
187
188		if b.extraConfig("SkVM") {
189			args = append(args, "--skvm")
190		}
191
192		if b.extraConfig("BonusConfigs") {
193			configs = []string{
194				"r8", "565",
195				"pic-8888", "serialize-8888"}
196		}
197
198		if b.extraConfig("PDF") {
199			configs = []string{"pdf"}
200			args = append(args, "--rasterize_pdf") // Works only on Mac.
201			// Take ~forever to rasterize:
202			skip("pdf", "gm", ALL, "lattice2")
203			skip("pdf", "gm", ALL, "hairmodes")
204			skip("pdf", "gm", ALL, "longpathdash")
205		}
206
207		if b.extraConfig("OldestSupportedSkpVersion") {
208			// For triaging convenience, make the old-skp job's output match the size of the DDL jobs' output
209			args = append(args, "--skpViewportSize", "2048")
210		}
211
212	} else if b.gpu() {
213		args = append(args, "--nocpu")
214
215		// Add in either gles or gl configs to the canonical set based on OS
216		glPrefix = "gl"
217		// Use 4x MSAA for all our testing. It's more consistent and 8x MSAA is nondeterministic (by
218		// design) on NVIDIA hardware. The problem is especially bad on ANGLE.  skia:6813 skia:6545
219		sampleCount = 4
220		if b.matchOs("Android") || b.os("iOS") {
221			glPrefix = "gles"
222			// MSAA is disabled on Pixel3a (https://b.corp.google.com/issues/143074513).
223			// MSAA is disabled on Pixel5 (https://skbug.com/11152).
224			if b.model("Pixel3a", "Pixel5") {
225				sampleCount = 0
226			}
227		} else if b.matchGpu("Intel") {
228			// MSAA doesn't work well on Intel GPUs chromium:527565, chromium:983926
229			if b.gpu("IntelIrisXe") && b.matchOs("Win") && b.extraConfig("ANGLE") {
230				// Make an exception for newer GPUs + D3D
231				args = append(args, "--allowMSAAOnNewIntel", "true")
232			} else {
233				sampleCount = 0
234			}
235		} else if b.os("ChromeOS") {
236			glPrefix = "gles"
237		}
238
239		if b.extraConfig("NativeFonts") {
240			configs = append(configs, glPrefix)
241		} else {
242			configs = append(configs, glPrefix, glPrefix+"dft")
243			if sampleCount > 0 {
244				configs = append(configs, fmt.Sprintf("%smsaa%d", glPrefix, sampleCount))
245				// Temporarily limit the bots we test dynamic MSAA on.
246				if b.gpu("QuadroP400", "MaliG77") || b.matchOs("Mac") {
247					configs = append(configs, fmt.Sprintf("%sdmsaa", glPrefix))
248				}
249			}
250		}
251
252		// The Tegra3 doesn't support MSAA
253		if b.gpu("Tegra3") ||
254			// We aren't interested in fixing msaa bugs on current iOS devices.
255			b.model("iPad4", "iPadPro", "iPhone7") ||
256			// skia:5792
257			b.gpu("IntelHD530", "IntelIris540") {
258			configs = removeContains(configs, "msaa")
259		}
260
261		// We want to test both the OpenGL config and the GLES config on Linux Intel:
262		// GL is used by Chrome, GLES is used by ChromeOS.
263		// Also do the Ganesh threading verification test (render with and without
264		// worker threads, using only the SW path renderer, and compare the results).
265		if b.matchGpu("Intel") && b.isLinux() {
266			configs = append(configs, "gles", "glesdft", "gltestthreading")
267			// skbug.com/6333, skbug.com/6419, skbug.com/6702
268			skip("gltestthreading", "gm", ALL, "lcdblendmodes")
269			skip("gltestthreading", "gm", ALL, "lcdoverlap")
270			skip("gltestthreading", "gm", ALL, "textbloblooper")
271			// All of these GMs are flaky, too:
272			skip("gltestthreading", "gm", ALL, "savelayer_with_backdrop")
273			skip("gltestthreading", "gm", ALL, "persp_shaders_bw")
274			skip("gltestthreading", "gm", ALL, "dftext_blob_persp")
275			skip("gltestthreading", "gm", ALL, "dftext")
276			skip("gltestthreading", "gm", ALL, "gpu_blur_utils")
277			skip("gltestthreading", "gm", ALL, "gpu_blur_utils_ref")
278			skip("gltestthreading", "gm", ALL, "gpu_blur_utils_subset_rect")
279			skip("gltestthreading", "gm", ALL, "gpu_blur_utils_subset_rect_ref")
280			// skbug.com/7523 - Flaky on various GPUs
281			skip("gltestthreading", "gm", ALL, "orientation")
282			// These GMs only differ in the low bits
283			skip("gltestthreading", "gm", ALL, "stroketext")
284			skip("gltestthreading", "gm", ALL, "draw_image_set")
285
286			// Fail on Iris Xe.
287			skip("gltestthreading", "gm", ALL, "anisotropic_image_scale_mip")
288			skip("gltestthreading", "gm", ALL, "bleed_downscale")
289			skip("gltestthreading", "gm", ALL, "degeneratesegments")
290			skip("gltestthreading", "gm", ALL, "mipmap_srgb")
291			skip("gltestthreading", "gm", ALL, "mipmap")
292			skip("gltestthreading", "gm", ALL, "ovals")
293			skip("gltestthreading", "gm", ALL, "persp_images")
294			skip("gltestthreading", "gm", ALL, "persp_shaders_aa")
295			skip("gltestthreading", "gm", ALL, "rtif_distort")
296			skip("gltestthreading", "gm", ALL, "skbug_8664")
297			skip("gltestthreading", "gm", ALL, "teenystrokes")
298			skip("gltestthreading", "gm", ALL, "texel_subset_linear_mipmap_nearest_down")
299			skip("gltestthreading", "gm", ALL, "yuv420_odd_dim_repeat")
300
301			skip("gltestthreading", "svg", ALL, "filters-conv-01-f.svg")
302			skip("gltestthreading", "svg", ALL, "filters-offset-01-b.svg")
303			skip("gltestthreading", "svg", ALL, "gallardo.svg")
304			skip("gltestthreading", "svg", ALL, "masking-filter-01-f.svg")
305
306		}
307
308		// Dawn bot *only* runs the dawn config
309		if b.extraConfig("Dawn") && !b.extraConfig("Graphite") {
310			// tint:1045: Tint doesn't implement MatrixInverse yet.
311			skip(ALL, "gm", ALL, "runtime_intrinsics_matrix")
312			configs = []string{"dawn"}
313		}
314
315		// The FailFlushTimeCallbacks bots only run the 'gl' config
316		if b.extraConfig("FailFlushTimeCallbacks") {
317			configs = []string{"gl"}
318		}
319
320		// Graphite bot *only* runs the gr*** configs
321		if b.extraConfig("Graphite") {
322			args = append(args, "--nogpu") // disable non-Graphite tests
323
324			// Failed to make lazy image.
325			skip(ALL, "gm", ALL, "image_subset")
326
327			// Could not readback from surface.
328			skip(ALL, "gm", ALL, "hugebitmapshader")
329			skip(ALL, "gm", ALL, "path_huge_aa")
330			skip(ALL, "gm", ALL, "verylargebitmap")
331			skip(ALL, "gm", ALL, "verylarge_picture_image")
332
333			if b.extraConfig("Metal") {
334				configs = []string{"grmtl"}
335			}
336                        if b.extraConfig("Dawn") {
337				configs = []string{"grdawn"}
338                                // Could not readback from surface
339                                // https://skbug/14105
340				skip(ALL, "gm", ALL, "tall_stretched_bitmaps")
341				// Shader doesn't compile
342                                // https://skbug/14105
343				skip(ALL, "gm", ALL, "runtime_intrinsics_matrix")
344                                // Crashes
345                                // https://skbug/14105
346                                skip(ALL, "test", ALL, "BackendTextureTest")
347                                skip(ALL, "test", ALL, "GraphitePromiseImageMultipleImgUses")
348                                skip(ALL, "test", ALL, "GraphitePromiseImageRecorderLoss")
349				skip(ALL, "test", ALL, "MutableImagesTest")
350				skip(ALL, "test", ALL, "PaintParamsKeyTest")
351				skip(ALL, "test", ALL, "VolatileGraphitePromiseImageTest")
352                                // Fails
353                                // https://skbug/14105
354				skip(ALL, "test", ALL, "ImageAsyncReadPixelsGraphite")
355				skip(ALL, "test", ALL, "ImageProviderTest_Graphite_Default")
356				skip(ALL, "test", ALL, "ImageProviderTest_Graphite_Testing")
357				skip(ALL, "test", ALL, "SurfaceAsyncReadPixelsGraphite")
358				skip(ALL, "test", ALL, "UpdateImageBackendTextureTest")
359				if b.matchOs("Win") {
360					// Async read call failed
361					skip(ALL, "gm", ALL, "async_rescale_and_read_no_bleed")
362					skip(ALL, "gm", ALL, "async_rescale_and_read_text_up")
363					skip(ALL, "gm", ALL, "async_rescale_and_read_dog_down")
364					skip(ALL, "gm", ALL, "async_rescale_and_read_rose")
365					// Crashes
366					skip(ALL, "gm", ALL, "blurrect")
367					skip(ALL, "gm", ALL, "circular_arcs_fill")
368					skip(ALL, "gm", ALL, "circular_arcs_hairline")
369					skip(ALL, "gm", ALL, "circular_arcs_stroke_butt")
370					skip(ALL, "gm", ALL, "circular_arcs_stroke_square")
371					skip(ALL, "gm", ALL, "circular_arcs_stroke_round")
372					skip(ALL, "gm", ALL, "circular_arcs_stroke_and_fill_butt")
373					skip(ALL, "gm", ALL, "circular_arcs_stroke_and_fill_square")
374					skip(ALL, "gm", ALL, "circular_arcs_stroke_and_fill_round")
375					skip(ALL, "gm", ALL, "circular_arcs")
376					skip(ALL, "gm", ALL, "manycircles")
377					skip(ALL, "gm", ALL, "nested_aa")
378					skip(ALL, "gm", ALL, "nested_bw")
379					skip(ALL, "gm", ALL, "nested_flipY_aa")
380					skip(ALL, "gm", ALL, "nested_flipY_bw")
381					skip(ALL, "gm", ALL, "simplerect")
382					skip(ALL, "gm", ALL, "wacky_yuv_formats_imggen")
383					skip(ALL, "gm", ALL, "xfermodes")
384				}
385                        }
386		}
387
388		// ANGLE bot *only* runs the angle configs
389		if b.extraConfig("ANGLE") {
390			if b.matchOs("Win") {
391				configs = []string{"angle_d3d11_es2", "angle_d3d11_es3"}
392				if sampleCount > 0 {
393					configs = append(configs, fmt.Sprintf("angle_d3d11_es2_msaa%d", sampleCount))
394					configs = append(configs, fmt.Sprintf("angle_d3d11_es2_dmsaa"))
395					configs = append(configs, fmt.Sprintf("angle_d3d11_es3_msaa%d", sampleCount))
396					configs = append(configs, fmt.Sprintf("angle_d3d11_es3_dmsaa"))
397				}
398				if !b.matchGpu("GTX", "Quadro", "GT610") {
399					// See skia:10149
400					configs = append(configs, "angle_d3d9_es2")
401				}
402				if b.model("NUC5i7RYH") {
403					// skbug.com/7376
404					skip(ALL, "test", ALL, "ProcessorCloneTest")
405				}
406				if b.matchGpu("Intel") {
407					// anglebug.com/5588
408					skip(ALL, "test", ALL, "SkSLIntrinsicFloor_GPU")
409				}
410			} else if b.matchOs("Mac") {
411				configs = []string{"angle_mtl_es2", "angle_mtl_es3"}
412
413				// anglebug.com/7145
414				skip(ALL, "test", ALL, "SkSLOutParamsAreDistinctFromGlobal_GPU")
415
416				// b/268720489
417				skip(ALL, "test", ALL, "SkSLIntrinsicMixFloatES3_GPU")
418
419				// anglebug.com/7245
420				skip("angle_mtl_es3", "gm", ALL, "runtime_intrinsics_common_es3")
421
422				if b.gpu("AppleM1") {
423					// M1 Macs fail this test for sRGB color types
424					// skbug.com/13289
425					skip(ALL, "test", ALL, "TransferPixelsToTextureTest")
426				}
427			}
428		}
429
430		if b.model("AndroidOne", "Nexus5", "Nexus7", "JioNext") {
431			// skbug.com/9019
432			skip(ALL, "test", ALL, "ProcessorCloneTest")
433			skip(ALL, "test", ALL, "Programs")
434			skip(ALL, "test", ALL, "ProcessorOptimizationValidationTest")
435		}
436
437		if b.model("GalaxyS20") {
438			// skbug.com/10595
439			skip(ALL, "test", ALL, "ProcessorCloneTest")
440		}
441
442		if b.model("Spin513") {
443			// skbug.com/11876
444			skip(ALL, "test", ALL, "Programs")
445			// skbug.com/12486
446			skip(ALL, "test", ALL, "TestMockContext")
447			skip(ALL, "test", ALL, "TestGpuRenderingContexts")
448			skip(ALL, "test", ALL, "TestGpuAllContexts")
449			skip(ALL, "test", ALL, "TextBlobCache")
450			skip(ALL, "test", ALL, "OverdrawSurface_Gpu")
451			skip(ALL, "test", ALL, "ReplaceSurfaceBackendTexture")
452			skip(ALL, "test", ALL, "SurfaceAttachStencil_Gpu")
453			skip(ALL, "test", ALL, "SurfacePartialDraw_Gpu")
454			skip(ALL, "test", ALL, "SurfaceWrappedWithRelease_Gpu")
455		}
456
457		// skbug.com/9043 - these devices render this test incorrectly
458		// when opList splitting reduction is enabled
459		if b.gpu() && b.extraConfig("Vulkan") && (b.gpu("RadeonR9M470X", "RadeonHD7770")) {
460			skip(ALL, "tests", ALL, "VkDrawableImportTest")
461		}
462		if b.extraConfig("Vulkan") {
463			configs = []string{"vk"}
464			// MSAA doesn't work well on Intel GPUs chromium:527565, chromium:983926, skia:9023
465			if !b.matchGpu("Intel") {
466				configs = append(configs, "vkmsaa4")
467			}
468			// Temporarily limit the bots we test dynamic MSAA on.
469			if b.gpu("QuadroP400", "MaliG77") && !b.extraConfig("TSAN") {
470				configs = append(configs, "vkdmsaa")
471			}
472		}
473		if b.extraConfig("Metal") && !b.extraConfig("Graphite") {
474			configs = []string{"mtl"}
475			// MSAA doesn't work well on Intel GPUs chromium:527565, chromium:983926
476			if !b.matchGpu("Intel") {
477				configs = append(configs, "mtlmsaa4")
478			}
479		}
480		if b.extraConfig("Slug") {
481			// Test slug drawing
482			configs = []string{"glslug", "glserializeslug", "glremoteslug"}
483			// glremoteslug does not handle layers right. Exclude the tests for now.
484			skip("glremoteslug", "gm", ALL, "rtif_distort")
485			skip("glremoteslug", "gm", ALL, "textfilter_image")
486			skip("glremoteslug", "gm", ALL, "textfilter_color")
487			skip("glremoteslug", "gm", ALL, "savelayerpreservelcdtext")
488			skip("glremoteslug", "gm", ALL, "typefacerendering_pfa")
489			skip("glremoteslug", "gm", ALL, "typefacerendering_pfb")
490			skip("glremoteslug", "gm", ALL, "typefacerendering")
491		}
492		if b.extraConfig("Direct3D") {
493			configs = []string{"d3d"}
494		}
495
496		// Test 1010102 on our Linux/NVIDIA bots and the persistent cache config
497		// on the GL bots.
498		if b.gpu("QuadroP400") && !b.extraConfig("PreAbandonGpuContext") && !b.extraConfig("TSAN") && b.isLinux() &&
499			!b.extraConfig("FailFlushTimeCallbacks") {
500			if b.extraConfig("Vulkan") {
501				configs = append(configs, "vk1010102")
502				// Decoding transparent images to 1010102 just looks bad
503				skip("vk1010102", "image", ALL, ALL)
504			} else if !b.extraConfig("Dawn") {
505				configs = append(configs, "gl1010102", "gltestpersistentcache", "gltestglslcache", "gltestprecompile")
506				// Decoding transparent images to 1010102 just looks bad
507				skip("gl1010102", "image", ALL, ALL)
508				// These tests produce slightly different pixels run to run on NV.
509				skip("gltestpersistentcache", "gm", ALL, "atlastext")
510				skip("gltestpersistentcache", "gm", ALL, "dftext")
511				skip("gltestpersistentcache", "gm", ALL, "glyph_pos_h_b")
512				skip("gltestpersistentcache", "gm", ALL, "glyph_pos_h_f")
513				skip("gltestpersistentcache", "gm", ALL, "glyph_pos_n_f")
514				skip("gltestglslcache", "gm", ALL, "atlastext")
515				skip("gltestglslcache", "gm", ALL, "dftext")
516				skip("gltestglslcache", "gm", ALL, "glyph_pos_h_b")
517				skip("gltestglslcache", "gm", ALL, "glyph_pos_h_f")
518				skip("gltestglslcache", "gm", ALL, "glyph_pos_n_f")
519				skip("gltestprecompile", "gm", ALL, "atlastext")
520				skip("gltestprecompile", "gm", ALL, "dftext")
521				skip("gltestprecompile", "gm", ALL, "glyph_pos_h_b")
522				skip("gltestprecompile", "gm", ALL, "glyph_pos_h_f")
523				skip("gltestprecompile", "gm", ALL, "glyph_pos_n_f")
524				// Tessellation shaders do not yet participate in the persistent cache.
525				skip("gltestpersistentcache", "gm", ALL, "tessellation")
526				skip("gltestglslcache", "gm", ALL, "tessellation")
527				skip("gltestprecompile", "gm", ALL, "tessellation")
528			}
529		}
530
531		// We also test the SkSL precompile config on Pixel2XL as a representative
532		// Android device - this feature is primarily used by Flutter.
533		if b.model("Pixel2XL") && !b.extraConfig("Vulkan") {
534			configs = append(configs, "glestestprecompile")
535		}
536
537		// Test SkSL precompile on iPhone 8 as representative iOS device
538		if b.model("iPhone8") && b.extraConfig("Metal") {
539			configs = append(configs, "mtltestprecompile")
540			// avoid tests that can generate slightly different pixels per run
541			skip("mtltestprecompile", "gm", ALL, "atlastext")
542			skip("mtltestprecompile", "gm", ALL, "circular_arcs_hairline")
543			skip("mtltestprecompile", "gm", ALL, "dashcircle")
544			skip("mtltestprecompile", "gm", ALL, "dftext")
545			skip("mtltestprecompile", "gm", ALL, "encode-platform")
546			skip("mtltestprecompile", "gm", ALL, "fontmgr_bounds")
547			skip("mtltestprecompile", "gm", ALL, "fontmgr_bounds_1_-0.25")
548			skip("mtltestprecompile", "gm", ALL, "glyph_pos_h_b")
549			skip("mtltestprecompile", "gm", ALL, "glyph_pos_h_f")
550			skip("mtltestprecompile", "gm", ALL, "glyph_pos_n_f")
551			skip("mtltestprecompile", "gm", ALL, "persp_images")
552			skip("mtltestprecompile", "gm", ALL, "ovals")
553			skip("mtltestprecompile", "gm", ALL, "roundrects")
554			skip("mtltestprecompile", "gm", ALL, "shadow_utils_occl")
555			skip("mtltestprecompile", "gm", ALL, "strokedlines")
556			skip("mtltestprecompile", "gm", ALL, "strokerect")
557			skip("mtltestprecompile", "gm", ALL, "strokes3")
558			skip("mtltestprecompile", "gm", ALL, "texel_subset_linear_mipmap_nearest_down")
559			skip("mtltestprecompile", "gm", ALL, "texel_subset_linear_mipmap_linear_down")
560			skip("mtltestprecompile", "gm", ALL, "textblobmixedsizes_df")
561			skip("mtltestprecompile", "gm", ALL, "yuv420_odd_dim_repeat")
562			skip("mtltestprecompile", "svg", ALL, "A_large_blank_world_map_with_oceans_marked_in_blue.svg")
563			skip("mtltestprecompile", "svg", ALL, "Chalkboard.svg")
564			skip("mtltestprecompile", "svg", ALL, "Ghostscript_Tiger.svg")
565			skip("mtltestprecompile", "svg", ALL, "Seal_of_American_Samoa.svg")
566			skip("mtltestprecompile", "svg", ALL, "Seal_of_Illinois.svg")
567			skip("mtltestprecompile", "svg", ALL, "cartman.svg")
568			skip("mtltestprecompile", "svg", ALL, "desk_motionmark_paths.svg")
569			skip("mtltestprecompile", "svg", ALL, "rg1024_green_grapes.svg")
570			skip("mtltestprecompile", "svg", ALL, "shapes-intro-02-f.svg")
571			skip("mtltestprecompile", "svg", ALL, "tiger-8.svg")
572		}
573		// Test reduced shader mode on iPhone 11 as representative iOS device
574		if b.model("iPhone11") && b.extraConfig("Metal") && !b.extraConfig("Graphite") {
575			configs = append(configs, "mtlreducedshaders")
576		}
577
578		if b.gpu("AppleM1") && !b.extraConfig("Metal") {
579			skip(ALL, "test", ALL, "TransferPixelsFromTextureTest") // skia:11814
580		}
581
582		if b.model(DONT_REDUCE_OPS_TASK_SPLITTING_MODELS...) {
583			args = append(args, "--dontReduceOpsTaskSplitting", "true")
584		}
585
586		// Test reduceOpsTaskSplitting fallback when over budget.
587		if b.model("NUC7i5BNK") && b.extraConfig("ASAN") {
588			args = append(args, "--gpuResourceCacheLimit", "16777216")
589		}
590
591		// Test rendering to wrapped dsts on a few bots
592		if b.extraConfig("BonusConfigs") {
593			configs = []string{"glbetex", "glbert", "glreducedshaders", "glr8"}
594		}
595
596		if b.os("ChromeOS") {
597			// Just run GLES for now - maybe add gles_msaa4 in the future
598			configs = []string{"gles"}
599		}
600
601		// Test GPU tessellation path renderer.
602		if b.extraConfig("GpuTess") {
603			configs = []string{glPrefix + "msaa4"}
604			// Use fixed count tessellation path renderers as much as possible.
605			args = append(args, "--pr", "atlas", "tess")
606		}
607
608		// DDL is a GPU-only feature
609		if b.extraConfig("DDL1") {
610			// This bot generates comparison images for the large skps and the gms
611			configs = filter(configs, "gl", "vk", "mtl")
612			args = append(args, "--skpViewportSize", "2048")
613		}
614		if b.extraConfig("DDL3") {
615			// This bot generates the real ddl images for the large skps and the gms
616			configs = suffix(filter(configs, "gl", "vk", "mtl"), "ddl")
617			args = append(args, "--skpViewportSize", "2048")
618			args = append(args, "--gpuThreads", "0")
619		}
620	}
621
622	if b.matchExtraConfig("ColorSpaces") {
623		// Here we're going to generate a bunch of configs with the format:
624		//        <colorspace> <backend> <targetFormat>
625		// Where: <colorspace> is one of:   "", "linear-", "narrow-", p3-", "rec2020-", "srgb2-"
626		//        <backend> is one of: "gl, "gles", "mtl", "vk"
627		//                             their "gr" prefixed versions
628		//                             and "" (for raster)
629		//        <targetFormat> is one of: "f16", { "" (for gpus) or "rgba" (for raster) }
630		//
631		// We also add on two configs with the format:
632		//        narrow-<backend>f16norm
633		//        linear-<backend>srgba
634		colorSpaces := []string{"", "linear-", "narrow-", "p3-", "rec2020-", "srgb2-"}
635
636		backendStr := ""
637		if b.gpu() {
638			if b.extraConfig("Graphite") {
639				if b.extraConfig("GL") {
640					backendStr = "grgl"
641				} else if b.extraConfig("GLES") {
642					backendStr = "grgles"
643				} else if b.extraConfig("Metal") {
644					backendStr = "grmtl"
645				} else if b.extraConfig("Vulkan") {
646					backendStr = "grvk"
647				}
648			} else {
649				if b.extraConfig("GL") {
650					backendStr = "gl"
651				} else if b.extraConfig("GLES") {
652					backendStr = "gles"
653				} else if b.extraConfig("Metal") {
654					backendStr = "mtl"
655				} else if b.extraConfig("Vulkan") {
656					backendStr = "vk"
657				}
658			}
659		}
660
661		targetFormats := []string{"f16"}
662		if b.gpu() {
663			targetFormats = append(targetFormats, "")
664		} else {
665			targetFormats = append(targetFormats, "rgba")
666		}
667
668		configs = []string{}
669
670		for _, cs := range colorSpaces {
671			for _, tf := range targetFormats {
672				configs = append(configs, cs+backendStr+tf)
673			}
674		}
675
676		configs = append(configs, "narrow-"+backendStr+"f16norm")
677		configs = append(configs, "linear-"+backendStr+"srgba")
678	}
679
680	// Sharding.
681	tf := b.parts["test_filter"]
682	if tf != "" && tf != "All" {
683		// Expected format: shard_XX_YY
684		split := strings.Split(tf, ALL)
685		if len(split) == 3 {
686			args = append(args, "--shard", split[1])
687			args = append(args, "--shards", split[2])
688		} else {
689			glog.Fatalf("Invalid task name - bad shards: %s", tf)
690		}
691	}
692
693	args = append(args, "--config")
694	args = append(args, configs...)
695
696	removeFromArgs := func(arg string) {
697		args = remove(args, arg)
698	}
699
700	// Run tests, gms, and image decoding tests everywhere.
701	args = append(args, "--src", "tests", "gm", "image", "lottie", "colorImage", "svg", "skp")
702	if b.gpu() {
703		// Don't run the "svgparse_*" svgs on GPU.
704		skip(ALL, "svg", ALL, "svgparse_")
705	} else if b.Name == "Test-Debian10-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN" {
706		// Only run the CPU SVGs on 8888.
707		skip("~8888", "svg", ALL, ALL)
708	} else {
709		// On CPU SVGs we only care about parsing. Only run them on the above bot.
710		removeFromArgs("svg")
711	}
712
713	// Eventually I'd like these to pass, but for now just skip 'em.
714	if b.extraConfig("SK_FORCE_RASTER_PIPELINE_BLITTER") {
715		removeFromArgs("tests")
716	}
717
718	if b.model("Spin513") {
719		removeFromArgs("tests")
720	}
721
722	if b.extraConfig("NativeFonts") { // images won't exercise native font integration :)
723		removeFromArgs("image")
724		removeFromArgs("colorImage")
725	}
726
727	if b.matchExtraConfig("Graphite") {
728		removeFromArgs("image")
729		removeFromArgs("lottie")
730		removeFromArgs("colorImage")
731		removeFromArgs("svg")
732	}
733
734	// Remove skps for all bots except for a select few. On bots that will run SKPs remove some of their other tests.
735	if b.matchExtraConfig("DDL", "PDF") {
736		// The DDL and PDF bots just render the large skps and the gms
737		removeFromArgs("tests")
738		removeFromArgs("image")
739		removeFromArgs("colorImage")
740		removeFromArgs("svg")
741	} else if b.matchExtraConfig("OldestSupportedSkpVersion") {
742		// The OldestSupportedSkpVersion bot only renders skps.
743		removeFromArgs("tests")
744		removeFromArgs("gm")
745		removeFromArgs("image")
746		removeFromArgs("colorImage")
747		removeFromArgs("svg")
748	} else if b.matchExtraConfig("FailFlushTimeCallbacks") {
749		// The FailFlushTimeCallbacks bot only runs skps, gms and svgs
750		removeFromArgs("tests")
751		removeFromArgs("image")
752		removeFromArgs("colorImage")
753	} else {
754		// No other bots render the .skps.
755		removeFromArgs("skp")
756	}
757
758	if b.extraConfig("Lottie") {
759		// Only run the lotties on Lottie bots.
760		removeFromArgs("tests")
761		removeFromArgs("gm")
762		removeFromArgs("image")
763		removeFromArgs("colorImage")
764		removeFromArgs("svg")
765		removeFromArgs("skp")
766	} else {
767		removeFromArgs("lottie")
768	}
769
770	if b.extraConfig("TSAN") {
771		// skbug.com/10848
772		removeFromArgs("svg")
773		// skbug.com/12900 avoid OOM on
774		//   Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-TSAN_Vulkan
775		// Avoid lots of spurious TSAN failures on
776		//   Test-Debian11-Clang-NUC11TZi5-GPU-IntelIrisXe-x86_64-Release-All-TSAN_Vulkan
777		//   Test-Debian11-Clang-NUC11TZi5-GPU-IntelIrisXe-x86_64-Release-All-DDL3_TSAN_Vulkan
778		if b.Name == "Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-TSAN_Vulkan" ||
779		   b.Name == "Test-Debian11-Clang-NUC11TZi5-GPU-IntelIrisXe-x86_64-Release-All-TSAN_Vulkan" ||
780		   b.Name == "Test-Debian11-Clang-NUC11TZi5-GPU-IntelIrisXe-x86_64-Release-All-DDL3_TSAN_Vulkan" {
781			skip("_", "test", "_", "_")
782		}
783	}
784
785	// TODO: ???
786	skip("f16", ALL, ALL, "dstreadshuffle")
787
788	// --src image --config r8 means "decode into R8", which isn't supported.
789	skip("r8", "image", ALL, ALL)
790	skip("r8", "colorImage", ALL, ALL)
791
792	if b.extraConfig("Valgrind") {
793		// These take 18+ hours to run.
794		skip("pdf", "gm", ALL, "fontmgr_iter")
795		skip("pdf", ALL, ALL, "PANO_20121023_214540.jpg")
796		skip("pdf", "skp", ALL, "worldjournal")
797		skip("pdf", "skp", ALL, "desk_baidu.skp")
798		skip("pdf", "skp", ALL, "desk_wikipedia.skp")
799		skip(ALL, "svg", ALL, ALL)
800		// skbug.com/9171 and 8847
801		skip(ALL, "test", ALL, "InitialTextureClear")
802	}
803
804	if b.model("Pixel3") {
805		// skbug.com/10546
806		skip("vkddl", "gm", ALL, "compressed_textures_nmof")
807		skip("vkddl", "gm", ALL, "compressed_textures_npot")
808		skip("vkddl", "gm", ALL, "compressed_textures")
809	}
810
811	if b.model("TecnoSpark3Pro", "Wembley") {
812		// skbug.com/9421
813		skip(ALL, "test", ALL, "InitialTextureClear")
814	}
815
816	if b.model("Wembley", "JioNext") {
817		// These tests run forever on the Wembley.
818		skip(ALL, "gm", ALL, "async_rescale_and_read")
819	}
820
821	if b.os("iOS") {
822		skip(glPrefix, "skp", ALL, ALL)
823	}
824
825	if b.matchOs("Mac", "iOS") {
826		// CG fails on questionable bmps
827		skip(ALL, "image", "gen_platf", "rgba32abf.bmp")
828		skip(ALL, "image", "gen_platf", "rgb24prof.bmp")
829		skip(ALL, "image", "gen_platf", "rgb24lprof.bmp")
830		skip(ALL, "image", "gen_platf", "8bpp-pixeldata-cropped.bmp")
831		skip(ALL, "image", "gen_platf", "4bpp-pixeldata-cropped.bmp")
832		skip(ALL, "image", "gen_platf", "32bpp-pixeldata-cropped.bmp")
833		skip(ALL, "image", "gen_platf", "24bpp-pixeldata-cropped.bmp")
834
835		// CG has unpredictable behavior on this questionable gif
836		// It's probably using uninitialized memory
837		skip(ALL, "image", "gen_platf", "frame_larger_than_image.gif")
838
839		// CG has unpredictable behavior on incomplete pngs
840		// skbug.com/5774
841		skip(ALL, "image", "gen_platf", "inc0.png")
842		skip(ALL, "image", "gen_platf", "inc1.png")
843		skip(ALL, "image", "gen_platf", "inc2.png")
844		skip(ALL, "image", "gen_platf", "inc3.png")
845		skip(ALL, "image", "gen_platf", "inc4.png")
846		skip(ALL, "image", "gen_platf", "inc5.png")
847		skip(ALL, "image", "gen_platf", "inc6.png")
848		skip(ALL, "image", "gen_platf", "inc7.png")
849		skip(ALL, "image", "gen_platf", "inc8.png")
850		skip(ALL, "image", "gen_platf", "inc9.png")
851		skip(ALL, "image", "gen_platf", "inc10.png")
852		skip(ALL, "image", "gen_platf", "inc11.png")
853		skip(ALL, "image", "gen_platf", "inc12.png")
854		skip(ALL, "image", "gen_platf", "inc13.png")
855		skip(ALL, "image", "gen_platf", "inc14.png")
856		skip(ALL, "image", "gen_platf", "incInterlaced.png")
857
858		// These images fail after Mac 10.13.1 upgrade.
859		skip(ALL, "image", "gen_platf", "incInterlaced.gif")
860		skip(ALL, "image", "gen_platf", "inc1.gif")
861		skip(ALL, "image", "gen_platf", "inc0.gif")
862		skip(ALL, "image", "gen_platf", "butterfly.gif")
863	}
864
865	// WIC fails on questionable bmps
866	if b.matchOs("Win") {
867		skip(ALL, "image", "gen_platf", "pal8os2v2.bmp")
868		skip(ALL, "image", "gen_platf", "pal8os2v2-16.bmp")
869		skip(ALL, "image", "gen_platf", "rgba32abf.bmp")
870		skip(ALL, "image", "gen_platf", "rgb24prof.bmp")
871		skip(ALL, "image", "gen_platf", "rgb24lprof.bmp")
872		skip(ALL, "image", "gen_platf", "8bpp-pixeldata-cropped.bmp")
873		skip(ALL, "image", "gen_platf", "4bpp-pixeldata-cropped.bmp")
874		skip(ALL, "image", "gen_platf", "32bpp-pixeldata-cropped.bmp")
875		skip(ALL, "image", "gen_platf", "24bpp-pixeldata-cropped.bmp")
876		if b.arch("x86_64") && b.cpu() {
877			// This GM triggers a SkSmallAllocator assert.
878			skip(ALL, "gm", ALL, "composeshader_bitmap")
879		}
880	}
881
882	if b.matchOs("Win", "Mac") {
883		// WIC and CG fail on arithmetic jpegs
884		skip(ALL, "image", "gen_platf", "testimgari.jpg")
885		// More questionable bmps that fail on Mac, too. skbug.com/6984
886		skip(ALL, "image", "gen_platf", "rle8-height-negative.bmp")
887		skip(ALL, "image", "gen_platf", "rle4-height-negative.bmp")
888	}
889
890	// These PNGs have CRC errors. The platform generators seem to draw
891	// uninitialized memory without reporting an error, so skip them to
892	// avoid lots of images on Gold.
893	skip(ALL, "image", "gen_platf", "error")
894
895	if b.matchOs("Android") || b.os("iOS") {
896		// This test crashes the N9 (perhaps because of large malloc/frees). It also
897		// is fairly slow and not platform-specific. So we just disable it on all of
898		// Android and iOS. skia:5438
899		skip(ALL, "test", ALL, "GrStyledShape")
900	}
901
902	if internalHardwareLabel == "5" {
903		// http://b/118312149#comment9
904		skip(ALL, "test", ALL, "SRGBReadWritePixels")
905	}
906
907	// skia:4095
908	badSerializeGMs := []string{
909		"strict_constraint_batch_no_red_allowed", // https://crbug.com/skia/10278
910		"strict_constraint_no_red_allowed",       // https://crbug.com/skia/10278
911		"fast_constraint_red_is_allowed",         // https://crbug.com/skia/10278
912		"c_gms",
913		"colortype",
914		"colortype_xfermodes",
915		"drawfilter",
916		"fontmgr_bounds_0.75_0",
917		"fontmgr_bounds_1_-0.25",
918		"fontmgr_bounds",
919		"fontmgr_match",
920		"fontmgr_iter",
921		"imagemasksubset",
922		"wacky_yuv_formats_domain",
923		"imagemakewithfilter",
924		"imagemakewithfilter_crop",
925		"imagemakewithfilter_crop_ref",
926		"imagemakewithfilter_ref",
927	}
928
929	// skia:5589
930	badSerializeGMs = append(badSerializeGMs,
931		"bitmapfilters",
932		"bitmapshaders",
933		"convex_poly_clip",
934		"extractalpha",
935		"filterbitmap_checkerboard_32_32_g8",
936		"filterbitmap_image_mandrill_64",
937		"shadows",
938		"simpleaaclip_aaclip",
939	)
940
941	// skia:5595
942	badSerializeGMs = append(badSerializeGMs,
943		"composeshader_bitmap",
944		"scaled_tilemodes_npot",
945		"scaled_tilemodes",
946	)
947
948	// skia:5778
949	badSerializeGMs = append(badSerializeGMs, "typefacerendering_pfaMac")
950	// skia:5942
951	badSerializeGMs = append(badSerializeGMs, "parsedpaths")
952
953	// these use a custom image generator which doesn't serialize
954	badSerializeGMs = append(badSerializeGMs, "ImageGeneratorExternal_rect")
955	badSerializeGMs = append(badSerializeGMs, "ImageGeneratorExternal_shader")
956
957	// skia:6189
958	badSerializeGMs = append(badSerializeGMs, "shadow_utils")
959	badSerializeGMs = append(badSerializeGMs, "graphitestart")
960
961	// skia:7938
962	badSerializeGMs = append(badSerializeGMs, "persp_images")
963
964	// Not expected to round trip encoding/decoding.
965	badSerializeGMs = append(badSerializeGMs, "all_bitmap_configs")
966	badSerializeGMs = append(badSerializeGMs, "makecolorspace")
967	badSerializeGMs = append(badSerializeGMs, "readpixels")
968	badSerializeGMs = append(badSerializeGMs, "draw_image_set_rect_to_rect")
969	badSerializeGMs = append(badSerializeGMs, "draw_image_set_alpha_only")
970	badSerializeGMs = append(badSerializeGMs, "compositor_quads_shader")
971	badSerializeGMs = append(badSerializeGMs, "wacky_yuv_formats_qtr")
972	badSerializeGMs = append(badSerializeGMs, "runtime_effect_image")
973	badSerializeGMs = append(badSerializeGMs, "ctmpatheffect")
974	badSerializeGMs = append(badSerializeGMs, "image_out_of_gamut")
975
976	// This GM forces a path to be convex. That property doesn't survive
977	// serialization.
978	badSerializeGMs = append(badSerializeGMs, "analytic_antialias_convex")
979
980	for _, test := range badSerializeGMs {
981		skip("serialize-8888", "gm", ALL, test)
982	}
983
984	// We skip these to avoid out-of-memory failures.
985	if b.matchOs("Win", "Android") {
986		for _, test := range []string{"verylargebitmap", "verylarge_picture_image"} {
987			skip("serialize-8888", "gm", ALL, test)
988		}
989	}
990	if b.matchOs("Mac") && b.cpu() {
991		// skia:6992
992		skip("pic-8888", "gm", ALL, "encode-platform")
993		skip("serialize-8888", "gm", ALL, "encode-platform")
994	}
995
996	// skia:4769
997	skip("pic-8888", "gm", ALL, "drawfilter")
998
999	// skia:4703
1000	for _, test := range []string{"image-cacherator-from-picture",
1001		"image-cacherator-from-raster",
1002		"image-cacherator-from-ctable"} {
1003		skip("pic-8888", "gm", ALL, test)
1004		skip("serialize-8888", "gm", ALL, test)
1005	}
1006
1007	// GM that requires raster-backed canvas
1008	for _, test := range []string{"complexclip4_bw", "complexclip4_aa", "p3",
1009		"async_rescale_and_read_text_up_large",
1010		"async_rescale_and_read_text_up",
1011		"async_rescale_and_read_text_down",
1012		"async_rescale_and_read_dog_up",
1013		"async_rescale_and_read_dog_down",
1014		"async_rescale_and_read_rose",
1015		"async_rescale_and_read_no_bleed",
1016		"async_rescale_and_read_alpha_type"} {
1017		skip("pic-8888", "gm", ALL, test)
1018		skip("serialize-8888", "gm", ALL, test)
1019
1020		// GM requires canvas->makeSurface() to return a valid surface.
1021		// TODO(borenet): These should be just outside of this block but are
1022		// left here to match the recipe which has an indentation bug.
1023		skip("pic-8888", "gm", ALL, "blurrect_compare")
1024		skip("serialize-8888", "gm", ALL, "blurrect_compare")
1025	}
1026
1027	// Extensions for RAW images
1028	r := []string{
1029		"arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
1030		"ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW",
1031	}
1032
1033	// skbug.com/4888
1034	// Skip RAW images (and a few large PNGs) on GPU bots
1035	// until we can resolve failures.
1036	if b.gpu() {
1037		skip(ALL, "image", ALL, "interlaced1.png")
1038		skip(ALL, "image", ALL, "interlaced2.png")
1039		skip(ALL, "image", ALL, "interlaced3.png")
1040		for _, rawExt := range r {
1041			skip(ALL, "image", ALL, "."+rawExt)
1042		}
1043	}
1044
1045	// Skip memory intensive tests on 32-bit bots.
1046	if b.os("Win8") && b.arch("x86") {
1047		skip(ALL, "image", "f16", ALL)
1048		skip(ALL, "image", ALL, "abnormal.wbmp")
1049		skip(ALL, "image", ALL, "interlaced1.png")
1050		skip(ALL, "image", ALL, "interlaced2.png")
1051		skip(ALL, "image", ALL, "interlaced3.png")
1052		for _, rawExt := range r {
1053			skip(ALL, "image", ALL, "."+rawExt)
1054		}
1055	}
1056
1057	if b.model("Nexus5", "Nexus5x", "JioNext") && b.gpu() {
1058		// skia:5876
1059		skip(ALL, "gm", ALL, "encode-platform")
1060	}
1061
1062	if b.model("AndroidOne") && b.gpu() { // skia:4697, skia:4704, skia:4694, skia:4705, skia:11133
1063		skip(ALL, "gm", ALL, "bigblurs")
1064		skip(ALL, "gm", ALL, "strict_constraint_no_red_allowed")
1065		skip(ALL, "gm", ALL, "fast_constraint_red_is_allowed")
1066		skip(ALL, "gm", ALL, "dropshadowimagefilter")
1067		skip(ALL, "gm", ALL, "filterfastbounds")
1068		skip(glPrefix, "gm", ALL, "imageblurtiled")
1069		skip(ALL, "gm", ALL, "imagefiltersclipped")
1070		skip(ALL, "gm", ALL, "imagefiltersscaled")
1071		skip(ALL, "gm", ALL, "imageresizetiled")
1072		skip(ALL, "gm", ALL, "matrixconvolution")
1073		skip(ALL, "gm", ALL, "strokedlines")
1074		skip(ALL, "gm", ALL, "runtime_intrinsics_matrix")
1075		if sampleCount > 0 {
1076			glMsaaConfig := fmt.Sprintf("%smsaa%d", glPrefix, sampleCount)
1077			skip(glMsaaConfig, "gm", ALL, "imageblurtiled")
1078			skip(glMsaaConfig, "gm", ALL, "imagefiltersbase")
1079		}
1080
1081		skip(ALL, "tests", ALL, "SkSLUnaryPositiveNegative_GPU")
1082	}
1083
1084	if b.model("Pixel3") || b.model("Pixel2XL") {
1085		skip(ALL, "tests", ALL, "SkSLEmptyBlocksES3_GPU") // skia:13309
1086	}
1087
1088	if b.matchGpu("Adreno[3456]") { // disable broken tests on Adreno 3/4/5/6xx
1089		skip(ALL, "tests", ALL, "SkSLArrayCast_GPU")       // skia:12332
1090		skip(ALL, "tests", ALL, "SkSLArrayComparison_GPU") // skia:12332
1091		skip(ALL, "tests", ALL, "SkSLCommaSideEffects_GPU")
1092		skip(ALL, "tests", ALL, "SkSLIntrinsicMixFloatES2_GPU")
1093		skip(ALL, "tests", ALL, "SkSLIntrinsicClampFloat_GPU")
1094	}
1095
1096	if b.matchGpu("Adreno[345]") && !b.extraConfig("Vulkan") { // disable broken tests on Adreno 3/4/5xx GLSL
1097		skip(ALL, "tests", ALL, "DSLFPTest_SwitchStatement")  // skia:11891
1098		skip(ALL, "tests", ALL, "SkSLMatrixToVectorCast_GPU") // skia:12192
1099		skip(ALL, "tests", ALL, "SkSLStructsInFunctions_GPU") // skia:11929
1100	}
1101
1102	if b.matchGpu("Adreno[3456]") && !b.extraConfig("Vulkan") { // disable broken tests on Adreno 3/4/5/6xx GLSL
1103		skip(ALL, "tests", ALL, "SkSLOutParamsAreDistinctFromGlobal_GPU") // skia:13115
1104	}
1105
1106	if b.matchGpu("Adreno6") && !b.extraConfig("Vulkan") { // disable broken tests on Adreno 6xx GLSL
1107		skip(ALL, "tests", ALL, "SkSLIntrinsicIsInf_GPU") // skia:12377
1108	}
1109
1110	if b.matchGpu("Adreno[56]") && !b.extraConfig("Vulkan") { // disable broken tests on Adreno 5/6xx GLSL
1111		skip(ALL, "tests", ALL, "SkSLStructFieldFolding_GPU") // skia:13393
1112	}
1113
1114	if b.matchGpu("Adreno[56]") && b.extraConfig("Vulkan") { // disable broken tests on Adreno 5/6xx Vulkan
1115		skip(ALL, "tests", ALL, "SkSLInoutParameters_GPU")   // skia:12869
1116		skip(ALL, "tests", ALL, "SkSLOutParams_GPU")         // skia:11919
1117		skip(ALL, "tests", ALL, "SkSLOutParamsTricky_GPU")   // skia:11919
1118		skip(ALL, "tests", ALL, "SkSLOutParamsNoInline_GPU") // skia:11919
1119	}
1120
1121	if (b.matchGpu("Adreno3") || b.matchGpu("Mali400")) && !b.extraConfig("Vulkan") {
1122		skip(ALL, "tests", ALL, "SkSLMatrices") // skia:12456
1123		skip(ALL, "tests", ALL, "SkSLMatrixNoOpFolding_GPU")
1124	}
1125
1126	if b.gpu("QuadroP400") {
1127		skip(ALL, "tests", ALL, "SkSLCommaSideEffects")
1128	}
1129
1130	if b.matchGpu("Mali400") || b.matchGpu("Tegra3") {
1131		skip(ALL, "tests", ALL, "SkSLMatrixScalarMath") // skia:12681
1132	}
1133
1134	if b.matchGpu("Mali400") {
1135		skip(ALL, "tests", ALL, "SkSLCross")
1136	}
1137
1138	if (b.matchOs("Mac") || b.matchOs("iOS")) && !b.extraConfig("Metal") {
1139		// MacOS/iOS do not handle short-circuit evaluation properly in OpenGL (chromium:307751)
1140		skip(ALL, "tests", ALL, "SkSLLogicalAndShortCircuit_GPU")
1141		skip(ALL, "tests", ALL, "SkSLLogicalOrShortCircuit_GPU")
1142	}
1143
1144	if b.matchOs("Mac") && b.extraConfig("Metal") && (b.gpu("IntelIrisPlus") ||
1145                                                      b.gpu("IntelHD6000")) {
1146		skip(ALL, "tests", ALL, "SkSLIntrinsicNot_GPU")         // skia:14025
1147		skip(ALL, "tests", ALL, "SkSLIntrinsicMixFloatES3_GPU") // skia:14025
1148	}
1149
1150	if b.gpu("IntelIris6100", "IntelHD4400") && b.matchOs("Win") && b.extraConfig("ANGLE") {
1151		skip(ALL, "tests", ALL, "SkSLVectorToMatrixCast_GPU")             // skia:12179, vec4(mat2) crash
1152		skip(ALL, "tests", ALL, "SkSLTrivialArgumentsInlineDirectly_GPU") // skia:12179 again
1153		skip(ALL, "tests", ALL, "SkSLVectorScalarMath_GPU")
1154	}
1155
1156	if b.gpu("IntelIris6100", "IntelHD4400") && b.matchOs("Win") && !b.extraConfig("Vulkan") {
1157		skip(ALL, "tests", ALL, "SkSLMatrixFoldingES2_GPU")               // skia:11919
1158		skip(ALL, "tests", ALL, "SkSLMatrixEquality_GPU")                 // skia:11919
1159	}
1160
1161	if b.matchGpu("Intel") && b.matchOs("Win") && !b.extraConfig("Vulkan") {
1162		skip(ALL, "tests", ALL, "SkSLReturnsValueOnEveryPathES3_GPU")     // skia:12465
1163		skip(ALL, "tests", ALL, "SkSLOutParamsAreDistinctFromGlobal_GPU") // skia:13115
1164		skip(ALL, "tests", ALL, "SkSLStructFieldFolding_GPU")             // skia:13393
1165	}
1166
1167	if b.extraConfig("Vulkan") && b.isLinux() && b.matchGpu("Intel") {
1168		skip(ALL, "tests", ALL, "SkSLSwitchDefaultOnly_GPU")          // skia:12465
1169		skip(ALL, "tests", ALL, "SkSLReturnsValueOnEveryPathES3_GPU") // skia:14131
1170	}
1171
1172	if b.extraConfig("ANGLE") && b.matchOs("Win") && b.matchGpu("IntelIris(540|655|Xe)") {
1173		skip(ALL, "tests", ALL, "SkSLSwitchDefaultOnly_GPU") // skia:12465
1174	}
1175
1176	if b.extraConfig("Dawn") {
1177		// skia:13922: WGSL does not support case fallthrough in switch statements.
1178		skip(ALL, "tests", ALL, "SkSLSwitchWithFallthrough_GPU")
1179		skip(ALL, "tests", ALL, "SkSLSwitchWithLoops_GPU")
1180	}
1181
1182	if b.gpu("Tegra3") {
1183		// Tegra3 fails to compile break stmts inside a for loop (skia:12477)
1184		skip(ALL, "tests", ALL, "SkSLSwitch_GPU")
1185		skip(ALL, "tests", ALL, "SkSLSwitchDefaultOnly_GPU")
1186		skip(ALL, "tests", ALL, "SkSLSwitchWithFallthrough_GPU")
1187		skip(ALL, "tests", ALL, "SkSLSwitchWithLoops_GPU")
1188		skip(ALL, "tests", ALL, "SkSLSwitchCaseFolding_GPU")
1189		skip(ALL, "tests", ALL, "SkSLLoopFloat_GPU")
1190		skip(ALL, "tests", ALL, "SkSLLoopInt_GPU")
1191	}
1192
1193	if b.gpu("QuadroP400") || b.gpu("GTX660") || b.gpu("GTX960") || b.gpu("Tegra3") || b.gpu("RTX3060") {
1194		if !b.extraConfig("Vulkan") {
1195			// Various Nvidia GPUs crash or generate errors when assembling weird matrices
1196			skip(ALL, "tests", ALL, "SkSLMatrixConstructorsES2_GPU") // skia:12443
1197			skip(ALL, "tests", ALL, "SkSLMatrixConstructorsES3_GPU") // skia:12443
1198
1199			// Nvidia drivers erroneously constant-fold expressions with side-effects in
1200			// constructors when compiling GLSL.
1201			skip(ALL, "tests", ALL, "SkSLPreserveSideEffects_GPU")  // skia:13035
1202			skip(ALL, "tests", ALL, "SkSLStructFieldNoFolding_GPU") // skia:13395
1203		}
1204	}
1205
1206	if !b.extraConfig("Vulkan") && (b.gpu("RTX3060") ||
1207									b.gpu("QuadroP400") ||
1208									b.matchGpu("GTX[6-9]60") ||
1209									b.matchGpu("Mali400") ||
1210									b.matchGpu("Tegra3") ||
1211									b.matchGpu("Radeon(R9|HD)")) {
1212		skip(ALL, "tests", ALL, "SkSLMatrixScalarNoOpFolding_GPU")  // skia:13556
1213	}
1214
1215	if b.matchOs("Mac") && b.extraConfig("ANGLE") {
1216		skip(ALL, "tests", ALL, "SkSLMatrixScalarNoOpFolding_GPU")  // https://anglebug.com/7525
1217	}
1218
1219	if b.gpu("RTX3060") && b.extraConfig("Vulkan") && b.matchOs("Win") {
1220		skip(ALL, "gm", ALL, "blurcircles2") // skia:13342
1221		skip(ALL, "tests", ALL, "SkSLIntrinsicMixFloatES3_GPU")
1222	}
1223
1224	if b.gpu("Tegra3") {
1225		skip(ALL, "tests", ALL, "SkSLMatrixFoldingES2_GPU") // skia:11919
1226		skip(ALL, "tests", ALL, "SkSLMatrixEquality_GPU")   // skia:11919
1227		skip(ALL, "tests", ALL, "SkSLIntrinsicFract_GPU")
1228	}
1229
1230	if b.gpu("QuadroP400") && b.matchOs("Ubuntu") && b.matchModel("Golo") {
1231		// Fails on Ubuntu18-Golo bots with QuadroP400 GPUs on Vulkan and OpenGL
1232		skip(ALL, "tests", ALL, "SkSLPreserveSideEffects_GPU") // skia:13035
1233	}
1234
1235	if b.gpu("QuadroP400") && b.matchOs("Win10") && b.matchModel("Golo") {
1236		// Times out with driver 30.0.15.1179
1237		skip("vkmsaa4", "gm", ALL, "shadow_utils")
1238	}
1239
1240	if b.gpu("PowerVRGE8320") {
1241		skip(ALL, "tests", ALL, "SkSLOutParamsAreDistinct_GPU")
1242		skip(ALL, "tests", ALL, "SkSLOutParamsAreDistinctFromGlobal_GPU") // skia:13115
1243	}
1244
1245	if !b.extraConfig("Vulkan") && (b.gpu("RadeonR9M470X") || b.gpu("RadeonHD7770")) {
1246		// Some AMD GPUs can get the wrong result when assembling non-square matrices (skia:12443)
1247		skip(ALL, "tests", ALL, "SkSLMatrixConstructorsES3_GPU")
1248		// Some AMD GPUs miscompile the all() intrinsic. (skia:14034)
1249		skip(ALL, "tests", ALL, "SkSLIntrinsicAll_GPU")
1250	}
1251
1252	if b.extraConfig("Vulkan") && b.gpu("RadeonVega6") {
1253		skip(ALL, "gm", ALL, "ycbcrimage")                                 // skia:13265
1254		skip(ALL, "test", ALL, "VkYCbcrSampler_DrawImageWithYcbcrSampler") // skia:13265
1255	}
1256
1257	if b.matchGpu("Intel") || b.matchGpu("RadeonVega6") { // some Intel and AMD GPUs don't return zero for the derivative of a uniform
1258		skip(ALL, "tests", ALL, "SkSLIntrinsicDFdy_GPU")
1259		skip(ALL, "tests", ALL, "SkSLIntrinsicDFdx_GPU")
1260		skip(ALL, "tests", ALL, "SkSLIntrinsicFwidth_GPU")
1261	}
1262
1263	if b.matchOs("Mac") && b.matchGpu("Intel(Iris5100|HD6000)") {
1264		skip(ALL, "tests", ALL, "SkSLLoopFloat_GPU") // skia:12426
1265	}
1266
1267	match := []string{}
1268	if b.extraConfig("Valgrind") { // skia:3021
1269		match = append(match, "~Threaded")
1270	}
1271
1272	if b.extraConfig("Valgrind") && b.extraConfig("PreAbandonGpuContext") {
1273		// skia:6575
1274		match = append(match, "~multipicturedraw_")
1275	}
1276
1277	if b.model("AndroidOne") {
1278		match = append(match, "~WritePixels")                             // skia:4711
1279		match = append(match, "~PremulAlphaRoundTrip_Gpu")                // skia:7501
1280		match = append(match, "~ReimportImageTextureWithMipLevels")       // skia:8090
1281		match = append(match, "~MorphologyFilterRadiusWithMirrorCTM_Gpu") // skia:10383
1282	}
1283
1284	if b.gpu("IntelIrisXe") {
1285		match = append(match, "~ReimportImageTextureWithMipLevels")
1286	}
1287
1288	if b.extraConfig("MSAN") {
1289		match = append(match, "~Once", "~Shared") // Not sure what's up with these tests.
1290	}
1291
1292	// By default, we test with GPU threading enabled, unless specifically
1293	// disabled.
1294	if b.extraConfig("NoGPUThreads") {
1295		args = append(args, "--gpuThreads", "0")
1296	}
1297
1298	if b.extraConfig("Vulkan") && b.gpu("Adreno530") {
1299		// skia:5777
1300		match = append(match, "~CopySurface")
1301	}
1302
1303	if b.extraConfig("Vulkan") && b.matchGpu("Adreno") {
1304		// skia:7663
1305		match = append(match, "~WritePixelsNonTextureMSAA_Gpu")
1306		match = append(match, "~WritePixelsMSAA_Gpu")
1307	}
1308
1309	if b.extraConfig("Vulkan") && b.isLinux() && b.gpu("IntelIris640") {
1310		match = append(match, "~VkHeapTests") // skia:6245
1311	}
1312
1313	if b.isLinux() && b.gpu("IntelIris640") {
1314		match = append(match, "~Programs") // skia:7849
1315	}
1316
1317	if b.model("TecnoSpark3Pro", "Wembley") {
1318		// skia:9814
1319		match = append(match, "~Programs")
1320		match = append(match, "~ProcessorCloneTest")
1321		match = append(match, "~ProcessorOptimizationValidationTest")
1322	}
1323
1324	if b.gpu("IntelIris640", "IntelHD615", "IntelHDGraphics615") {
1325		match = append(match, "~^SRGBReadWritePixels$") // skia:9225
1326	}
1327
1328	if b.extraConfig("Vulkan") && b.isLinux() && b.gpu("IntelHD405") {
1329		// skia:7322
1330		skip("vk", "gm", ALL, "skbug_257")
1331		skip("vk", "gm", ALL, "filltypespersp")
1332		match = append(match, "~^ClearOp$")
1333		match = append(match, "~^CopySurface$")
1334		match = append(match, "~^ImageNewShader_GPU$")
1335		match = append(match, "~^InitialTextureClear$")
1336		match = append(match, "~^PinnedImageTest$")
1337		match = append(match, "~^ReadPixels_Gpu$")
1338		match = append(match, "~^ReadPixels_Texture$")
1339		match = append(match, "~^SRGBReadWritePixels$")
1340		match = append(match, "~^VkUploadPixelsTests$")
1341		match = append(match, "~^WritePixelsNonTexture_Gpu$")
1342		match = append(match, "~^WritePixelsNonTextureMSAA_Gpu$")
1343		match = append(match, "~^WritePixels_Gpu$")
1344		match = append(match, "~^WritePixelsMSAA_Gpu$")
1345	}
1346
1347	if b.extraConfig("Vulkan") && b.gpu("GTX660") && b.matchOs("Win") {
1348		// skbug.com/8047
1349		match = append(match, "~FloatingPointTextureTest$")
1350	}
1351
1352	if b.extraConfig("Metal") && !b.extraConfig("Graphite") && b.gpu("RadeonHD8870M") && b.matchOs("Mac") {
1353		// skia:9255
1354		match = append(match, "~WritePixelsNonTextureMSAA_Gpu")
1355		// skbug.com/11366
1356		match = append(match, "~SurfacePartialDraw_Gpu")
1357	}
1358
1359	if b.extraConfig("Metal") && !b.extraConfig("Graphite") && b.gpu("PowerVRGX6450") && b.matchOs("iOS") {
1360		// skbug.com/11885
1361		match = append(match, "~flight_animated_image")
1362	}
1363
1364	if b.extraConfig("ANGLE") {
1365		// skia:7835
1366		match = append(match, "~BlurMaskBiggerThanDest")
1367	}
1368
1369	if b.gpu("IntelIris6100") && b.extraConfig("ANGLE") && !b.debug() {
1370		// skia:7376
1371		match = append(match, "~^ProcessorOptimizationValidationTest$")
1372	}
1373
1374	if b.gpu("IntelIris6100", "IntelHD4400") && b.extraConfig("ANGLE") {
1375		// skia:6857
1376		skip("angle_d3d9_es2", "gm", ALL, "lighting")
1377	}
1378
1379	if b.gpu("PowerVRGX6250") {
1380		match = append(match, "~gradients_view_perspective_nodither") //skia:6972
1381	}
1382
1383	if b.arch("arm") && b.extraConfig("ASAN") {
1384		// TODO: can we run with env allocator_may_return_null=1 instead?
1385		match = append(match, "~BadImage")
1386	}
1387
1388	if b.arch("arm64") && b.extraConfig("ASAN") {
1389		// skbug.com/13155 the use of longjmp may cause ASAN stack check issues.
1390		skip(ALL, "test", ALL, "SkPDF_JpegIdentification")
1391	}
1392
1393	if b.extraConfig("HWASAN") {
1394		// HWASAN adds tag bytes to pointers. That's incompatible with this test -- it compares
1395		// pointers from unrelated stack frames to check that RP isn't growing the stack.
1396		skip(ALL, "test", ALL, "SkRasterPipeline_stack_rewind")
1397	}
1398
1399	if b.matchOs("Mac") && b.gpu("IntelHD6000") {
1400		// skia:7574
1401		match = append(match, "~^ProcessorCloneTest$")
1402		match = append(match, "~^GrMeshTest$")
1403	}
1404
1405	if b.matchOs("Mac") && b.gpu("IntelHD615") {
1406		// skia:7603
1407		match = append(match, "~^GrMeshTest$")
1408	}
1409
1410	if b.matchOs("Mac") && b.gpu("IntelIrisPlus") {
1411		// skia:7603
1412		match = append(match, "~^GrMeshTest$")
1413	}
1414
1415	if b.extraConfig("Vulkan") && b.model("GalaxyS20") {
1416		// skia:10247
1417		match = append(match, "~VkPrepareForExternalIOQueueTransitionTest")
1418	}
1419	if b.matchExtraConfig("Graphite") {
1420		// skia:12813
1421		match = append(match, "~async_rescale_and_read")
1422	}
1423
1424	if b.matchExtraConfig("ColorSpaces") {
1425		// Here we reset the 'match' and 'skipped' strings bc the ColorSpaces job only runs
1426		// a very specific subset of the GMs.
1427		skipped = []string{}
1428		match = []string{}
1429		match = append(match, "async_rescale_and_read_dog_up")
1430		match = append(match, "bug6783")
1431		match = append(match, "colorspace")
1432		match = append(match, "colorspace2")
1433		match = append(match, "composeCF")
1434		match = append(match, "crbug_224618")
1435		match = append(match, "drawlines_with_local_matrix")
1436		match = append(match, "gradients_interesting")
1437		match = append(match, "manypathatlases_2048")
1438		match = append(match, "paint_alpha_normals_rt")
1439		match = append(match, "runtimefunctions")
1440		match = append(match, "savelayer_f16")
1441		match = append(match, "spiral_rt")
1442		match = append(match, "srgb_colorfilter")
1443		match = append(match, "strokedlines")
1444		match = append(match, "sweep_tiling")
1445	}
1446
1447	if len(skipped) > 0 {
1448		args = append(args, "--skip")
1449		args = append(args, skipped...)
1450	}
1451
1452	if len(match) > 0 {
1453		args = append(args, "--match")
1454		args = append(args, match...)
1455	}
1456
1457	// These bots run out of memory running RAW codec tests. Do not run them in
1458	// parallel
1459	// TODO(borenet): Previously this was `'Nexus5' in bot or 'Nexus9' in bot`
1460	// which also matched 'Nexus5x'. I added That here to maintain the
1461	// existing behavior, but we should verify that it's needed.
1462	if b.model("Nexus5", "Nexus5x", "Nexus9", "JioNext") {
1463		args = append(args, "--noRAW_threading")
1464	}
1465
1466	if b.extraConfig("FSAA") {
1467		args = append(args, "--analyticAA", "false")
1468	}
1469	if b.extraConfig("FAAA") {
1470		args = append(args, "--forceAnalyticAA")
1471	}
1472
1473	if !b.extraConfig("NativeFonts") {
1474		args = append(args, "--nonativeFonts")
1475	}
1476
1477	if b.extraConfig("GDI") {
1478		args = append(args, "--gdi")
1479	}
1480
1481	// Let's make all bots produce verbose output by default.
1482	args = append(args, "--verbose")
1483
1484	// See skia:2789.
1485	if b.extraConfig("AbandonGpuContext") {
1486		args = append(args, "--abandonGpuContext")
1487	}
1488	if b.extraConfig("PreAbandonGpuContext") {
1489		args = append(args, "--preAbandonGpuContext")
1490	}
1491	if b.extraConfig("ReleaseAndAbandonGpuContext") {
1492		args = append(args, "--releaseAndAbandonGpuContext")
1493	}
1494
1495	if b.extraConfig("FailFlushTimeCallbacks") {
1496		args = append(args, "--failFlushTimeCallbacks")
1497	}
1498
1499	// Finalize the DM flags and properties.
1500	b.recipeProp("dm_flags", marshalJson(args))
1501	b.recipeProp("dm_properties", marshalJson(properties))
1502
1503	// Add properties indicating which assets the task should use.
1504	if b.matchExtraConfig("Lottie") {
1505		b.asset("lottie-samples")
1506		b.recipeProp("lotties", "true")
1507	} else if b.matchExtraConfig("OldestSupportedSkpVersion") {
1508		b.recipeProp("skps", "true")
1509	} else {
1510		b.asset("skimage")
1511		b.recipeProp("images", "true")
1512		b.asset("skp")
1513		b.recipeProp("skps", "true")
1514		b.asset("svg")
1515		b.recipeProp("svgs", "true")
1516	}
1517	b.recipeProp("do_upload", fmt.Sprintf("%t", b.doUpload()))
1518	b.recipeProp("resources", "true")
1519}
1520