Repository navigation
Port the govpx v0.5.3 decoder subset (M0 D0a) - #1
Merged
Merged
Conversation
The decoder subset of govpx v0.5.3, extracted by tools/portgovpx (a
per-declaration closure of VP8Decoder and VP9Decoder under 13
GOOS/GOARCH/GOEXPERIMENT configurations, import prefix rewritten, a
derivation header on each file). Public packages: vpx (Image, errors),
vp8, vp9 (New, Options{MaxWidth, MaxHeight, Threads, RowMT}, DecodeWithPTS,
NextFrame, LastFrameCorrupted, Close).
Tests: libvpx's 376 decoder vectors picture by picture (0 and 4 threads,
4:4:0 included), FuzzReadBool against RFC 6386, FuzzVP8Decode and
FuzzVP9Decode with committed corpora. CI: gofmt, 3 OSes, vectors on amd64,
amd64+simd and arm64, 386, qemu lanes, tools modules.
Licences: third_party/govpx (BSD-3), third_party/libvpx (LICENSE, PATENTS),
third_party/goav1 (BSD-2) and PATENTS (AOM) for the AV1-derived kernels.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Found by buildscan --vet: govpx's nextPowerOfTwo shifts by 32 and does not compile where int is 32 bits; no CI lane compiled the arm64 SIMD files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
internal/ is the output of tools/portgovpx. Its files now carry the "Code generated ... DO NOT EDIT." line, and the one change from govpx (nextPowerOfTwo, which does not compile for 32-bit int) is a Patch the generator applies, with a test, instead of a hand edit. Regenerating from govpx v0.5.3 reproduces the committed tree plus the header line. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
mutsweep over tools/portgovpx found 14 guards no test held, one that hung the suite and four held only by a crash; over tools/vpxfetch, two held by a nil dereference. Every one is now caught by an assertion. - portgovpx: errors that cannot be provoked on a healthy host (Abs, ReadDir, packages.Load) go through replaceable package variables and are tested to be returned; Rel and Unquote, which cannot fail on their inputs, lose their dead guards; the unused docStart is dropped (a doc comment is printed from the declaration's Doc field, now asserted to appear once); the Write error paths, the verbatim copy of a wholly kept file, the root errors and the recursive-function termination each have a test, and a TestMain watchdog turns a spinning closure into a failure. - vpxfetch: the two errors that surfaced as a nil dereference are asserted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
M0 step D0a of docs/design/vpx-decoder.md: a port of the VP8/VP9 decoder subset of govpx v0.5.3 (BSD-3-Clause), so that every later change is made here and measured against libvpx.
vpx(Image, error sentinels),vp8,vp9(New,Options{MaxWidth, MaxHeight, Threads, RowMT},DecodeWithPTS,NextFrame,LastFrameCorrupted,Close).internal/is the output oftools/portgovpx(a per-declaration closure of the decoder under 13 GOOS/GOARCH/GOEXPERIMENT configurations). Every file carriesCode generated ... DO NOT EDIT.and its govpx path. The only change from govpx is aPatchapplied by the generator (nextPowerOfTwo, whosev >> 32does not compile whereintis 32 bits); the tree was generated before the last commit of this PR, which only removed an unused comment-range helper and added tests (a doc comment is still printed exactly once, asserted on a fixture); I did not re-run the generator over the full tree after that commit.third_party/{govpx,libvpx,goav1}andPATENTS.Evidence
FuzzReadBool(against RFC 6386, past the end of the data),FuzzVP8Decode,FuzzVP9Decodewith committed corpora; 40-45 s runs clean.buildscan --vetpasses under all 21 CI configurations. It found two defects before the first push: the 386 build failure above and no CI lane compiling the arm64 SIMD files (anarm64 simdvectors lane is added).Gates
The mutation gate (mutsweep) does not sweep the generated tree: its files are marked generated, and they are measured by the vectors and the fuzz corpora instead. The hand-written code (
vp8,vp9,tools/vpxfetch,tools/portgovpx) is swept: every guard oftools/portgovpxandtools/vpxfetchis caught by an assertion (0 survived, 0 hung, 0 caught only by a panic). The sweep first found 14 survivors, 1 hang and 4 panic-only catches in the generator; they were fixed with tests, four guards that cannot fire (twoRel,Unquote, the printer's write error) were removed, and three host-failure calls became replaceable variables so their error return is asserted.No waiver variable was used.
Not in this PR
Performance (M0's t1 targets are measured in D0c on the fractal host), the
Picturetype, and decode's switch to this module (D0b, D0c).🤖 Generated with Claude Code