# Wire goldens `make xserver` captures from a fresh Xvfb and compares every packet with the committed golden. Comparison is independent of the server build: - Server-chosen values (root window, visual, colormap, interned atom, resource IDs from the client's resource base, extension opcodes and event/error bases) are listed per golden by field offset in `serverFields`. `-update` records their capture-time values in `testdata/golden/xvfb-roles.json`. Compare mode checks that the golden holds the recorded value and the live packet holds the live server's value, masks both, then compares the remaining bytes exactly. Server timestamps are masked without a value check. - `ListExtensions` and Render `QueryPictFormats` replies depend on how the server was built (extension list, visuals, formats), so live compare checks invariants: framing, counts matching list lengths, the bound extensions present, the root visual mapped to the format CreatePicture uses. Unit tests still decode the committed goldens byte-exactly. The test is skipped when Xvfb is not installed. `XTURBO_XVFB_ARGS` adds Xvfb options to simulate another server layout, e.g. `XTURBO_XVFB_ARGS="-extension GLX"`. Screen size and depth (800x600x24) and the bound extensions are capture inputs and must stay as captured. Rewrite the goldens from the repository root with: ``` PATH="$PATH:/usr/sbin" go test -tags xserver ./internal/xtest -update ``` The local `/usr/sbin/xtrace` is glibc's program execution tracer, not the X11 protocol proxy. The permitted fallback uses a raw Unix socketpair tee connected to a fresh Xvfb server. A small independent reference encoder (not the generated bindings) sends the requests; the tee records their actual bytes. GetGeometry's successful response also establishes that the preceding MapWindow was accepted. The captured target is the root window; XFIXES's major opcode is negotiated. Tests read target/opcode from the fixture, not a hard-coded server assignment. No runtime Conn is needed at this phase. The same run also writes reply goldens (`.reply.hex`): the server's response to each reference request, read back through the tee. Events and runtime integration belong to their subsequent tasks. T2.4 adds InternAtom, ChangeProperty and XRes QueryClientIds. A GetProperty read-back validates the property contents. XRes's major opcode is negotiated; QueryVersion 1.2 precedes the ClientIdSpec-list query. The capture is independent of generated code, including counts, framing, and padding. T2.5 adds ConfigureWindow with empty, sparse and all-seven-bit masks, CreateWindow, ChangeWindowAttributes and Render CreatePicture. The reference encoder creates sibling windows, exercises signed coordinates and both BOOL32 values, and fences void requests with a successful reply (any preceding error fails capture). RENDER's opcode and the root visual's picture format are queried from Xvfb. Tests reuse only server-assigned resource/format IDs from fixtures; mask bits, values and ordering remain independent expected inputs. T2.6 keeps the replies to QueryExtension, xfixes QueryVersion, GetGeometry, InternAtom, GetProperty, res QueryClientIds and render QueryPictFormats, and adds GetWindowAttributes (child window), QueryTree (root), an unset WM_NAME GetProperty (zero-length value) and ListExtensions (variable STR list). These reply-only requests use opcodes outside the request-golden classifier. Generated `FuzzParse*Reply` targets seed from every matching reply golden. T2.7 adds event and error goldens (`.event.hex`, `.error.hex`). The tee client selects SubstructureRedirect/Notify and PropertyChange on the root plus XFIXES selection input; a second raw client (not teed) creates, maps, configures, unmaps and destroys a window, writes a root property, sends a format-32 ClientMessage and takes PRIMARY. ConvertSelection of an unowned SECONDARY yields a core SelectionNotify. GetAtomName, GetWindowAttributes and XFIXES DestroyRegion on bad IDs yield BadAtom, BadWindow and BadRegion. Each batch is fenced by a GetInputFocus reply; unexpected packets fail capture. `KeymapNotify` and `GeGeneric` (XGE framing with a tail) are hand-written (`# hand:`): Xvfb produces neither for these clients.