Skip to content

feat(engine): R5-B integrate TargetAssociator into target lock (flag-gated, default off)#96

Merged
TCVinNYC merged 1 commit into
mainfrom
feat/r5b-associator-integration
Jun 24, 2026
Merged

feat(engine): R5-B integrate TargetAssociator into target lock (flag-gated, default off)#96
TCVinNYC merged 1 commit into
mainfrom
feat/r5b-associator-integration

Conversation

@TCVinNYC

Copy link
Copy Markdown
Member

Second half of R5: wires the pure TargetAssociator (#95) into _apply_target_lock, behind a new TrackingConfig.use_target_associator flag (default OFF). Flag OFF ⇒ the existing heuristic path runs byte-identical (verified: the flag-off test monkeypatches decide to raise and confirms it is never called; full suite green). Flag ON ⇒ the fused associator drives keep/switch/ambiguous.

  • Cues are built conservatively from real signals: motion = IOU(current target trusted bbox, candidate); identity = _track_identity matched to the bound target identity. pose/appearance are marked unavailable (not computed per-candidate from this path) — the associator excludes missing cues, so it degrades gracefully rather than using wrong values.
  • switch → the existing _commit_target_track (so pose/reid/identity recovery state resets exactly as a ReID switch); ambiguous → existing _mark_target_ambiguous. No raw target-id writes; lock ordering preserved (RLock re-entry).
  • 14 integration tests: flag-off never consults the associator; flag-on keep / look-alike→ambiguous (real associator, no ID-switch) / identity-lead→switch (with lock-state asserts); cue-availability.

The flag lets you validate + tune the weights/margins on real cameras before it becomes default (a follow-up flips the default + removes the old heuristics). Full suite green.

🤖 Generated with Claude Code

…y_target_lock

Add `use_target_associator: bool = False` to TrackingConfig and wire the pure
TargetAssociator (R5-A) into CameraWorker._apply_target_lock behind that flag.
Flag OFF (default) is byte-identical to today — existing heuristic path is
completely unchanged and all 1006 existing tests pass.  Flag ON routes through
_build_candidate_cues (motion via IOU to trusted_bbox; identity when the track
carries the camera's target_identity_id; pose + appearance always unavailable
from this path — conservative) → _associator.decide → _apply_associator_decision
(keep/switch via _commit_target_track; ambiguous via _mark_target_ambiguous).
Add 14 tests in tests/test_associator_integration.py covering flag-off isolation,
flag-on keep/ambiguous/switch, cue availability rules, and config field defaults.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TCVinNYC TCVinNYC merged commit 7f8969c into main Jun 24, 2026
3 checks passed
@TCVinNYC TCVinNYC mentioned this pull request Jun 24, 2026
TCVinNYC added a commit that referenced this pull request Jun 24, 2026
Second **pre-release** of the 2.2.0 reliability + performance roadmap,
for real-hardware validation before the stable 2.2.0. Bumps
`__version__` to `2.2.0-rc2`; on merge, tag `v2.2.0-rc2` triggers the
pre-release installer build.

**New since rc1 (all merged, CI-green + multi-agent-reviewed):**
- #92 CPU subservice governor — fewer CPU spikes (phase-stagger) +
cadence throttle under load
- #93 preview-rate-cap (~20fps)
- #90 live GPU-acceleration verdict in the Services panel
- #91 OpenVINO auto-install for Intel
- #94 scene-adaptive ReID threshold
- #95/#96 opt-in fused TargetAssociator (off by default)
- #97 batched detect_batch primitive

**Validate especially:** CPU usage/spikes with all subservices running
(your priority), and \`python -m autoptz --bench\` / the Services-panel
verdict on Intel-Mac+AMD. To try the new tracking logic, set
\`tracking.use_target_associator = true\`.

Follow-ups after your validation: P4 coalescing scheduler, wire the
associator ReID/pose cues + flip its default, int8 CPU quant, stable
Win/Linux device binding.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant