Skip to content

Remove the decoder's own parsers: internal/syntax becomes test fixtures - #45

Merged
tannevaled merged 1 commit into
mainfrom
drop-syntax-parsers
Nov 10, 2026
Merged

tannevaled merged 1 commit into
mainfrom
drop-syntax-parsers

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Remove the decoder's own parsers: internal/syntax becomes test fixtures (step 2d)

internal/syntax was go.264's reader of the parameter sets and slice headers. The
decoder has read them with the root package since the previous step, so the second
reader goes:

  • ParseSPS, ParsePPS, ParseSliceHeader, the VUI/HRD readers, the scaling list
    reader and the list resolution, the SEI reader and writer (nothing here uses
    SEI) and their tests are deleted.
  • What stays is what tests need to build a stream: the structs and the writers
    (WriteSPS, WritePPS, WriteSliceHeader), as internal/syntaxfixture, which
    reads nothing. The stream-building decoder tests keep using it through
    compat_test.go.
  • levelreorder_test patches level_idc in place (the third byte of the set) and
    reads the result with the root.
  • The root keeps its 100 % gate: corpus_test.go reads every set and slice of the
    repository's streams (what the removed differential tests did against the old
    reader, which agreed field by field when it was replaced), and the set bounds
    of the previous step have tests at their edges.

JVT: 69 of 73 bit-exact, unchanged (4 pending oops1/go.264#2).

Refs go-avkit/decode#10

🤖 Generated with Claude Code

…es (step 2d)

internal/syntax was go.264's reader of the parameter sets and slice headers. The
decoder has read them with the root package since the previous step, so the second
reader goes:

* ParseSPS, ParsePPS, ParseSliceHeader, the VUI/HRD readers, the scaling list
  reader and the list resolution, the SEI reader and writer (nothing here uses
  SEI) and their tests are deleted.
* What stays is what tests need to build a stream: the structs and the writers
  (WriteSPS, WritePPS, WriteSliceHeader), as internal/syntaxfixture, which
  reads nothing. The stream-building decoder tests keep using it through
  compat_test.go.
* levelreorder_test patches level_idc in place (the third byte of the set) and
  reads the result with the root.
* The root keeps its 100 % gate: corpus_test.go reads every set and slice of the
  repository's streams (what the removed differential tests did against the old
  reader, which agreed field by field when it was replaced), and the set bounds
  of the previous step have tests at their edges.

JVT: 69 of 73 bit-exact, unchanged (4 pending oops1/go.264#2).

Refs go-avkit/decode#10

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@tannevaled
tannevaled merged commit de95876 into main Nov 10, 2026
13 checks passed
@tannevaled
tannevaled deleted the drop-syntax-parsers branch November 10, 2026 20:38
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