Skip to content

serve: derive the EBML master set from ebml-go's element table - #2

Merged
tannevaled merged 1 commit into
mainfrom
ebml-masters
Nov 14, 2026
Merged

tannevaled merged 1 commit into
mainfrom
ebml-masters

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Refs go-avkit/avkit#89
Refs go-avkit/avkit#120
Refs go-avkit/avkit#121

The laced-block frame counter of v0.1.0 only descended into a hand-written list of master elements. ebml-go, which the container reader decodes with, treats more elements as masters (BlockAdditionMapping 0x41E4, Slices 0x8E, BlockMore 0xA6, TimeSlice 0xE8, ...), so laced blocks nested in them escaped the count (reported on go-avkit/avkit#120 and in the review of go-avkit/avkit#121).

  • ebmlMasters is derived from ebml-go's element table: every ElementType whose DataType is Master.
  • TestMastersAgreeWithEbmlGoTable fails if the set and the table differ, element by element, and pins the ids named by the review and the old list.
  • TestLacedBlocksInOtherMastersAreCounted: 10,000 laced blocks (70 KB) in each of those masters is refused as video.limit with about 2.5 KB allocated. Without the change the test fails (checked by stashing scan.go).

If avkit exports its own table after its fix, this should switch to it.

🤖 Generated with Claude Code

The hand-written list lacked BlockAdditionMapping (0x41E4), Slices (0x8E),
BlockMore (0xA6), TimeSlice (0xE8) and others that ebml-go treats as masters,
so laced blocks nested in them escaped the frame counter (go-avkit/avkit#120).
The set is now every ElementType whose DataType is Master. A test fails if the
set and the table differ; a bomb test of 10,000 laced blocks in each of those
masters is refused as video.limit and fails without the change.

Refs go-avkit/avkit#89

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit c3f012e into main Nov 14, 2026
8 checks passed
@tannevaled
tannevaled deleted the ebml-masters branch November 14, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant