Change-Id: I9eb9095131adb5862d286b211501bf194ef8e91e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205822
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Split work queues for CPU and GPU, assigning using a --backend
whitelist. This lets us up the CPU process limit to NumCPUs,
while keeping the GPU process limit at 8.
On my desktop this speeds up this mixed workload about 2x:
cat <<EOF | go run tools/fm/fm_bot.go -quiet -script - out/fm
b=cpu gms ct=8888 w=$WHERE/8888 legacy=true # old and busted
b=cpu gms ct=8888 w=$WHERE/srgb # new hotness
b=gl gms ct=8888 w=$WHERE/gl
b=mtl gms ct=8888 w=$WHERE/mtl
b=cpu gms ct=565 w=$WHERE/565
b=cpu gms ct=f16 w=$WHERE/f16
b=skp gms w=$WHERE/skp
EOF
Before: 44.37 real 303.87 user 15.40 sys
After: 21.87 real 480.05 user 27.10 sys
Change-Id: Ibea4537c8cdf278f8e4621f26ebacd942952eec3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205833
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
E.g.
cat <<EOF | go run tools/fm/fm_bot.go -processLimit 0 -quiet -script - out/fm
b=cpu gms ct=8888 w=$WHERE/8888 legacy=true # old and busted
b=cpu gms ct=8888 w=$WHERE/srgb # new hotness
EOF
Change-Id: Ia92ba113ae95478313e1f2cc18b7270ea1aa8a42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205831
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
These do the same thing:
$ go run tools/fm_bot.go out/fm b=cpu gms
$ echo "b=cpu gms" | go run tools/fm/fm_bot.go -s - out/fm
~/skia (make-from-memory↑2|…) $ cat test.sh
set -e
set -x
mkdir -p foo
cat <<EOF | go run tools/fm/fm_bot.go -j 0 -q -s - out/fm
b=cpu ct=8888 gms w=foo/8888
b=cpu ct=565 gms w=foo/565
b=cpu ct=f16 gms w=foo/f16
EOF
~/skia (make-from-memory↑2|…) $ time ./test.sh
+ mkdir -p foo
+ cat
+ go run tools/fm/fm_bot.go -j 0 -q -s - out/fm
9.47 real 234.71 user 9.12 sys
Change-Id: If0e8de2772f12de4257671d24f70662c423581c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205826
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Running fm_bot at head I'm confronted with a puzzling error:
2019/04/03 10:26:01
out/fm -b cpu -w foo -s big_rrect_rect_aa_effect filterbitmap_image_mandrill_512.png #failed (exit status 1):
Don't understand --source ... bailing out.
2019/04/03 10:26:05 1 invocations of out/fm failed
And of course running that command works fine. Puzzling!
To fix this, we must take care not to subslice sources past its end,
which fills with defaults, a bunch of extra "" sources. And add some ''
around the unknown source to make the error message easier to parse.
Serves me right for not testing this before I landed that tweak...
Change-Id: I5c2abb35733b32a1142b0f42c4323112969ad2bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205825
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
fm itself can always be verbose. We'll rarely call it directly
and when we do and we don't want to see its output, we can always
pipe to /dev/null.
Switch fm_bot.go over to random shuffle by default, and to verbose by
default with a -q/-quiet flag to only print failures.
Change-Id: Ibd53bf7f1d29e0fd5deb7d4689dc0ca100df648f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205587
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
GMs sometimes want to skip instead of drawing or failing.
E.g. GPU-only GMs with a non-GPU backend.
Change-Id: I5bd8acecbef1aa88b4d7e6cfb88dfde04424aa8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205349
Reviewed-by: Mike Klein <mtklein@google.com>
This handles batching and things like figuring out "skps" means "all the
files under the directory skps", "gms" means "all the GMs linked into
fm", etc.
You can set up one job on the command line, or any number of them
with a -script file, e.g.
~/skia (fm-bot↑1|●1…) $ cat fm.script
gms b=cpu w=foo/8888
gms b=cpu w=foo/565 ct=565
skps b=gl w=foo/msaa4-skps samples=4
Change-Id: I878c623bfc8673f04b4effa247bc850c0258a89b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204582
Reviewed-by: Brian Osman <brianosman@google.com>
Only try to parse .skp files as SkPictures, only .svg
files as SVG, and only try to parse any given file once.
This cleans up error logging from, e.g., trying to
parse a .jpg as an .svg. Sometimes even asserts.
Change-Id: Ibfab76e201eb273107b96fcbd3af94d397862291
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204882
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: Ic364059cb277773a5d5f8011be2b68b757e889f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204280
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
And move --backend first among the backend flags.
Change-Id: I853ede2a8218f046c968ace2ce8c5e277421e225
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204133
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
FM's a bit like DM, and a bit like the old GM tool, maybe closer to GM.
FM always does one serial run through of a list of GM, image, or .skp
sources (-s/--sources) into one drawing configuration, set at a high
level with -b/--backend, fine-tuned by flags like --ct, --at, --gamut,
--samples, etc.
FM prints all available GMs when run with no arguments, part of
how it integrates well with external parallelization like xargs:
out/fm | time xargs -n4 -P32 out/fm -b cpu ... -s
out/fm | time xargs -n32 -P8 out/fm -b gl ... -s
ls *.skp | xargs ... out/fm ... -s
...
TODO later:
vector backends: --backend pdf, svg, xps, skp
--source *.svg, *.json (Skottie)
Create/update a dm.json file
Change-Id: Idacbd2785deaf6f1d33674c66c4d984fa91dbd85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/203520
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>