# 14 — Known lane-family geometry evidence

Date: 21 July 2026

Status: historical guarded-policy result; superseded for the raw exact-copy
hypothesis by
[`14.1-KNOWN_LANE_GEOMETRY-CORRECTED_REPORT.md`](14.1-KNOWN_LANE_GEOMETRY-CORRECTED_REPORT.md)

> **Correction:** the exact/shared aggregates in this report include independent
> Stage-7 fallback masks and therefore do not measure raw exact copying. Use the
> Checkpoint-14.1 report for the clean six-copy experiment. This report remains
> as provenance for the earlier guarded implementation.

Plan: [`12.2-EXPLOIT_KNOWN_LANE_GEOMETRY_PLAN.md`](12.2-EXPLOIT_KNOWN_LANE_GEOMETRY_PLAN.md)

## Executive summary

Checkpoint 14 asked whether one trustworthy lane can help recover and stabilize
the other markings on the same road. The answer is **sometimes, but not
reliably enough to replace the independent Stage-6 route**.

- **What I built:** three explicit geometry modes preserve the independent
  Checkpoint-11 result, translate one anchor along its true rotating normal, or
  jointly fit a common road shape with bounded lane-specific normal-offset
  corrections.
- **Default behavior:** the public API defaults to `independent`, and its input
  is the Stage-6 cleaned mask. The experimental family modes must be requested
  explicitly.
- **Lane discovery:** every offset peak needs its own evidence in at least five
  forward bands over at least 4 m. Members never inherit the anchor's visible
  length and no lane is invented from a spacing template alone.
- **Reviewed safeguards:** shared fitting stays in normal coordinates during
  assignment, refinement, and rendering. Corrected members are checked over
  overlap for order, crossing, foldback, lateral bounds, slope, curvature, and
  curvature rate. Violation counts survive fallback.
- **Temporally separated held-out result:** independent fitting reaches
  **17.43%** one-cell-tolerant F1, exact copies 17.31%, and shared shape 17.16%.
  The two family modes add recall but lose more precision.
- **Best new geometry:** exact copies is stronger than shared shape on the
  frozen development aggregate (16.90% versus 16.62%), so the requested
  Checkpoint-13 input sweep uses `exact_copies` only.
- **Requested sweep:** on the temporally separated sample, exact copies on
  Stage-5 point cells reaches **18.42%**, Stage 6 reaches 17.31%, guided Stage 4
  11.31%, and uniform Stage 4 10.12%. The Stage-5 reversal did not appear on
  development, so it is reported as held-out evidence rather than adopted
  after the fact.
- **Branch limitation:** a label-derived post-fit proxy identifies seven
  held-out branching/rapid-spacing-change frames. Exact copies improves their
  F1 from 23.60% to 25.33%. The label-blind warning detector is weak, however:
  3 true positives, 18 false positives, and 4 false negatives. It cannot be
  described as a reliable branch classifier.
- **Decision:** keep the Stage-6 mask feeding independent Stage 7 as the
  production/research default. Preserve exact and shared modes as explicit
  diagnostics. Do not select a replacement from the held-out-only Stage-5
  reversal.

This is a completed negative replacement result. The implementation, tests,
plots, development freeze, temporally separated evaluation, requested sweep,
review fixes, artifacts, and recommendation are delivered.

## Delivered artifacts

Frozen, temporally separated held-out results:

- [artifact index](../artifacts/14_known_lane_geometry_heldout/README.md);
- [benchmark CSV](../artifacts/14_known_lane_geometry_heldout/benchmark.csv);
- [aggregate JSON](../artifacts/14_known_lane_geometry_heldout/benchmark.json);
- [largest exact-copy gain](../artifacts/14_known_lane_geometry_heldout/images/seq_01_001321422158390_family.png);
  and
- [largest exact-copy regression](../artifacts/14_known_lane_geometry_heldout/images/seq_04_001608541603360_family.png).

Development results:

- [artifact index](../artifacts/14_known_lane_geometry/README.md);
- [benchmark CSV](../artifacts/14_known_lane_geometry/benchmark.csv); and
- [aggregate JSON](../artifacts/14_known_lane_geometry/benchmark.json).

Every successful frame has a six-panel PNG and JSON report with independent
fits, anchor choice, true-normal members, per-member extent/residual/stability,
spacing, corrections, warning and violation diagnostics, primary metrics, and
the four-route sweep.

## How to read a panel

1. **Stage-6 evidence:** gray is the common cleaned input.
2. **Independent Stage 7:** green is the unchanged adaptive fit.
3. **Exact normal copies:** yellow is the anchor translated along its local
   normal at each evidence-backed offset.
4. **Shared shape:** blue is the common curve plus penalized, varying normal
   offset for each member.
5. **Shared support:** each bright color is one supported member; unused
   Stage-6 evidence is gray.
6. **Shared strict error map:** white is exact TP, blue FP, and magenta FN.

Panels 1–4 show truth in magenta and overlap in white. Forward is up and
positive lateral `y` is left. Every primary and sweep fit completes before the
label is loaded.

The [held-out ranked-sample index](../artifacts/14_known_lane_geometry_heldout/ranked_samples/README.md)
collects three best, three median-like, and three worst frames for the winning
primary control. Development has the same structure.

## Evaluation split and review correction

The earlier checkpoint helper excluded exact development records but selected
many neighboring scans. Terra-high review found that 37 of 40 old held-out
frames were only about 0.1–0.2 seconds from a development frame. Checkpoint 14
now has its own selector that excludes every labeled frame within
`1,000,000,000 ns` (one second) of any development timestamp, then samples the
remaining records evenly.

All 40 final held-out frames satisfy that window; the minimum separation per
sequence is 1.000–1.099 seconds. This makes the final baseline different from
Checkpoint 13's neighboring-frame sample, so their held-out percentages should
not be compared as if they used the same records.

## Frozen primary comparison

All modes below receive the same Stage-6 mask and start from the same
independent accepted chains.

### K-Lane one-cell-tolerant result

| Geometry mode | TP | FP | FN | Precision | Recall | F1 |
|---|---:|---:|---:|---:|---:|---:|
| `independent` | 3,041 | 9,257 | 19,549 | **24.73%** | 13.46% | **17.43%** |
| `exact_copies` | 3,145 | 10,610 | 19,445 | 22.86% | **13.92%** | 17.31% |
| `shared_shape` | 3,076 | 10,190 | 19,514 | 23.19% | 13.62% | 17.16% |

Exact copying adds 104 tolerant true positives but also 1,353 false positives.
Shared shape removes 420 exact-copy false positives, but also loses 69 of its
true positives. Independent fitting remains the best F1 balance.

### Strict same-cell result

| Geometry mode | TP | FP | FN | Precision | Recall | F1 |
|---|---:|---:|---:|---:|---:|---:|
| `independent` | 2,043 | 12,440 | 20,810 | **14.11%** | 8.94% | **10.94%** |
| `exact_copies` | 2,090 | 13,832 | 20,763 | 13.13% | **9.15%** | 10.78% |
| `shared_shape` | 2,062 | 13,377 | 20,791 | 13.36% | 9.02% | 10.77% |

Strict and tolerant metrics now give the same recommendation.

## Development-versus-held-out

| Geometry mode | Development F1 | Held-out F1 |
|---|---:|---:|
| `independent` | **17.76%** | **17.43%** |
| `exact_copies` | 16.90% | 17.31% |
| `shared_shape` | 16.62% | 17.16% |

The ordering is stable. Exact copies, not shared shape, is therefore the best
new geometry chosen before the final sweep and held-out interpretation.

## Requested best-new-mode input sweep

| Input to `exact_copies` | TP | FP | FN | Precision | Recall | F1 |
|---|---:|---:|---:|---:|---:|---:|
| `stage6_mask` | 3,145 | 10,610 | 19,445 | 22.86% | 13.92% | 17.31% |
| `stage5_points` | 3,306 | 10,003 | 19,284 | **24.84%** | **14.63%** | **18.42%** |
| `stage4_uniform` | 2,697 | 28,032 | 19,893 | 8.78% | 11.94% | 10.12% |
| `stage4_guided` | 2,854 | 25,017 | 19,736 | 10.24% | 12.63% | 11.31% |

The strict sweep F1 values are 10.78%, **12.01%**, 4.82%, and 5.48% in the same
order. On development, however, Stage 6 exact copies scored 16.90% and Stage 5
only 15.31%. Selecting Stage 5 from the final held-out reversal would turn the
held-out set into another development set. It is preserved as an explicit
future hypothesis; it does not change the default.

## Near/far, shape, and sequence subsets

| Held-out range | Independent | Exact copies | Shared shape |
|---|---:|---:|---:|
| Near half | 17.44% | **18.25%** | 17.77% |
| Far half | **17.43%** | 16.49% | 16.62% |

Exact geometry helps nearby evidence but regresses at distance.

| Label shape | Frames | Independent | Exact copies | Shared shape |
|---|---:|---:|---:|---:|
| Straight | 31 | **17.57%** | 17.23% | 17.05% |
| Curved | 9 | 16.82% | **17.61%** | 17.59% |

True normal translation produces a real curved-subset gain, but the nine-frame
subset does not overturn the aggregate.

| Sequence | Independent | Exact copies | Shared shape |
|---|---:|---:|---:|
| `seq_01` | 26.74% | 26.98% | **27.02%** |
| `seq_02` | **13.73%** | 13.27% | 12.28% |
| `seq_03` | 19.56% | 19.53% | **20.11%** |
| `seq_04` | 8.34% | **8.65%** | 8.02% |

The family assumption is condition-dependent rather than uniformly useful.

## Lane count, spacing, violations, and fallback

The held-out labels contain 4.40 classes per frame on average.

| Mode | Mean inferred | Exact-count frames | Count MAE | Fallbacks | Warnings |
|---|---:|---:|---:|---:|---:|
| Independent | 4.08 | 10 / 40 | 1.48 | 0 | 0 |
| Exact copies | 4.50 | **11 / 40** | 1.45 | 22 | 21 |
| Shared shape | 4.33 | 9 / 40 | **1.43** | 24 | 21 |

Exact accepted members have a median 14.76 m span, nine forward bins, and
0.143 m normal residual. Shared members have a median 16.00 m span, nine bins,
and 0.119 m normal residual. Accepted exact families contain 67 adjacent gaps
with a 2.50 m median and 0.79 coefficient of variation. The high variation
shows why spacing alone is not semantic lane evidence.

No exact-copy held-out family reaches the output with a crossing or physical
violation. Shared fitting detects one order and one physical violation across
two frames; both counts and specific reasons remain in the reports after those
frames fall back. Development similarly records three exact and two shared
physical violations instead of erasing them.

## Branching and model-failure evaluation

A post-fit label proxy marks a frame when adjacent label-lane spacing changes
by more than 1 m across at least five common rows. It is not used by fitting.

| Label-derived subset | Frames | Independent | Exact copies | Shared shape |
|---|---:|---:|---:|---:|
| Branching / rapid spacing change | 7 | 23.60% | **25.33%** | 24.86% |

The label-blind detector warns on 21 frames. Against the proxy it has 3 TP,
18 FP, 4 FN, and 15 TN: 14.29% precision and 42.86% recall. The warning is a
conservative model-failure trigger, not a validated branch classifier. On its
21 warning frames both family outputs are intentionally identical to
independent fitting.

Only one held-out frame meets the fixed sparse-evidence definition, and all
three modes score 0% on it; no conclusion is drawn from that singleton.

## Stability and runtime

Stability is the median alternating-forward-band fit disagreement. Lower is
better.

| Mode | Median stability RMSE | Median route time | Mean | P95 |
|---|---:|---:|---:|---:|
| Independent | 0.088 m | **562.9 ms** | **597.4 ms** | **1,154.9 ms** |
| Exact copies | **0.085 m** | 579.8 ms | 614.3 ms | 1,176.6 ms |
| Shared shape | 0.105 m | 579.5 ms | 616.0 ms | 1,176.6 ms |

Exact copies slightly stabilize accepted shapes; shared corrections are less
stable despite their lower in-family residual. Accuracy, not runtime, remains
the adoption blocker.

Sweep median times are 579.2 ms for Stage 6, 568.7 ms for Stage 5, 1,853.4 ms
for uniform Stage 4, and 1,641.7 ms for guided Stage 4. Stage-4 aggregation is
included.

## Implementation details

### Anchor and true normal coordinates

Accepted chains are ranked by forward bands, span, support, residual, and
alternating-band stability. Each evidence cell is projected to the closest
anchor point with a bounded Newton solve. Offset is the signed metric distance
along the local normal.

Exact mode renders the parametric normal translation directly. Shared mode
never switches to vertical `y` offsets: it assigns on normal residual, fits
constant plus bounded longitudinal normal-offset correction, subtracts that
normal displacement to update the common curve, and renders the corrected
parametric normal member.

### Joint objective and evidence extent

Shared fitting alternates for at most five iterations. Ridge penalties keep
each offset near its discovered peak and keep lane-specific correction small.
An adjacent-gap gradient from the soft spacing cost enters each joint offset
update; strong support can still override it. Each member retains its own
support parameters and gap-separated render segments.

### Ordering, physics, and fallback

Members are ordered by normal offset at the vehicle. Their varying offsets are
evaluated over complete overlap; crossing, order swaps, and minimum separation
violations are counted. Every corrected parametric curve is independently
checked for foldback, lateral bounds, slope, curvature, and curvature rate.

Branch drift compares only the overlapping longitudinal support of an accepted
chain and the anchor. Persistent normal-offset or adjacent-spacing drift marks
the single-family model invalid. Any warning or geometry violation returns the
unchanged independent mask while retaining the diagnostic counts and reasons.

## Representative cases

The [largest held-out exact gain](../artifacts/14_known_lane_geometry_heldout/images/seq_01_001321422158390_family.png)
improves from 11.83% to 20.52% F1 on a curved, label-proxy branching frame.
Exact mode finds six supported peaks around five label classes. The mask gain
is real, but the count mismatch remains a warning against interpreting every
parallel peak as a lane.

The [largest regression](../artifacts/14_known_lane_geometry_heldout/images/seq_04_001608541603360_family.png)
falls from 12.08% to 0%. Independent fitting and both families infer five
traces around a three-class label, but forcing them to one anchor shape moves
all family output away from the labeled markings. This is a semantic anchor
failure, not a numerical crossing.

Across held-out frames, exact copies improve nine, tie on 25 explicit or
incidental equal outputs, and regress six. The six losses outweigh the nine
gains.

## Tests and verification

All **62** repository tests pass. The 13 Checkpoint-14 tests cover:

- explicit modes, independent bit-exactness, and the safe independent default;
- true-normal projection/translation round-trip on a curve;
- shared normal spacing on a steep synthetic lane, preventing the reviewed
  vertical-offset bias;
- weak-lane recovery without borrowed anchor extent;
- corrected-member crossing and physical-bound detection over overlap;
- branch drift on overlap only, including the reviewed unequal-extent curve;
- a true diverging-chain warning and fallback;
- the joint spacing objective step;
- preserved order/physical diagnostics after fallback;
- label-derived lane count, branching proxy, and ranked samples as post-fit
  diagnostics;
- one-second temporal held-out exclusion; and
- resume provenance plus invalid/no-support handling.

Source and tests pass bytecode compilation. Artifact integrity checks cover 39
successful development frames plus the known malformed source PCD, and 40
successful temporally separated held-out frames. Every primary independent
result remains the unchanged Stage-6-to-Stage-7 baseline.

Reproduce with:

```bash
uv run klane-stage7-family /mnt/arnavs_hdd/data/02-lane-detection/K-Lane \
  --sequence 1,2,3,4 --sample-count 10 --sweep-mode exact_copies \
  --output-dir artifacts/14_known_lane_geometry

uv run klane-stage7-family /mnt/arnavs_hdd/data/02-lane-detection/K-Lane \
  --sequence 1,2,3,4 --sample-count 10 --selection heldout \
  --sweep-mode exact_copies \
  --output-dir artifacts/14_known_lane_geometry_heldout

uv run python -m unittest discover -s tests -v
```

## Recommendation and stop gate

Keep `stage6_mask` feeding independent Stage 7 as the default. Preserve
`exact_copies` and `shared_shape` behind explicit flags. Exact copies has a
useful curved/nearby signal, and the Stage-5 sweep reversal is worth a future
pre-registered experiment, but neither is stable enough for adoption here.

Future work should add new semantic or temporal evidence, or an explicit
multi-branch model, rather than selecting another threshold from these held-out
results.

Checkpoint 14 is complete after the single requested Terra-high review and
remediation pass.
