M53 Card 1: GOWIN.ELF — a Go program owns a raw ADR 0007 window (Closes #1245) - #1282
Merged
Merged
Conversation
This was referenced Sep 15, 2026
M53 Card 1 (umbrella #1244 is context; it stays open). tools/go/gowin.go -> GOWIN.ELF, the first Go consumer of the raw ADR 0007 window seam, in the same family as tools/go/hello.go: sys_win_open, a shared-anonymous back-buffer over sys_mmap, a visible rect filled from that buffer, sys_win_present, sys_poll_event until CloseRequested (WIN_CLOSE, kind 8), then sys_win_close and sys_exit. No LIBUI, no webrender, no browser, no HTTP, no new syscall, kernel untouched. Each of the five serial markers is printed only after its syscall succeeded, so the marker chain IS the syscall chain. Two findings the code records, both observed live rather than assumed: * vi.MmapAnon hard-codes addr=0, and a hintless sys_mmap from a Go program is refused with EINVAL: the GOOS=virelai runtime's sbrk heap reserves upward from the module end and covers the kernel's default mmap base (process.mmap_next_va = 0x1000_0000), which the issue-#1214 collision rule rejects. GOWIN passes an explicit page-aligned hint (12 GiB, clear of the heap and of the randomized EL0 stack band) through the same `svc #0` gateway vi_arm64.s implements, reached by //go:linkname. * The scanout must be armed before a window can exist at all: driving_award.user_open returns EINVAL while the manager is unarmed, so a gate run without the display never reaches a window id (observed as `gowin: error open -1`). tools/go/build-go.sh gains the gowin -> GOWIN name mapping and links user/go into GOPATH as `virelai` (the build-web.sh pattern) so a fixture can import the shared guest SDK; the five existing fixtures still build. tools/gate/specs/go-win.spec is a new declarative class-B gate cloned from go-hello.spec: it stages .build/go/GOWIN.ELF, execs it, holds `dui close 2` (script2) until the program's own `gowin: present` line arrives, and asserts the five markers plus serial-absent [EXC] and exited status=139. Evidence: `just gate go-win` PASS 1/1 (runner rc 0; markers in order open id=2 / fill / present / close / OK); inventory re-rendered and --check clean; the gate was falsified by breaking one marker assert and confirmed red before restoring. Card 2's codec was split out of this branch and lives on agent/autocoder/m53-tabcodec. Closes #1245
drawmeanelephant
force-pushed
the
agent/autocoder/m53-go-first-app
branch
from
September 15, 2026 00:36
95a4d48 to
94beb03
Compare
drawmeanelephant
added a commit
that referenced
this pull request
Sep 15, 2026
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 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 1 (umbrella #1244 is context only — it stays open).
Closes #1245
What this is
GOWIN.ELF— the first Go consumer of the raw ADR 0007 window seam, in the same family astools/go/hello.go. One window, one filled rect, no chrome:No LIBUI, no webrender, no browser, no HTTP, no tabs, no new syscall, kernel untouched,
docs/status.mduntouched, boot default unchanged. Each of the five markers is printed only after its syscall succeeded, so the marker chain is the syscall chain:Files
tools/go/gowin.gotools/go/build-go.shgowin -> GOWINname mapping; linksuser/gointo GOPATH asvirelaiso a fixture can import the shared guest SDK (thebuild-web.shpattern). The five existing fixtures still build.tools/gate/specs/go-win.specgo-hello.specdocs/gate-fleet-inventory.mdThe gate
Stages
.build/go/GOWIN.ELF, execs it, holdsdui close 2(script2) until the program's owngowin: presentline arrives, then asserts the five markers plusserial-absent '[EXC] parking:'andserial-absent 'exited status=139'.dui close <n>is the privileged release path (driving_award.user_close->remove_user_at), which is what pushesWIN_CLOSEto the window's owner; the first user window of a boot is id 2 (the terminal and the clock are the fixed windows) and the run asserts the program's owngowin: open id=line, so drift shows up as a failed gate rather than a silent pass.Evidence
Beyond the markers, the frame captured at
gowin: presentwas checked against the colour the program painted into its own back-buffer: 46,299 scanout pixels exact0x3050a0, 96% of the window rect exact. And the gate was deliberately falsified — one marker assert changed to a string the program never prints turned the run red (serial-contains [...]=0,01: FAIL) before the spec was restored.Two findings the code records
vi.MmapAnoncannot work from a Go program. It hard-codesaddr = 0, and a hintlesssys_mmapis refused withEINVAL: the GOOS=virelai runtime's sbrk heap reserves upward from the module end and covers the kernel's default mmap base (process.mmap_next_va = 0x1000_0000), which the issue-claim: GOOS=virelai 0b round 2: argv-flake root cause + ADR 0027 thread/futex slots 73/74 #1214 collision rule rejects. GOWIN passes an explicit page-aligned hint (12 GiB, clear of that heap and of the randomized EL0 stack band) through the samesvc #0gatewayuser/go/vi/vi_arm64.simplements, reached by//go:linkname— no new slot, no new file, no edit touser/go/vi.driving_award.user_openreturnsEINVALwhile the manager is unarmed, so a run without the display never reaches a window id (observed asgowin: error open -1on the first cut of the spec). The spec carries--screen/--via-virtiofor that reason.Rollback
Nothing here mutates kernel state, persisted data, or configuration. Close this PR without merging (the claim on #1245 reopens), or
git revert 94beb03. Deletingtools/gate/specs/go-win.specremoves the gate from the discovered fleet with no other edit.Handoff
Card 2's codec is not in this PR; it lives on
agent/autocoder/m53-tabcodec(its own claim is #1246). The maintainer adds the M53 row todocs/status.mdat landing, and merge closes #1245.