Live-editable tuning, hot-reloaded while the daemon runs #1

Open
lytedev wants to merge 1 commit from live-tuning into main
Owner

Edit $XDG_RUNTIME_DIR/deck-pose-tuning.toml, save, and the daemon applies it within half a second — crop, score floor, tracking thresholds and smoothing. A documented template is written on first run.

Companion to the same feature in deck-slice (its PR #1); the two are built alike so there is one idea to learn.

Not reloadable, deliberately: camera device/resolution/format (needs the capture pipeline reopened), model path and size (needs the session rebuilt), sockets (clients attached). The template says so rather than accepting an edit that does nothing.

Safety: a file that does not parse leaves running values alone and logs why — it is edited over ssh while a game runs in front of people, and half-saved is its ordinary state. Every reload applies to the daemons STARTUP values, so deleting one line restores that one value rather than leaving the previous experiment in place.

Retuning leaves existing tracks alone: ids, appearance signatures and smoothing state survive, so a threshold can be judged against the same people who were standing there a moment ago.

7 new unit tests (133 total pass), plus a live daemon exercise: template written, edit applied without restart, deletion returning to defaults.

Edit `$XDG_RUNTIME_DIR/deck-pose-tuning.toml`, save, and the daemon applies it within half a second — crop, score floor, tracking thresholds and smoothing. A documented template is written on first run. Companion to the same feature in deck-slice (its PR #1); the two are built alike so there is one idea to learn. **Not reloadable, deliberately:** camera device/resolution/format (needs the capture pipeline reopened), model path and size (needs the session rebuilt), sockets (clients attached). The template says so rather than accepting an edit that does nothing. **Safety:** a file that does not parse leaves running values alone and logs why — it is edited over ssh while a game runs in front of people, and half-saved is its ordinary state. Every reload applies to the daemons STARTUP values, so deleting one line restores that one value rather than leaving the previous experiment in place. Retuning leaves existing tracks alone: ids, appearance signatures and smoothing state survive, so a threshold can be judged against the same people who were standing there a moment ago. 7 new unit tests (133 total pass), plus a live daemon exercise: template written, edit applied without restart, deletion returning to defaults.
feat: live-editable tuning, reloaded while the daemon runs
Some checks failed
/ check (push) Failing after 18s
2bf36398f5
Daniel: "This needs to let me tweak the pose daemon settings as well
and tolerances and all that stuff all needs to be able to be managed
from here and hot reloaded."

The numbers that decide whether this daemon SEES somebody — the crop,
the score floor, how hard the smoother pulls, what counts as the same
person between frames — cannot be chosen by reasoning. Each has been
wrong at least once in a way visible only with a person standing in a
real room, and correcting one meant a build, a deploy and a restart.
deck-slice grew the same thing for its own constants; this is the
daemon half, built the same way so there is one idea to learn.

Edit `$XDG_RUNTIME_DIR/deck-pose-tuning.toml`, save, and it applies
within half a second. A documented template is written on first run —
bare numbers are barely better than no file, since `min_cutoff = 1.7`
says nothing about which way to move it or what it costs.

The runtime dir rather than a config dir is deliberate: this file is
SCRATCH. It is for finding a value, after which the value belongs in
the code, and a tuning file surviving a reboot is how a machine ends up
quietly running somebody's half-finished experiment.

# What is deliberately not reloadable

Only what can change between two frames without rebuilding something:
the crop, the score floor, tracking and smoothing. The camera device,
resolution and format need the capture pipeline reopened; the model
path and size need the session rebuilt; the sockets have clients
attached. Silently accepting an edit that does nothing would be worse
than not offering it, so the template says so rather than pretending.

Retuning leaves existing tracks alone — ids, appearance signatures and
smoothing state all survive. Retuning is meant to answer "does this
threshold work better", and it could not if touching a threshold
renumbered everybody in the room.

# The safety property

A file that does not parse leaves the running values ALONE and logs
why. Not tidiness: this file is edited over ssh while a game runs in
front of people, and half-saved is its ordinary state. Every field is
optional and every reload is applied to the daemon's STARTUP values, so
deleting one line restores that one value rather than leaving the
previous experiment in place — otherwise "delete a line to undo" would
be a lie.

# Testing

Seven unit tests: absent file, one value winning without disturbing its
neighbours, five kinds of broken file, clamping (a crop of 0.0 would
show the model nothing, and a mistyped decimal point is a normal thing
to do at a keyboard), deletion restoring startup values, two edits in a
row proving the base is the startup value rather than the last edit,
and the template both documenting itself and parsing back as those
defaults — a template only a human could read would be a quiet
regression.

Also exercised against a live daemon: template written on start, an
edit applied without a restart, deletion returning to defaults.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtnYWFX9eMBH7oK3gmcMMs
Some checks failed
/ check (push) Failing after 18s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin live-tuning:live-tuning
git switch live-tuning

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff live-tuning
git switch live-tuning
git rebase main
git switch main
git merge --ff-only live-tuning
git switch live-tuning
git rebase main
git switch main
git merge --no-ff live-tuning
git switch main
git merge --squash live-tuning
git switch main
git merge --ff-only live-tuning
git switch main
git merge live-tuning
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lytedev/deck-pose!1
No description provided.