blit.s gains v7 -- v6's 24-pixel movem chain plus a second chain whose unit is
one `move.l (a0)+,(a2)+`. Measured over 13 span lengths by span.sh, every config
pixel-exact:
cycles = 66.0 per span + 9.143 per COARSE pixel + 9.978 per FINE pixel
fitting all 13 to within 0.2%. v5 and v6 re-measure to FINDINGS 30 exactly, so
the harness has not drifted underneath the new variant.
Rescored against the same scsi window and the same additive model, v7 takes
84/120 frames over budget to 18/120 -- exactly what FINDINGS 39.4 derived, and
that agreement is two cancelling errors: the derivation's 2-register movem tail
is 29% too dear per pixel, and its "nothing per span" for the second chain entry
is 22.3 clocks too cheap. The plain post-incrementing move.l is the right tail
instruction, and it makes the padding quantum 2 pixels, which a run of 4x4
blocks pads to exactly zero.
The DMAC stays dropped on a measurement now rather than an argument: v7 takes
back 37 of the 43 frames the array chain would, with no reserved channel and no
timing neither emulator here can verify. Break-even against all-V1 moves from
L=4 blocks to L=2.
The fine displacement is carried mid-stream rather than in the span record, so
the decoder holds nothing across the copy and keeps all 12 payload registers --
which is the whole reason the coarse unit is 24 pixels.
span.sh is now -seconds_to_run 200 (30 s wall, 36 configs) and takes its
expected snapshot count from the generated metadata instead of a literal 23.
Claude-Session: https://claude.ai/code/session_01194oWYW8DQXK1SZ2DnChW6
36 lines
1.7 KiB
Bash
Executable File
36 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# Measure the cost of a row-linear literal span on the 68000 (FINDINGS 30).
|
|
# ~45 s. Run from the repo root. Needs tmp/frame256.bin (check.sh makes it).
|
|
#
|
|
# NOT part of check.sh, for the same reason blit.s is not: the output is a wall
|
|
# timing, so gating on it would make the green light host-sensitive. What IS
|
|
# gated here is correctness -- all 23 configs must draw a pixel-exact frame,
|
|
# which is what stops a config timing fast by quietly writing nothing.
|
|
set -e
|
|
cd "$(dirname "$0")/../.."
|
|
[ -f tmp/frame256.bin ] || { echo "need tmp/frame256.bin -- run tools/bench/check.sh"; exit 2; }
|
|
|
|
python3 tools/bench/prep_spans.py
|
|
tools/vasm/vasmm68k_mot -Fbin -o tmp/blit.bin tools/bench/blit.s > /dev/null
|
|
mkdir -p tmp/snap_span
|
|
rm -f tmp/snap_span/x68000/*.png
|
|
( cd tmp && SDL_VIDEODRIVER=dummy stdbuf -oL timeout -k 5 1800 mame x68000 -bios ipl10 \
|
|
-ramsize 2M -video soft -window -sound none -nothrottle -plugins \
|
|
-autoboot_script ../tools/bench/span.lua \
|
|
-snapshot_directory ./snap_span -snapview native -seconds_to_run 200 \
|
|
> span.log 2>&1 )
|
|
grep -a "^\[SPAN\]" tmp/span.log
|
|
|
|
# One snapshot per config, and the expected count comes from the generated
|
|
# metadata rather than a literal: adding a config must not silently weaken the
|
|
# assertion that every one of them drew the picture.
|
|
want=$(grep -c '{var=' tmp/spans_meta.lua)
|
|
n=0
|
|
for f in tmp/snap_span/x68000/*.png; do
|
|
python3 tools/bench/verify_frame256.py "$f" > /dev/null || {
|
|
echo "FAIL: $f is not pixel-exact"; python3 tools/bench/verify_frame256.py "$f"; exit 1; }
|
|
n=$((n+1))
|
|
done
|
|
[ "$n" -eq "$want" ] || { echo "FAIL: $n snapshots, expected $want"; exit 1; }
|
|
echo "OK $n/$want span configs drew a pixel-exact frame"
|