Skip to content

worker: proto, serve and the js/wasm Web Worker - #1

Merged
tannevaled merged 4 commits into
mainfrom
worker-v0
Nov 14, 2026
Merged

tannevaled merged 4 commits into
mainfrom
worker-v0

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Refs go-avkit/avkit#89

First content of the repository. main holds only the LICENSE and README that ghnew created through GitHub; this pull request adds everything else.

What

  • proto: the video worker protocol (standard library only, no syscall/js), Clamp, a bounded DecodeRequest.
  • serve: Server.Handle (poster, probe) over go-avkit's container reader and go-avkit/decode; box/element pre-scan; the last 2 files held by key.
  • cmd/avkit-worker: the js/wasm Web Worker main.
  • CI: gofmt, vet and tests on 3 systems under GOMEMLIMIT, 386, js/wasm build with size, fuzz, govulncheck. renovate.json.

Moved from the video-worker branch of go-slides/go-slides.github.io (playground/videoproto, videoproto/serve, cmd/playground-video), read-only. The client videoproto/remote stays in go-slides. The wire format is unchanged: the limits' field names are those of go-slides' video.Limits, so its switch is a dependency change.

Differences from the source

  • No dependency on go-slides: proto has its own Limits, codes and Error; serve carries the pre-scan and the poster conversion that lived in go-slides' video and video/avkit.
  • Clamp and serve now have tests: a request only lowers limits (table over the 9 fields at MaxInt, 2^40, 0, -1; 0 and negative mean "use the default"), a fuzz property field by field, a refusal test per code, bomb tests asserting a refusal and a small allocation.
  • A held file is checked again against the limits of each request that reads it (the source checked it once, at the first request).
  • NaN and infinite poster times are refused as video.syntax; a request header is bounded and a refused header is answered with its id.
  • video.unavailable is never produced by a Server; it is the client's code for an unreachable worker.

Size

Go 1.27.4, -trimpath -ldflags="-s -w": 12,881,038 bytes raw, 3,297,044 gzip -9.

Not done here

Listing in the docs site and the org landing is a separate pull request.

🤖 Generated with Claude Code

tannevaled and others added 2 commits November 14, 2026 13:05
proto: the request/response protocol (standard library only), the clamp of a
request's limits (a request can only lower them), a bounded request decoder.
serve: Server.Handle with go-avkit's container reader and H.264 decoder
(poster, probe), the box and element pre-scan, the two-file cache, each held
file re-checked against every request's limits.
cmd/avkit-worker: the Web Worker main.

The wire format is that of go-slides' current client (the limits' field names
are those of its video.Limits). Refs go-avkit/avkit#89

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t/http 1.27.4)

Refs go-avkit/avkit#89

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tannevaled and others added 2 commits November 14, 2026 13:24
…dary; fuzz all nine limits

The pre-scan counted elements, not the frames a laced SimpleBlock/Block holds,
which the reader unlaces up front (7 bytes, 256 frames; go-avkit/avkit#120):
refuse above MaxTrackSamples per track and twice that in total (video.limit).
Handle and the wasm answer recover a panic into video.syntax; the JS message
types are checked. The decode-limit refusal text no longer names MaxSamples for
the other limits. FuzzHandle covers every limit; README Security section.

Refs go-avkit/avkit#89

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r the cap

Refs go-avkit/avkit#89

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 86632c5 into main Nov 14, 2026
8 checks passed
@tannevaled
tannevaled deleted the worker-v0 branch November 14, 2026 12: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