Skip to content

portgovpx: regeneration gate; carry the hand edits as Patches - #11

Merged
tannevaled merged 2 commits into
mainfrom
portgen-gate
Nov 29, 2026
Merged

tannevaled merged 2 commits into
mainfrom
portgen-gate

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

What

TestRegenerationMatchesCommitted (tools/portgovpx) regenerates the port from govpx v0.5.3 with the real closure roots and compares every emitted file byte for byte with the committed one. It also fails if a committed file that carries the generated header is not emitted. CI fetches the pinned source with go mod download github.com/thesyncim/govpx@v0.5.3 (checksum database verified) and sets GOVPX_REQUIRED=1, so a missing source fails the lane instead of skipping. Locally the test skips with a message when the source is absent (GOVPX_SRC or the module cache).

The gate FAILING before any move (commit 1 of this PR)

    internal/pixel/filter_arm64.go: committed file differs from the regenerated one (line 20: committed `// filterHorizMadd8 is the amd64 VPMADDUBSW kernel; arm64 has no counterpart.`, regenerated `// filterWide8 implements ARM64 NEON 8-tap and 2-tap subpixel convolution using`)
    internal/pixel/filter_avx2.go: committed file differs from the regenerated one (line 28: committed `	if step == 1 && filterHorizMadd(src, ss, dst, ds, w, h, taps) {`, regenerated `	mode := narrow8Mode(taps)`)
    internal/pixel/filter_six_simd.go: committed file differs from the regenerated one (line 105: committed `	if step == 1 && filterHorizMadd8(src, ss, dst, ds, w, h, taps) {`, regenerated `	mode := narrow8Mode(taps)`)
    internal/vp9/codec/vp9_decoder_modes.go: committed file differs from the regenerated one (line 659: committed `	var refMv, nearNearest [2]vp9dec.MV`, regenerated `	var mv, refMv, nearNearest [2]vp9dec.MV`)
    internal/vp9/decoder/header.go: committed file differs from the regenerated one (line 14: committed `	"encoding/binary"`, regenerated `	"errors"`)
--- FAIL: TestRegenerationMatchesCommitted

Five files, not two: the two of v0.5.1 (vp9_decoder_modes.go, header.go) and the three of the VPMADDUBSW kernel hand-wired in #3 (Refs #3; internal/pixel/filter_{arm64,avx2,six_simd}.go).

Two further defects were found on the way, both in the generator, not in the committed files: Emit dropped the doc comment of every declaration in a rewritten file (the committed files have them), and the closure roots were not recorded anywhere (the test now records them, including NewVP8Decoder and NewVP9Decoder).

The fix

The five hand edits move into Patches (tools/portgovpx/patches_stalls.go); Emit keeps doc comments. The committed generated files are NOT touched: the gate passes against them as they are, so the generated output is unchanged and no release is needed.

Passes: go test ./... in tools/portgovpx, gofmt clean.

🤖 Generated with Claude Code

tannevaled and others added 2 commits November 29, 2026 19:50
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he gate in CI

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit e889c3c into main Nov 29, 2026
14 checks passed
@tannevaled
tannevaled deleted the portgen-gate branch November 29, 2026 19:02
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