Skip to content

[pull] master from golang:master#132

Merged
pull[bot] merged 35 commits into
trailofbits:masterfrom
golang:master
Jul 15, 2026
Merged

[pull] master from golang:master#132
pull[bot] merged 35 commits into
trailofbits:masterfrom
golang:master

Conversation

@pull

@pull pull Bot commented Jul 15, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

dr2chase and others added 30 commits June 5, 2026 12:02
Merge List:

+ 2026-06-04 d2b991c simd: for 1.27, changed StorePart to return the length stored
+ 2026-06-04 9a23a31 simd: for 1.27, remove deprecated arm64 "As..." methods
+ 2026-06-04 3521c10 simd, cmd/compile: for 1.27, rename MulEvenWiden to MulWidenEven
+ 2026-06-04 6f010ac simd: for 1.27, remove deprecated Merge method
+ 2026-06-04 07664b7 simd: for 1.27, remove the arm64 uint vector to mask conversions
+ 2026-06-04 67c2e8b simd: for 1.27, remove arm64 LookupOrKeep
+ 2026-06-04 e50343d simd: for 1.27, rename Deinterleave and Transpose
+ 2026-06-04 20e9fe5 simd: for 1.27, remove SetHi and rename GetHi to HiToLo
+ 2026-06-04 bdd2182 go/types, types2: do not reuse declared Funcs for expanded methods
+ 2026-06-04 8b42aab simd: refactor simdgen to simplify custom ssa rulegen
+ 2026-06-04 7de45e8 simd, cmd/compile: for 1.27, postpone arm64 Const shift methods
+ 2026-06-04 e07983a cmd/compile: minor midway-related cleanups
+ 2026-06-04 62fcd1a simd: added some tests
+ 2026-06-04 c0cd914 cmd/compile: better error message when using promoted field with version < 1.27
+ 2026-06-04 b7327ec simd, cmd/compile: add broadcast to wasm and midway
+ 2026-06-04 a531ad4 cmd/compile: remove multi-register shift optimization on amd64
+ 2026-06-04 96736b8 net/http: make shouldCopyHeaderOnRedirect case-insensitive for ASCII input
+ 2026-06-04 3f9d49f net/http: use raw Punycode when deciding if we should copy headers on redirect
+ 2026-06-04 3286f7c net/http: document Client redirect behavior
+ 2026-06-03 d1d68c2 runtime: show more information for "WaitDelay expired" errors in failed tests
+ 2026-06-03 8ff56d0 crypto/tls: benchmark needs no entropy, old suites
+ 2026-06-03 c520633 crypto/internal/fips140test: v1.28 FIPS 140-3 module ACVP updates
+ 2026-06-03 0252b4b runtime: format generic methods properly in tracebacks
+ 2026-06-02 2ce1819 net/http: add additional documentation on Request.PathValue escaping
+ 2026-06-02 803d53a go/types, types2: fix confusing error message in multiple assignment
+ 2026-06-02 06a1fb3 cmd/dist: test GOEXPERIMENT=simd in more places
+ 2026-06-02 d7a3737 cmd/internal/obj/arm64: put SVE support behind GOEXPERIMENT=simd
+ 2026-06-02 a5b2a19 crypto/x509: reject IPv4-mapped addresses during parsing
+ 2026-06-02 a81b20a crypto/internal/fips140deps/time: always use unbubbled monotonic clock
+ 2026-06-01 0153438 cmd/go: allow defaults for removed GODEBUG settings
+ 2026-06-01 33001a6 all: REVERSE MERGE dev.simd (0e5948d) into master

Change-Id: I568b16b95999ae2fee87461836b37b7843f3387c
Route HiToLo through Float64x2.SetElem/GetElem instead of Uint64x2
to avoid a round-trip through a GP register.

Update simd_arm64.go codegen test for current API.

Updates #79899

Change-Id: I3d98bd137474a5188509e5ee365c0d9af386e32c
Reviewed-on: https://go-review.googlesource.com/c/go/+/787302
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Arseny Samoylov <samoylov.arseny@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
It looks like a missing logic which breaks a very simple hello world
simd program. To reproduce: create a new directory, `go mod init main`,
write a very simple main.go that imports simd/archsimd, and then open
it with vscode+gopls, then cmd/go will panic:

Error loading workspace: packages.Load error: err: exit status 2: stderr: panic: runtime error: index out of range [0] with length 0

This CL fixes that.

Cherry pick of CL 788281

Change-Id: I03706a12dd0d8e2351494abe95265e4fc7672e48
Reviewed-on: https://go-review.googlesource.com/c/go/+/788281
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit a79201b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/788360
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Merge List:

+ 2026-06-18 cabdf7f net/http: validate trailers when writing requests and responses
+ 2026-06-18 ac2b8fc cmd/compile: update default PGO profile
+ 2026-06-18 15929d1 cmd/compile: fix typo in comment
+ 2026-06-17 96bc97f go/types, types2: permit function type argument inference for map keys
+ 2026-06-17 8931a19 cmd/go: link and clarify docs for GOCACHEPROG
+ 2026-06-17 c83d55f simd: add doc.go
+ 2026-06-17 cc1ee09 cmd/compile: rename types with dependent methods instead of renaming methods
+ 2026-06-17 f22ebe8 simd: repair doc comment for Store, StorePart
+ 2026-06-17 6a1dd03 encoding/json/v2: rename `inline` tag option as `embed`
+ 2026-06-17 22fbb9e cmd/go: adjust test script (fix build)
+ 2026-06-17 9052a29 crypto/tls: only set LocalCertificate when a certificate is presented
+ 2026-06-17 beed654 cmd/cgo: fix TestFortran on Windows
+ 2026-06-17 26d16b7 cmd/internal/script/scripttest: deflake cmd/link and other testscript tests via a longer WaitDelay
+ 2026-06-17 16e8e06 runtime: prefix "runtime error:" to PanicNilError.Error to fully confirm as runtime.Error
+ 2026-06-16 5d1cdac net/http/internal/http2: call synctest.Test directly
+ 2026-06-16 b6a3601 net/http/internal/http2: verify SETTINGS from server against flow limits
+ 2026-06-16 efddb5a go/types, types2: add user-friendly panics in Instantiate
+ 2026-06-16 b4771dc bytes, strings: clarify WriteRune return values
+ 2026-06-16 1a15699 runtime: in moveSliceNoCap, round size down to a whole multiple of element size
+ 2026-06-15 679b34e all: re-run stringer
+ 2026-06-15 0ed8395 cmd/go: harmonize error messages for invalid GODEBUG settings
+ 2026-06-15 e5fcab9 crypto/tls: update ECH specification reference
+ 2026-06-15 2f4a096 crypto/tls: skip unnecessary type conversion
+ 2026-06-15 c086c0e simd: add example_test.go
+ 2026-06-15 0607ffa syscall: add //go:norace to rawSyscall on darwin
+ 2026-06-15 7239eea go/types, types2: traverse aliases in isComplete check
+ 2026-06-15 012d142 internal/goexperiment: delete Flags.GenericMethods
+ 2026-06-13 38e988e cmd/compile: fix AMD64 misscompilation due to AMD64 SETcc and Jcc mapping
+ 2026-06-13 61202f5 test/codegen: update runtimefreegc test for slice backing store fix
+ 2026-06-12 dfc01c3 cmd/go/internal/doc: move buildPkgsite version constant to package scope
+ 2026-06-12 13a70de simd, cmd/compile: check for out-of-bounds SetElem panic
+ 2026-06-12 7624fb3 cmd/compile: add debugging flag for simd "midway" transformation
+ 2026-06-12 ff99e41 cmd/dist: drop 3 minute timeout for a few packages that get close
+ 2026-06-12 3ca82d4 path/filepath: handle \\?\ and \??\ UNC prefixes in VolumeName
+ 2026-06-12 10cfbfc path/filepath: reject Windows volume names containing ..
+ 2026-06-12 1459690 cmd/compile: make sure methods are type checked when used in inference
+ 2026-06-12 b2b5aa4 simd: create a single file for simd types shared by stubs and emulation
+ 2026-06-12 90e20f8 simd: add a hard dependence of simd types on their implementation
+ 2026-06-12 2e2e974 go/types, types2: add missing generic test to Checker.Instantiate
+ 2026-06-12 ff05f35 simd: check for out-of-bounds GetElem panic
+ 2026-06-12 38ff67c cmd/go/internal/load: use file path prefix check for GOROOT dirs
+ 2026-06-11 c829583 simd: add some inner-product benchmarks
+ 2026-06-11 c910146 simd: add test that emulation is endianness-insensitive
+ 2026-06-11 ee5e65d cmd/compile: "simd" types have non-constant sizeof
+ 2026-06-11 0ac1ebd cmd/compile: tweak rewriting to leave original exported declarations
+ 2026-06-11 a72a6b2 database/sql/driver: document RowsColumnScanner interaction with Next
+ 2026-06-11 f5eb66f runtime: detect use of old setting for removed GODEBUGs at startup time
+ 2026-06-11 e4bc71d cmd/compile: hint about unexported fields in "too few values" error
+ 2026-06-11 6e04f9f cmd/compile: fix slice backing store analysis
+ 2026-06-11 8fd906a cmd/compile: relax ConvertVal assertion for non-constant conversions
+ 2026-06-11 4611acc encoding/json: fix regression with unmarshaling unsupported types
+ 2026-06-11 a3acf85 encoding/json: treat invalid `inline` as a regular field
+ 2026-06-11 8c14de9 simd, cmd/compile: turns out mul-add is not supported on some WASM
+ 2026-06-11 9879a55 go/types: don't guarantee that Hasher{,IgnoreTags} have same hash
+ 2026-06-11 5fa87c6 all: fix some function names in comment
+ 2026-06-10 f2f369d cmd/compile: fix misscompilation of Rsh with 32bits rhs on arm64
+ 2026-06-10 9f9476d cmd/compile: add the ability to eat InvertFlags to ADCQ and SBBQ
+ 2026-06-10 ea05c82 encoding/json: document contrasting v2 behavior in StringifyWithLegacySemantics and UnmarshalArrayFromAnyLength
+ 2026-06-10 98da1ab runtime: make lockRank an int64 instead of an int
+ 2026-06-10 5bf2dcd cmd/dist: test encoding/json/... with GOEXPERIMENT=nojsonv2
+ 2026-06-10 4f965ec encoding/json/v2: document lack of support for non-finite float values
+ 2026-06-10 068ceb6 cmd/cgo: fix TestFortran on openbsd
+ 2026-06-10 3b00b08 go/types, types2: stash receivers on method selections
+ 2026-06-10 4093d5e crypto/x509: normalize IP name constraints with non-zero host bits
+ 2026-06-10 f72cd89 encoding/json/jsontext: improve Encoder/Decoder documentation
+ 2026-06-10 efbecbb crypto/tls: add LocalCertificate to ConnectionState
+ 2026-06-10 5005a20 net/http: prevent blocking when reading and closing gzipReader concurrently
+ 2026-06-10 e02b0a5 crypto/tls: update EncryptedClientHelloKey.Config KEM docs
+ 2026-06-10 04ef2e7 net: return ErrClosed in Plan 9 if connection is closed during Read
+ 2026-06-10 6278b72 cmd/compile: fix conversion from constant to type parameter
+ 2026-06-09 f5cdf47 cmd/internal/testdir: don't skip asmcheck tests with arch build constraints in -all_codegen mode
+ 2026-06-09 aa0e916 cmd/fix: pull in CL 787020
+ 2026-06-09 fe49de6 crypto/internal/cryptotest: add ChaCha20-Poly1305 Wycheproof coverage
+ 2026-06-09 5ac12e6 crypto/hmac: expand Wycheproof coverage to truncated tags
+ 2026-06-09 7525263 crypto/rsa: add RSA PSS sig. verification Wycheproof coverage
+ 2026-06-09 64a5c54 crypto/rsa: expand OAEP Wycheproof coverage to mismatched MGF hashes
+ 2026-06-09 b5bf108 crypto/internal/fips140test: add AES-CMAC Wycheproof coverage
+ 2026-06-09 af3d961 crypto/rsa: add PKCS#1 v1.5 decryption Wycheproof coverage
+ 2026-06-09 4e83bbb crypto/pbkdf2: add Wycheproof coverage
+ 2026-06-09 733cdd6 crypto/mldsa: add ML-DSA Wycheproof coverage
+ 2026-06-09 a9b6f1b crypto/internal/cryptotest/wycheproof: allow local vector dir
+ 2026-06-09 2e75fc9 crypto/internal/cryptotest/wycheproof: update deps and schema
+ 2026-06-09 7ecf1df encoding/json: fix Decoder.InputOffset regression after EOF
+ 2026-06-09 fc44626 encoding/json: drop documentation mention of `format`
+ 2026-06-09 7c074f1 cmd/compile: use position of nil check when merging it with subsequent store
+ 2026-06-09 7395fa1 cmd/compile: don't re-evaluate length of value being ranged over
+ 2026-06-09 fdfc67f encoding/json/v2: support format tag via runtime Option
+ 2026-06-09 661aadb internal/runtime/gc: require AVX512DQ for greentea
+ 2026-06-09 a501383 text/template/parse: respect delims in String representations
+ 2026-06-08 e95518b net/http/internal/http2: reject non-identical duplicate Content-Length headers
+ 2026-06-08 2458ba0 simd: route HiToLo through Float64x2 and fix codegen tests
+ 2026-06-08 a79201b cmd/go: include simd bridge package in compiled test imports
+ 2026-06-08 6a8455f crypto/x509: use netip.ParseAddr in VerifyHostname for IPv6 zones
+ 2026-06-08 bc14746 math/rand/v2: fix comments on rand.N
+ 2026-06-08 121b442 cmd/go/internal/doc: clear packageCache before building pkgsite
+ 2026-06-06 d00c67f net/mail: parse ipv6 in addresses according to RFC 5321.
+ 2026-06-05 f4d1304 cmd/compile,sync/atomic: make Add And & Or SQCST on PPC64
+ 2026-06-05 35e6f58 cmd/go/internal/doc: update pkgsite version
+ 2026-06-05 8d29cf2 simd: for 1.27, make ARM64 Reduce* methods return scalar
+ 2026-06-05 66bc4c7 cmd/internal/script: help deflake "WaitDelay expired" errors by reporting the duration

Change-Id: Ife242b00b5c33aec9eba026886f46e61fef750dc
Merge List:

+ 2026-07-01 9e5cf80 simd: correct two errors in formatting code, standardize emulation
+ 2026-06-30 1952e61 net/http: apply header timeout to server's unencrypted HTTP/2 check
+ 2026-06-30 2e82d2c internal/runtime/maps: document hashing of stack pointers
+ 2026-06-30 686bbb7 net: fix TestLookupCNAME
+ 2026-06-30 11c4fcb simd: repaired emulation String methods for simd
+ 2026-06-30 8dcb317 cmd/compile: fix misscompile in rewrite generic rules
+ 2026-06-30 3233439 Revert "cmd/compile: speedup large init function compile time"
+ 2026-06-30 2f81c9e cmd/internal/objfile: fix PE BSS symbol classification
+ 2026-06-29 06bb174 net/http: prevent server from draining request body if status 100 was not sent
+ 2026-06-29 9a92465 Revert "net/http/httputil: wrap ReverseProxy's outbound request body so Close is a noop"
+ 2026-06-29 54719fc simd: repair renaming of Mask.ToIntNs
+ 2026-06-26 6565f55 cmd/compile: repair mask optimizations
+ 2026-06-26 137b806 crypto/tls: omit PSK in ECH outer client hello
+ 2026-06-25 76d509e math/rand/v2: document PCG and ChaCha8 tradeoffs
+ 2026-06-25 63b51fc runtime: lock M for the entire fast path
+ 2026-06-25 fe4da8e runtime: unify mallocStub fast/slow blocks
+ 2026-06-25 2827927 go/types, types2: improve error message for incomplete alias hashing
+ 2026-06-25 3aeef48 os: test and fix ReadDir("/dev/fd") on macOS
+ 2026-06-25 5703e10 cmd/internal/objfile: use 'B' code for ELF and PE BSS symbols
+ 2026-06-25 48bf922 cmd/compile, simd/archsimd: make Wasm Get/SetElem work for out-of-bound constants
+ 2026-06-25 0f0fb7a simd/archsimd: rename arm64 test files
+ 2026-06-25 b350da2 simd/archsimd: deduplicate simd_test.go and arm64_simd_test.go
+ 2026-06-25 e233bce simd/archsimd: deduplicate ternary test helpers
+ 2026-06-24 6498978 runtime: handle nil pointer in sysFreeOS on sbrk platforms
+ 2026-06-24 104f868 cmd/link: quote PE .def library name
+ 2026-06-24 29c1c94 runtime: deconflict gscan and mutex profiler
+ 2026-06-24 cdf9693 simd/archsimd: deduplicate conversion test helpers
+ 2026-06-24 0d0822b internal/nettest: fix flake in TestConnPartialWrite
+ 2026-06-23 c996ed1 simd/archsimd: deduplicate shift tests
+ 2026-06-23 a2b3c73 simd/archsimd: correct ARM64 IfElse semantics
+ 2026-06-23 2a4fbc3 cmd/compile: fix invalid code generation for OINDEXMAP
+ 2026-06-23 9c9e880 cmd/compile: don't require Heapaddr for heap vars in dead code
+ 2026-06-23 c433e42 crypto/x509: triage x509limbo allows
+ 2026-06-23 431520e crypto/internal/cryptotest: x509-limbo test coverage
+ 2026-06-23 674ceb7 types2, go/types: fix conversion error for pointer to type param
+ 2026-06-23 c554c53 simd/archsimd: deduplicate tests
+ 2026-06-23 2f457b9 crypto/internal/cryptotest: parse go mod download JSON from stdout
+ 2026-06-22 57f9a58 net/http: preserve path escaping in redirects
+ 2026-06-22 40f0f81 encoding/json/v2: report error when unmarshaling into ambiguous set of fields
+ 2026-06-22 5e685ce encoding/json/v2: improve documentation
+ 2026-06-22 e296659 cmd/compile: plumb PGO profile through inliner and body reader
+ 2026-06-22 61796ad os: remap / to \ in Windows os.Root.Symlink targets
+ 2026-06-22 d6427ef crypto/tls: document that ConnectionState is valid only after handshake
+ 2026-06-22 97b2bec log/slog: remove obsolete comment
+ 2026-06-22 9d758c0 fmt: fix %q verb documentation to say "rune literal"
+ 2026-06-19 fd6f414 os/signal: avoid flaky TestCtrlBreak by waiting for child stdout
+ 2026-06-19 a2fd613 runtime: fix softfloat64 add/sub for normal operands cancelling to subnormal
+ 2026-06-18 6d1bcd1 simd: set GOEXPERIMENT in testdata tests
+ 2026-06-18 642abec simd: repair missed StorePart-returns-int in generated code
+ 2026-06-18 86f1f77 math/big: Float.Text result may not match strconv.FormatFloat result

Change-Id: I3979ab19ab463b5066df7ed5d68d6e9d6847c65d
Change-Id: I0c4374740c6382bffd066f09a9987120745f3ef2
Reviewed-on: https://go-review.googlesource.com/c/go/+/798841
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: I38bf2c17f031f6d592726ed26ad689bc0c182273
Reviewed-on: https://go-review.googlesource.com/c/go/+/798842
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Surprisingly, nothing to go fix with this update.

Change-Id: I286675ad23372ee42ba03cb1c8701f74db5a24a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/798845
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
In case of an IPv4-in-IPv6 address, the buffer would be too large.
Follow the implementation in Addr.MarshalText and only allocate a
buffer large enough for the largest possible IPv4-in-IPv6 with port.
While at it, also streamline the MarshalText implementations to be as
similar as possible to Addr.MarshalText.

Change-Id: I884a275089385571a7019545e8a01b45b7325461
Reviewed-on: https://go-review.googlesource.com/c/go/+/779700
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Florian Lehner <lhnr.flrn@gmail.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Change-Id: I5bf1c23e115ebac06eec9fb301777b58407327ef
GitHub-Last-Rev: 42ea3c2
GitHub-Pull-Request: #64074
Reviewed-on: https://go-review.googlesource.com/c/go/+/541735
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
…configured

The runtime.SetCPUProfileRate function configures the CPU profiling
sampling rate and starts profiling if the rate is non-zero. If the
function is called with a non-zero rate and profiling is already
enabled, the function logs a warning to standard error. This is a
hard-coded print and can't be turned off. However,
runtime.SetCPUProfileRate is the only way to configure the profiling
frequency, since pprof.StartCPUProfile doesn't provide an option to
change the rate. That function calls runtime.SetCPUProfileRate with a
hard-coded default of 100. This means that the following code logs an
error:

	runtime.SetCPUProfileRate(200)
	pprof.StartCPUProfile(w)

The error is misleading. CPU profiling is working after the second call,
sampling at 200 Hz as intended. The error is also annoying for something
like a continuous profiling library, which stops and starts CPU
profiling regularly and thus prints a useless log repeatedly.

This CL gives pprof.StartCPUProfile a way to set the sampling rate and
start profiling without logging the error if the user already set the
sampling rate. Calling runtime.SetCPUProfileRate twice with a non-zero
rate will still log an error.

Fixes #79900

Change-Id: Icb89bb4ed66689c5a91ce5a677edff126a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/787580
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Florian Lehner <lhnr.flrn@gmail.com>
Auto-Submit: Nick Ripley <nick.ripley@datadoghq.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
The compiler already folds several math/bits intrinsics with constant inputs. Add generic SSA folds for constant Reverse, ReverseBytes, and their narrower forms after they lower to BitRev and Bswap ops.

This removes residual reverse instructions for constant arguments while leaving target-specific lowering unchanged for variable arguments.

For #21872.

Change-Id: I16d8192e9b900a8ded75cb51f411382e9c987880
Reviewed-on: https://go-review.googlesource.com/c/go/+/782462
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
As a gradual step, make it so that setting a custom timeout in goTest
only has effect if it raises the timeout beyond what the go command's
default is (10 minutes at this time).

For #79970.

Change-Id: Iefd397aaafe367e5883d3582aa7dfb6b1ce00f91
Reviewed-on: https://go-review.googlesource.com/c/go/+/789886
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
The reason we have these particular custom timeouts in cmd/dist today
is because CL 120762 increased cmd/go timeout from 6 minutes to 9,
and before that CL 84235 increased cmd/go timeout from 3 minutes to 6,
and before that CL 12368 increased std cmd timeout from 2 minutes to 3.
The original 2 minute per-package timeout was added in 14 years ago in
CL 5604051, where the motivation was to have _some_ hard limit.

Today we have a hard limit via the go command (as well as via LUCI), so
it's safe to drop the custom timeout given it has become a no-op as of
CL 789886, and because the original reason it was added continues to be
in place via other means.

For #79970.

Change-Id: I32d3d34cd6d380453d65d43b6ddf90e4b90dec61
Reviewed-on: https://go-review.googlesource.com/c/go/+/790000
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Keep only the timeout that goes beyond the default of 10 minutes.
The rest are no-ops as of CL 789886.

Fixes #79970.

Change-Id: Ibd3b6d2c8251e6ad995354cac3bf96bd9ccd9639
Reviewed-on: https://go-review.googlesource.com/c/go/+/790001
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Merge List:

+ 2026-07-15 8871cdc cmd/dist: drop all but one custom timeout
+ 2026-07-15 9af3834 cmd/dist: drop 3 minute (or 9 for cmd/go) custom timeout for std cmd
+ 2026-07-15 94e11b4 cmd/dist: redefine goTest.timeout to raise timeout only, not lower it
+ 2026-07-15 61d964e cmd/compile: fold constant bits reverse operations
+ 2026-07-15 2482f9c runtime/pprof: stop logging an error if CPU sampling rate is already configured
+ 2026-07-15 e68a67f runtime: implement stackcheck for riscv64
+ 2026-07-15 6e02631 net/netip: don't overallocate in AddrPort.MarshalText
+ 2026-07-14 7449936 doc: initialize next directory for Go 1.28
+ 2026-07-14 6c87434 internal/goversion: update Version to 1.28
+ 2026-07-14 a5f29a6 encoding/json/v2: add UnmarshalDecode example
+ 2026-07-14 f5c3217 net/http: don't rely on server request body not changing
+ 2026-07-14 e824a5b encoding/pem: handle error from Close
+ 2026-07-14 e414538 cmd/vet: improve how stdversion analyzer refers to methods
+ 2026-07-14 e09c10f net/http: return 404 when redirecting paths with escaped slashes
+ 2026-07-14 a4d587a std: address ptrtoerror analyzer diagnostics
+ 2026-07-14 fcf8878 log/slog: test marshaler output escaping
+ 2026-07-13 a129840 runtime: be sure to scan small frame introduced by (*sigctxt).pushCall
+ 2026-07-13 eb18b3b html/template: document that Tree is updated after the first execution
+ 2026-07-13 92efe23 text/template, html/template: document calling Funcs after parsing
+ 2026-07-13 ba26848 os: document that ReadFile returns *PathError errors
+ 2026-07-13 0b9d317 os: document Process.Pid
+ 2026-07-13 25de5eb internal/poll: document why zero-byte reads do not wait for readability
+ 2026-07-13 9463584 cmd/compile: remove no-op ABIConfig.Copy
+ 2026-07-13 96307fb math: document Nextafter and Nextafter32 special cases for signed zero
+ 2026-07-13 31525e9 cmd/compile: disable merge conditional branches pass
+ 2026-07-13 0969751 reflect: emphasize issue of function pointer comparison
+ 2026-07-13 1e282a3 cmd/vet: pull in CL 799441
+ 2026-07-10 03845e3 os: don't expect an error from Root.ReadFile from a directory on NetBSD
+ 2026-07-10 668ec58 os: properly handle trailing / in Root.MkdirAll
+ 2026-07-10 30719fe testing: record a test's failure for -failfast after cleanup runs
+ 2026-07-09 63d8363 os: strip trailing slashes in RemoveAll on Plan 9
+ 2026-07-09 ee05e88 simd: remove simd/testdata/ip
+ 2026-07-09 db97d07 all: use path for go.mod module path
+ 2026-07-09 f20c97b lib/time: update to 2026c/2026c
+ 2026-07-09 0a9b01c crypto/mlkem: improved semi-expanded wycheproof tests
+ 2026-07-09 4d1000c cmd/go: split test_vet script test for improved parallelism
+ 2026-07-09 10f7480 cmd/go: split build_overlay script test to improve parallelism
+ 2026-07-08 c1e0cd1 cmd/fix: pull in CL 791660
+ 2026-07-08 999c718 go/types, types2: copy test from issue48703 into its own file
+ 2026-07-08 0af88e5 cmd/gofmt: correctly truncate symlinks instead of buggy mangling
+ 2026-07-08 1cee9db os: rewrite PathError.Path in dirFS.ReadLink to relative name
+ 2026-07-07 82215dc os: properly handle trailing slashes in paths in Root
+ 2026-07-07 183e201 go/types, types2: set underlying for imported types
+ 2026-07-07 95a31da cmd/go: remove net script test condition from main go command suite
+ 2026-07-07 cc0242c cmd/go: move mod_sumdb_golang network tests to verylongtest
+ 2026-07-07 d426cba cmd/go: move part of gotoolchain_net to verylongtest
+ 2026-07-07 9cb0e9c cmd/go: move mod_insecure_issue63845 and mod_proxy_https to verylongtest
+ 2026-07-07 342285e cmd/go/testdata/script: remove net condition from always skipped tests
+ 2026-07-07 a89bf59 cmd/go/testdata/script: update mod_prefer_compatible to not use net
+ 2026-07-07 44db00e cmd/go/testdata/script: don't use network in mod_gonoproxy test
+ 2026-07-07 0f091ac cmd/go/testdata/script: remove net from mod_download_private_vcs
+ 2026-07-07 773dae7 cmd/go/testdata/script: don't use net in mod_pseudo_cache
+ 2026-07-07 2772c8e cmd/go/testdata/script: don't use net in mod_sumdb_file_path test
+ 2026-07-07 4a5010f cmd/go/testdata/script: stop using network from mod_git_export_subst
+ 2026-07-07 5a4aeca cmd/go/testdata/script: remove net from gotoolchain_version test
+ 2026-07-07 f14d0eb cmd/go/testdata/script: remove net check in get_issue53955 test
+ 2026-07-07 f38d2ed cmd/go/testdata/script: don't use network in govcs script test
+ 2026-07-07 0858430 test: add write barrier test
+ 2026-07-07 cb4d292 net/http: apply header timeout to server's unencrypted HTTP/2 check
+ 2026-07-07 d468ad3 cmd/go: switch toolchain if necessary in applyUpgrades
+ 2026-07-06 e37f65a cmd/doc: prefer non-internal packages in shorthand lookup
+ 2026-07-06 8184635 net/http: apply Server.MaxHeaderValueCount towards HTTP/1 trailer headers
+ 2026-07-06 976f004 test : repair codegen/simd mask instructions test
+ 2026-07-02 6550487 crypto/mldsa: remove hand-defined wycheproof structs
+ 2026-07-02 aa44f96 net/http: fix BenchmarkClientRequestHeaders header count failure
+ 2026-07-01 3d3798e net/http/internal/http2: do not silently truncate large trailers
+ 2026-07-01 821f3ff Revert "net/http: apply header timeout to server's unencrypted HTTP/2 check"
+ 2026-07-01 375872b math/big: fix edge case float formatting
+ 2026-07-01 d90bf6d net/http: add Server.MaxHeaderValueCount setting

Change-Id: I268aaa4230c359f9fc466dbb1e08bc9b678ea9a0
This commit is a REVERSE MERGE.
It merges dev.simd back into its parent branch, master.

Merge List:

+ 2026-07-15 c29765a [dev.simd] all: merge master (8871cdc) into dev.simd
+ 2026-07-10 cbb6afc [dev.simd] simd/archsimd/_gen: update to Go 1.26
+ 2026-07-09 9f177c6 [dev.simd] simd/archsimd/_gen: run go fix
+ 2026-07-09 57ae1c2 [dev.simd] simd/archsimd/_gen/midway: fix vet errors
+ 2026-07-01 b996c7a [dev.simd] all: merge master (9e5cf80) into dev.simd
+ 2026-06-18 0061fdb [dev.simd] all: merge master (cabdf7f) into dev.simd
+ 2026-06-08 74b9232 [dev.simd] cmd/go: include simd bridge package in compiled test imports
+ 2026-06-08 a4731ef [dev.simd] simd: route HiToLo through Float64x2 and fix codegen tests
+ 2026-06-05 fbe166e [dev.simd] all: merge master (d2b991c) into dev.simd

Change-Id: I646b1adece655105d01f41a8eafce9e380a8d43d
We'll now cache the outputs of the coverage action separately from the
rest of the build action. The goal of this change is to enable a future
change that will remove the dependency of generating the dynimport file
provided to the linker on the build action so that it can run in
parallel. But that depends on the contents of the files passed to cgo
which in turn depends on the coverage outputs, if coverage is enabled.

We'll cache the cover output files similarly to how how we cache vet
files by using cacheSrcFiles to cache each of the files and also a
"directory" file containing a list of the cached files.

For #15681

Change-Id: I39808c3a1a65a0c2c22e38a4e661f5736a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/764761
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
For go list -compiled, cmd/go currently constructs build actions for
every listed package in order to populate CompiledGoFiles. For pure-Go
packages, that information is already available after package loading:
the compiler inputs are just GoFiles. The builder is only needed for
packages that generate additional Go sources, such as cgo or SWIG
packages, or when list also needs stale, export, or coverage
information.

Avoid constructing build actions for pure-Go packages in the common
-compiled case, and fill CompiledGoFiles directly from GoFiles instead.

On a small repro using:

    go list -e -compiled=true -test=true -export=false -deps=true -find=false -pgo=off ./...

the elapsed time dropped from about 630-690 ms to about 440-490 ms.

Add a GOTMPDIR regression test showing that pure-Go go list -compiled
does not require creating a build work directory.

For #75238.

Change-Id: I5f06536a2047f54f9df530ebbc39db9257f2a49f
Reviewed-on: https://go-review.googlesource.com/c/go/+/787320
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Alexander <jitsu@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
The .jj directory is created by the JJ version control system, which
works on top of Git and is used by several Go contributors. Exclude this
directory from binary and source distributions.

Fixes #80408

Change-Id: I559d7bfa7991d52a059cb9aae279cd1d6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/799983
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
This CL redo the work in CL 737880 to split large synthetic init
function into smaller ones, allow faster compile time for package with
many global initialization statements.

Updates #80141
Fixes #77153

Change-Id: I8475b6c7ca8bcf997baf043986ba639d897c2510
Reviewed-on: https://go-review.googlesource.com/c/go/+/795261
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Appears to have been a copy/paste bug in CL 227869.

Marginally improves generated code on 32 bit systems.

Change-Id: Iec37e3962e2fa0276157a58f033d9762a9b42cbf
Reviewed-on: https://go-review.googlesource.com/c/go/+/780103
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
 goos: darwin
 goarch: arm64
 pkg: bytes
 cpu: Apple M3 Pro
                                      │   old.txt   │                 new.txt                 │
                                      │   sec/op    │    sec/op      vs base                  │
 CompareBytesBigUnaligned/offset=1-11   26.44µ ± 0%   22.91µ ± 1%    -13.36% (p=0.000 n=10)
 CompareBytesBigUnaligned/offset=2-11   26.43µ ± 0%   22.90µ ± 0%    -13.33% (p=0.000 n=10)
 CompareBytesBigUnaligned/offset=3-11   26.42µ ± 1%   22.90µ ± 1%    -13.32% (p=0.000 n=7+10)
 CompareBytesBigUnaligned/offset=4-11                 22.92µ ±  ∞ ¹
 geomean                                26.43µ        22.91µ         -13.34%
 ¹ need >= 6 samples for confidence interval at level 0.95

                                      │   old.txt    │                 new.txt                  │
                                      │     B/s      │      B/s        vs base                  │
 CompareBytesBigUnaligned/offset=1-11   36.94Gi ± 0%   42.63Gi ± 1%    +15.41% (p=0.000 n=10)
 CompareBytesBigUnaligned/offset=2-11   36.96Gi ± 0%   42.64Gi ± 0%    +15.39% (p=0.000 n=10)
 CompareBytesBigUnaligned/offset=3-11   36.97Gi ± 1%   42.65Gi ± 1%    +15.37% (p=0.000 n=7+10)
 CompareBytesBigUnaligned/offset=4-11                  42.60Gi ±  ∞ ¹
 geomean                                36.95Gi        42.63Gi         +15.39%

Change-Id: I9137c0ce58dbecf9cf1833f46c086f128d63c95c
GitHub-Last-Rev: fc1fb6f
GitHub-Pull-Request: #79728
Reviewed-on: https://go-review.googlesource.com/c/go/+/784520
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
The existing extendedGCD implementation differs from
BoringSSL & Fiat-Crypto, which this PR fixes.

Avoiding the calls to Nat.Add in the loop results in an on average
24% speedup due to in-place updates instead of allocating temporary
Nat instances as shown in this plot:

    https://github.com/user-attachments/files/27047498/bench_plot.pdf

While all annotations have been removed for this PR, the fixed
implementation is backed by proofs using Gobra (https://gobra.ethz.ch),
a program verifier for Go programs. The linked issue describes the
proofs in more details.

Fixes #78218

Change-Id: I268a07506d6c916abbd0d5cfbd522407fdb10202
GitHub-Last-Rev: 6e376f8
GitHub-Pull-Request: #78932
Reviewed-on: https://go-review.googlesource.com/c/go/+/770380
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
The full proof is in #78218, so trim the comments on syncAdd to just its
mechanical operation, and document the a < m precondition for the A
coefficient in extendedGCD.

Change-Id: Ia75facd856c13f19a4ec9fb70755481e6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/786940
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Linard Arquint <arquint.linard@gmail.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Function hasUpperCase accesses its parameter's bytes while iterating
over its runes. This approach muddles intent and causes an unnecessary
bounds check.

This CL makes hasUpperCase iterate over its parameter's bytes instead.

Updates #76354

Change-Id: Ica403cf35c151dcdd46c98fb55984d4afd3fe871
GitHub-Last-Rev: aa226a0
GitHub-Pull-Request: #78311
Reviewed-on: https://go-review.googlesource.com/c/go/+/758600
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Olivier Mengué <olivier.mengue@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
The variable frag is computed but never used in the ASAN poisoning logic below.
The code calculates the fragment size between the actual allocation slot and the requested size, optionally adjusting for the malloc header, but the result is discarded.
Remove this dead code since asanpoison and asanunpoison only require size and asanRZ.

Change-Id: I3aae669bf55a1a21f3f79ae65299bf5c3e8cd49e
GitHub-Last-Rev: 9eb7bd6
GitHub-Pull-Request: #80126
Reviewed-on: https://go-review.googlesource.com/c/go/+/793580
Reviewed-by: 秦龙 <qinlong.mkl@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
osHasLowResTimer guards the runnext steal backoff in
runqgrab, where usleep(3) gives the running P a chance
to schedule its runnext before another M steals it.
Plan 9 has no sub-millisecond sleep, so usleep rounds
that 3 µs up to 1 ms, but plan9 is missing from the
guard.

Add plan9 to osHasLowResTimer so runqgrab yields, as
it already does on windows, openbsd and netbsd. This
dominates the scheduler tests at GOMAXPROCS > 1, where
a goroutine started with go waits in runnext to be
stolen (Plan 9 has no async preemption). On plan9/amd64
TestSchedLocalQueueEmpty drops from 360s to 1.1s and
the whole runtime test from 1486s to 407s.

Change-Id: I9b323b7d8a6cdb0da3be4355919e8d02c99f3ca5
Reviewed-on: https://go-review.googlesource.com/c/go/+/795140
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Richard Miller <millerresearch@gmail.com>
Auto-Submit: David du Colombier <0intro@gmail.com>
Teach splitPtr to recognize shifts in slice indexing patterns.
For example, indexes of accesses: s[i], s[i+1],
to a []uint64 are lowered to -- (i)<<3, (i+1)<<3

splitPtr now canonicalizes both addresses to the same base and index -- BaseAddress{s, {i, shift: 3}},
while folding the constant component into the offset.

This allows memcombine to recognize adjacent loads/stores for ^2 size element types.

Change-Id: I71b31f8e6dd9ef1151e5ff0a7f7d95d7ecb5f664
Reviewed-on: https://go-review.googlesource.com/c/go/+/792920
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Without this rule the compiler keeps emitting a UMULH for the high half
even when one operand is a known power of two; the LSR is strictly
cheaper on every 64-bit target.

Change-Id: Iea3a00e9a14ac652422bb0ce81a7e32e50c38b67
Reviewed-on: https://go-review.googlesource.com/c/go/+/781840
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Florian Lehner <lhnr.flrn@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
elee1766 and others added 5 commits July 15, 2026 11:28
changes rewriteCondSelectIntoMath to also use inline register shifts
for amd64 for power of 2 cases, as opposed to the cmov based approach.
this is faster for the case of accumulating independent conditions
into a bitset, and slower for dependent conditions.

analysis of existing go code shows a 10:1+ ratio of independent to
dependent conditions. the independent condition is also found more
in hot paths where the optimization would help, for instance packing
headers, as opposed to the dependent pattern which is used far more
for reading flags for a first-time setup step.

Fixes #80202

Change-Id: I668757241e6e9a9ae2a62e9507ebfe4ec4a8aa3f
GitHub-Last-Rev: 478b339
GitHub-Pull-Request: #80248
Reviewed-on: https://go-review.googlesource.com/c/go/+/796641
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: I7f27b726c8b6cf3eb52938184bf8112ddbcceb64
Reviewed-on: https://go-review.googlesource.com/c/go/+/760923
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
On Windows, filepath.Rel can loop forever when the base path is a bare
UNC volume root and the target path is the same root with a trailing
separator. Clean preserves the target's trailing separator, and Rel's
UNC root adjustment reduces the base remainder to a separator. The
component comparison loop then consumes both matching remainders, but
continues comparing empty elements without making progress.

Return "." when a matched element consumes both adjusted paths. At that
point all compared elements are equal and no path elements remain, so
the paths are equivalent.

Expand the Windows UNC Rel tests to cover the trailing-separator root
case, normal descendants, case-insensitive volumes, parent/sibling
paths, and mismatched host/share errors.

Fixes #79784

Change-Id: I4cf95a864154d7509d6533d9f9d6614f8b80bd49
Reviewed-on: https://go-review.googlesource.com/c/go/+/786100
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
The ELF .strtab emitted by putelfstr is currently append-only, so exact
duplicate symbol names get written more than once. Keep a small map from
string to .strtab offset while building elfstrdat, and reuse the
existing offset when the same string is emitted again.

Local linux/amd64 file-size measurements:

  cmd/go:
    before: 23,236,079 bytes
    after:  23,187,035 bytes
    delta:     -49,044 bytes
    change:      -0.21%

  cmd/compile:
    before: 36,719,182 bytes
    after:  36,592,746 bytes
    delta:    -126,436 bytes
    change:      -0.34%

Updates #6853.

Change-Id: I48bb9cc9797a2d33f1e33ee1bf8cf39e21d57a85
Reviewed-on: https://go-review.googlesource.com/c/go/+/788140
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Restructure runtime.memequal on arm64 to speed up the small and medium
sizes (16-127 B).

- Move the small-size path ahead of the 64-byte loop so the common
  2-32 byte case falls through from the entry checks.
- Compare 16-32 bytes with a 16-byte load-pair head+tail and 33-63
  bytes with a 32-byte NEON head+tail.
- tests: add BenchmarkEqual sizes 65/96/100/127 for the patch with
  single iteration plus remainder.

Benchmark results vs. the current implementation:

goos: darwin
goarch: arm64
pkg: bytes
cpu: Apple M4 Pro
goos: darwin
                                │   base.out    │             restruct.out              │
                                │    sec/op     │    sec/op      vs base                │
Equal/0-2                         0.2453n ±  7%   0.2477n ±  8%        ~ (p=0.481 n=10)
Equal/1-2                          1.831n ± 10%    1.800n ± 12%        ~ (p=0.781 n=10)
Equal/6-2                          2.303n ±  9%    2.023n ± 12%  -12.14% (p=0.001 n=10)
Equal/9-2                          2.032n ± 12%    1.774n ± 13%  -12.67% (p=0.002 n=10)
Equal/15-2                         2.038n ± 12%    1.770n ± 14%  -13.17% (p=0.001 n=10)
Equal/16-2                         2.029n ±  2%    1.759n ± 10%  -13.31% (p=0.000 n=10)
Equal/20-2                         2.478n ±  0%    1.983n ±  0%  -19.98% (p=0.000 n=10)
Equal/32-2                         2.235n ±  6%    1.984n ±  0%  -11.23% (p=0.000 n=10)
Equal/65-2                         2.972n ±  0%    2.975n ±  0%        ~ (p=0.159 n=10)
Equal/96-2                         3.496n ±  1%    2.986n ±  0%  -14.56% (p=0.000 n=10)
Equal/100-2                        4.039n ±  2%    3.278n ±  2%  -18.84% (p=0.000 n=10)
Equal/127-2                        4.034n ±  2%    3.279n ±  2%  -18.72% (p=0.000 n=10)
Equal/4K-2                         50.22n ±  2%    50.10n ±  2%        ~ (p=0.839 n=10)
Equal/4M-2                         71.30µ ±  1%    71.69µ ±  2%        ~ (p=0.190 n=10)
Equal/64M-2                        1.143m ±  1%    1.143m ±  1%        ~ (p=0.529 n=10)
EqualBothUnaligned/64_0-2          2.227n ±  1%    2.229n ±  1%        ~ (p=1.000 n=10)
EqualBothUnaligned/64_1-2          2.227n ±  1%    2.228n ±  1%        ~ (p=1.000 n=10)
EqualBothUnaligned/64_4-2          2.228n ±  1%    2.229n ±  1%        ~ (p=0.897 n=10)
EqualBothUnaligned/64_7-2          2.268n ±  3%    2.263n ±  2%        ~ (p=0.644 n=10)
EqualBothUnaligned/4096_0-2        49.96n ±  2%    50.01n ±  2%        ~ (p=0.868 n=10)
EqualBothUnaligned/4096_1-2        49.96n ±  2%    49.91n ±  2%        ~ (p=0.956 n=10)
EqualBothUnaligned/4096_4-2        49.88n ±  2%    49.98n ±  2%        ~ (p=0.493 n=10)
EqualBothUnaligned/4096_7-2        49.79n ±  2%    49.76n ±  1%        ~ (p=0.926 n=10)
EqualBothUnaligned/4194304_0-2     73.08µ ±  1%    73.19µ ±  1%        ~ (p=0.579 n=10)
EqualBothUnaligned/4194304_1-2     75.30µ ±  1%    75.48µ ±  1%        ~ (p=0.481 n=10)
EqualBothUnaligned/4194304_4-2     74.93µ ±  1%    75.17µ ±  1%        ~ (p=0.280 n=10)
EqualBothUnaligned/4194304_7-2     76.58µ ±  2%    76.89µ ±  2%        ~ (p=0.342 n=10)
EqualBothUnaligned/67108864_0-2    1.210m ±  3%    1.209m ±  3%        ~ (p=0.853 n=10)
EqualBothUnaligned/67108864_1-2    1.243m ±  2%    1.246m ±  3%        ~ (p=0.796 n=10)
EqualBothUnaligned/67108864_4-2    1.237m ±  3%    1.241m ±  3%        ~ (p=0.247 n=10)
EqualBothUnaligned/67108864_7-2    1.229m ±  1%    1.245m ±  3%        ~ (p=0.123 n=10)
geomean                            162.9n          155.6n         -4.52%

On CIX P1 the 4 M and offset-0 unaligned bulk cases regress by 3-5%, a
side-effect of the loop restructuring on this core. Moving the
loop-terminating CMP to just before the BNE avoids it on CIX P1 but
regresses the other cores, so the original placement is kept:

goos: linux
goarch: arm64
pkg: bytes
cpu: CIX P1 CD8160
                                │   base.out   │             restruct.out             │
                                │    sec/op    │    sec/op     vs base                │
Equal/0-2                         0.3850n ± 0%   0.3850n ± 0%        ~ (p=0.263 n=10)
Equal/1-2                          3.296n ± 0%    3.280n ± 0%   -0.50% (p=0.000 n=10)
Equal/6-2                          4.363n ± 0%    4.235n ± 0%   -2.93% (p=0.000 n=10)
Equal/9-2                          4.235n ± 2%    3.946n ± 0%   -6.82% (p=0.000 n=10)
Equal/15-2                         4.235n ± 0%    3.946n ± 0%   -6.82% (p=0.000 n=10)
Equal/16-2                         4.491n ± 0%    3.850n ± 0%  -14.27% (p=0.000 n=10)
Equal/20-2                         5.409n ± 0%    4.289n ± 0%  -20.70% (p=0.000 n=10)
Equal/32-2                         5.101n ± 0%    4.283n ± 0%  -16.04% (p=0.000 n=10)
Equal/65-2                         6.067n ± 0%    6.159n ± 0%   +1.52% (p=0.000 n=10)
Equal/96-2                         6.930n ± 1%    6.416n ± 0%   -7.42% (p=0.000 n=10)
Equal/100-2                        7.956n ± 0%    7.135n ± 0%  -10.33% (p=0.000 n=10)
Equal/127-2                        8.469n ± 0%    7.133n ± 0%  -15.77% (p=0.000 n=10)
Equal/4K-2                         128.2n ± 0%    128.7n ± 0%   +0.35% (p=0.000 n=10)
Equal/4M-2                         197.8µ ± 0%    207.4µ ± 0%   +4.87% (p=0.000 n=10)
Equal/64M-2                        3.292m ± 0%    3.278m ± 0%   -0.42% (p=0.000 n=10)
EqualBothUnaligned/64_0-2          3.721n ± 0%    3.850n ± 0%   +3.47% (p=0.000 n=10)
EqualBothUnaligned/64_1-2          3.722n ± 0%    3.850n ± 0%   +3.44% (p=0.000 n=10)
EqualBothUnaligned/64_4-2          3.721n ± 0%    3.850n ± 0%   +3.47% (p=0.000 n=10)
EqualBothUnaligned/64_7-2          3.721n ± 0%    3.850n ± 0%   +3.47% (p=0.000 n=10)
EqualBothUnaligned/4096_0-2        129.4n ± 0%    129.1n ± 0%   -0.23% (p=0.000 n=10)
EqualBothUnaligned/4096_1-2        135.2n ± 0%    135.1n ± 0%   -0.11% (p=0.001 n=10)
EqualBothUnaligned/4096_4-2        135.2n ± 0%    135.0n ± 0%   -0.15% (p=0.000 n=10)
EqualBothUnaligned/4096_7-2        135.2n ± 0%    135.0n ± 0%   -0.15% (p=0.001 n=10)
EqualBothUnaligned/4194304_0-2     176.2µ ± 0%    185.9µ ± 0%   +5.48% (p=0.000 n=10)
EqualBothUnaligned/4194304_1-2     192.3µ ± 0%    191.1µ ± 0%   -0.61% (p=0.000 n=10)
EqualBothUnaligned/4194304_4-2     192.3µ ± 0%    191.1µ ± 0%   -0.64% (p=0.000 n=10)
EqualBothUnaligned/4194304_7-2     192.3µ ± 0%    191.1µ ± 0%   -0.64% (p=0.000 n=10)
EqualBothUnaligned/67108864_0-2    2.881m ± 0%    2.977m ± 0%   +3.31% (p=0.000 n=10)
EqualBothUnaligned/67108864_1-2    2.993m ± 0%    2.991m ± 0%        ~ (p=0.280 n=10)
EqualBothUnaligned/67108864_4-2    2.992m ± 0%    2.990m ± 0%   -0.06% (p=0.011 n=10)
EqualBothUnaligned/67108864_7-2    2.994m ± 0%    2.991m ± 0%   -0.09% (p=0.035 n=10)
geomean                            359.8n         350.2n        -2.67%

Change-Id: Ibdcc9a558c40769c5ddde01797dcee9af41dc52a
Reviewed-on: https://go-review.googlesource.com/c/go/+/798720
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
@pull pull Bot locked and limited conversation to collaborators Jul 15, 2026
@pull pull Bot added the ⤵️ pull label Jul 15, 2026
@pull
pull Bot merged commit 92e067e into trailofbits:master Jul 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.