golang/go Week: SIMD Specs, Type Checker Cleanup and a DWARF Fix


The golang/go repository saw 133 commits in this review window, and most of the weight sits in two places: the experimental simd package and the shared type checker used by cmd/compile and go/types. There is also one compiler fix worth attention from anyone shipping release builds with stripped debug info.

By commit count, the busiest file in the window is src/simd/internal/simdref/simdref.go with 8 commits, and the surrounding simd tree accounts for most of the top changed files list. Austin Clements landed a series of specification and lowering changes across the package.

A few of the concrete items:

  • The generator now lowers arm64 Neon ShiftAll* by a constant to immediate shifts (4dd9e73c).
  • specialLower hooks were replaced with structured rule fields, which makes the generator easier to extend (b82c04a0).
  • Semantics got pinned down: ReduceSum is documented as always pairwise (a6e16b0d), DotProductPairs is fully specified (d00612c8), and the spec now supports platform variations where architectures diverge (9919a080).
  • On wasm, unfused MulAdd results are allowed (690b1e95), acknowledging that wasm SIMD has no fused multiply add.

The takeaway for operators is limited for now: this is still internal and gated behind the simd proposal work. The interesting signal is the effort going into a portable spec layer, since that decides whether the API behaves identically on amd64, arm64/SVE, and wasm.

The go/types and cmd/compile/internal/types2 trees mirror each other, and files like src/go/types/expr.go and src/cmd/compile/internal/types2/builtins.go show 6 to 7 commits each. Robert Griesemer worked through the builtin call implementation in two steps: a pure refactor of builtins.go (5a1c9b59) followed by removal of the old builtin implementation (8095cd35). Alongside that: a shared newIdent helper (eb713120), removal of coding differences in expr.go (b05cb926), and file reorganization moving target.go and literals.go into place.

This is mostly internal refactor. The user visible benefit is one codebase for two type checkers, which means fewer divergent bug reports where go vet and the compiler disagree. Griesemer also touched the syntax scanner in the same period, simplifying scanner.next and routing NUL bytes through a slow case.

The most recent commit in the window fixes a real build failure. 2b74366d changes createConservativeVar in src/cmd/compile/internal/dwarfgen/dwarf.go so that heap escaped variables only get a location list when -dwarflocationlists is enabled. Previously a heap promoted variable could get a location list even with location lists off, leaving putvar asking for the size of a nil loc symbol. The linked issue is 82738.

Symptom, trigger, fix: link failures when compiling with explicit -gcflags=-dwarflocationlists=false; the trigger was an unguarded EscHeap branch in DWARF generation; the fix adds the flag check plus a regression test that builds exactly the failing program shape. Anyone producing stripped or size optimized release binaries benefits. Related debugging work landed the same week: arm64 line numbering fractions were relaxed (c5258d8f) and a g0 check in racecallbackthunk was corrected on amd64 (d3051490).

A quieter but useful cluster touches the standard library. In encoding/json, the embed tag option got documentation (165bc6e7), encoding/json/v2 now lazily copies unaddressable values during marshaling (d93b69fd), and a regression test covers CallMethodsWithLegacySemantics on embedded fields (3365a356). Joe Tsai also documented which reflect methods are affected by CanAddr and CanSet (ea818abe).

Elsewhere: a sweep fixed error handling bugs found by the errflow tool (7b276651), the uuid package now accepts a case insensitive urn:uuid prefix (cfbe34be), FIPS SHA3 Keccak got its Armv8.2 path enabled on iOS, and s390x gained Z17+ instruction encodings (8f93e185) for mainframe builds. If your fleet includes z systems, that last one is the commit to watch.

  • The simd spec layer: platform variation support suggests the API is heading toward a testable, portable definition. Expect more generator and lowering commits before anything becomes user visible.
  • The types2 unification: check future releases for behavior differences between go vet and the compiler shrinking away, and report mismatches if you see any.
  • -dwarflocationlists handling: if you build with custom gcflags today, verify your release binaries still produce usable DWARF after the next toolchain upgrade.