# 14.1 — Corrected exact-copy lane-family update

Date: 21 July 2026

Status: implementation, raw development selection, four-input sweep,
temporally separated held-out evaluation, artifacts, tests, and recommendation
complete

Updated plan: [`12.2.1-update.md`](12.2.1-update.md)

## Executive summary

Checkpoint 14.1 reruns the lane-family question without allowing an
experimental method to hide behind independent Stage 7. It produces a clear
positive result: **six literal copies of one detected lane shape improve
held-out one-cell-tolerant F1 from 17.43% to 21.21%**.

- **Literal means literal:** each successful frame contains exactly six curves
  with bit-identical coefficients, the same forward intervals, and the same
  dash gaps. Member `i` is `y_i(t) = f(t) + d_i`; only the constant lateral
  translation changes.
- **No raw fallback:** branch, support, clipping, and physical checks attach
  warnings to raw exact and raw shared masks. They never replace those masks.
- **Explicit failures:** if Stage 7 has no accepted anchor, the raw result is an
  empty prediction. There are three such development frames and one held-out
  frame. They remain in all-frame metrics.
- **Separate guarded policy:** the operational policy may use independent Stage
  7, but it has its own name, panel, and score. It is never used to rank the raw
  methods.
- **Development result:** independent 17.76%, raw exact **23.37%**, raw shared
  18.81%, guarded 17.21% F1.
- **Temporally separated result:** independent 17.43%, raw exact **21.21%**, raw
  shared 17.96%, guarded 17.34% F1.
- **Mechanism:** raw exact approximately doubles recall, from 13.46% to 22.09%,
  while precision falls from 24.73% to 20.40%. Wholesale copying recovers far
  more label cells, but also draws unsupported copies.
- **Input sweep:** Stage 6 is the best development input for raw exact copies at
  23.37%. Stage 5 reaches 20.41%, guided Stage 4 15.11%, and uniform Stage 4
  13.13%. The frozen held-out ordering is consistent at 21.21%, 21.03%, 13.61%,
  and 12.03%.
- **Decision:** exact copying is a real geometry signal and is the winning new
  experimental mode. Keep the default pipeline as Stage 6 into independent
  Stage 7 for now because exact copying loses precision, regresses two
  sequences and the branching subset, and requires imputed lane positions.
  Stage 6 remains the canonical input for both routes.

The earlier Checkpoint-14 exact/shared aggregates are guarded mixtures. They
must not be used to answer whether exact copying itself works. Checkpoint 14.1
is the corrected experiment.

## Delivered artifacts

Temporally separated held-out results:

- [artifact index](../artifacts/14.1_known_lane_geometry_update_heldout/README.md);
- [benchmark JSON](../artifacts/14.1_known_lane_geometry_update_heldout/benchmark.json);
- [benchmark CSV](../artifacts/14.1_known_lane_geometry_update_heldout/benchmark.csv);
- [corrected version of the questioned frame](../artifacts/14.1_known_lane_geometry_update_heldout/images/seq_01_001332521021520_update.png);
- [largest raw-exact gain](../artifacts/14.1_known_lane_geometry_update_heldout/images/seq_02_000925394561640_update.png); and
- [ranked raw-exact samples](../artifacts/14.1_known_lane_geometry_update_heldout/ranked_samples/README.md).

Development results:

- [artifact index](../artifacts/14.1_known_lane_geometry_update/README.md);
- [benchmark JSON](../artifacts/14.1_known_lane_geometry_update/benchmark.json);
- [benchmark CSV](../artifacts/14.1_known_lane_geometry_update/benchmark.csv); and
- [ranked raw-exact samples](../artifacts/14.1_known_lane_geometry_update/ranked_samples/README.md).

Every successful source frame has a PNG and JSON report. The JSON contains the
immutable anchor, six shifts, observed/imputed status, common coefficients and
segments, raw masks, raw warnings, separately guarded output, primary metrics,
and the four-route sweep.

## What changed from Checkpoint 14

Checkpoint 14 implemented a conservative family policy. On warnings, it copied
the independent Stage-7 mask into the result and still included that frame in
the exact/shared aggregate. Exact mode fell back on 22 of 40 held-out frames.
That measured a conditional policy, not exact copying.

Checkpoint 14.1 separates four modes:

| Mode | Output contract |
|---|---|
| `independent_stage7` | Unchanged Stage-6-to-Stage-7 baseline |
| `raw_exact_copies` | Six rigid translations of one immutable anchor, always scored raw |
| `raw_shared_shape` | Six initial slots with supported bounded corrections, always scored raw |
| `guarded_family_policy` | Operational shared-family policy that may explicitly use independent Stage 7 |

Warnings cannot mutate either raw mask. An anchor failure produces an empty raw
mask rather than borrowing another method's output. All-frame and success-only
aggregates are both recorded.

## Exact-copy definition

Given one anchor

```text
y = f(x)
```

the six members are

```text
y_i(x) = f(x) + d_i,  i = 0..5
```

The coefficients, normalization, parameter domain, rendered intervals, and
dash gaps are identical for every member. This is a rigid `(0, d_i)` BEV
translation, not a pointwise normal warp.

Six label-blind positions are always requested. Stable Stage-6 residual peaks
provide observed positions. Missing slots are completed from the observed
spacing pattern with a fixed 3.4 m default when necessary. Labels are loaded
only after every primary and sweep mask is final.

Across the 39 held-out frames with an anchor, exact mode emits 234 members:
exactly six per frame. Of their positions, 136 are observed and 98 are imputed,
or 3.49 observed and 2.51 imputed per successful frame.

## Evaluation protocol

The development sample uses ten evenly spaced records per sequence. One of 40
source PCDs is the known malformed development file, leaving 39 evaluated
frames.

The held-out selector excludes every labeled frame within one second of any
development timestamp before sampling ten per sequence. All 40 held-out frames
pass this rule. The closest held-out/development separation is 1,000,203,550 ns;
there are zero violations.

The raw winner and all configuration choices are selected on development. The
same raw-exact mode, Stage-6 primary input, six-slot policy, and thresholds are
then frozen for held-out evaluation. Labels are used only for metrics and
post-fit subsets.

## Primary all-frame comparison

All four modes below receive the same Stage-6 mask. Empty raw predictions from
anchor failures remain in the aggregate.

### One-cell-tolerant K-Lane metric

| Mode | TP | FP | FN | Precision | Recall | F1 |
|---|---:|---:|---:|---:|---:|---:|
| `independent_stage7` | 3,041 | 9,257 | 19,549 | **24.73%** | 13.46% | 17.43% |
| `raw_exact_copies` | **4,990** | 19,469 | **17,600** | 20.40% | **22.09%** | **21.21%** |
| `raw_shared_shape` | 3,001 | **7,825** | 19,589 | **27.72%** | 13.28% | 17.96% |
| `guarded_family_policy` | 2,994 | 8,945 | 19,596 | 25.08% | 13.25% | 17.34% |

Raw exact adds 1,949 tolerant true positives and removes 1,949 false negatives
relative to independent Stage 7. It also adds 10,212 false positives. The F1
gain is 3.78 percentage points, or about 21.7% relative.

Raw shared is a smaller positive result: it gains precision and reaches 17.96%
F1, but does not reproduce exact mode's recall gain. The guarded policy falls
back on 22/40 frames and scores below the independent baseline. It is reported
only as an operational comparison.

### Strict same-cell metric

| Mode | TP | FP | FN | Precision | Recall | F1 |
|---|---:|---:|---:|---:|---:|---:|
| `independent_stage7` | 2,043 | 12,440 | 20,810 | 14.11% | 8.94% | 10.94% |
| `raw_exact_copies` | **3,003** | 24,581 | **19,850** | 10.89% | **13.14%** | **11.91%** |
| `raw_shared_shape` | 1,982 | **10,858** | 20,871 | **15.44%** | 8.67% | 11.11% |
| `guarded_family_policy` | 1,972 | 12,019 | 20,881 | 14.09% | 8.63% | 10.70% |

Strict evaluation gives the same winner. Literal copies improve exact-cell
recall enough to offset their lower precision.

## Development and held-out consistency

| Mode | Development F1 | Held-out F1 |
|---|---:|---:|
| `independent_stage7` | 17.76% | 17.43% |
| `raw_exact_copies` | **23.37%** | **21.21%** |
| `raw_shared_shape` | 18.81% | 17.96% |
| `guarded_family_policy` | 17.21% | 17.34% |

The ordering is stable. Raw exact is not a held-out-only reversal.

Raw exact has three anchor failures in the 39-frame development aggregate and
one in the 40-frame held-out aggregate. Success-only F1 is 24.08% on 36
development frames and 21.60% on 39 held-out frames. The all-frame result is
the primary result because failure is part of method performance.

## Raw-exact input-route sweep

The development winner, `raw_exact_copies`, is swept over the four
Checkpoint-13 inputs without guarded substitution.

| Input | Development F1 | Held-out F1 | Held-out strict F1 |
|---|---:|---:|---:|
| `stage6_mask` | **23.37%** | **21.21%** | 11.91% |
| `stage5_points` | 20.41% | 21.03% | **12.07%** |
| `stage4_uniform` | 13.13% | 12.03% | 6.13% |
| `stage4_guided` | 15.11% | 13.61% | 6.60% |

Stage 6 wins the frozen development tolerant metric and remains narrowly best
on held-out tolerant F1. Stage 5 has slightly better held-out strict F1, but its
development strict F1 is only 11.16% versus 13.05% for Stage 6. There is no
basis to switch after seeing held-out data.

Therefore Stage 6 remains both the normal pipeline input and the raw-exact
experimental input.

## Distance, shape, branch, and sequence subsets

| Held-out range | Independent | Raw exact | Raw shared |
|---|---:|---:|---:|
| Near half | 17.44% | **21.39%** | 17.22% |
| Far half | 17.43% | **21.07%** | 18.60% |

Literal copying improves both distance halves; the gain is not restricted to
nearby markings.

| Label shape | Frames | Independent | Raw exact | Raw shared |
|---|---:|---:|---:|---:|
| Straight | 31 | 17.57% | **21.71%** | 18.44% |
| Curved | 9 | 16.82% | **19.46%** | 15.90% |

Rigid lateral copies improve both straight and curved label subsets. This does
not imply they preserve true perpendicular lane width on a bend; it establishes
that the literal template hypothesis improves this mask metric.

| Sequence | Independent | Raw exact | Raw shared | Guarded |
|---|---:|---:|---:|---:|
| `seq_01` | **26.74%** | 24.32% | 28.09% | 26.95% |
| `seq_02` | 13.73% | **24.01%** | 12.11% | 12.90% |
| `seq_03` | 19.56% | **27.17%** | 21.34% | 19.41% |
| `seq_04` | **8.34%** | 6.08% | 7.58% | 8.31% |

The aggregate gain is driven by large improvements in sequences 2 and 3.
Sequences 1 and 4 regress, so the six-copy assumption is not uniformly safe.

A label-derived post-fit proxy marks seven held-out branching/rapid-spacing
frames. Raw exact scores 20.26% there versus 23.60% for independent Stage 7;
raw shared scores 21.03%. The label-blind warning detector has 3 TP, 17 FP, 4
FN, and 16 TN against this proxy: 15.0% precision and 42.9% recall. Warnings are
useful diagnostics but are not a reliable branch classifier—and importantly,
they no longer alter the raw masks.

## Lane count, position support, and violations

Held-out labels contain 4.40 classes per frame on average. Raw exact deliberately
emits six members whenever an anchor exists, so its all-frame mean is 5.85 and
lane-count MAE is 1.75. It matches the label-derived count on five frames. This
count mismatch is expected: the experiment tests wholesale six-copy geometry,
not adaptive semantic lane counting.

The 195 held-out adjacent gaps have a 3.20 m median and 0.153 coefficient of
variation. Median evidence support is 14 Stage-6 cells per exact member. Median
BEV clipping is zero, but ten members cross a lateral image boundary and record
a physical/clipping violation. No exact members cross or swap order.

Every held-out raw-exact frame carries at least one warning, commonly because
one or more of the six positions is imputed. Twenty frames also carry a branch
warning. These warnings remain visible in JSON and PNG artifacts without
changing the scored mask.

## Stability and runtime

| Mode | Median stability RMSE | Median route time | Mean | P95 |
|---|---:|---:|---:|---:|
| `independent_stage7` | 0.088 m | **537.2 ms** | **587.0 ms** | **1,173.1 ms** |
| `raw_exact_copies` | **0.074 m** | 548.8 ms | 602.8 ms | 1,197.8 ms |
| `raw_shared_shape` | 0.144 m | 550.2 ms | 604.4 ms | 1,200.2 ms |
| `guarded_family_policy` | 0.116 m | 550.2 ms | 604.4 ms | 1,199.9 ms |

Exact copies inherit the selected strongest anchor's stability, so their lower
median is expected rather than evidence of six independent stable fits. The
additional exact-copy work adds roughly 12 ms to the held-out median route.

## Representative cases

The [questioned frame](../artifacts/14.1_known_lane_geometry_update_heldout/images/seq_01_001332521021520_update.png)
now shows the intended experiment. Panel 3 isolates the selected anchor. Panel
4 shows six visibly identical curves at shifts `-3.09`, `0.00`, `+2.39`,
`+6.02`, `+9.16`, and `+12.52` m. The branch warning remains visible, but raw
exact is not replaced. Its F1 is 14.16%, independent is 29.96%, and the guarded
policy separately uses independent Stage 7.

The [largest per-frame gain](../artifacts/14.1_known_lane_geometry_update_heldout/images/seq_02_000925394561640_update.png)
improves from 15.25% to 48.03% F1. The selected anchor is a strong near-vertical
marking, and its six wholesale copies align with multiple label lanes that
independent Stage 7 only fits in fragments.

Across 40 held-out frames, raw exact improves 23, ties 4, and regresses 13. The
largest regression is the branching-proxy frame
`seq_01/001379316866760`, which falls from 34.93% to 17.27%. This is why raw
exact is a successful geometry experiment but not yet an unconditional default.

## Tests and implementation verification

All **68** repository tests pass, including six checkpoint-14.1 tests that
directly establish the corrected contract:

- six exact members whenever an anchor exists;
- bit-identical coefficients and identical render segments;
- constant `y_i(t) - y_anchor(t)` over the common domain;
- zero exact private corrections;
- raw warnings that do not mutate output;
- a separately named guarded fallback mask and score;
- explicit empty anchor failure;
- safe independent default and explicit mode names;
- independent raw/guarded diagnostics and metrics; and
- fixed target-count validation.

Source and tests pass bytecode compilation. Artifact JSON parses cleanly. The
development set contains 39 PNG/JSON pairs plus the known malformed source
frame; held-out contains 40 PNG/JSON pairs. The held-out temporal exclusion has
zero violations.

Reproduce with:

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

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

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

## Recommendation and stop gate

Checkpoint 14.1 demonstrates that the requested geometry is useful: duplicating
one detected lane shape six times produces a repeatable development and
held-out F1 gain. This conclusion is based only on raw masks.

Keep `stage6_mask` as the evidence route. Keep Stage 6 into independent Stage 7
as the normal default until a deliberate adoption decision addresses exact
mode's precision loss, imputed positions, sequence-1/4 regressions, and branch
behavior. Preserve `raw_exact_copies` as the winning experimental geometry and
use it—not a guarded mixture—as the basis for subsequent improvement.

Checkpoint 14.1 update is complete.
