Skip to content

fix(track): Planar Track honours forward, backward and already tracked; reports held frames (0.61.1) - #23

Merged
nodemode-ai merged 2 commits into
mainfrom
fix/planar-track-direction
Dec 3, 2026
Merged

nodemode-ai merged 2 commits into
mainfrom
fix/planar-track-direction

Conversation

@gbarnai

@gbarnai gbarnai commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Planar Track (track.planar, the planar_track agent tool and the Tracker panel's Planar Track section) now does what its track option says. Patch release 0.61.1.

  • track is read. The engine service passed track and the panel offered Forward and Backward, Forward, Backward and Already tracked, but the engine never read it: every run tracked both ways into a new tracker. Now:
    • forward: from the reference time to the end of the layer (or end).
    • backward: from the start (or start) to the reference time. A backward-only run keeps the reference frame (before, the backward pass always dropped it because the forward pass keyed it).
    • both: both, as before.
    • Left out, null or empty (the panel's Already tracked, and what the tool description already promised): nothing is analysed. The layer's Perspective tracker with keys on all four points (the current tracker when it is one, else the last) is pinned onto target with Corner Pin and Grow Bounds in one undo step, with no new tracker. It needs target, does not read the mask or surface, and when the layer has no such tracker it fails with "this layer has no Perspective tracker with tracked keys to reuse; pass track forward, backward or both to track the mask".
    • Any other value is refused.
  • Held frames are visible. A frame that does not track still holds the last tracked surface with no limit (unchanged, by decision). Those frames are now returned as comp times in the result's held, the Planar Tracker keys confidence 0 on them instead of 100, and the panel's status line says how many frames held. The reuse path reports a frame as held when any of the four points keys confidence 0 there.
  • planar is split into small helpers in native/fvx-core/src/engine/cmd/track.rs; the tracking, corner choice and Corner Pin maths are unchanged.
  • The planar_track tool description says what each direction covers, what leaving track out does and what held means; the harness references are regenerated (./formvfx agents sync).
  • CI's test job now also runs the engine's Rust unit tests (cargo test --locked --no-default-features --lib). Before this, the crate's existing Rust tests never ran in CI.
  • HASHOUT entries under 0.61.1 in all three logs; version sites moved to 0.61.1 in a separate commit, the same fifteen files as the last release.

Tests

New tests, each shown failing on the 0.61.0 code first, then passing:

  • native/fvx-core/src/engine/cmd/track_planar_tests.rs, 8 Rust unit tests. The fixture is a textured PNG in a precomp, moved by a known homography per frame through a keyed Corner Pin, with a mask around a region of it; expected corners come from the same homographies. Covered: surface_track directly, both, forward, backward, a bad track value, reuse of the existing tracker, reuse with nothing tracked, and a frame that fails to track (opacity 0 for one frame). Corner error bound 0.35 px; worst measured 0.131 px.
    • On 0.61.0: cargo test --no-default-features --lib planar_tests, 2 passed, 6 failed (the two accuracy checks that use both directions pass; forward, backward, bad value, reuse, nothing to reuse and held fail).
    • After: 8 passed.
  • backend/tests/test_planar_track.py, 4 tests through /api/rpc with the window key, on the built module as CI loads it: forward only, backward only, reuse without a second tracker, and the error with nothing tracked.
    • On 0.61.0: 4 failed (forward and backward returned all 8 frames, reuse made a second tracker, nothing-to-reuse succeeded).
    • After: 4 passed.

Local run of what .github/workflows/ci.yml runs (macOS arm64, engine built with ./formvfx install-native --dev, 701 commands, 306 effects, Python 3.14 venv from backend/oc_install):

  • cargo test --locked --no-default-features --lib in native/fvx-core: 12 passed (8 new, 4 existing).
  • python -m compileall -q app formvfx_engine.py and python formvfx_engine.py --selfcheck: ok, core 0.61.1.
  • ./formvfx agents sync --check: in step.
  • Engine boot with the HTTP and MCP probes from the engine job (on port 18250): comp.new over /api/rpc ok, mcp ok: 33 tools.
  • venv/bin/python -m pytest tests -q in backend: 296 passed, 4 skipped (the 4 new tests included).
  • venv/bin/python ../setup/notices.py --check: third-party notices cover everything that ships.
  • npm ci, npm audit --audit-level=low (0 vulnerabilities), npm run build: ok.
  • python -m pytest frontend/tests/window -q -p no:cacheprovider: 3 passed.
  • Shell syntax of the setup scripts, python3 setup/lint_text.py . (0 findings), py_compile setup/*.py, python3 setup/text_presets.py --check (in step).
  • cargo check --locked in src-tauri with the placeholder sidecar: ok.

Tests ran with a scratch HOME inside the clone and the keyring fail backend.

For the owner

  • Leaving track out now reuses instead of tracking both ways. This matches the tool description and the panel's Already tracked option, but an outside caller that omitted track and expected a fresh track now gets the reuse, or the error when the layer has no Perspective tracker. The harness skill already tells agents to pass track: "both". If you would rather keep both as the default, the alternative is an explicit value (for example tracked) sent by the panel.
  • Confidence 0 on held frames. The Planar Tracker used to key confidence 100 on every frame, held or not. It now keys 0 on held frames so the reuse path and anyone reading the tracker can see them. The Corner Pin keys and the held homography itself are unchanged.
  • Rust unit tests in CI. The new step adds a test build of the engine crate (without the Python feature) to the test job. It shares the rust-cache with the dev build.
  • The repo's CLAUDE.md says to write only tests the family test plan names; these tests were asked for explicitly.

Left for the owner (not changed here)

  • No limit or confidence on held frames. Frames that fail still hold the last homography indefinitely, and there is no per-frame match quality beyond held or tracked. A hold limit, or a confidence from the RANSAC inlier ratio, is a behaviour decision.
  • Reuse from a tracked mask. Already tracked reuses a Perspective tracker only. A mask tracked with Track Mask (perspective) is not read as a planar surface.
  • No tracker choice for reuse. Reuse takes the current Perspective tracker or the last one; track.planar does not accept a tracker argument (it is not in the RPC's argument list or the tool schema).
  • start after the reference. When start is later than the reference time, the forward pass starts tracking at start while the surface corners are read at the reference time.
  • Harness text says the mask is set to mode None. .claude/skills/formvfx-harness/sub-skills/tracking-and-stabilizing/SUB-SKILL.md (and its .agents mirror) says planar_track "sets the mask to mode None so the footage stays whole"; the engine does not change the mask mode, before or after this change.
  • track.rs is about 1300 lines; moving planar tracking into its own module would be a separate refactor.

How to ship

  1. Review and merge this PR into main (CI must be green on the merge commit).
  2. Release 0.61.1 through formcompiler from main as usual (compile_v branch or tag made by the release process, not by this PR).
  3. After release, check the Tracker panel: Forward and Backward each key only their side of the current time, and Already tracked pins the chosen layer from the existing Planar Tracker.

…d, and reports held frames

track.planar read no `track` value and always tracked both ways into a new tracker. Forward now tracks from the reference time to the end, backward from the start to the reference time, both does both, and another value is refused. With `track` left out (the Tracker panel's Already tracked, and what the agent tool described), the layer's Perspective tracker is pinned onto the target without tracking again, or a clear error says there is none.

Frames that do not track still hold the last tracked surface (unchanged); they are now listed in the result's `held`, keyed with confidence 0 on the Planar Tracker, and counted in the Tracker panel's status line.

Tests: eight Rust unit tests on a textured plane moved by a known homography per frame (surface_track, each direction, a bad value, reuse, nothing to reuse, a held frame) and four backend tests through /api/rpc. CI runs the engine's Rust unit tests.
Version sites, the same fifteen files as the last release: README.md (badge and the Version line), backend/app/__init__.py, frontend/package.json, frontend/package-lock.json (both fields), frontend/src/version.ts, native/fvx-core/Cargo.toml, Cargo.lock (the fvx-core entry) and pyproject.toml, src-tauri/Cargo.toml, Cargo.lock (the formvfx entry) and tauri.conf.json, docs/EXTENSIONS.md, and the version string in the three built demo scripts. No demo source changed since 0.61.0, so the demos were not rebuilt.

A patch release: the Planar Track fix logged under 0.61.1 in the three HASHOUT logs.
@gbarnai
gbarnai requested a review from nodemode-ai as a code owner December 3, 2026 20:48
@nodemode-ai
nodemode-ai merged commit 59ec923 into main Dec 3, 2026
6 checks passed
@nodemode-ai
nodemode-ai deleted the fix/planar-track-direction branch December 3, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants