]> Cypherpunks repositories - gostls13.git/log
gostls13.git
7 weeks agoruntime: mark race functions on s390x as ABIInternal
Srinivas Pokala [Tue, 11 Nov 2025 03:57:22 +0000 (04:57 +0100)]
runtime: mark race functions on s390x as ABIInternal

This adds ABIInternal to the race function declarations.

Update #40724

Change-Id: I827f94fa08240a17a4107a39bca6b4e279dc2530
Reviewed-on: https://go-review.googlesource.com/c/go/+/719422
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agoruntime: add runtime changes for register ABI on s390x
Srinivas Pokala [Tue, 11 Nov 2025 03:53:03 +0000 (04:53 +0100)]
runtime: add runtime changes for register ABI on s390x

This adds the changes for the register ABI in the runtime
functions for s390x platform:
- Add spill/unspill functions used by runtime
- Add ABIInternal to functions

Updates #40724

Change-Id: I6aaeec1d7293b6fec2aa489df90414937b80199e
Reviewed-on: https://go-review.googlesource.com/c/go/+/719465
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
7 weeks agocmd/internal/obj: set morestack arg spilling and regabi prologue on
Srinivas Pokala [Tue, 11 Nov 2025 03:47:55 +0000 (04:47 +0100)]
cmd/internal/obj: set morestack arg spilling and regabi prologue on
s390x

This CL spill arg registers before calling morestack, unspill them
after morestack call. It also avoid clobbering the register that
could contain incoming argument values. Change registers on s390x to
avoid regABI arguments.

Update #40724

Change-Id: I67b20552410dd23ef0b86f14b9c5bfed9f9723a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/719421
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
7 weeks agocmd/compile: update s390x CALL* ops
Srinivas Pokala [Tue, 11 Nov 2025 03:41:50 +0000 (04:41 +0100)]
cmd/compile: update s390x CALL* ops

This CL allow the CALL ops to take variable no of arguments.

Update #40724

Change-Id: Ibfa2e98c5051684cae69200c396dfa1edb2878e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/719464
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agocmd/compile/internal/s390x: add initial spill support
Srinivas Pokala [Tue, 11 Nov 2025 03:37:44 +0000 (04:37 +0100)]
cmd/compile/internal/s390x: add initial spill support

This adds some initial support for spilling and reloading registers in
the new ABI for s390x

Update #40724

Change-Id: Icc46a9375454765dea7d03fc4c8f2dbcc87f5f50
Reviewed-on: https://go-review.googlesource.com/c/go/+/719463
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
7 weeks agocmd/compile/internal: add register ABI information for s390x
Srinivas Pokala [Tue, 11 Nov 2025 03:33:33 +0000 (04:33 +0100)]
cmd/compile/internal: add register ABI information for s390x

Update #40724

Change-Id: If8f2574259560b097db29347b2aecb098acef863
Reviewed-on: https://go-review.googlesource.com/c/go/+/719462
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: Keith Randall <khr@google.com>
7 weeks agointernal/abi: define s390x ABI constants
Srinivas Pokala [Tue, 11 Nov 2025 03:25:23 +0000 (04:25 +0100)]
internal/abi: define s390x ABI constants

Updates #40724

Change-Id: I9b6c56194b2cbc95c08441dfa1f779ed5efbadb8
Reviewed-on: https://go-review.googlesource.com/c/go/+/719461
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
7 weeks agocmd/compile: document register-based ABI for s390x
Srinivas Pokala [Tue, 11 Nov 2025 03:13:51 +0000 (04:13 +0100)]
cmd/compile: document register-based ABI for s390x

This CL adds the s390x information to the ABI doc.

Update #40724

Cq-Include-Trybots: luci.golang.try:gotip-linux-s390x
Change-Id: I1b4b25ef1003e2ab011e1b808aeb1c02288095c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/719460
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
TryBot-Bypass: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
7 weeks agocmd/compile: relax stmtline_test on amd64
David Chase [Mon, 24 Nov 2025 14:37:43 +0000 (09:37 -0500)]
cmd/compile: relax stmtline_test on amd64

This platform was already the strictest, we've hit the limit
several times in the last month or so and it interferes with
getting other stuff done.  This allows 1.5% missing, 2% is
the default, so still strictest.

We do need to revisit the limit and line numbering, but other
work is also a priority.

Change-Id: Ib06f6a9bb39a38ff06bf0b6579bb4eeb0163ce96
Reviewed-on: https://go-review.googlesource.com/c/go/+/723740
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: David Chase <drchase@google.com>

7 weeks agocmd/compile: use 32x32->64 multiplies on loong64
Xiaolin Zhao [Tue, 18 Nov 2025 05:00:15 +0000 (13:00 +0800)]
cmd/compile: use 32x32->64 multiplies on loong64

Gets rid of some sign extensions, like arm64.

Change-Id: I9fc37e15a82718bfcf53db8cab0c4e7baaa0a747
Reviewed-on: https://go-review.googlesource.com/c/go/+/721522
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agoruntime: fix stale comment for mheap/malloc
Lidong Yan [Fri, 21 Nov 2025 03:14:46 +0000 (11:14 +0800)]
runtime: fix stale comment for mheap/malloc

mheap use pageAlloc to manage free/scav address space instead of
using free/scav treap. The comment on mheap states mheap uses
treaps. Update the comment to reflect the use of pageAlloc.

In the fallback code when sizeSpecializedMalloc is enabled,
heapBitsInSpan is false. Update the comment to reflect that.

Change-Id: I50d2993c84e2c0312a925ab0a33065cc4cd41c41
Reviewed-on: https://go-review.googlesource.com/c/go/+/722700
Reviewed-by: Lidong Yan <yldhome2d2@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
7 weeks agocmd/internal/obj/loong64: optimize duplicate optab entries
Xiaolin Zhao [Tue, 18 Nov 2025 09:36:24 +0000 (17:36 +0800)]
cmd/internal/obj/loong64: optimize duplicate optab entries

Change-Id: I28b79d178a2ed3d304f0e61613439813c4dcf79e
Reviewed-on: https://go-review.googlesource.com/c/go/+/721600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
7 weeks agocmd/internal/obj/arm64, image/gif, runtime, sort: use math/bits to calculate log2
Axel Wagner [Wed, 19 Nov 2025 08:28:16 +0000 (09:28 +0100)]
cmd/internal/obj/arm64, image/gif, runtime, sort: use math/bits to calculate log2

In several places the integer log2 is calculated using loops or similar
mechanisms. math/bits.Len* provide a simpler and more efficient
mechanisms for this.

Annoyingly, every usage has slightly different ideas of what "log2"
means and how non-positive inputs should be handled. I verified the
replacements in each case by comparing the result for inputs from 0
to 1<<16.

Change-Id: Ie962a74674802da363e0038d34c06979ccb41cf3
Reviewed-on: https://go-review.googlesource.com/c/go/+/721880
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
7 weeks agoslices: fix incorrect comment in slices.Insert function documentation
cuishuang [Fri, 21 Nov 2025 02:47:06 +0000 (10:47 +0800)]
slices: fix incorrect comment in slices.Insert function documentation

The comment previously stated that r[i+len(v)] would equal the value
originally at r[i], but it should be the value originally at s[i].

Change-Id: I635ddbdd5dc4da9c06ed426d5542bf969b7fe6dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/722680
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
7 weeks agodoc/next: pre-announce end of support for macOS 12 in Go 1.27
Sean Liao [Fri, 21 Nov 2025 21:50:09 +0000 (21:50 +0000)]
doc/next: pre-announce end of support for macOS 12 in Go 1.27

For #75836

Change-Id: I7fd515eb7fcdfb5944388ab42716fd81bc13a7b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/723080
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
7 weeks agocmd/go: update default go directive in mod or work init
Ian Alexander [Thu, 13 Nov 2025 21:38:20 +0000 (16:38 -0500)]
cmd/go: update default go directive in mod or work init

This commit updates the default go directive when initializing a new
module.

The current logic is to use the latest version supported by the
toolchain.  This behavior is simple, predictable, and importantly, it
can work while completely offline (i.e., no internet connection
required).

This commit changes the default version to the following behavior:

* If the current toolchain version is a stable version of Go 1.N.M,
default to go 1.(N-1).0
* If the current toolchain version is a pre-release version of Go
1.N (Release Candidate M) or a development version of Go 1.N, default
to go 1.(N-2).0

This behavior maintains the property of being able to work offline.

Fixes #74748.

Change-Id: I81f62eef29f1dd51060067c8075f61e7bcf57c20
Reviewed-on: https://go-review.googlesource.com/c/go/+/720480
Commit-Queue: Ian Alexander <jitsu@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
7 weeks agocmd/internal/obj/riscv: improve large branch/call/jump tests
Joel Sing [Tue, 18 Nov 2025 07:35:45 +0000 (18:35 +1100)]
cmd/internal/obj/riscv: improve large branch/call/jump tests

Rework these tests such that they are built on all architectures and
actually executed when run on riscv64. This increases the likelihood
of catching code generation issues, especially those that impact
relocations. Also ensure that the generated assembly includes the
instruction sequence that is expected for the large branch/call/jump.

Change-Id: I15c40a439dd1d0d4ed189ab81697e93d82c4ef4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/721621
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 weeks agocrypto/tls: use inner hello for earlyData when using QUIC and ECH
Roland Shoemaker [Mon, 17 Nov 2025 00:09:16 +0000 (16:09 -0800)]
crypto/tls: use inner hello for earlyData when using QUIC and ECH

I don't think we have good QUIC ECH tests. BoGo has some for this, but
I'm not sure how easy it would be to enable those for QUIC.

Fixes #76283

Change-Id: I0ffa535fd89a624b7f9bfd73441ce2a1683e0549
Reviewed-on: https://go-review.googlesource.com/c/go/+/720920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
7 weeks agoruntime: replace trace seqlock with write flag
Michael Anthony Knyszek [Wed, 19 Nov 2025 03:17:54 +0000 (03:17 +0000)]
runtime: replace trace seqlock with write flag

The runtime tracer currently uses a per-M seqlock to indicate whether a
thread is writing to a local trace buffer. The seqlock is updated with
two atomic adds, read-modify-write operations. These are quite
expensive, even though they're completely uncontended.

We can make these operations slightly cheaper by using an atomic store.
The key insight here is that only one thread ever writes to the value at
a time, so only the "write" of the read-modify-write actually matters.
At that point, it doesn't really matter that we have a monotonically
increasing counter. This is made clearer by the fact that nothing other
than basic checks make sure the counter is monotonically increasing:
everything only depends on whether the counter is even or odd.

At that point, all we really need is a flag: an atomic.Bool, which we
can update with an atomic Store, a write-only instruction.

Change-Id: I0cfe39b34c7634554c34c53c0f0e196d125bbc4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/721840
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
7 weeks agoruntime/trace: add Log benchmark
Michael Anthony Knyszek [Wed, 19 Nov 2025 03:37:09 +0000 (03:37 +0000)]
runtime/trace: add Log benchmark

This is a pretty decent benchmark of the baseline event cost.

Change-Id: I22a7fa3411bd80be3bd8093d5933e29062cb1377
Reviewed-on: https://go-review.googlesource.com/c/go/+/723060
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agocmd/go: support sha1 repos when git default is sha256
David Finkel [Fri, 14 Nov 2025 02:16:43 +0000 (21:16 -0500)]
cmd/go: support sha1 repos when git default is sha256

When git is recent enough (beyond 2.29), always set the --object-format
flag.

This fixes repo cloning when users have set the git configuration
init.defaultObjectFormat to sha256.

Git is planning[1] to switch the default hash function to sha256 with
the 3.0 release sometime in late 2026. (that may slip, but it's still
worth being ahead of the curve)

This change moves the version-check function from cl/698835 into
codehost/git.go so we can use it to condition setting
--object-format=sha1.

Adjust the regexp parsing git version output to handle more cases.

[1]: https://lore.kernel.org/lkml/xmqqikikk1hr.fsf@gitster.g/T/#u

Updates #68359
Change-Id: I7d59eb4e116b8afb47d3d1ca068d75eb5047d5c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/720500
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
7 weeks agocrypto/sha3: make the zero value of SHAKE useable
qiulaidongfeng [Thu, 6 Nov 2025 17:58:58 +0000 (01:58 +0800)]
crypto/sha3: make the zero value of SHAKE useable

For #75154

Change-Id: Iee5a11ebea8c74b9abab4c077dc7990fe8f562dd
Reviewed-on: https://go-review.googlesource.com/c/go/+/718521
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agocrypto/sha3: make the zero value of SHA3 useable
qiulaidongfeng [Thu, 23 Oct 2025 09:20:10 +0000 (17:20 +0800)]
crypto/sha3: make the zero value of SHA3 useable

Fixes #75154

Change-Id: I860ab0b4bd5d64e1f58aa5dfbab19d77e2925430
Reviewed-on: https://go-review.googlesource.com/c/go/+/714120
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 weeks agodatabase/sql: don't ignore ColumnConverter for unknown input count
Jonathan Hall [Mon, 8 Jul 2024 16:14:43 +0000 (18:14 +0200)]
database/sql: don't ignore ColumnConverter for unknown input count

In the case a sql driver implements the ColumnConverter interface and also
returns -1 for NumInputs, indicating an unknown number of input arguments to
a query, the previous implementation would ignore the column converter would
not be called, leading to unexpected or invalid arguments passed to the driver.

Fixes #68342

Change-Id: Ib2ddaf040fa9be669d593eacdaa1e88ba66d7bc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/597115
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agoruntime/pprof: remove hard-coded sleep in CPU profile reader
Nick Ripley [Fri, 21 Nov 2025 16:01:29 +0000 (16:01 +0000)]
runtime/pprof: remove hard-coded sleep in CPU profile reader

The CPU profiler reader goroutine has a hard-coded 100ms sleep between
reads of the CPU profile sample buffer. This is done because waking up
the CPU profile reader is not signal-safe on some platforms. As a
consequence, stopping the profiler takes 200ms (one iteration to read
the last samples and one to see the "eof"), and on many-core systems the
reader does not wake up frequently enought to keep up with incoming
data.

This CL removes the sleep where it is safe to do so, following a
suggestion by Austin Clements in the comments on CL 445375. We let the
reader fully block, and wake up the reader when the buffer is over
half-full.

Fixes #63043
Updates #56029

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-arm64-longtest,gotip-linux-386-longtest
Change-Id: I9f7e7e9918a4a6f16e80f6aaf33103126568a81f
Reviewed-on: https://go-review.googlesource.com/c/go/+/610815
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
7 weeks agoruntime: fix double wakeup in CPU profile buffer
Nick Ripley [Fri, 21 Nov 2025 14:09:57 +0000 (14:09 +0000)]
runtime: fix double wakeup in CPU profile buffer

The profBuf.wakeupExtra method wakes up the profile reader if it's
sleeping, either when the buffer is closed or when there is a pending
overflow entry.  Unlike in profBuf.write, profBuf.wakeupExtra does not
clear the profReaderSleeping bit before doing the wakeup. As a result,
if there are two writes to a full buffer before the sleeping reader has
time to wake up, we'll see two consecutive calls to notewakeup, which is
a fatal error. This CL updates profBuf.wakeupExtra to clear the sleeping
bit before doing the wakeup.

This CL adds a unit test that demonstrates the problem. This is
theoretically possible to trigger for real programs as well, but it's
more difficult. The profBufWordCount is large enough that it takes
several CPU-seconds to fill up the buffer. So we'd need to run on a
system with lots of cores to have a chance of running into this failure,
and the reader would need to fully go to sleep before a large burst of
CPU activity.

Change-Id: I59b4fa86a12f6236890b82cd353a95706a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/722940
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agocmd/compile: change testing.B.Loop keep alive semantic
Junyang Shao [Thu, 30 Oct 2025 19:14:57 +0000 (19:14 +0000)]
cmd/compile: change testing.B.Loop keep alive semantic

This CL implements this initial design of testing.B.Loop's keep variable
alive semantic:
https://github.com/golang/go/issues/61515#issuecomment-2407963248.

Fixes #73137.

Change-Id: I8060470dbcb0dda0819334f3615cc391ff0f6501
Reviewed-on: https://go-review.googlesource.com/c/go/+/716660
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
8 weeks agonet: remove unused linknames
Sean Liao [Mon, 17 Nov 2025 19:25:21 +0000 (19:25 +0000)]
net: remove unused linknames

errNoSuchInterface:
https://github.com/SagerNet/sing/commit/a33349366d899068145f2d0e3ea0f5b2632fa3f2

defaultNS:
https://github.com/MetaCubeX/mihomo/commit/4a16d22398116a88a230071278be536491a8cdce

For #67401

Change-Id: I2945bc5edf8a474315283c57259ba6c2a0b85776
Reviewed-on: https://go-review.googlesource.com/c/go/+/721161
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agonet/http: remove unused linknames
Sean Liao [Mon, 17 Nov 2025 19:34:55 +0000 (19:34 +0000)]
net/http: remove unused linknames

These were removed in:
https://github.com/gobwas/ws/commit/8e2d520ba2966517f9c339e36dd89fd8a4460446

For #67401

Change-Id: I44898beb6fa3b6867b3d2164fc930724e143cf30
Reviewed-on: https://go-review.googlesource.com/c/go/+/721200
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agonet/http: populate Response.Request when using NewFileTransport
Sean Liao [Sun, 16 Nov 2025 00:26:27 +0000 (00:26 +0000)]
net/http: populate Response.Request when using NewFileTransport

Fixes #51562

Change-Id: Ia6fe4728b1e3e0cf3a6462be99c1044260cadf31
Reviewed-on: https://go-review.googlesource.com/c/go/+/720822
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agonet/http: preserve original path encoding in redirects
Sean Liao [Sun, 16 Nov 2025 00:13:40 +0000 (00:13 +0000)]
net/http: preserve original path encoding in redirects

Fixes #70758

Change-Id: I9fc6fe98c194351557c6219513918b7593899bc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/720821
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agonet/http: use HTTP 307 redirects in ServeMux
Sean Liao [Sat, 15 Nov 2025 23:58:58 +0000 (23:58 +0000)]
net/http: use HTTP 307 redirects in ServeMux

Clients receiving an HTTP 301 Moved Permanently may conservatively
change the method of a POST request to GET.
The newer HTTP 307 Temporary Redirect and 308 Permanent Redirect
explicitly allows retrying POST requests after the redirect.
These should be safe for ServeMux as this internal redirect is generated
before user provided handlers are called.
As ServeMux is making the redirect for the user without explicit
direction, and clients may cache Permanent Redirects indefinitely,
Temporary Redirect is used in case the user adds a handler for a path,
that was previously redirected but no longer should.

Fixes #50243
Fixes #60769

Change-Id: I6c0b735bab03bb7b50f05457b3b8a8ba813badb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/720820
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agonet/http: update Response.Request.URL after redirects on GOOS=js
Sean Liao [Sun, 16 Nov 2025 00:45:28 +0000 (00:45 +0000)]
net/http: update Response.Request.URL after redirects on GOOS=js

Fixes #71346

Change-Id: Id4053626e621faf50bb88a10ca0d540f393c8e01
Reviewed-on: https://go-review.googlesource.com/c/go/+/720860
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agonet/http/cookiejar: treat localhost as secure origin
Sean Liao [Tue, 4 Nov 2025 22:47:42 +0000 (22:47 +0000)]
net/http/cookiejar: treat localhost as secure origin

For development purposes, browsers treat localhost
as a secure origin regardless of protocol.

Fixes #60997

https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies#restrict_access_to_cookies
https://bugzilla.mozilla.org/show_bug.cgi?id=1618113
https://issues.chromium.org/issues/40120372

Change-Id: I6d31df4e055f2872c4b93571c53ae5160923852b
Reviewed-on: https://go-review.googlesource.com/c/go/+/717860
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
8 weeks agonet/url: warn that JoinPath arguments should be escaped
Sean Liao [Sat, 8 Nov 2025 18:16:48 +0000 (18:16 +0000)]
net/url: warn that JoinPath arguments should be escaped

Fixes #75799

Change-Id: I483f7b1129799d8dd7f359a04e6ebc1b6a5d0b08
Reviewed-on: https://go-review.googlesource.com/c/go/+/719000
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocrypto/internal/fips140/mldsa: unroll NTT and inverseNTT
Filippo Valsorda [Fri, 21 Nov 2025 18:24:37 +0000 (19:24 +0100)]
crypto/internal/fips140/mldsa: unroll NTT and inverseNTT

fips140: off
goos: darwin
goarch: arm64
pkg: crypto/internal/fips140test
cpu: Apple M2
                      │ bade4ade59  │          bade4ade59-dirty          │
                      │   sec/op    │   sec/op     vs base               │
MLDSASign/ML-DSA-44-8   264.8µ ± 0%   244.5µ ± 0%  -7.68% (p=0.000 n=20)

fips140: off
goos: linux
goarch: amd64
pkg: crypto/internal/fips140test
cpu: AMD EPYC 7443P 24-Core Processor
                       │ bade4ade59  │          bade4ade59-dirty          │
                       │   sec/op    │   sec/op     vs base               │
MLDSASign/ML-DSA-44-48   408.7µ ± 3%   386.5µ ± 1%  -5.41% (p=0.000 n=20)

Change-Id: I04d38a48d5105cbcd625cba9398711b26a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/723020
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agocrypto/internal/fisp140test: update acvptool, test data
Daniel McCarney [Tue, 11 Nov 2025 19:41:43 +0000 (14:41 -0500)]
crypto/internal/fisp140test: update acvptool, test data

This commit updates the BoringSSL module version used for the acvptool,
as well as the module version used for the static test data used by our
CI process to avoid interacting with a live ACVP server.

Two important upstream changes of note:

1. NIST changed the ML-KEM format slightly, and the BoringSSL acvptool
   was updated in turn. We need to update the go-acvp data version to
   one where I've regenerated the corresponding vector/expected files to
   match these changes. Otherwise, we see an error from an empty dk
   value.

2. The upstream BoringSSL acvptool switched to no longer truncating MAC
   output in the subprocess handler for HMAC tests. Instead of relying on
   this, we switch our capabilities to describe the output length we
   return natively. In turn, we need to update the go-acvp data version
   to vectors generated with the updated capabilities. Otherwise, we see
   an error from the acvptool that our module wrapper returned a result
   of the wrong length.

Change-Id: I1def172585ced0aaf1611d82f2e2802ca1500390
Reviewed-on: https://go-review.googlesource.com/c/go/+/719780
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agocrypto/internal/fips140/mldsa: new package
Filippo Valsorda [Tue, 4 Nov 2025 18:04:00 +0000 (19:04 +0100)]
crypto/internal/fips140/mldsa: new package

Change-Id: I6a6a6964fabee819e62bb6eda032dee6a60d907a
Reviewed-on: https://go-review.googlesource.com/c/go/+/717781
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agoruntime: remove linkname for gopanic
Sean Liao [Mon, 17 Nov 2025 21:16:06 +0000 (21:16 +0000)]
runtime: remove linkname for gopanic

github.com/goplus/igop now renamed github.com/goplus/ixgo
already requires checklinkname=0, so the special case can be removed.
https://github.com/goplus/ixgo/tree/e0d0bfeb2de9cfbe0b6cd668f015a1ba35dfea76/ixgo

go.undefinedlabs.com is no longer a resolvable domain,
having been absorbed by Datadog. The original use in
https://pkg.go.dev/go.undefinedlabs.com/scopeagent@v0.4.2/reflection
probably shouldn't have qualified anyway with 0 known importers.

For #67401

Change-Id: Ida6024e014f3304d4a4190f0bd9d12746a29b40b
Reviewed-on: https://go-review.googlesource.com/c/go/+/721300
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocrypto/internal/hpke: separate KEM and PublicKey/PrivateKey interfaces
Filippo Valsorda [Tue, 11 Nov 2025 12:10:17 +0000 (13:10 +0100)]
crypto/internal/hpke: separate KEM and PublicKey/PrivateKey interfaces

Updates #75300

Change-Id: I87ed26e8f57180d741408bdbda1696d46a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/719560
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Filippo Valsorda <filippo@golang.org>

8 weeks agocrypto/internal/hpke: add ML-KEM and hybrid KEMs, and SHAKE KDFs
Filippo Valsorda [Mon, 22 Sep 2025 12:50:31 +0000 (14:50 +0200)]
crypto/internal/hpke: add ML-KEM and hybrid KEMs, and SHAKE KDFs

Updates #75300

Change-Id: I6a6a6964fbd45420b4001f53fa79228808e4778a
Reviewed-on: https://go-review.googlesource.com/c/go/+/705797
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocrypto/internal/hpke: modularize API and support more ciphersuites
Filippo Valsorda [Sat, 6 Sep 2025 19:37:09 +0000 (21:37 +0200)]
crypto/internal/hpke: modularize API and support more ciphersuites

Updates #75300

Change-Id: I6a6a6964de449b36bc6f5594e08c3c47a0a2f17f
Reviewed-on: https://go-review.googlesource.com/c/go/+/701435
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agocmd/compile: simplify negative on multiplication
Meng Zhuo [Tue, 18 Nov 2025 01:53:21 +0000 (09:53 +0800)]
cmd/compile: simplify negative on multiplication

goos: linux
goarch: amd64
pkg: cmd/compile/internal/test
cpu: AMD EPYC 7532 32-Core Processor
               │       simplify_base │               simplify_new          │
               │       sec/op        │   sec/op     vs base                │
SimplifyNegMul           623.0n ± 0%   319.3n ± 1%  -48.75% (p=0.000 n=10)

goos: linux
goarch: riscv64
pkg: cmd/compile/internal/test
cpu: Spacemit(R) X60
               │       simplify.base │               simplify.new          │
               │       sec/op        │   sec/op     vs base                │
SimplifyNegMul          10.928µ ± 0%   6.432µ ± 0%  -41.14% (p=0.000 n=10)

Change-Id: I1d9393cd19a0b948a5d3a512d627cdc0cf0b38be
Reviewed-on: https://go-review.googlesource.com/c/go/+/721520
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
8 weeks agonet/http: fix typo in Transport docs
Victor [Sun, 16 Nov 2025 00:00:59 +0000 (00:00 +0000)]
net/http: fix typo in Transport docs

Change-Id: Ifeb8d6d2e3fd4c8b0e27da62bec5cf28fe71db34
GitHub-Last-Rev: 5760fb106f58bf77817b9813f029d47be4ca7e3b
GitHub-Pull-Request: golang/go#76316
Reviewed-on: https://go-review.googlesource.com/c/go/+/720800
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Sean Liao <sean@liao.dev>
8 weeks agonet: remove unnecessary loop variable copies in tests
Plamerdi Makela [Tue, 11 Nov 2025 15:10:53 +0000 (15:10 +0000)]
net: remove unnecessary loop variable copies in tests

Similar to CL 711640.

Change-Id: I5cd9470138c80094eeb497cf4652d6a29cd795a6
GitHub-Last-Rev: 603fb5f4d55a12a773f2cb08b295578fb45ad14e
GitHub-Pull-Request: golang/go#76253
Reviewed-on: https://go-review.googlesource.com/c/go/+/719600
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
8 weeks agocmd/cgo: strip top-level const qualifier from argument frame struct
Ian Lance Taylor [Mon, 3 Nov 2025 23:54:39 +0000 (15:54 -0800)]
cmd/cgo: strip top-level const qualifier from argument frame struct

Otherwise we can't assign to it.

Fixes #75751

Change-Id: Iba680db672297bca1a1d1a33912b80863da66a08
Reviewed-on: https://go-review.googlesource.com/c/go/+/717342
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoerrors: add examples for custom Is/As matching
Sean Liao [Wed, 22 Oct 2025 12:13:51 +0000 (13:13 +0100)]
errors: add examples for custom Is/As matching

Change-Id: Ia92dae13b6a4e9434b29d2ab3f698f6ba87b4b89
Reviewed-on: https://go-review.googlesource.com/c/go/+/713740
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>

8 weeks agocmd/compile: rewrite Rsh to RshU if arguments are proved positive
Jorropo [Tue, 18 Nov 2025 00:42:37 +0000 (01:42 +0100)]
cmd/compile: rewrite Rsh to RshU if arguments are proved positive

Fixes #76332

Change-Id: I9044025d5dc599531c7f88ed2870bcf3d8b0acbd
Reviewed-on: https://go-review.googlesource.com/c/go/+/721206
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
8 weeks agocmd/compile: propagate unsigned relations for Rsh if arguments are positive
Jorropo [Tue, 18 Nov 2025 00:33:40 +0000 (01:33 +0100)]
cmd/compile: propagate unsigned relations for Rsh if arguments are positive

Updates #76332

Change-Id: Ifaa4d12897138d88d56b9d4e530c53dcee70bd58
Reviewed-on: https://go-review.googlesource.com/c/go/+/721205
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Keith Randall <khr@google.com>
8 weeks agocmd/compile: make dse track multiple shadowed ranges
Jakub Ciolek [Wed, 21 May 2025 07:34:48 +0000 (09:34 +0200)]
cmd/compile: make dse track multiple shadowed ranges

Track multiple shadowed ranges when doing DSE.

Elides zeroing for:

func nozero() (b [5]int64) {
b[0] = 1
b[1] = 7
b[3] = 1
b[4] = 1
b[2] = 0
return b
}

goes from:

 v28    00003 (7) LEAQ main.b(SP), AX
 v5     00004 (7) MOVUPS X15, (AX)
 v5     00005 (7) MOVUPS X15, 16(AX)
 v5     00006 (7) MOVUPS X15, 24(AX)
 v11    00007 (8) MOVQ $1, main.b(SP)
 v16    00008 (9) MOVQ $7, main.b+8(SP)
 v20    00009 (10) MOVQ $1, main.b+24(SP)
 v24    00010 (11) MOVQ $1, main.b+32(SP)
 v29    00011 (12) MOVQ $0, main.b+16(SP)
 b1     00012 (13) RET
        00013 (?) END

to:

 v11    00003 (8) MOVQ $1, main.b(SP)
 v16    00004 (9) MOVQ $7, main.b+8(SP)
 v20    00005 (10) MOVQ $1, main.b+24(SP)
 v24    00006 (11) MOVQ $1, main.b+32(SP)
 v29    00007 (12) MOVQ $0, main.b+16(SP)
 b1     00008 (13) RET
        00009 (?) END

regexp linux/amd64:

Find-16                                             89.17n ± ∞ ¹    83.09n ± ∞ ¹   -6.82% (p=0.008 n=5)
FindAllNoMatches-16                                 46.23n ± ∞ ¹    44.26n ± ∞ ¹   -4.26% (p=0.008 n=5)
FindString-16                                       89.77n ± ∞ ¹    82.84n ± ∞ ¹   -7.72% (p=0.008 n=5)
FindSubmatch-16                                     108.9n ± ∞ ¹    101.6n ± ∞ ¹   -6.70% (p=0.008 n=5)
FindStringSubmatch-16                              103.10n ± ∞ ¹    99.98n ± ∞ ¹   -3.03% (p=0.008 n=5)
Literal-16                                          29.61n ± ∞ ¹    29.17n ± ∞ ¹   -1.49% (p=0.008 n=5)
NotLiteral-16                                       590.0n ± ∞ ¹    566.0n ± ∞ ¹   -4.07% (p=0.008 n=5)
MatchClass-16                                       894.7n ± ∞ ¹    814.0n ± ∞ ¹   -9.02% (p=0.008 n=5)
MatchClass_InRange-16                               793.0n ± ∞ ¹    756.3n ± ∞ ¹   -4.63% (p=0.008 n=5)
ReplaceAll-16                                       513.9n ± ∞ ¹    503.6n ± ∞ ¹   -2.00% (p=0.008 n=5)
AnchoredLiteralShortNonMatch-16                     21.70n ± ∞ ¹    21.66n ± ∞ ¹        ~ (p=0.738 n=5)
AnchoredLiteralLongNonMatch-16                      21.74n ± ∞ ¹    21.65n ± ∞ ¹        ~ (p=0.286 n=5)
AnchoredShortMatch-16                               37.71n ± ∞ ¹    37.63n ± ∞ ¹        ~ (p=0.421 n=5)
AnchoredLongMatch-16                                37.75n ± ∞ ¹    37.70n ± ∞ ¹        ~ (p=0.286 n=5)
OnePassShortA-16                                    188.7n ± ∞ ¹    185.7n ± ∞ ¹   -1.59% (p=0.008 n=5)
NotOnePassShortA-16                                 188.0n ± ∞ ¹    190.7n ± ∞ ¹   +1.44% (p=0.008 n=5)
OnePassShortB-16                                    147.9n ± ∞ ¹    154.2n ± ∞ ¹   +4.26% (p=0.008 n=5)
NotOnePassShortB-16                                 141.2n ± ∞ ¹    144.1n ± ∞ ¹   +2.05% (p=0.008 n=5)
OnePassLongPrefix-16                                40.43n ± ∞ ¹    38.45n ± ∞ ¹   -4.90% (p=0.008 n=5)
OnePassLongNotPrefix-16                             100.6n ± ∞ ¹    102.5n ± ∞ ¹   +1.89% (p=0.008 n=5)
MatchParallelShared-16                              9.666n ± ∞ ¹    9.461n ± ∞ ¹        ~ (p=0.056 n=5)
MatchParallelCopied-16                              9.530n ± ∞ ¹    9.540n ± ∞ ¹        ~ (p=0.841 n=5)
QuoteMetaAll-16                                     28.60n ± ∞ ¹    29.52n ± ∞ ¹   +3.22% (p=0.016 n=5)
QuoteMetaNone-16                                    16.73n ± ∞ ¹    16.74n ± ∞ ¹        ~ (p=0.817 n=5)
Compile/Onepass-16                                  2.040µ ± ∞ ¹    2.012µ ± ∞ ¹        ~ (p=0.381 n=5)
Compile/Medium-16                                   4.652µ ± ∞ ¹    4.661µ ± ∞ ¹        ~ (p=0.341 n=5)
Compile/Hard-16                                     37.59µ ± ∞ ¹    37.93µ ± ∞ ¹        ~ (p=0.222 n=5)
Match/Easy0/16-16                                   1.848n ± ∞ ¹    1.847n ± ∞ ¹   -0.05% (p=0.048 n=5)
Match/Easy0/32-16                                   23.81n ± ∞ ¹    24.16n ± ∞ ¹   +1.47% (p=0.008 n=5)
Match/Easy0/1K-16                                   143.2n ± ∞ ¹    148.6n ± ∞ ¹   +3.77% (p=0.008 n=5)
Match/Easy0/32K-16                                  2.023µ ± ∞ ¹    2.008µ ± ∞ ¹   -0.74% (p=0.024 n=5)
Match/Easy0/1M-16                                   135.3µ ± ∞ ¹    136.8µ ± ∞ ¹   +1.10% (p=0.016 n=5)
Match/Easy0/32M-16                                  5.139m ± ∞ ¹    5.123m ± ∞ ¹   -0.29% (p=0.008 n=5)
Match/Easy0i/16-16                                  1.848n ± ∞ ¹    1.847n ± ∞ ¹        ~ (p=0.167 n=5)
Match/Easy0i/32-16                                  438.3n ± ∞ ¹    421.9n ± ∞ ¹   -3.74% (p=0.008 n=5)
Match/Easy0i/1K-16                                  12.93µ ± ∞ ¹    12.25µ ± ∞ ¹   -5.25% (p=0.008 n=5)
Match/Easy0i/32K-16                                 443.3µ ± ∞ ¹    450.6µ ± ∞ ¹   +1.64% (p=0.008 n=5)
Match/Easy0i/1M-16                                  14.26m ± ∞ ¹    14.44m ± ∞ ¹        ~ (p=0.222 n=5)
Match/Easy0i/32M-16                                 454.8m ± ∞ ¹    459.0m ± ∞ ¹        ~ (p=0.056 n=5)
Match/Easy1/16-16                                   1.848n ± ∞ ¹    1.847n ± ∞ ¹        ~ (p=0.206 n=5)
Match/Easy1/32-16                                   20.78n ± ∞ ¹    20.95n ± ∞ ¹        ~ (p=0.841 n=5)
Match/Easy1/1K-16                                   292.0n ± ∞ ¹    278.6n ± ∞ ¹   -4.59% (p=0.008 n=5)
Match/Easy1/32K-16                                  14.19µ ± ∞ ¹    14.31µ ± ∞ ¹   +0.85% (p=0.008 n=5)
Match/Easy1/1M-16                                   513.3µ ± ∞ ¹    517.0µ ± ∞ ¹   +0.72% (p=0.008 n=5)
Match/Easy1/32M-16                                  16.58m ± ∞ ¹    16.69m ± ∞ ¹   +0.64% (p=0.008 n=5)
Match/Medium/16-16                                  1.849n ± ∞ ¹    1.847n ± ∞ ¹   -0.11% (p=0.024 n=5)
Match/Medium/32-16                                  319.8n ± ∞ ¹    312.1n ± ∞ ¹   -2.41% (p=0.008 n=5)
Match/Medium/1K-16                                  12.54µ ± ∞ ¹    12.66µ ± ∞ ¹   +0.97% (p=0.008 n=5)
Match/Medium/32K-16                                 496.9µ ± ∞ ¹    496.0µ ± ∞ ¹        ~ (p=0.056 n=5)
Match/Medium/1M-16                                  16.11m ± ∞ ¹    16.00m ± ∞ ¹   -0.63% (p=0.032 n=5)
Match/Medium/32M-16                                 516.5m ± ∞ ¹    513.1m ± ∞ ¹   -0.65% (p=0.032 n=5)
Match/Hard/16-16                                    1.848n ± ∞ ¹    1.847n ± ∞ ¹        ~ (p=0.238 n=5)
Match/Hard/32-16                                    527.2n ± ∞ ¹    508.4n ± ∞ ¹   -3.57% (p=0.008 n=5)
Match/Hard/1K-16                                    15.53µ ± ∞ ¹    15.42µ ± ∞ ¹   -0.68% (p=0.008 n=5)
Match/Hard/32K-16                                   636.5µ ± ∞ ¹    665.8µ ± ∞ ¹   +4.62% (p=0.008 n=5)
Match/Hard/1M-16                                    20.45m ± ∞ ¹    21.13m ± ∞ ¹   +3.30% (p=0.008 n=5)
Match/Hard/32M-16                                   654.5m ± ∞ ¹    671.9m ± ∞ ¹   +2.66% (p=0.008 n=5)
Match/Hard1/16-16                                   1.538µ ± ∞ ¹    1.499µ ± ∞ ¹   -2.54% (p=0.008 n=5)
Match/Hard1/32-16                                   2.965µ ± ∞ ¹    2.906µ ± ∞ ¹   -1.99% (p=0.008 n=5)
Match/Hard1/1K-16                                   91.28µ ± ∞ ¹    90.09µ ± ∞ ¹   -1.29% (p=0.008 n=5)
Match/Hard1/32K-16                                  2.996m ± ∞ ¹    3.311m ± ∞ ¹  +10.50% (p=0.008 n=5)
Match/Hard1/1M-16                                   95.77m ± ∞ ¹   105.87m ± ∞ ¹  +10.54% (p=0.008 n=5)
Match/Hard1/32M-16                                   3.069 ± ∞ ¹     3.399 ± ∞ ¹  +10.74% (p=0.008 n=5)
Match_onepass_regex/16-16                           120.9n ± ∞ ¹    117.4n ± ∞ ¹   -2.89% (p=0.008 n=5)
Match_onepass_regex/32-16                           211.8n ± ∞ ¹    207.5n ± ∞ ¹   -2.03% (p=0.008 n=5)
Match_onepass_regex/1K-16                           5.602µ ± ∞ ¹    5.548µ ± ∞ ¹        ~ (p=0.421 n=5)
Match_onepass_regex/32K-16                          185.6µ ± ∞ ¹    185.1µ ± ∞ ¹        ~ (p=0.690 n=5)
Match_onepass_regex/1M-16                           5.896m ± ∞ ¹    5.808m ± ∞ ¹   -1.50% (p=0.016 n=5)
Match_onepass_regex/32M-16                          193.4m ± ∞ ¹    185.5m ± ∞ ¹   -4.10% (p=0.008 n=5)
geomean                                             3.815µ          3.796µ         -0.51%

compilecmp linux/amd64:

file                                                                 before   after    Δ       %
runtime.s                                                            673118   672419   -699    -0.104%
runtime [cmd/compile].s                                              720475   719781   -694    -0.096%
math/rand/v2.s                                                       9394     9371     -23     -0.245%
bytes.s                                                              36026    35999    -27     -0.075%
vendor/golang.org/x/net/dns/dnsmessage.s                             76433    76193    -240    -0.314%
math/rand/v2 [cmd/compile].s                                         9394     9371     -23     -0.245%
strings.s                                                            43435    43414    -21     -0.048%
syscall.s                                                            82215    82183    -32     -0.039%
html.s                                                               6010     5949     -61     -1.015%
bytes [cmd/compile].s                                                36615    36588    -27     -0.074%
regexp/syntax.s                                                      81442    81299    -143    -0.176%
syscall [cmd/compile].s                                              82215    82183    -32     -0.039%
time.s                                                               90555    90507    -48     -0.053%
regexp.s                                                             58974    58876    -98     -0.166%
reflect.s                                                            176893   176829   -64     -0.036%
context.s                                                            14298    14234    -64     -0.448%
plugin.s                                                             3879     3847     -32     -0.825%
io/fs.s                                                              29026    29009    -17     -0.059%
strings [cmd/compile].s                                              43446    43425    -21     -0.048%
html [cmd/compile].s                                                 6010     5949     -61     -1.015%
time [cmd/compile].s                                                 90555    90507    -48     -0.053%
os.s                                                                 116321   116249   -72     -0.062%
regexp/syntax [cmd/compile].s                                        81442    81299    -143    -0.176%
context [cmd/compile].s                                              14298    14234    -64     -0.448%
io/fs [cmd/compile].s                                                29026    29009    -17     -0.059%
path/filepath.s                                                      19879    19842    -37     -0.186%
cmd/cgo/internal/cgotest.s                                           1965     1932     -33     -1.679%
reflect [cmd/compile].s                                              176893   176829   -64     -0.036%
regexp [cmd/compile].s                                               58974    58876    -98     -0.166%
crypto/cipher.s                                                      21706    21660    -46     -0.212%
runtime/trace.s                                                      14644    14634    -10     -0.068%
math/big.s                                                           170782   170250   -532    -0.312%
debug/dwarf.s                                                        105214   105141   -73     -0.069%
log.s                                                                15749    15603    -146    -0.927%
encoding/json.s                                                      118965   118933   -32     -0.027%
os/user.s                                                            10367    10326    -41     -0.395%
crypto/dsa.s                                                         4988     4974     -14     -0.281%
crypto/rsa.s                                                         29486    29474    -12     -0.041%
database/sql.s                                                       99574    99403    -171    -0.172%
encoding/gob.s                                                       146507   146475   -32     -0.022%
debug/macho.s                                                        29517    29421    -96     -0.325%
crypto/ed25519.s                                                     8648     8594     -54     -0.624%
internal/goroot.s                                                    3165     3107     -58     -1.833%
testing.s                                                            123472   123438   -34     -0.028%
archive/tar.s                                                        71179    71096    -83     -0.117%
go/doc/comment.s                                                     48429    48397    -32     -0.066%
vendor/golang.org/x/crypto/cryptobyte.s                              31717    31690    -27     -0.085%
internal/cgrouptest.s                                                4760     4686     -74     -1.555%
image/png.s                                                          34484    34479    -5      -0.014%
go/constant.s                                                        29502    29297    -205    -0.695%
internal/testenv.s                                                   22396    22331    -65     -0.290%
internal/pkgbits.s                                                   19609    19598    -11     -0.056%
testing/iotest.s                                                     15070    15018    -52     -0.345%
internal/runtime/gc/internal/gen.s                                   50837    50548    -289    -0.568%
crypto/internal/cryptotest.s                                         58607    58229    -378    -0.645%
crypto/ecdsa.s                                                       43878    43658    -220    -0.501%
cmd/internal/objabi.s                                                20244    20231    -13     -0.064%
math/big/internal/asmgen.s                                           74554    74422    -132    -0.177%
log/slog.s                                                           81620    81617    -3      -0.004%
net.s                                                                299158   299080   -78     -0.026%
cmd/vendor/golang.org/x/telemetry/internal/telemetry.s               4531     4472     -59     -1.302%
testing/fstest.s                                                     73370    73286    -84     -0.114%
log/syslog.s                                                         6457     6426     -31     -0.480%
vendor/golang.org/x/net/http/httpproxy.s                             7674     7666     -8      -0.104%
cmd/vendor/golang.org/x/telemetry/internal/counter.s                 31504    31493    -11     -0.035%
cmd/internal/pkgpath.s                                               4828     4810     -18     -0.373%
internal/trace.s                                                     190495   190463   -32     -0.017%
cmd/internal/telemetry/counter.s                                     1999     1979     -20     -1.001%
net/mail.s                                                           21912    21866    -46     -0.210%
mime/multipart.s                                                     30856    30806    -50     -0.162%
internal/trace/internal/testgen.s                                    12870    12850    -20     -0.155%
go/parser.s                                                          109753   109739   -14     -0.013%
crypto/x509.s                                                        184334   183966   -368    -0.200%
cmd/internal/pgo.s                                                   7886     7850     -36     -0.457%
cmd/internal/browser.s                                               1980     1962     -18     -0.909%
cmd/covdata.s                                                        40197    40180    -17     -0.042%
internal/fuzz.s                                                      90255    90234    -21     -0.023%
go/build.s                                                           74975    74722    -253    -0.337%
cmd/distpack.s                                                       29343    29056    -287    -0.978%
cmd/cover.s                                                          53513    53412    -101    -0.189%
cmd/internal/obj.s                                                   144804   144764   -40     -0.028%
os [cmd/compile].s                                                   116325   116253   -72     -0.062%
cmd/cgo.s                                                            217917   217878   -39     -0.018%
internal/exportdata.s                                                8849     8800     -49     -0.554%
cmd/dist.s                                                           179720   179253   -467    -0.260%
cmd/compile/internal/syntax.s                                        174526   174495   -31     -0.018%
cmd/asm/internal/lex.s                                               21635    21628    -7      -0.032%
cmd/internal/obj/riscv.s                                             149150   149118   -32     -0.021%
path/filepath [cmd/compile].s                                        19879    19842    -37     -0.186%
cmd/internal/obj/wasm.s                                              83633    83569    -64     -0.077%
crypto/tls.s                                                         405459   405103   -356    -0.088%
cmd/internal/obj/loong64.s                                           117422   117392   -30     -0.026%
log [cmd/compile].s                                                  15798    15652    -146    -0.924%
crypto/cipher [cmd/compile].s                                        21706    21660    -46     -0.212%
go/types.s                                                           592053   591930   -123    -0.021%
cmd/vendor/golang.org/x/telemetry/internal/telemetry [cmd/compile].s 4531     4472     -59     -1.302%
cmd/internal/objabi [cmd/compile].s                                  20244    20231    -13     -0.064%
encoding/json [cmd/compile].s                                        119184   119152   -32     -0.027%
go/internal/srcimporter.s                                            9957     9948     -9      -0.090%
internal/goroot [cmd/compile].s                                      3165     3107     -58     -1.833%
runtime/trace [cmd/compile].s                                        14703    14693    -10     -0.068%
go/internal/gccgoimporter.s                                          47218    47189    -29     -0.061%
cmd/vendor/golang.org/x/telemetry/internal/counter [cmd/compile].s   31563    31552    -11     -0.035%
go/doc/comment [cmd/compile].s                                       48488    48456    -32     -0.066%
cmd/compile/internal/base.s                                          44391    44379    -12     -0.027%
cmd/vendor/golang.org/x/tools/internal/analysis/analyzerutil.s       3957     3925     -32     -0.809%
math/big [cmd/compile].s                                             173023   172491   -532    -0.307%
cmd/asm.s                                                            3824     3749     -75     -1.961%
cmd/vendor/golang.org/x/tools/internal/diff/lcs.s                    22413    22289    -124    -0.553%
cmd/internal/telemetry/counter [cmd/compile].s                       1999     1979     -20     -1.001%
cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag.s          8886     8877     -9      -0.101%
go/constant [cmd/compile].s                                          29673    29468    -205    -0.691%
cmd/internal/obj [cmd/compile].s                                     218137   218102   -35     -0.016%
cmd/internal/pgo [cmd/compile].s                                     7945     7909     -36     -0.453%
internal/pkgbits [cmd/compile].s                                     37142    37115    -27     -0.073%
go/parser [cmd/compile].s                                            109812   109798   -14     -0.013%
cmd/compile/internal/base [cmd/compile].s                            44607    44595    -12     -0.027%
go/build [cmd/compile].s                                             75034    74781    -253    -0.337%
cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags.s   10379    10338    -41     -0.395%
cmd/go/internal/lockedfile.s                                         15477    15473    -4      -0.026%
cmd/internal/obj/loong64 [cmd/compile].s                             117481   117451   -30     -0.026%
cmd/internal/obj/wasm [cmd/compile].s                                83677    83613    -64     -0.076%
cmd/internal/obj/riscv [cmd/compile].s                               148985   148953   -32     -0.021%
cmd/vendor/golang.org/x/tools/internal/analysis/driverutil.s         31164    31100    -64     -0.205%
internal/exportdata [cmd/compile].s                                  8849     8800     -49     -0.554%
cmd/vendor/golang.org/x/mod/sumdb/dirhash.s                          12387    12366    -21     -0.170%
cmd/vendor/golang.org/x/tools/internal/typesinternal.s               24320    24295    -25     -0.103%
cmd/go/internal/fsys.s                                               60108    60040    -68     -0.113%
net/http.s                                                           603320   602752   -568    -0.094%
cmd/compile/internal/syntax [cmd/compile].s                          187371   187340   -31     -0.017%
cmd/cgo/internal/test.s                                              219885   219826   -59     -0.027%
net/http/httptest.s                                                  21757    21754    -3      -0.014%
cmd/compile/internal/types2.s                                        576035   575871   -164    -0.028%
net/http/cgi.s                                                       36196    36146    -50     -0.138%
net/http/httputil.s                                                  45557    45502    -55     -0.121%
cmd/compile/internal/objw.s                                          5710     5672     -38     -0.665%
net/http/pprof.s                                                     32053    32011    -42     -0.131%
internal/trace/traceviewer.s                                         34748    34695    -53     -0.153%
net/rpc.s                                                            44569    44361    -208    -0.467%
cmd/compile/internal/staticdata.s                                    21461    21446    -15     -0.070%
cmd/vendor/golang.org/x/telemetry/internal/crashmonitor.s            6104     6073     -31     -0.508%
cmd/go/internal/cfg.s                                                14419    14303    -116    -0.804%
cmd/vendor/golang.org/x/tools/go/analysis/passes/hostport.s          6834     6802     -32     -0.468%
cmd/vendor/golang.org/x/tools/go/types/objectpath.s                  19228    19118    -110    -0.572%
cmd/go/internal/imports.s                                            15978    15970    -8      -0.050%
cmd/vendor/golang.org/x/tools/internal/facts.s                       15249    15237    -12     -0.079%
cmd/vendor/golang.org/x/telemetry/internal/upload.s                  34546    33957    -589    -1.705%
cmd/vendor/golang.org/x/mod/sumdb.s                                  28991    28941    -50     -0.172%
cmd/vendor/golang.org/x/telemetry.s                                  7555     7420     -135    -1.787%
cmd/gofmt.s                                                          29924    29898    -26     -0.087%
cmd/go/internal/base.s                                               19950    19938    -12     -0.060%
cmd/vendor/golang.org/x/tools/internal/refactor/inline.s             161628   161596   -32     -0.020%
cmd/internal/script.s                                                89932    89811    -121    -0.135%
cmd/vendor/golang.org/x/tools/go/analysis/unitchecker.s              14865    14797    -68     -0.457%
cmd/vendor/golang.org/x/arch/riscv64/riscv64asm.s                    62049    62017    -32     -0.052%
cmd/vendor/golang.org/x/mod/zip.s                                    39525    39428    -97     -0.245%
cmd/compile/internal/typecheck.s                                     170567   170522   -45     -0.026%
cmd/go/internal/cache.s                                              37546    37451    -95     -0.253%
cmd/go/internal/gover.s                                              6733     6726     -7      -0.104%
cmd/vendor/golang.org/x/arch/arm/armasm.s                            30032    29991    -41     -0.137%
cmd/go/internal/auth.s                                               22485    22385    -100    -0.445%
cmd/go/internal/search.s                                             15362    15262    -100    -0.651%
cmd/vendor/golang.org/x/tools/go/analysis/passes/modernize.s         197385   196963   -422    -0.214%
cmd/go/internal/doc.s                                                62764    62590    -174    -0.277%
cmd/compile/internal/compare.s                                       10769    10758    -11     -0.102%
cmd/vendor/golang.org/x/arch/ppc64/ppc64asm.s                        208027   208005   -22     -0.011%
cmd/compile/internal/escape.s                                        72599    72560    -39     -0.054%
cmd/go/internal/mvs.s                                                30363    30339    -24     -0.079%
cmd/go/internal/vcweb.s                                              51575    51334    -241    -0.467%
cmd/go/internal/modindex.s                                           80742    80444    -298    -0.369%
cmd/vendor/golang.org/x/arch/x86/x86asm.s                            72057    72004    -53     -0.074%
cmd/compile/internal/objw [cmd/compile].s                            7408     7345     -63     -0.850%
cmd/go/internal/vcs.s                                                51661    51545    -116    -0.225%
cmd/go/internal/modfetch/codehost.s                                  110786   110689   -97     -0.088%
cmd/nm.s                                                             5055     4981     -74     -1.464%
cmd/pack.s                                                           8826     8804     -22     -0.249%
cmd/compile/internal/types2 [cmd/compile].s                          667403   667271   -132    -0.020%
cmd/internal/script/scripttest.s                                     40383    40149    -234    -0.579%
cmd/compile/internal/typecheck [cmd/compile].s                       196101   196056   -45     -0.023%
cmd/preprofile.s                                                     3127     3107     -20     -0.640%
cmd/compile/internal/staticdata [cmd/compile].s                      31032    31017    -15     -0.048%
cmd/go/internal/modfetch.s                                           134544   134056   -488    -0.363%
cmd/vendor/golang.org/x/tools/go/analysis/passes/atomic.s            2433     2408     -25     -1.028%
cmd/vendor/github.com/google/pprof/profile.s                         155233   155173   -60     -0.039%
cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl.s           29779    29182    -597    -2.005%
cmd/link/internal/loader.s                                           91163    91116    -47     -0.052%
cmd/compile/internal/escape [cmd/compile].s                          86596    86592    -4      -0.005%
cmd/go/internal/fips140.s                                            5054     5043     -11     -0.218%
cmd/vendor/github.com/google/pprof/internal/symbolz.s                4726     4674     -52     -1.100%
cmd/vendor/golang.org/x/tools/go/analysis/passes/framepointer.s      3703     3660     -43     -1.161%
cmd/vendor/golang.org/x/tools/go/analysis/passes/loopclosure.s       6869     6844     -25     -0.364%
cmd/vendor/golang.org/x/text/language.s                              46461    46443    -18     -0.039%
cmd/vendor/golang.org/x/text/internal.s                              2514     2502     -12     -0.477%
cmd/trace.s                                                          259231   258558   -673    -0.260%
cmd/vendor/golang.org/x/tools/go/analysis/passes/ctrlflow.s          3996     3987     -9      -0.225%
cmd/vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine.s  9587     9555     -32     -0.334%
cmd/vendor/golang.org/x/text/cases.s                                 38482    38463    -19     -0.049%
cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr.s         3150     3124     -26     -0.825%
cmd/vendor/github.com/ianlancetaylor/demangle.s                      302482   302444   -38     -0.013%
cmd/vendor/github.com/google/pprof/internal/report.s                 90542    90448    -94     -0.104%
cmd/vendor/github.com/google/pprof/internal/binutils.s               37434    37280    -154    -0.411%
cmd/vendor/rsc.io/markdown.s                                         114203   114108   -95     -0.083%
cmd/go/internal/modload.s                                            359362   358159   -1203   -0.335%
cmd/vendor/golang.org/x/build/relnote.s                              31599    31577    -22     -0.070%
cmd/vendor/github.com/google/pprof/internal/driver.s                 178419   177787   -632    -0.354%
cmd/go/internal/load.s                                               186922   186634   -288    -0.154%
cmd/link/internal/ld.s                                               643871   643415   -456    -0.071%
cmd/link/internal/riscv64.s                                          19743    19726    -17     -0.086%
cmd/go/internal/work.s                                               348917   348463   -454    -0.130%
cmd/go/internal/clean.s                                              14815    14755    -60     -0.405%
cmd/go/internal/list.s                                               29662    29630    -32     -0.108%
cmd/go/internal/tool.s                                               27842    27825    -17     -0.061%
cmd/go/internal/envcmd.s                                             49896    49872    -24     -0.048%
cmd/go/internal/test.s                                               72162    72098    -64     -0.089%
cmd/go/internal/bug.s                                                10603    10547    -56     -0.528%
cmd/go/internal/toolchain.s                                          29042    28890    -152    -0.523%
cmd/go/internal/modcmd.s                                             61916    61761    -155    -0.250%
cmd/go/internal/modget.s                                             79559    79358    -201    -0.253%
cmd/go/internal/workcmd.s                                            28612    28481    -131    -0.458%
cmd/go.s                                                             13367    13343    -24     -0.180%
cmd/compile/internal/ssa.s                                           3614387  3614418  +31     +0.001%
cmd/compile/internal/liveness.s                                      96901    96882    -19     -0.020%
cmd/compile/internal/ssa [cmd/compile].s                             3779800  3779973  +173    +0.005%
cmd/compile/internal/liveness [cmd/compile].s                        129898   129895   -3      -0.002%
cmd/compile/internal/ssagen.s                                        436780   436748   -32     -0.007%
cmd/compile/internal/ssagen [cmd/compile].s                          473190   473109   -81     -0.017%
cmd/compile/internal/walk [cmd/compile].s                            347940   347810   -130    -0.037%
cmd/compile/internal/walk.s                                          334528   334382   -146    -0.044%
cmd/compile/internal/noder.s                                         260365   260297   -68     -0.026%
cmd/compile/internal/noder [cmd/compile].s                           296865   296819   -46     -0.015%
cmd/compile/internal/gc.s                                            30442    30346    -96     -0.315%
cmd/compile/internal/gc [cmd/compile].s                              41682    41586    -96     -0.230%
total                                                                38124617 38101256 -23361  -0.061%

Change-Id: Id0b3770da69c6f666b3ff36741f75377001466c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/675335
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocmd/compile/internal/ssa: correct type of ARM64 conditional instructions
Ch1n-ch1nless [Fri, 21 Nov 2025 09:58:40 +0000 (12:58 +0300)]
cmd/compile/internal/ssa: correct type of ARM64 conditional instructions

The CCMP, CCMN, CCMPconst, and related instructions in ARM64Ops.go
were incorrectly set to type "Flag". This non-existent type caused
compilation failures during the "lower" and "late lower" passes.

Change them to the correct type, "Flags".

Change-Id: I4fbf96b8c7b051be901711948028a717ce953e5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/722780
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agointernal/runtime/gc/scan: add AVX512 impl of filterNil.
Junyang Shao [Wed, 19 Nov 2025 20:13:31 +0000 (20:13 +0000)]
internal/runtime/gc/scan: add AVX512 impl of filterNil.

Benchmark results:
ScanSpanPacked/cache=ram/pages=10368/sizeclass=25/pct=60-48          6.356Gi ± ∞ ¹    7.332Gi ± ∞ ¹        ~ (p=1.000 n=1) ²
ScanSpanPacked/cache=ram/pages=10368/sizeclass=25/pct=70-48          6.756Gi ± ∞ ¹    8.302Gi ± ∞ ¹        ~ (p=1.000 n=1) ²
ScanSpanPacked/cache=ram/pages=10368/sizeclass=25/pct=80-48          7.018Gi ± ∞ ¹    8.658Gi ± ∞ ¹        ~ (p=1.000 n=1) ²
ScanSpanPacked/cache=ram/pages=10368/sizeclass=25/pct=90-48          7.313Gi ± ∞ ¹    9.055Gi ± ∞ ¹        ~ (p=1.000 n=1) ²
ScanSpanPacked/cache=ram/pages=10368/sizeclass=25/pct=100-48         7.583Gi ± ∞ ¹    9.557Gi ± ∞ ¹        ~ (p=1.000 n=1) ²
geomean                                                              10.61Gi          14.83Gi        +39.81%

Almost a +40% on throughput.

Change-Id: I6f31a0f0202ec7f3c9d2bbffca5d6e377306fc25
Reviewed-on: https://go-review.googlesource.com/c/go/+/722040
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocmd/internal/objabi: remove -V=goexperiment internal special case
Dmitri Shuralyov [Fri, 14 Nov 2025 18:00:28 +0000 (13:00 -0500)]
cmd/internal/objabi: remove -V=goexperiment internal special case

This special case was added in CL 310171 for test/run.go use, as the
comment still says, but run.go (cmd/internal/testdir/testdir_test.go
by now) stopped using this in CL 310732. There don't seem to be any
other internal or external uses of this special case, so delete it.

Doing this kind of a cleanup can become harder as more time passes,
so try it as early as now and see how it goes.

Change-Id: Ib52aac51ef05166f7349cfc7d63b860a8ece7ec0
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/720620
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoruntime: go fmt
Michael Pratt [Thu, 20 Nov 2025 21:25:40 +0000 (16:25 -0500)]
runtime: go fmt

Change-Id: I6a6a636cf38ddb1dc6f2170361eb4093b81acdfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/722521
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
8 weeks agointernal/strconv: go fmt
Michael Pratt [Thu, 20 Nov 2025 21:25:40 +0000 (16:25 -0500)]
internal/strconv: go fmt

Change-Id: I6a6a636ccd140dc5318f45bb2dc7236a5a43b1cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/722523
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

8 weeks agointernal/trace: go fmt
Michael Pratt [Thu, 20 Nov 2025 21:25:40 +0000 (16:25 -0500)]
internal/trace: go fmt

Change-Id: I6a6a636c8f14008d3da6c526be10fa3386d4ec32
Reviewed-on: https://go-review.googlesource.com/c/go/+/722522
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
8 weeks agocmd/compile: fix integer overflow in prove pass
Jakub Ciolek [Wed, 19 Nov 2025 10:17:47 +0000 (11:17 +0100)]
cmd/compile: fix integer overflow in prove pass

The detectSliceLenRelation function incorrectly deduced lower bounds
for "len(s) - i" without checking if the subtraction could overflow
(e.g. when i is negative). This led to incorrect elimination of
bounds checks.

Fixes: #76355
Change-Id: I30ada0e5f1425929ddd8ae1b66e55096ec209b5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/721920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
8 weeks agocmd/compile/internal: fix typos
Jes Cok [Fri, 21 Nov 2025 16:08:00 +0000 (16:08 +0000)]
cmd/compile/internal: fix typos

Change-Id: I5974f5b460f827877f49f69aff01ce5042f511c0
GitHub-Last-Rev: 552d12c0e609a65481381191be6bbd9f353120f5
GitHub-Pull-Request: golang/go#76398
Reviewed-on: https://go-review.googlesource.com/c/go/+/722900
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
Auto-Submit: Keith Randall <khr@golang.org>

8 weeks agocmd/compile/internal/devirtualize: fix typos
Jes Cok [Fri, 21 Nov 2025 15:51:03 +0000 (15:51 +0000)]
cmd/compile/internal/devirtualize: fix typos

Change-Id: I4f5a89f452a252018072d067da4cdb9a6cb0f4fe
GitHub-Last-Rev: 7eb108d3878109ccb9846d97b2adc7ea3003772a
GitHub-Pull-Request: golang/go#76396
Reviewed-on: https://go-review.googlesource.com/c/go/+/722860
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>

8 weeks agocmd/link: support loading R_LARCH_PCREL20_S2 and R_LARCH_CALL36 relocs
WANG Xuerui [Mon, 6 Oct 2025 10:09:14 +0000 (18:09 +0800)]
cmd/link: support loading R_LARCH_PCREL20_S2 and R_LARCH_CALL36 relocs

Host libgcc.a (among other libraries) on loong64 systems may contain
such relocs if built with the "medium" code model and/or linker
relaxation, which is increasingly the case. Make the internal linker
aware of these for cgo interopability going forward.

While at it, fix some of the comments for the loong64-specific
RelocTypes.

Fixes #75562

Change-Id: I0810969dcd229c5131ef06b0f70f51d81a3be4cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/709717
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agocmd/internal/obj/loong64: add {,X}VSLT.{B/H/W/V}{,U} instructions support
Guoqi Chen [Tue, 18 Nov 2025 13:10:51 +0000 (21:10 +0800)]
cmd/internal/obj/loong64: add {,X}VSLT.{B/H/W/V}{,U} instructions support

  Go asm syntax:
 VSLT{B,H,W,V}    V1,   V2, V3
 VSLT{B,H,W,V}U   V1,   V2, V3
 VSLT{B,H,W,V}    $-2,  V2, V3
 VSLT{B,H,W,V}U   $8,   V2, V3
XVSLT{B,H,W,V}    X1,   X2, X3
XVSLT{B,H,W,V}U   X1,   X2, X3
XVSLT{B,H,W,V}    $-16, X2, X3
XVSLT{B,H,W,V}U   $31,  X2, X3

  Equivalent platform assembler syntax:
 vslt.{b,h,w,d}    v3, v2, v1
 vslt.{b,h,w,d}u   v3, v2, v1
 vslti.{b,h,w,d}   v3, v2, $-2
 vslti.{b,h,w,d}u  v3, v2, $8
xvslt.{b,h,w,d}    x3, x2, x1
xvslt.{b,h,w,d}u   x3, x2, x1
xvslti.{b,h,w,d}   x3, x2, $-16
xvslti.{b,h,w,d}u  x3, x2, $31

Change-Id: Iccfb65c0c19b62d2c5ec279a077393c68e1bf7d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/721620
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocrypto/tls: add QUICErrorEvent
Damien Neil [Sat, 8 Nov 2025 19:22:59 +0000 (11:22 -0800)]
crypto/tls: add QUICErrorEvent

Add a new QUICEvent type for reporting errors.
This provides a way to report errors that don't occur as a result of
QUICConn.Start, QUICConn.HandleData, or QUICConn.SendSessionTicket.

Fixes #75108

Change-Id: I941371a21f26b940e75287a66d7e0211fc0baab1
Reviewed-on: https://go-review.googlesource.com/c/go/+/719040
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
8 weeks agonet/http/httputil: wrap ReverseProxy's outbound request body so Close is a noop
Nicholas S. Husin [Wed, 19 Nov 2025 22:10:02 +0000 (17:10 -0500)]
net/http/httputil: wrap ReverseProxy's outbound request body so Close is a noop

Within ReverseProxy, we are currently sending a clone of our inbound
request (from client) as our outbound request (to upstream). However,
the clone of the request has a shallow copy of the request body. As a
result, when the outbound request body is closed, the inbound request
body (i.e. the outbound request body of the client) will also be closed.

This causes an unfortunate effect where we would infinitely hang when a
client sends a request with a 100-continue header via a ReverseProxy,
but the ReverseProxy fails to make a connection to the upstream server.

When this happens, the ReverseProxy's outbound request body would be
closed, which in turns also closes the client's request body.
Internally, when we close a request body, we would try to consume and
discard the content. Since the client has yet to actually send the body
content (due to 100-continue header) though, an infinite hang occurs.

To prevent this, we make sure that closing an outbound request body from
a ReverseProxy is a noop.

For #75933

Change-Id: I52dc7247f689f35a6e93d1f32b2d003d90e9d2c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/722160
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoruntime: track goroutine location until actual STW
Michael Pratt [Thu, 20 Nov 2025 21:21:09 +0000 (16:21 -0500)]
runtime: track goroutine location until actual STW

TestTraceSTW / TestTraceGCSTW currently tracks the location (M/P) of the
target goroutines until it reaches the "start" log message, assuming the
actual STW comes immediately afterwards.

On 386 with TestTraceGCSTW, it actually tends to take >10ms after the
start log before the STW actually occurs. This is enough time for sysmon
to preempt the target goroutines and migration them to another location.

Fix this by continuing tracking all the way until the STW itself occurs.
We still keep the start log message so we can ignore any STW (if any)
before we expect.

Cq-Include-Trybots: luci.golang.try:gotip-linux-386-longtest,gotip-linux-amd64-longtest
Change-Id: I6a6a636cf2dcb18d8b33ac4ad88333cabff2eabb
Reviewed-on: https://go-review.googlesource.com/c/go/+/722520
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocmd/vendor: update to x/tools@68724af
Alan Donovan [Thu, 20 Nov 2025 21:45:17 +0000 (16:45 -0500)]
cmd/vendor: update to x/tools@68724af

This causes the go1.26 vet printf analyzer to deduce printf
wrappers via interface methods (#76368).

For #76368

Change-Id: I80e6d3b21bdffb5d925a162af7c4b21b1357bb89
Reviewed-on: https://go-review.googlesource.com/c/go/+/722540
Auto-Submit: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoruntime: disable stack allocation tests on sanitizers
Keith Randall [Thu, 20 Nov 2025 18:37:10 +0000 (10:37 -0800)]
runtime: disable stack allocation tests on sanitizers

CL 707755 broke the asan/msan builders.

Change-Id: Ic9738140999a9bcfc94cecfe0964a5f1bc243c56
Reviewed-on: https://go-review.googlesource.com/c/go/+/722480
Auto-Submit: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
8 weeks agonet/url: permit colons in the host of postgresql:// URLs
Damien Neil [Wed, 19 Nov 2025 23:32:04 +0000 (15:32 -0800)]
net/url: permit colons in the host of postgresql:// URLs

PostgreSQL's postgresql:// URL scheme permits a comma-separated list of
host:ports to appear in the host subcomponent:
https://www.postgresql.org/docs/11/libpq-connect.html#LIBPQ-MULTIPLE-HOSTS

While this is not compliant with RFC 3986, it's something we've accepted
for a long time. Continue to accept colons in the host when the URL
scheme is "postgresql".

Fixes #75859

Change-Id: Iaa2e82b0be11d8e034e10dd7f4d6070039acfa2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/722300
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
8 weeks agoencoding/json: remove linknames
Sean Liao [Mon, 17 Nov 2025 19:16:37 +0000 (19:16 +0000)]
encoding/json: remove linknames

The linknames have been removed in the latest commits:

isValidNumber, typeFields:
https://github.com/bytedance/sonic/commit/908af5dfaf7d509db1f2c2b1c43f4df728db80a6

unquoteBytes:
https://github.com/bytedance/sonic/commit/8e9090a84be10962046197f1867d297d3e73020a

For #67401

Change-Id: I30b057137932fcf267014ab5470c417298765249
Reviewed-on: https://go-review.googlesource.com/c/go/+/721160
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agomime: add missing path for mime types in godoc
Taichi Maeda [Tue, 18 Nov 2025 10:05:12 +0000 (19:05 +0900)]
mime: add missing path for mime types in godoc

ExtensionsByType was missing godoc for a mime.types file path
that was added in CL 236677.

Change-Id: Ia04fa90f01490fc1f063c4905aea65d240935cab
Reviewed-on: https://go-review.googlesource.com/c/go/+/721580
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoos/signal: make NotifyContext cancel the context with a cause
Filippo Valsorda [Tue, 18 Nov 2025 16:19:04 +0000 (17:19 +0100)]
os/signal: make NotifyContext cancel the context with a cause

This is especially useful when combined with the nesting semantics of
context.Cause, and with errgroup's use of CancelCauseFunc.

For example, with the following code

ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
defer stop()
serveGroup, ctx := errgroup.WithContext(ctx)

calling context.Cause(ctx) after serveGroup.Wait() will return either
"interrupt signal received" (if that happens first) or the error from
serveGroup.

Change-Id: Ie181f5f84269f6e39defdad2d5fd8ead6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/721700
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Commit-Queue: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agonet/http: drop unused "broken" field from persistConn
Damien Neil [Wed, 19 Nov 2025 22:35:20 +0000 (14:35 -0800)]
net/http: drop unused "broken" field from persistConn

Change-Id: Ic65cf98c090c73299b5e88e642e91139315d8e52
Reviewed-on: https://go-review.googlesource.com/c/go/+/722221
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
8 weeks agocmd/internal/obj/x86: handle global reference in From3 in dynlink mode
Cherry Mui [Wed, 19 Nov 2025 22:32:12 +0000 (17:32 -0500)]
cmd/internal/obj/x86: handle global reference in From3 in dynlink mode

In dynlink mode, we rewrite reference to a global variable to
a load from the GOT. Currently this code does not handle the case
that the global reference is in From3 of a Prog. Most instructions
don't expect a memory operand in From3, but some do, like
VGF2P8AFFINEQB. Handle this case.

Change-Id: Ibb6773606e6967bcc629d9ef5dac6e050f4008ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/722181
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agospec: adjust rule for type parameter on RHS of alias declaration
Robert Griesemer [Tue, 18 Nov 2025 23:47:44 +0000 (15:47 -0800)]
spec: adjust rule for type parameter on RHS of alias declaration

Per discussion on issue #75885, a type parameter on the RHS of an alias
declaration must not be declared in the same declaration (but it may be
declared by an enclosing function). This relaxes the spec slightly and
allows for (pre-existing) test cases.

Add a corresponding check to the type checker (there was no check for
type parameters on the RHS of alias declarations at all, before).

Fixes #75884.
Fixes #75885.

Change-Id: I1e5675978e6423d626c068829d4bf5e90035ea82
Reviewed-on: https://go-review.googlesource.com/c/go/+/721820
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agonet/http: correctly close fake net.Conns
Damien Neil [Wed, 19 Nov 2025 19:25:49 +0000 (11:25 -0800)]
net/http: correctly close fake net.Conns

Fix an inverted test in fakeNetConn.Close that caused closing
a connection to not break the other half of the connection.

Change-Id: I4e53f78402f8e503c749d57f294a4524abdccfb5
Reviewed-on: https://go-review.googlesource.com/c/go/+/722220
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocmd/compile: stack allocate backing stores during append
khr@golang.org [Fri, 12 Sep 2025 21:43:19 +0000 (14:43 -0700)]
cmd/compile: stack allocate backing stores during append

We can already stack allocate the backing store during append if the
resulting backing store doesn't escape. See CL 664299.

This CL enables us to often stack allocate the backing store during
append *even if* the result escapes. Typically, for code like:

    func f(n int) []int {
        var r []int
        for i := range n {
            r = append(r, i)
        }
        return r
    }

the backing store for r escapes, but only by returning it.
Could we operate with r on the stack for most of its lifeime,
and only move it to the heap at the return point?

The current implementation of append will need to do an allocation
each time it calls growslice. This will happen on the 1st, 2nd, 4th,
8th, etc. append calls. The allocations done by all but the
last growslice call will then immediately be garbage.

We'd like to avoid doing some of those intermediate allocations
if possible. We rewrite the above code by introducing a move2heap
operation:

    func f(n int) []int {
        var r []int
        for i := range n {
            r = append(r, i)
        }
        r = move2heap(r)
        return r
    }

Using the move2heap runtime function, which does:

    move2heap(r):
        If r is already backed by heap storage, return r.
        Otherwise, copy r to the heap and return the copy.

Now we can treat the backing store of r allocated at the
append site as not escaping. Previous stack allocation
optimizations now apply, which can use a fixed-size
stack-allocated backing store for r when appending.

See the description in cmd/compile/internal/slice/slice.go
for how we ensure that this optimization is safe.

Change-Id: I81f36e58bade2241d07f67967d8d547fff5302b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/707755
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoruntime: select GC mark workers during start-the-world
Michael Pratt [Mon, 17 Nov 2025 21:08:21 +0000 (16:08 -0500)]
runtime: select GC mark workers during start-the-world

When the GC starts today, procresize and startTheWorldWithSema don't
consider the additional Ps required to run the mark workers. procresize
and startTheWorldWithSema resume only the Ps necessary to run the normal
user goroutines.

Once those Ps start, findRunnable and findRunnableGCWorker determine
that a GC worker is necessary and run the worker instead, calling wakep
to wake another P to run the original user goroutine.

This is unfortunate because it disrupts the intentional placement of Ps
on Ms that procresize does. It also has the unfortunate side effect of
slightly delaying start-the-world time, as it takes several sequential
wakeps to get all Ps started.

To address this, procresize explicitly assigns GC mark workers to Ps
before starting the world. The assignment occurs _after_ selecting
runnable Ps, so that we prefer to select Ps that were previously idle.

Note that if fewer than 25% of Ps are idle then we won't be able to
assign all dedicated workers, and some of the Ps intended for user
goroutines will convert to dedicated workers once they reach
findRunnableGCWorker.

Also note that stack scanning temporarily suspends the goroutine. Resume
occurs through ready, which will move the goroutine to the local runq of
the P that did the scan. Thus there is still a source of migration at
some point during the GC.

For #65694.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest
Change-Id: I6a6a636c51f39f4f4bc716aa87de68f6ebe163a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/721002
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
8 weeks agoruntime: split findRunnableGCWorker in two
Michael Pratt [Mon, 17 Nov 2025 20:09:50 +0000 (15:09 -0500)]
runtime: split findRunnableGCWorker in two

The first part, assignWaitingGCWorker selects a mark worker (if any) and
assigns it to the P. The second part, findRunnableGCWorker, is
responsible for actually marking the worker as runnable and updating the
CPU limiter.

The advantage of this split is that assignWaitingGCWorker is safe to do
during STW, which will allow the next CL to make selections during
procresize.

This change is a semantic no-op in preparation for the next CL.

For #65694.

Change-Id: I6a6a636c8beb212185829946cfa1e49f706ac31a
Reviewed-on: https://go-review.googlesource.com/c/go/+/721001
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

8 weeks agogo/version: use "custom" as an example of a version suffix
Dmitri Shuralyov [Fri, 14 Nov 2025 20:40:43 +0000 (15:40 -0500)]
go/version: use "custom" as an example of a version suffix

The suffix in a non-standard toolchain version can be any string. Show
more of a middle ground example of a non-standard version suffix,
aligning it with the example used at https://go.dev/doc/toolchain#name.

For #75953.

Change-Id: I98f9c4de98316aecf76c017eb13cf25582c8939c
Reviewed-on: https://go-review.googlesource.com/c/go/+/720621
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
8 weeks agocmd/compile: Implement LoweredZeroLoop with LSX Instruction on loong64
Guoqi Chen [Mon, 17 Nov 2025 03:33:04 +0000 (11:33 +0800)]
cmd/compile: Implement LoweredZeroLoop with LSX Instruction on loong64

goos: linux
goarch: loong64
pkg: runtime
cpu: Loongson-3A6000 @ 2500.00MHz
                   |   old.txt    |               new.txt               |
                   |    sec/op    |   sec/op     vs base                |
ClearFat256           6.406n ± 0%   3.329n ± 1%  -48.03% (p=0.000 n=10)
ClearFat512          12.810n ± 0%   7.607n ± 0%  -40.62% (p=0.000 n=10)
ClearFat1024          25.62n ± 0%   14.01n ± 0%  -45.32% (p=0.000 n=10)
ClearFat1032          26.02n ± 0%   14.28n ± 0%  -45.14% (p=0.000 n=10)
ClearFat1040          26.02n ± 0%   14.41n ± 0%  -44.62% (p=0.000 n=10)
MemclrKnownSize192    4.804n ± 0%   2.827n ± 0%  -41.15% (p=0.000 n=10)
MemclrKnownSize248    6.561n ± 0%   4.371n ± 0%  -33.38% (p=0.000 n=10)
MemclrKnownSize256    6.406n ± 0%   3.335n ± 0%  -47.94% (p=0.000 n=10)
geomean               11.41n        6.453n       -43.45%

goos: linux
goarch: loong64
pkg: runtime
cpu: Loongson-3C5000 @ 2200.00MHz
                   |   old.txt    |               new.txt               |
                   |    sec/op    |   sec/op     vs base                |
ClearFat256          14.570n ± 0%   7.284n ± 0%  -50.01% (p=0.000 n=10)
ClearFat512           29.13n ± 0%   14.57n ± 0%  -49.98% (p=0.000 n=10)
ClearFat1024          58.26n ± 0%   29.15n ± 0%  -49.97% (p=0.000 n=10)
ClearFat1032          58.73n ± 0%   29.15n ± 0%  -50.36% (p=0.000 n=10)
ClearFat1040          59.18n ± 0%   29.26n ± 0%  -50.56% (p=0.000 n=10)
MemclrKnownSize192   10.930n ± 0%   5.466n ± 0%  -49.99% (p=0.000 n=10)
MemclrKnownSize248   14.110n ± 0%   6.772n ± 0%  -52.01% (p=0.000 n=10)
MemclrKnownSize256   14.570n ± 0%   7.285n ± 0%  -50.00% (p=0.000 n=10)
geomean               25.75n        12.78n       -50.36%

Change-Id: I88d7b6ae2f6fc3f095979f24fb83ff42a9d2d42e
Reviewed-on: https://go-review.googlesource.com/c/go/+/720940
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
8 weeks agocmd/internal/obj/loong64: add MULW.D.W[U] instructions
Xiaolin Zhao [Tue, 18 Nov 2025 02:55:19 +0000 (10:55 +0800)]
cmd/internal/obj/loong64: add MULW.D.W[U] instructions

Go asm syntax:
MULWVW RK, RJ, RD
MULWVWU RK, RJ, RD

Equivalent platform assembler syntax:
mulw.d.w rd, rj, rk
mulw.d.wu rd, rj, rk

Change-Id: Ie46a21904a4c25d04200b0663f83072c38a76c6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/721521
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Keith Randall <khr@google.com>
8 weeks agocrypto: add Encapsulator and Decapsulator interfaces
Filippo Valsorda [Mon, 22 Sep 2025 12:12:53 +0000 (14:12 +0200)]
crypto: add Encapsulator and Decapsulator interfaces

Updates #75300

Change-Id: I6a6a6964a0ab36ee3132d8481515c34c86011c13
Reviewed-on: https://go-review.googlesource.com/c/go/+/705796
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocrypto/ecdh: add KeyExchanger interface
Filippo Valsorda [Mon, 22 Sep 2025 12:12:15 +0000 (14:12 +0200)]
crypto/ecdh: add KeyExchanger interface

Updates #75300

Change-Id: I6a6a6964bbfa1f099c74d0a3fb3f7894d7b1b832
Reviewed-on: https://go-review.googlesource.com/c/go/+/705795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
8 weeks agogo/types, types2: fix object path for grouped declaration statements
Mark Freeman [Wed, 19 Nov 2025 20:10:24 +0000 (15:10 -0500)]
go/types, types2: fix object path for grouped declaration statements

CL 715840 deferred popping from the object path during handling of
grouped declaration statements, which leaves extra objects on the
path since this executes in a loop.

Surprisingly, no test exercised this. This change fixes this small
bug and adds a supporting test.

Fixes #76366

Change-Id: I7fc038b39d3871eea3e60855c46614b463bcfa4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/722060
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agospec: escape double-ampersands
zigo101 [Mon, 17 Nov 2025 02:33:01 +0000 (02:33 +0000)]
spec: escape double-ampersands

Change-Id: I7ce375f975a86e4c2494d2003aeb9b4a86caff3e
GitHub-Last-Rev: a368bc020816cdadb06a918bd90576b490879ae8
GitHub-Pull-Request: golang/go#76299
Reviewed-on: https://go-review.googlesource.com/c/go/+/720460
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocmd/compile: fix control flow for unsigned divisions proof relations
Jorropo [Tue, 18 Nov 2025 00:26:01 +0000 (01:26 +0100)]
cmd/compile: fix control flow for unsigned divisions proof relations

The continue used to make sense since I first wrote this patch with a loop,
for testing the commutativity of the add.

This was refactored to just try both but I forgot to fix the continue.

Change-Id: I91466a052d5d8ee7193084a71faf69bd27e36d2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/721204
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>

8 weeks agocmd/compile: cleanup useless if statement in prove
Jorropo [Tue, 18 Nov 2025 00:18:30 +0000 (01:18 +0100)]
cmd/compile: cleanup useless if statement in prove

Change-Id: Icf5db366b311b5f88809dd07f22cf4bfdead516c
Reviewed-on: https://go-review.googlesource.com/c/go/+/721203
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agotest: go fmt prove.go tests
Jorropo [Mon, 17 Nov 2025 23:54:38 +0000 (00:54 +0100)]
test: go fmt prove.go tests

Change-Id: Ia4c2ceffcf2bfde862e9dba02a4b38245f868692
Reviewed-on: https://go-review.googlesource.com/c/go/+/721202
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>

8 weeks agomath: switch s390x math.Pow to generic implementation
Srinivas Pokala [Fri, 14 Nov 2025 13:21:37 +0000 (14:21 +0100)]
math: switch s390x math.Pow to generic implementation

The s390x assembly implementation of math.Pow incorrectly handles
certain subnormal cases. This change switches the function to use the
generic implementation instead.

Updates #76247

Cq-Include-Trybots: luci.golang.try:gotip-linux-s390x
Change-Id: I794339080d5a7acf79bbffaeb0214809006fd30c
Reviewed-on: https://go-review.googlesource.com/c/go/+/720540
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Kiran M Vijay IBM <kiran.m.vijay@ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
8 weeks agoruntime: add dlog.hexdump
Austin Clements [Tue, 10 Jun 2025 23:19:34 +0000 (19:19 -0400)]
runtime: add dlog.hexdump

Change-Id: I8149ab9314216bb8f9bf58da55633e2587d75851
Reviewed-on: https://go-review.googlesource.com/c/go/+/681376
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoruntime: add hexdumper
Austin Clements [Tue, 10 Jun 2025 23:19:08 +0000 (19:19 -0400)]
runtime: add hexdumper

Currently, we have a simple hexdumpWords facility for debugging. It's
useful but pretty limited.

This CL adds a much more configurable and capable "hexdumper". It can
be configured for any word size (including bytes), handles unaligned
data, includes an ASCII dump, and accepts data in multiple slices. It
also has a much nicer "mark" facility for annotating the hexdump that
isn't limited to a single character per word.

We use this to improve our existing hexdumps, particularly the new
mark facility. The next CL will integrate hexdumps into debuglog,
which will make use of several other new capabilities.

Also this adds an actual test.

The output looks like:

                       7 6 5 4  3 2 1 0   f e d c  b a 9 8  0123456789abcdef
    000000c00006ef70:                    03000000 00000000          ........
    000000c00006ef8000000000 0053da80  000000c0 000bc380  ..S.............
                      ^ <testing.tRunner.func2+0x0>
    000000c00006ef9000000000 0053dac0  000000c0 000bc380  ..S.............
                      ^ <testing.tRunner.func1+0x0>
    000000c00006efa0000000c0 0006ef90  000000c0 0006ef80  ................
    000000c00006efb0000000c0 0006efd0  00000000 0053eb65  ........e.S.....
                                         ^ <testing.(*T).Run.gowrap1+0x25>
    000000c00006efc0000000c0 000bc380  00000000 009aaae8  ................
    000000c00006efd000000000 00000000  00000000 00496b01  .........kI.....
                                         ^ <runtime.goexit+0x1>
    000000c00006efe000000000 00000000  00000000 00000000  ................
    000000c00006eff000000000 00000000                     ........

The header gives column labels, indicating the order of bytes within
the following words. The addresses on the left are always 16-byte
aligned so it's easy to combine that address with the column header to
determine the full address of a byte. Annotations are no longer
interleaved with the data, so the data stays in nicely aligned
columns. The annotations are also now much more flexible, including
support for multiple annotations on the same word (not shown).

Change-Id: I27e83800a1f6a7bdd3cc2c59614661a810a57d4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/681375
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Austin Clements <austin@google.com>

8 weeks agoRevert "net/http: do not discard body content when closing it within request handlers"
Nicholas S. Husin [Tue, 18 Nov 2025 17:32:44 +0000 (12:32 -0500)]
Revert "net/http: do not discard body content when closing it within request handlers"

This reverts commit cb0d9980f5721715ebb73dd2e580eaa11c2ddee2.

Reason for revert: the old behavior seems to be relied on by current
users, e.g.
https://github.com/connectrpc/connect-go/blob/cb2e11fb88c9a61804043355a619c12d4a30a1a5/protocol_connect.go#L837.

For #75933

Change-Id: I996280238e5c70a8d760a0b31e3a13c6a44b8616
Reviewed-on: https://go-review.googlesource.com/c/go/+/721761
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
8 weeks agocmd/compile: prefer fixed registers for values
Keith Randall [Mon, 17 Nov 2025 23:33:01 +0000 (15:33 -0800)]
cmd/compile: prefer fixed registers for values

For this code:

func f() (int, int) {
return 0, 0
}

We currently generate on arm64:

   MOVD ZR, R0
   MOVD R0, R1

This CL changes that to

   MOVD ZR, R0
   MOVD ZR, R1

Probably not a big performance difference, but it makes the generated
code clearer.

A followup-ish CL from 633075 when the zero fixed register was exposed
to the register allocator.

Change-Id: I869a92817dcbbca46c900999fab538e76e10ed05
Reviewed-on: https://go-review.googlesource.com/c/go/+/721440
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocmd/compile: fold boolean NOT into branches
Keith Randall [Tue, 18 Nov 2025 06:40:26 +0000 (22:40 -0800)]
cmd/compile: fold boolean NOT into branches

Gets rid of an EOR $1 instruction.

Change-Id: Ib032b0cee9ac484329c978af9b1305446f8d5dac
Reviewed-on: https://go-review.googlesource.com/c/go/+/721501
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Keith Randall <khr@google.com>
8 weeks agocmd/link: align sections, not symbols after DWARF compress
Cherry Mui [Mon, 17 Nov 2025 22:27:21 +0000 (17:27 -0500)]
cmd/link: align sections, not symbols after DWARF compress

After DWARF compression, we recompute the symbol and section
addresses. On Windows, we need to align the sections to
PEFILEALIGN. But the code actually apply the alignment to every
symbol. This works mostly fine as after compression a section
usually contains a single symbol (the compressed data). But if the
compression is not beneficial, it leaves with the original set of
symbols, which could be more than one. Applying alignment to every
symbol causing the section size too big, no longer matching the
size we computed before compression.

Fixes #76022.

Change-Id: I2246045955405997c77e54001bbb83f9ccd1ee7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/721340
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
8 weeks agoruntime: do not print recovered when double panic with the same value
Youlin Feng [Wed, 29 Oct 2025 05:11:48 +0000 (13:11 +0800)]
runtime: do not print recovered when double panic with the same value

Show the "[recovered, repanicked]" message only when it is repanicked
after recovered. For the duplicated panics that not recovered, do not
show this message.

Fixes #76099

Change-Id: I87282022ebe44c6f6efbe3239218be4a2a7b1104
Reviewed-on: https://go-review.googlesource.com/c/go/+/716020
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

8 weeks agocmd/asm,cmd/compile,cmd/internal/obj/riscv: use compressed instructions on riscv64
Joel Sing [Thu, 25 Sep 2025 19:05:49 +0000 (05:05 +1000)]
cmd/asm,cmd/compile,cmd/internal/obj/riscv: use compressed instructions on riscv64

Make use of compressed instructions on riscv64 - add a compress
pass to the end of the assembler, which replaces non-compressed
instructions with compressed alternatives if possible.

Provide a `compressinstructions` compiler and assembler debug
flag, such that the compression pass can be disabled via
`-asmflags=all=-d=compressinstructions=0` and
`-gcflags=all=-d=compressinstructions=0`. Note that this does
not prevent the explicit use of compressed instructions via
assembly.

Note that this does not make use of compressed control transfer
instructions - this will be implemented in later changes.

Reduces the text size of a hello world binary by ~121KB
and reduces the text size of the go binary on riscv64 by ~1.21MB
(between 8-10% in both cases).

Updates #71105

Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64
Change-Id: I24258353688554042c2a836deed4830cc673e985
Reviewed-on: https://go-review.googlesource.com/c/go/+/523478
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
8 weeks agocmd/internal/sys,internal/goarch,runtime: enable the use of compressed instructions...
Joel Sing [Sun, 27 Aug 2023 09:35:33 +0000 (19:35 +1000)]
cmd/internal/sys,internal/goarch,runtime: enable the use of compressed instructions on riscv64

Enable the use of compressed instructions on riscv64 by reducing
the PC quantum to two bytes and reducing the minimum instruction
length to two bytes. Change gostartcall on riscv64 to land at
two times the PC quantum into goexit, so that we retain four byte
alignment and revise the NOP instructions in goexit to ensure that
they are never compressed. Additionally, adjust PCALIGN so that it
correctly handles two byte offsets.

Fixes #47560
Updates #71105

Cq-Include-Trybots: luci.golang.try:gotip-linux-riscv64
Change-Id: I4329a8fbfcb4de636aadaeadabb826bc22698640
Reviewed-on: https://go-review.googlesource.com/c/go/+/523477
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
8 weeks agodebug/elf: sync new loong64 relocation types up to LoongArch ELF psABI v20250521
WANG Xuerui [Sat, 13 Sep 2025 07:57:12 +0000 (15:57 +0800)]
debug/elf: sync new loong64 relocation types up to LoongArch ELF psABI v20250521

Add several new relocation types defined in newer versions of LoongArch
ELF psABI v20250521, part of the v2.40 spec bundle. The new relocations
are seeing increased adoption because distributions are moving to newer
GNU/LLVM toolchain versions, so Go's internal linker must be prepared to
handle some of them, especially R_LARCH_CALL36 because the ecosystem is
slowly migrating to the "medium" code model by default.

The constants R_LARCH_DELETE and R_LARCH_CFA were removed in LoongArch
ELF psABI v20231102 (spec bundle v2.20), but they are already part of
the public API, so they are retained for now for upholding the go1
compatibility guarantee.

Corresponding binutils implementation:

* R_LARCH_CALL36: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=dc5f359ed6a36d2c895d89c3e4886f3a2b6d9232
* TLSDESC: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=26265e7fdf19d461563388495b6799eb3719f80a
* TLS {LD,GD,DESC} relaxation: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae296cc45258b95223210263d1b91115e84beb56
* TLS LE relaxation: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=775dead218e12e3fb94481c7a99aa0238d6a9138

Updates #75562

See: https://github.com/loongson/la-abi-specs/blob/v2.40/laelf.adoc
See: https://github.com/loongson-community/discussions/issues/43
Change-Id: Ib023e0b6becc0862d27afc419d3eb84c737359db
Reviewed-on: https://go-review.googlesource.com/c/go/+/709716
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn>
8 weeks agocmd/compile: use 32x32->64 multiplies on arm64
Keith Randall [Mon, 17 Nov 2025 20:47:04 +0000 (12:47 -0800)]
cmd/compile: use 32x32->64 multiplies on arm64

Gets rid of some sign extensions.

Change-Id: Ie67ef36b4ca1cd1a2cd9fa5d84578db553578a22
Reviewed-on: https://go-review.googlesource.com/c/go/+/721241
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Keith Randall <khr@google.com>
8 weeks agoruntime: relax TestMemoryLimit on darwin a bit more
Keith Randall [Thu, 2 Oct 2025 20:09:03 +0000 (13:09 -0700)]
runtime: relax TestMemoryLimit on darwin a bit more

Add 8MB more. Covers most of the failures watchflakes has seen.

Fixes #73136

Change-Id: I593c599a9519b8b31ed0f401d4157d27ac692587
Reviewed-on: https://go-review.googlesource.com/c/go/+/708617
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@google.com>