# Bounded multiscale LK research diagnostic v1

**Partial improvement; does not achieve five classes × 50. Not published, not independently validated, not GT.**

## Results

| Class | Active | All algorithm-admissible new targets | Selected toward 50 | Hypothetical cumulative | Remaining |
|---|---:|---:|---:|---:|---:|
| 1 | 48 | 8 | 2 | 50 | 0 |
| 2 | 5 | 0 | 0 | 5 | 45 |
| 9 | 38 | 2 | 2 | 40 | 10 |
| 10 | 10 | 1 | 1 | 11 | 39 |
| 15 | 39 | 7 | 7 | 46 | 4 |

Scanned all 4,214 eligible targets with **149 direct-human templates**: 97 saved gallery edits and 52 original pose human polygons. Latest read-only snapshots match the completed feasibility scan; no saved gallery revisions changed since refined_v3. All 140 active targets and quarantine/history protections were excluded. Newly generated polygons never become templates.

16,684 pair audit records include below-initial-NCC records (unlike the prior scan's 12,415 above-gate registration attempts). A target stops at its first admissible template, ranked by initial image NCC. All above-gate compatible templates are exhausted when a target fails.

## Algorithm and gates

New algorithm version: `bounded_lk_cross_window_consensus_research_v1`.

Unchanged whole-patch affine ECC and original metrics/gates: initial NCC ≥ .55; ECC ≥ .84; source-boundary-band NCC ≥ .78; **every** forward/backward status; maximum FB ≤ 1.5 in the original 256×112 canonical patch coordinates; native refinement ≤ max(3, target bbox height × .16); area ratio strictly (.72, 1.35); same vertex count/order; existing beam guard must pass. Original affine deformation constraints are also retained.

Fixed LK bank: windows 15/25/31, requested maximum levels 0/1/2/3. Original 19/3 is recorded as a diagnostic baseline, not a selectable result. Fixed priority is level first, then window. Selection requires an independently admissible configuration with a **different window**, agreeing within 1.5 original patch pixels at **every** vertex. No polygon averaging, per-vertex mixing, or lowest-FB selection.

Additional conservative support checks at every actual tracked vertex: 15×15 affine-oriented local image NCC ≥ .55, directional gradient NCC ≥ .25, both window standard deviations ≥ 3, and full windows inside the patch. These are explicitly new research checks, not relabeled original thresholds.

## Why the deficits remain

The prior exhaustive 149-template attempt audit establishes only **20 remaining Class 2 targets** and **21 Class 10 targets** pass this fixed ECC alignment's original image gates. Optimistic totals are therefore at most **25** and **31**, before tracking or other checks. See `fixed_ecc_photometric_ceiling.json`. This is specific to the fixed ECC alignment and current human-template inventory, **not** a proof against different registration algorithms or future human edits.

Class 2: all 59 photometrically admissible pairs fail tracking for every one of the 12 alternative configurations (and original baseline). For target `245c7efb16913ea13fbc18ff` / original pose template `d361bf582d8b5141e3158106`, ECC=.92316 and boundary NCC=.83886. Baseline maximum FB is 98.77 patch pixels; window15/level0 reduces it to 2.80 but still has a failed vertex status, while window31/level0 has all statuses but FB=4.47. Neither is accepted.

## Visual inspection (researcher, not independent validation)

Inspected all 18 actual source/target native-image crop pairs via `accepted_contact_1.png` through `accepted_contact_3.png`, plus representative rejected Class 2/10 pairs in `failure_cases/` and `class2_source_affine_inspection.png`.

- Accepted Class 1 pairs show the beam and end-post envelope remaining aligned; Class 9/15 preserve the 16-vertex notched structure. Several leg-bottom boundaries remain visually diffuse, inherited from the human-template semantics, so image similarity is not confirmation of precise mask accuracy.
- The single accepted Class 10 target (`a563476c61926f13035f3e2a`) retains a beam envelope despite missing returns/black regions in the beam itself; independent review remains necessary.
- The rejected Class 2 pair shows a plausible coarse affine envelope but catastrophic baseline corner drift. Some human leg-bottom vertices lie in low-texture material rather than unique image corners. Smaller windows/pyramids improve some drifts, but the full-polygon status/FB requirement still fails. No affine-only fallback was accepted.
- Failure figures represent rejected **template-target pairs**; the same target can be accepted from a different human template.

## Files and reproducibility

- `accepted_candidates.jsonl`: all 18 exact polygons, source rows, human-event provenance, selected metrics, support configs, and pending-research status.
- `selected_candidates.jsonl`: 12 quota-selected polygons, globally distinct frames, capped at 50 per class.
- `registration_attempts.jsonl`: all pair attempts; every tested configuration has exact forward/backward coordinates, statuses, polygon, FB/refinement/area metrics and rejection; local/beam evidence when reached.
- `settings.json`, `manifest.json`, `template_inventory.json`, `refined_annotations.jsonl`: algorithm/settings hashes, snapshots, direct-human templates, eligibility and provenance.
- `configuration_analysis.json`, `failure_visual_cases.json`: configuration outcomes and representative rejected pairs.
- `cases/`, `report.html`, `accepted_contact_*.png`: actual source/target comparison crops.
- `self_replay_check.json`: **all 18 polygons and metrics replay exactly**. Original ECC, initial NCC, boundary NCC, affine matrix, and baseline FB arrays match the unchanged original transfer exactly. Every original 19/3 transfer rejects these 18 pairs for vertex tracking.
- `protected_formal_before.json` equals `protected_formal_after.json`; historical event-preservation checks pass; no live database/config/service or frozen-code edits.

Commands from repository root:

```bash
.venv/bin/python -m pallet.mask_transfer_multiscale --workers 8
.venv/bin/python -m outputs.pallet_mask_multiscale_diagnostic_v1.analyze_diagnostic
.venv/bin/python -m outputs.pallet_mask_multiscale_diagnostic_v1.verify_replay
.venv/bin/python -m pytest -q tests/test_mask_transfer_multiscale.py tests/test_mask_template_transfer.py tests/test_mask_boundary_review.py
```

The generator intentionally refuses to overwrite this output directory. **12 tests passed.** The self-replay is a researcher's check, not independent validation or human approval. Frozen dependency hashes and the new algorithm hash are recorded separately.
