Fold one frame per press, not eight -- and put snapshots where the user can find them

Four matches, each followed by a template save, then five consecutive failures.
Jorijn asked whether it was user error. It was not.

Over one evening the harvest folded 185 frames into a template whose
max_sub_template_num is 96, and the template went from matching ten presses out
of ten to failing five in a row. The frames one press contributes are
near-duplicates of a single image, so folding eight of them per press does not
add coverage: it spends the template's slots on one finger position and evicts
the diversity the enrolment put there. Stock's roughly forty-six updates in a
session are spread across many separate presses, which is where diversity
actually comes from.

So one fold per matched press, which also needs no extra capture at all because
the matching frame is already inside the trustlet. Eight remains available for a
deliberate experiment.

The snapshot directory was resolved from $HOME while the script is run under
sudo, so every snapshot landed in /root/fp6-backups and looked, from the user's
shell, like it had never been taken. That is the one thing that would have made
this unrecoverable, and it was caught only because the restore was needed. It
now resolves the invoking user's home.
This commit is contained in:
Jorijn van der Graaf 2026-09-05 01:36:10 +02:00
commit 756093e847
2 changed files with 22 additions and 8 deletions

View file

@ -90,7 +90,11 @@ restart() { # $1 = extra args
printf ' TIMED OUT\n'; return 1
}
SNAPDIR=$HOME/fp6-backups/snapshots
# NOT $HOME: this script is run under sudo, where HOME is root's, so snapshots
# silently landed in /root/fp6-backups and `ls ~/fp6-backups/snapshots` said
# they did not exist. Resolve the INVOKING user's home instead.
SNAPHOME=$(getent passwd "${SUDO_USER:-$(id -un)}" | cut -d: -f6)
SNAPDIR=${SNAPHOME:-$HOME}/fp6-backups/snapshots
case "${1:-}" in
snapshot)
@ -144,7 +148,7 @@ wipe)
# taken first because a template is not reproducible without a finger.
echo "=== wipe: every stored template ==="
echo "before:"; sizes
D=$HOME/fp6-backups/$(date +%Y-%m-%d-%H%M)-pre-wipe
D=${SNAPHOME:-$HOME}/fp6-backups/$(date +%Y-%m-%d-%H%M)-pre-wipe
mkdir -p "$D"
sudo tar -cf "$D/persist-data.tar" -C /mnt/persist data
sudo cp "$MAP" "$D/" 2>/dev/null || true