Drop GIMP workload; make Inkscape export a tunable subset

GIMP 3 removed/renamed the Script-Fu PDB calls the workload relied on
(plug-in-unsharp-mask, gimp-levels-stretch), so it is removed rather than
maintained as best-effort. Inkscape now exports the first INKSCAPE_FILES SVGs
(default 25) instead of all 121, cutting that step to well under a minute.
This commit is contained in:
smill 2026-09-29 21:51:18 -04:00
commit cc9354e136
133 changed files with 32 additions and 5235 deletions

View file

@ -33,9 +33,10 @@
# GPU_VD=0x1002:0x73df vendor:device hex for Vulkan selection (auto-detected)
# LLAMA_MODEL=/path GGUF for the LLM test (default: bundled model)
# LLAMA_NGL=0 GPU layers to offload (0 = CPU/RAM, the default)
# RUN_APPS=1 app workloads: LibreOffice, GEGL, Inkscape, GIMP
# RUN_APPS=1 app workloads: LibreOffice, GEGL, Inkscape
# CORPUS=/path where the sample inputs are cached (default ./tools/corpus)
# CORPUS_URL=... base URL the sample corpora are fetched from
# INKSCAPE_FILES=25 how many SVGs the Inkscape step exports
# GOVERNOR=powersave CPU governor to pin (default performance); an explicit
# value is appended to the tag, e.g. after-powersave-headless
# GLMARK2_DURATION=10 seconds for the glmark2 scene (headed part)
@ -392,11 +393,11 @@ doctor() {
printf ' %-22s %s\n' "$t" "$(command -v "$t" || echo MISSING)"
done
printf 'apps:\n'
for t in libreoffice inkscape gegl gimp; do
for t in libreoffice inkscape gegl; do
printf ' %-22s %s\n' "$t" "$(command -v "$t" || echo MISSING)"
done
printf 'corpus: %s\n' "$CORPUS"
printf ' install apps: sudo dnf install -y libreoffice-writer libreoffice-calc inkscape gegl04-tools gimp\n'
printf ' install apps: sudo dnf install -y libreoffice-writer libreoffice-calc inkscape gegl04-tools\n'
printf 'governor: %s (pinned for timed runs; set GOVERNOR=... to choose)\n' "$GOVERNOR"
local need; need="$(pkgs_for_missing)"
if [ -z "${need// /}" ]; then
@ -499,7 +500,7 @@ run_llama() {
}
# --- app workloads (stock apps + fixed corpora) -------------------------------
# Phases and score names are the benchmark names: libreoffice gegl inkscape gimp.
# Phases and score names are the benchmark names: libreoffice gegl inkscape.
# Each registers a rate (items/s) so higher stays better for the score/W table.
run_libreoffice() {
@ -568,13 +569,17 @@ run_inkscape() {
c373998bebff0a88f0c4e6fec383eaa62690f544c6eb2b1ad7c55b1547e4db08 inkscape \
|| { printf 'skip (corpus unavailable)\n'; return 0; }
local d="$CORPUS/inkscape" out="$CORPUS/inkscape-out" log="inkscape-$TAG.txt"
local n t0 t1 el r f
n=$(find "$d" -maxdepth 1 -name '*.svg' 2>/dev/null | wc -l)
local n limit t0 t1 el r f
local -a svgs
mapfile -t svgs < <(find "$d" -maxdepth 1 -name '*.svg' 2>/dev/null | sort)
n="${#svgs[@]}"
[ "$n" -gt 0 ] || { printf 'skip (no SVG in corpus)\n'; return 0; }
limit="${INKSCAPE_FILES:-25}" # cap the corpus so the step stays short
[ "$limit" -gt 0 ] 2>/dev/null && [ "$limit" -lt "$n" ] && n="$limit"
rm -rf "$out"; mkdir -p "$out"
{ inkscape --version; printf 'export %s SVG files -> PNG\n' "$n"; } > "$log" 2>&1
{ inkscape --version; printf 'export %s of %s SVG files -> PNG\n' "$n" "${#svgs[@]}"; } > "$log" 2>&1
t0=$(now)
for f in "$d"/*.svg; do
for f in "${svgs[@]:0:$n}"; do
inkscape --export-filename="$out/$(basename "${f%.svg}").png" "$f" >> "$log" 2>&1
done
t1=$(now)
@ -584,89 +589,11 @@ run_inkscape() {
reg_score "inkscape" "$r"
}
# GIMP batch Script-Fu. GIMP 3 renamed/reshaped much of the PDB, so pick the
# script for the installed major version. GIMP 3 support is best-effort: verify
# the log if the op count or timing looks off.
gimp_script_v2() {
cat > "$1" <<'SCM'
(define (batch-op op pattern)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(cond ((string=? op "unsharp-mask")
(plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable 15.0 0.6 0))
((string=? op "resize") (gimp-image-scale image 600 400))
((string=? op "rotate") (gimp-image-rotate image 0))
((string=? op "auto-levels") (gimp-levels-stretch drawable)))
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
SCM
}
gimp_script_v3() {
cat > "$1" <<'SCM'
(script-fu-use-v3)
(define (batch-op op pattern)
(let* ((filelist (file-glob #:pattern pattern #:filename-encoding TRUE)))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (gimp-file-load RUN-NONINTERACTIVE filename))
(drawable (vector-ref (gimp-image-get-selected-drawables image) 0)))
(cond ((string=? op "unsharp-mask")
(plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable 15.0 0.6 0))
((string=? op "resize") (gimp-image-scale image 600 400))
((string=? op "rotate") (gimp-image-rotate image 0))
((string=? op "auto-levels") (gimp-levels-stretch drawable)))
(gimp-file-save RUN-NONINTERACTIVE image filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
SCM
}
run_gimp() {
section "APP: GIMP — batch image operations"
phase "gimp"
if ! have gimp; then
printf 'skip (gimp missing) — sudo dnf install -y gimp\n'
return 0
fi
setup_corpus sample-photo-6000x4000-1.zip "$CORPUS_URL/sample-photo-6000x4000-1.zip" \
cadcd434abcdc82a220e7022c749b6fa5f46bb7a32ec14423ca8aab067b0e989 gimp \
|| { printf 'skip (corpus unavailable)\n'; return 0; }
local d="$CORPUS/gimp" src log="gimp-$TAG.txt" w scm gv t0 t1 el r op
src="$(find "$d" -maxdepth 1 -iname '*.jpg' 2>/dev/null | head -1)"
[ -n "$src" ] || { printf 'skip (no JPEG in corpus)\n'; return 0; }
w="$CORPUS/gimp-work"; rm -rf "$w"; mkdir -p "$w"
scm="$w/bench.scm"
gv="$(gimp --version 2>&1 | grep -oE '[0-9]+' | head -1)"; gv="${gv:-3}"
if [ "$gv" -ge 3 ] 2>/dev/null; then gimp_script_v3 "$scm"; else gimp_script_v2 "$scm"; fi
{ gimp --version 2>&1 | head -1; printf '4 ops x 1 image (v%s script)\n' "$gv"; } > "$log"
t0=$(now)
for op in unsharp-mask resize rotate auto-levels; do
cp -f "$src" "$w/sample.JPG"
printf -- '-- %s --\n' "$op" >> "$log"
if [ "$gv" -ge 3 ] 2>/dev/null; then
GIMP3_DIRECTORY="$w/cfg" gimp -i --batch-interpreter=plug-in-script-fu-eval \
-b "(load \"$scm\")" -b "(batch-op \"$op\" \"$w/*.JPG\")" -b '(gimp-quit 0)' >> "$log" 2>&1
else
GIMP2_DIRECTORY="$w/cfg" gimp -i \
-b "(load \"$scm\")" -b "(batch-op \"$op\" \"$w/*.JPG\")" -b '(gimp-quit 0)' >> "$log" 2>&1
fi
done
t1=$(now)
el="$(secs "$t0" "$t1")"; r="$(per_s 4 "$el")"
cat "$log"
printf 'gimp: 4 ops in %ss = %s ops/s\n' "$el" "$r"
reg_score "gimp" "$r"
}
run_apps() {
section "APP WORKLOADS (LibreOffice / GEGL / Inkscape / GIMP)"
section "APP WORKLOADS (LibreOffice / GEGL / Inkscape)"
run_libreoffice
run_gegl
run_inkscape
run_gimp
}
run_headless() {