End a label section where the next one's stream list begins

The pixelogic walk finds the feature playlist's section by name and ends
it at the next `SEG_`/`SF_`/`FPL_` marker. Those markers are section
NAMES, and a project's trailing sections — the per-language notice,
disclaimer and dub-credit cards — carry none. On 8 of the 11
affected-format discs in the corpus the feature playlist is the last
NAMED section in the blob, so the terminator never fires and the walk
consumes the whole tail of the file as more of the feature's stream
list.

The card names are `{lang3}_{card}`, which passes `is_stream_token`, so
each one advances an STN counter, and a card whose name collides with a
catalogued component emits a label outright. Measured on the worst disc:
95 entries past the end of a 9-audio/21-PG list, five phantom audio
labels at STN 10-14 from `*_AC` notice cards (`AC` reads as the AC-3
codec), and 94 uncatalogued-component occurrences — which also took the
parse from High to Medium confidence and fired the vocabulary-gap
warning on four components that are deliberately not catalogued. A
second disc fabricated one subtitle label from a token in a following
playlist section named `FP_SingAlong`, which `FPL_` does not match.

What every section has, named or not, is a stream list that opens with
its video slots. So a `Video Stream N` entry repeating one this section
already listed is the first entry of the NEXT section, and ends this
one. Distinct video entries are kept, since a section may legitimately
list a secondary video stream; the memo of them is bounded at the BD STN
table's ceiling so disc bytes cannot grow it.

Replaying all 11 blobs through `assign_labels` before and after: the two
discs above lose exactly their phantom labels (11→6 and 5→4), the other
nine are byte-identical.

One residue is pinned rather than papered over: a card's name precedes
its own section's video slot, so a forward-only walk can still count the
FIRST card after the last real slot. It sits at the tail of a list
nothing follows in, so it can renumber nothing — at worst it costs a
parse its High confidence.

No other parser in src/labels/ walks a flat entry sequence with a
terminator set; the rest scope each stream to a structural range or read
its number off the entry itself. paramount and criterion gain immunity
pins for the boundary property specifically: a stream list cannot run
into the next element's, and a missing element boundary shortens the
list rather than extending it.
This commit is contained in:
Matthew Jackson
2026-08-02 16:55:08 -07:00
parent d0d8e2c9bf
commit c94e9f4fb7
4 changed files with 272 additions and 2 deletions
+19
View File
@@ -26,6 +26,25 @@
(`pixelogic`, `paramount`, `mpls_universal`, `deluxe`); the rest are now
pinned by tests proving they are immune. Three of the crate's own tests had
been asserting the shifted numbering.
- **A feature's stream list ran on past its end and picked up menu clips as
streams.** The parser for one vendor's label blob finds the feature
playlist's section by name and ends it at the next named section — but on
most discs of that authoring style the feature playlist IS the last named
section, and the trailing per-language notice, disclaimer and dub-credit
cards carry no name marker at all. The walk therefore swallowed the whole
tail of the blob as more of the feature's own stream list. Those cards are
named per language, in the same shape as a stream token, so each one silently
advanced a stream-number counter, and the ones whose name collided with a
catalogued component were labelled as streams outright — on one disc, five
audio labels for slots 10 to 14 of a playlist that has nine. The same
collisions were being reported as vocabulary gaps and cost that disc's parse
its high-confidence rating. A section now also ends where the next one's
stream list begins, which is at a video slot the section has already listed.
Eight of eleven affected-format discs in the test corpus have no terminating
marker; two of them were producing labels for streams their feature playlist
does not contain. No other label parser walks a flat entry sequence this way
— the rest scope each stream to a structural range or read its number off the
entry itself, and two more now carry tests pinning that.
- **A forced-narrative subtitle marker went uncatalogued.** The token marking
the signs-and-on-screen-text pass that accompanies a dubbed presentation was
not in the vocabulary, so that track lost its forced flag while every other