# Forced alignment probe — 2026-09-10

Evidence for `182.C.08.07`. The aligner in `tools/human-video/forced-align.py`,
run against the fixture already committed for
[`../2026-09-10-cpu-sync-and-alignment/`](../2026-09-10-cpu-sync-and-alignment/),
whose per-word ground truth was measured from a synthesised clip.

## It reproduces the earlier measurement exactly

```sh
python3 tools/human-video/forced-align.py \
  --audio .../known-onset-clip-16k.wav \
  --text "engine ships tuesday costs forty dollars" --phonemes
```

| Word    | Onset | Truth | Error | End error | Confidence |
| ------- | ----- | ----- | ----- | --------- | ---------- |
| engine  | 0.681 | 0.600 | +81.2 | −96.1     | 0.998      |
| ships   | 1.763 | 1.698 | +65.2 | −104.6    | 0.975      |
| tuesday | 2.745 | 2.728 | +16.6 | −83.7     | 0.933      |
| costs   | 3.887 | 3.869 | +17.5 | −99.4     | 0.975      |
| forty   | 5.029 | 4.967 | +61.9 | −126.6    | 1.000      |
| dollars | 6.110 | 6.076 | +34.6 | −121.2    | 0.990      |

Max onset error **81.2 ms**, matching `align-accuracy.json` from the earlier
session to the tenth of a millisecond. That match is the point: the tool
committed here is the measurement, not a description of one somebody else ran.

## A bug the fixture caught

The first version reported onsets ~700 ms early for every word after the first.
The cause was the word SEPARATOR: the transcript is fed to the character CTC
model as `|WORD|WORD…`, and the separator token is emitted across the whole
silent gap before a word. Counting it as part of the word that follows makes the
word appear to start where the previous one ended.

| Version                              | Onset error (ms), words 2–6  |
| ------------------------------------ | ---------------------------- |
| separator counted with the next word | −676, −705, −664, −699, −707 |
| separator owned by no word (fixed)   | **+65, +17, +17, +62, +35**  |

Nothing about the output looked wrong — the numbers were plausible, ordered, and
inside the clip. Only the ground truth showed it.

## Phonemes

`--phonemes` adds a second pass with `facebook/wav2vec2-lv-60-espeak-cv-ft`
(phoneme CTC, Apache-2.0). It emits IPA:

| Word   | Phones aligned inside it |
| ------ | ------------------------ |
| forty  | `f`, `oːɹ`, `ɾ`, `i`     |
| engine | `n`, `dʒ`, `ə`, `n`      |

`forty` is exactly right, including the American flap `ɾ`. `engine` is missing
its initial `ɛ`, which sits before the word onset the character model reported —
the two models are independent and disagree at the edges, which is why
`human-video-alignment-adapter.ts` assigns a phone by its MIDPOINT and clamps it
into the word rather than trusting either boundary.

The phoneme tokenizer normally builds an espeak phonemizer at construction, and
espeak is not installed here. The tool loads the feature extractor and the vocab
file directly instead: espeak is only needed to turn TEXT into phonemes, and
going from audio to phone ids needs neither.

## Uncertainty, as shipped

`human-video-alignment-adapter.ts` reports `uncertaintySeconds` of **0.081** for
onsets — the largest onset error above — and documents 0.141 for ends. Both come
from this one six-word fixture, which is stated in the code rather than implied,
and `182.C.34` re-fits them on a real corpus.

The end bias is reported, never corrected. Word ends run 84–141 ms early because
CTC emits a token where the evidence becomes decisive rather than where the
sound stops; a correction fitted on six words would be a constant wearing a
calibration's name.
