M53 Card 2: an independent Go .tabs v2 codec (and go-toolchain builds GOWIN.ELF) - #1283
Merged
Merged
Conversation
An independent Go implementation of the TABWM .tabs v2 session format frozen in user/src/tabwm.zig (6-byte header + 69-byte records): a total decoder and host tests covering a pinned 144-byte golden vector for the state Zig test TWM/ST1 builds, round-trips, v1 refusal (TWM/ST3 parity), the TWM/ST4 rejection table, trailing-byte tolerance, fixed-field boundaries, and a truncation x mutation sweep proving Decode never panics. Host-only: no VM, no kernel, no TABWM change, no new gate spec. Closes #1246
The recipe listed the five runtime fixtures explicitly, so `just go-toolchain` produced GOHELLO/GOARGS/GOROUT/GOSTRESS/GOPANIC but not GOWIN — and gate go-win's setup hook needs that ELF, refusing with the exact build hint when it is missing. GOWIN.ELF is a fleet member since #1282, so a fresh `just verify-vz` reported the new gate as a setup failure. Adds tools/go/gowin.go to the argument list and updates the recipe's fixture/gate enumeration to match. No codec change: tools/go/tabcodec/** is untouched by this commit. Carried here because the card that landed GOWIN.ELF could not declare the justfile.
This was referenced Sep 15, 2026
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.
M53 Card 2 (umbrella #1244 is context only — it stays open).
Closes #1246
What this is
tools/go/tabcodec/— an independent Go implementation of the TABWM.tabsv2 session format frozen inuser/src/tabwm.zig, so a second language can own TABWM session state without touching the kernel, TABWM, or the Zig side.version(2) | active+1 (0 = none) | count | seq_lo | seq_hi | prefstitle(32, NUL-padded) | flags(1) | group(12, NUL-padded) | bin(24, NUL-padded)Encode/Decodemirrorserialize_tabs_v2/parse_tabs_v2.Decodeis total: a short header, a wrong version byte,count > 16, a truncated record body, and an out-of-range active index are all rejected with an error wrappingErrCorrupt; bytes trailing the last record are ignored, exactly as the Zig parser does. At most 16 tabs, so a maximal file is6 + 16*69 = 1110bytes.The one-line
justfilechange, carried here deliberatelyjust go-toolchainlisted the five runtime fixtures explicitly, so it producedGOHELLO/GOARGS/GOROUT/GOSTRESS/GOPANICbut notGOWIN.ELF— andgo-win's setup hook needs that binary, refusing with its build hint when it is missing.GOWIN.ELFbecame a fleet member in #1282, so a freshjust verify-vzreported the new gate as a setup failure. This addstools/go/gowin.goto the argument list and updates the recipe's fixture/gate enumeration to match. The card that landedGOWIN.ELFcould not declare thejustfile, which is why it rides with this one.Verified:
just go-toolchainnow stages all six, including.build/go/GOWIN.ELF(1,194,141 B).Evidence
Golden A parity — the exact state Zig test
TWM/ST1builds (tabsCalcandFiles, the first pinned withCALC.BIN, the second frozen in grouptools, active 0, seq 7) pins 144 bytes:The suite covers: Golden A encode parity plus field offsets, the checked-in
testdata/golden-a.tabsfixture, round-trips (golden / empty / maximal / prefs), v1 refusal (TWM/ST3parity), theTWM/ST4rejection table plus short buffers, trailing-byte tolerance, fixed-field boundaries, encode of unrepresentable states, and a truncation × single-byte-mutation sweep provingDecodenever panics.Honest limit, also written into the package README: the Zig serializer is not callable from a host Go test, so the golden vector is derived from the frozen layout (and re-derived independently for review), not emitted by executing the Zig binary. Parity here is by derivation + review.
Scope
Host-only: no VM, no kernel, no TABWM change, no new gate spec. No
GOWINrewrite —tools/go/gowin.goandtools/gate/specs/go-win.specare untouched by this branch.docs/status.mdis not touched. Rebased ontomainatfafe111.Rollback
Close this PR unmerged (the claim on #1246 reopens) or
git revertthe two commits. Nothing here mutates kernel state, persisted data, or configuration; thejustfileline is inert unlessjust go-toolchainis run.