]> git.feebdaed.xyz Git - 0xmirror/go.git/log
0xmirror/go.git
3 weeks ago[dev.simd] internal/buildcfg: default-disable simd experiment, for merge w/ master
David Chase [Wed, 3 Dec 2025 19:20:55 +0000 (14:20 -0500)]
[dev.simd] internal/buildcfg: default-disable simd experiment, for merge w/ master

this will be undone after the two branches are both in sync.

Change-Id: I114e8a9b4ed29646ec22db1135e59f8bad47c4da
Reviewed-on: https://go-review.googlesource.com/c/go/+/726521
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
3 weeks ago[dev.simd] simd: make "best" instruction choice also depend on commutativity
David Chase [Wed, 3 Dec 2025 17:49:30 +0000 (12:49 -0500)]
[dev.simd] simd: make "best" instruction choice also depend on commutativity

the compare-based-on-immediate instructions are sometimes commutative,
sometimes not.  In this case, that means the instruction cannot be
commutative.

also improve the comments for comparisons.

Change-Id: I83a55fa5ffbd6cbbaf5cb23b3e8a68a5da8aae2f
Reviewed-on: https://go-review.googlesource.com/c/go/+/726440
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Austin Clements <austin@google.com>
4 weeks ago[dev.simd] simd, cmd/compile: add float -> float conversions
Junyang Shao [Tue, 25 Nov 2025 21:02:44 +0000 (21:02 +0000)]
[dev.simd] simd, cmd/compile: add float -> float conversions

This should mark the end of the conversion table, except for float16
which does not exist on Go yet.

The rounding logic documentation of float64 -> float32 is based on
abi-internal default MXCSR:
| RC | 14/13 | 0 (RN) | Round to nearest |

Change-Id: I27a86560e8d74d20f21350bf78314b4eada20ec0
Reviewed-on: https://go-review.googlesource.com/c/go/+/724440
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks ago[dev.simd] simd, cmd/compile: add int -> fp conversions
Junyang Shao [Tue, 25 Nov 2025 19:52:18 +0000 (19:52 +0000)]
[dev.simd] simd, cmd/compile: add int -> fp conversions

Change-Id: Iadfa2dd982d7156d60fb6977ed9afb7894d6e8a0
Reviewed-on: https://go-review.googlesource.com/c/go/+/724321
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks ago[dev.simd] simd, cmd/compile: add float -> int conversions
Junyang Shao [Tue, 25 Nov 2025 17:27:23 +0000 (17:27 +0000)]
[dev.simd] simd, cmd/compile: add float -> int conversions

This CL also fixed some documentation errors in existing APIs.

Go defaults MXCSR to mask exceptions, the documentation is based on this
fact.

Change-Id: I745083b82b4bef93126a4b4e41f8698956963704
Reviewed-on: https://go-review.googlesource.com/c/go/+/724320
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks ago[dev.simd] internal/buildcfg: turn GOEXPERIMENT=simd back on
Cherry Mui [Mon, 24 Nov 2025 21:43:45 +0000 (16:43 -0500)]
[dev.simd] internal/buildcfg: turn GOEXPERIMENT=simd back on

Turn the experiment back on by default on the dev.simd branch, for
the ease of experimenting and development.

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

4 weeks ago[dev.simd] all: merge master (e704b09) into dev.simd
Cherry Mui [Mon, 24 Nov 2025 20:48:06 +0000 (15:48 -0500)]
[dev.simd] all: merge master (e704b09) into dev.simd

Merge List:

+ 2025-11-24 e704b0993b go/types, types2: shorten object map assertion

Change-Id: Ie45f971d2872c6b7f8f62d61e4d307ccf52a6546

4 weeks agogo/types, types2: shorten object map assertion
Mark Freeman [Fri, 14 Nov 2025 20:04:28 +0000 (15:04 -0500)]
go/types, types2: shorten object map assertion

It's a fairly well-known invariant that each object must exist in the
object map and cannot be nil. This change just shortens a check of
that invariant.

Change-Id: Id15c158c3a9ad91cdc230fb0b84eb69b2451cbdc
Reviewed-on: https://go-review.googlesource.com/c/go/+/722061
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
4 weeks ago[dev.simd] all: merge master (02d1f3a) into dev.simd
Cherry Mui [Mon, 24 Nov 2025 20:29:27 +0000 (15:29 -0500)]
[dev.simd] all: merge master (02d1f3a) into dev.simd

Merge List:

+ 2025-11-24 02d1f3a06b runtime: respect GOTRACEBACK for user-triggered runtime panics
+ 2025-11-24 a593ca9d65 runtime/cgo: add support for `any` param and return type
+ 2025-11-24 89552911b3 cmd/compile, internal/buildcfg: enable regABI on s390x, and add s390x
+ 2025-11-24 2fe0ba8d52 internal/bytealg: port bytealg functions to reg ABI on s390x
+ 2025-11-24 4529c8fba6 runtime: port memmove, memclr to register ABI on s390x
+ 2025-11-24 58a48a3e3b internal/runtime/syscall: Syscall changes for s390x regabi
+ 2025-11-24 2a185fae7e reflect, runtime: add reflect support for regabi on s390x
+ 2025-11-24 e92d2964fa runtime: mark race functions on s390x as ABIInternal
+ 2025-11-24 41af98eb83 runtime: add runtime changes for register ABI on s390x
+ 2025-11-24 85e6080089 cmd/internal/obj: set morestack arg spilling and regabi prologue on s390x
+ 2025-11-24 24697419c5 cmd/compile: update s390x CALL* ops
+ 2025-11-24 81242d034c cmd/compile/internal/s390x: add initial spill support
+ 2025-11-24 73b6aa0fec cmd/compile/internal: add register ABI information for s390x
+ 2025-11-24 1036f6f485 internal/abi: define s390x ABI constants
+ 2025-11-24 2e5d12a277 cmd/compile: document register-based ABI for s390x

Change-Id: I57b4ae6f9b65d99958b9fe5974205770e18f7788

4 weeks agoruntime: respect GOTRACEBACK for user-triggered runtime panics
Joe Tsai [Thu, 13 Feb 2025 23:59:32 +0000 (15:59 -0800)]
runtime: respect GOTRACEBACK for user-triggered runtime panics

The documentation for GOTRACEBACK says that "single" is the default
where the stack trace for only a single routine is printed except
that it prints all stack traces if:

there is no current goroutine or
the failure is internal to the run-time.

In the runtime, there are two types of panics:
throwTypeUser and throwTypeRuntime.
The latter more clearly corresponds to a
"failure [that] is internal to the run-time",
while the former corresponds to a
problem trigger due to a user mistake.

Thus, a user-triggered panic (e.g., concurrent map access)
should not result in a dump of all stack traces.

Fixes #68019

Change-Id: I9b02f82535ddb9fd666f7158e2e4ee10f235646a
Reviewed-on: https://go-review.googlesource.com/c/go/+/649535
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
4 weeks ago[dev.simd] internal/buildcfg: don't enable SIMD experiment by default
Cherry Mui [Mon, 24 Nov 2025 19:41:26 +0000 (14:41 -0500)]
[dev.simd] internal/buildcfg: don't enable SIMD experiment by default

Preparing for merge to the main branch. Will reenable on the
branch.

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

4 weeks agoruntime/cgo: add support for `any` param and return type
Alexandre Daubois [Mon, 24 Nov 2025 08:14:18 +0000 (08:14 +0000)]
runtime/cgo: add support for `any` param and return type

When using `any` as param or return type of an exported
function, we currently have the error `unrecognized Go
type any`. `any` is an alias of `interface{}` which is
already supported.

This would avoid such change: https://github.com/php/frankenphp/pull/1976

Fixes #76340

Change-Id: I301838ff72e99ae78b035a8eff2405f6a145ed1a
GitHub-Last-Rev: 7dfbccfa582bbc6e79ed29677391b9ae81a9b5bd
GitHub-Pull-Request: golang/go#76325
Reviewed-on: https://go-review.googlesource.com/c/go/+/720960
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

4 weeks ago[dev.simd] simd: add goexperiment tag to generate.go
Cherry Mui [Mon, 24 Nov 2025 16:24:00 +0000 (11:24 -0500)]
[dev.simd] simd: add goexperiment tag to generate.go

So the simd package does not exist, instead of existing as an
empty package, if the goexperiment is not enabled. Unfortunately
the simd package developers have to run
GOEXPERIMENT=simd go generate, especially if one is not on an
AMD64 machine. But that command is still simple enough, not too
bad.

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

4 weeks agocmd/compile, internal/buildcfg: enable regABI on s390x, and add s390x
Srinivas Pokala [Tue, 11 Nov 2025 04:52:28 +0000 (05:52 +0100)]
cmd/compile, internal/buildcfg: enable regABI on s390x, and add s390x

in test func hasRegisterABI

```
goos: linux
goarch: s390x
shortname: minio
pkg: github.com/minio/minio/cmd
                                 │     old      │                 new

                                 │    sec/op    │    sec/op     vs base

DecodehealingTracker-128           1227.5n ± 1%   894.6n ±  1%  -27.12%
(p=0.000 n=10)
AppendMsgResyncTargetsInfo-128      8.755n ± 0%   4.942n ± 20%  -43.55%
(p=0.000 n=10)
DataUpdateTracker-128               2.075µ ± 1%   1.949µ ±  1%   -6.10%
(p=0.000 n=10)
MarshalMsgdataUsageCacheInfo-128    64.32n ± 2%   50.57n ±  6%  -21.37%
(p=0.000 n=10)
geomean                             194.6n        144.5n        -25.76%

shortname: gonum_topo
pkg: gonum.org/v1/gonum/graph/topo
                           │     old      │                 new

                           │    sec/op    │   sec/op     vs base

TarjanSCCGnp_10_tenth-128     8.733µ ± 1%   6.953µ ± 2%  -20.38%
(p=0.000 n=10)
TarjanSCCGnp_1000_half-128   101.60m ± 0%   72.79m ± 1%  -28.36%
(p=0.000 n=10)
geomean                       942.0µ        711.4µ       -24.48%

shortname: gonum_traverse
pkg: gonum.org/v1/gonum/graph/traverse
                                      │     old      │
new                 │
                                      │    sec/op    │   sec/op     vs
base                │
WalkAllBreadthFirstGnp_10_tenth-128      3.871µ ± 2%   3.242µ ± 2%
-16.25% (p=0.000 n=10)
WalkAllBreadthFirstGnp_1000_tenth-128   11.879m ± 1%   9.034m ± 1%
-23.95% (p=0.000 n=10)
geomean                                  214.4µ        171.1µ
-20.19%

hortname: ericlagergren_decimal
pkg: github.com/ericlagergren/decimal/benchmarks
                                        │     old     │
new                 │
                                        │   sec/op    │   sec/op     vs
base                │
Pi/foo=ericlagergren_(Go)/prec=100-128    181.6µ ± 0%   145.3µ ± 2%
-20.01% (p=0.000 n=10)
Pi/foo=ericlagergren_(GDA)/prec=100-128   356.4µ ± 1%   298.2µ ± 2%
-16.33% (p=0.000 n=10)
Pi/foo=shopspring/prec=100-128            426.5µ ± 2%   403.1µ ± 4%
-5.47% (p=0.000 n=10)
Pi/foo=apmckinlay/prec=100-128            4.943µ ± 0%   3.903µ ± 1%
-21.03% (p=0.000 n=10)
Pi/foo=go-inf/prec=100-128                132.1µ ± 4%   119.7µ ± 3%
-9.37% (p=0.000 n=10)
Pi/foo=float64/prec=100-128               4.210µ ± 0%   4.210µ ± 0%
~ (p=0.269 n=10)
geomean                                   65.07µ        57.02µ
-12.37%

shortname: uber_tally
pkg: github.com/uber-go/tally
                                 │     old      │                 new

                                 │    sec/op    │   sec/op     vs base

ScopeTaggedNoCachedSubscopes-128   3.511µ ± 12%   3.067µ ± 6%  -12.63%
(p=0.000 n=10)
HistogramAllocation-128            1.085µ ± 15%   1.011µ ± 6%   -6.87%
(p=0.001 n=10)
geomean                            1.952µ         1.760µ        -9.80%

shortname: uber_zap
pkg: go.uber.org/zap/zapcore
                                               │      old      │
new                  │
                                               │    sec/op     │
sec/op     vs base                │
BufferedWriteSyncer/write_file_with_buffer-128    119.0n ±  3%   101.7n
±  5%  -14.54% (p=0.000 n=10)
MultiWriteSyncer/2_discarder-128                 13.320n ± 34%   9.410n
± 28%  -29.35% (p=0.005 n=10)
MultiWriteSyncer/4_discarder-128                 10.830n ± 10%   8.883n
±  8%  -17.98% (p=0.000 n=10)
MultiWriteSyncer/4_discarder_with_buffer-128      119.0n ±  5%   104.1n
±  4%  -12.52% (p=0.000 n=10)
WriteSyncer/write_file_with_no_buffer-128         1.393µ ± 10%   1.409µ
±  7%        ~ (p=1.000 n=10)
ZapConsole-128                                    796.9n ± 14%   722.2n
±  7%   -9.37% (p=0.003 n=10)
JSONLogMarshalerFunc-128                          1.233µ ±  5%   1.095µ
±  8%  -11.20% (p=0.002 n=10)
ZapJSON-128                                       560.7n ±  9%   547.9n
±  6%        ~ (p=0.289 n=10)
StandardJSON-128                                  628.7n ±  7%   566.2n
±  7%   -9.95% (p=0.001 n=10)
Sampler_Check/7_keys-128                          8.068n ± 17%   8.232n
±  4%        ~ (p=0.382 n=10)
Sampler_Check/50_keys-128                         4.064n ± 13%   3.610n
± 17%        ~ (p=0.063 n=10)
Sampler_Check/100_keys-128                        6.559n ±  5%   6.386n
±  6%        ~ (p=0.063 n=10)
Sampler_CheckWithHook/7_keys-128                  40.04n ±  3%   36.82n
±  6%   -8.05% (p=0.000 n=10)
Sampler_CheckWithHook/50_keys-128                 39.48n ±  3%   36.48n
±  4%   -7.61% (p=0.000 n=10)
Sampler_CheckWithHook/100_keys-128                41.27n ±  5%   40.85n
±  9%        ~ (p=0.353 n=10)
TeeCheck-128                                      135.2n ± 11%   128.2n
± 10%        ~ (p=0.190 n=10)
geomean                                           77.98n         70.91n
-9.07%

shortname: spexs2
pkg: github.com/egonelbre/spexs2/_benchmark
               │    old     │                 new                 │
               │   sec/op   │   sec/op     vs base                │
Run/10k/1-128    21.58 ± 2%   19.68 ± 12%   -8.84% (p=0.015 n=10)
Run/10k/16-128   4.539 ± 6%   4.063 ±  7%  -10.48% (p=0.000 n=10)
geomean          9.898        8.941         -9.67%
 ```
Update #40724

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

4 weeks agointernal/bytealg: port bytealg functions to reg ABI on s390x
Srinivas Pokala [Tue, 11 Nov 2025 04:26:42 +0000 (05:26 +0100)]
internal/bytealg: port bytealg functions to reg ABI on s390x

This adds support for the reg ABI to the byte/string functions for
s390x. These are initially under control of the GOEXPERIMENT
macro until all changes are in.

Updates #40724

Change-Id: Ia3532523fe3a839cc0370d6fe1544972327be514
Reviewed-on: https://go-review.googlesource.com/c/go/+/719481
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: David Chase <drchase@google.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>
4 weeks agoruntime: port memmove, memclr to register ABI on s390x
Srinivas Pokala [Tue, 11 Nov 2025 04:22:32 +0000 (05:22 +0100)]
runtime: port memmove, memclr to register ABI on s390x

This allows memmove and memclr to be invoked using the new
register ABI on s390x.

Update #40724

Change-Id: I2e799aac693ddd693266c156c525d6303060796f
Reviewed-on: https://go-review.googlesource.com/c/go/+/719424
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>
Reviewed-by: Keith Randall <khr@google.com>
4 weeks agointernal/runtime/syscall: Syscall changes for s390x regabi
Srinivas Pokala [Tue, 11 Nov 2025 04:19:47 +0000 (05:19 +0100)]
internal/runtime/syscall: Syscall changes for s390x regabi

Updates #40724

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

4 weeks agoreflect, runtime: add reflect support for regabi on s390x
Srinivas Pokala [Tue, 11 Nov 2025 04:07:49 +0000 (05:07 +0100)]
reflect, runtime: add reflect support for regabi on s390x

This adds the regabi support needed for reflect calls
makeFuncSub and methodValueCall. Also, It add's archFloat32FromReg
and archFloat32ToReg.

Update #40724

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

4 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>

4 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>
4 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>
4 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>

4 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>
4 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>
4 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>
4 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>
4 weeks ago[dev.simd] go/doc/comment: don't include experimental packages in std list
Cherry Mui [Mon, 24 Nov 2025 17:03:59 +0000 (12:03 -0500)]
[dev.simd] go/doc/comment: don't include experimental packages in std list

go/doc/comment/std.go has a list of top-level package prefixes in
the standard library. This list can vary depending on goexperiment,
but the file is static. E.g.

GOEXPERIMENT=arenas go test -run=TestStd go/doc/comment

would fail.

Don't include experimental packages, as they are not (yet)
generally available. We could have a per-experiment list of
package prefixes. But given that experimental packages are not
intended to be used widely (yet), it is probably not worth the
complexity.

Change-Id: Ib5bc060297cbae29c01fee458aaaa29600b81e98
Reviewed-on: https://go-review.googlesource.com/c/go/+/723840
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
4 weeks ago[dev.simd] all: merge master (8dd5b13) into dev.simd
Cherry Mui [Mon, 24 Nov 2025 16:03:06 +0000 (11:03 -0500)]
[dev.simd] all: merge master (8dd5b13) into dev.simd

Merge List:

+ 2025-11-24 8dd5b13abc cmd/compile: relax stmtline_test on amd64
+ 2025-11-23 feae743bdb cmd/compile: use 32x32->64 multiplies on loong64
+ 2025-11-23 e88be8a128 runtime: fix stale comment for mheap/malloc
+ 2025-11-23 a318843a2a cmd/internal/obj/loong64: optimize duplicate optab entries
+ 2025-11-23 a18294bb6a cmd/internal/obj/arm64, image/gif, runtime, sort: use math/bits to calculate log2
+ 2025-11-23 437323ef7b slices: fix incorrect comment in slices.Insert function documentation
+ 2025-11-23 1993dca400 doc/next: pre-announce end of support for macOS 12 in Go 1.27
+ 2025-11-22 337f7b1f5d cmd/go: update default go directive in mod or work init
+ 2025-11-21 3c26aef8fb cmd/internal/obj/riscv: improve large branch/call/jump tests
+ 2025-11-21 31aa9f800b crypto/tls: use inner hello for earlyData when using QUIC and ECH
+ 2025-11-21 d68aec8db1 runtime: replace trace seqlock with write flag
+ 2025-11-21 8d9906cd34 runtime/trace: add Log benchmark
+ 2025-11-21 6aeacdff38 cmd/go: support sha1 repos when git default is sha256
+ 2025-11-21 9570036ca5 crypto/sha3: make the zero value of SHAKE useable
+ 2025-11-21 155efbbeeb crypto/sha3: make the zero value of SHA3 useable
+ 2025-11-21 6f16669e34 database/sql: don't ignore ColumnConverter for unknown input count
+ 2025-11-21 121bc3e464 runtime/pprof: remove hard-coded sleep in CPU profile reader
+ 2025-11-21 b604148c4e runtime: fix double wakeup in CPU profile buffer
+ 2025-11-21 22f24f90b5 cmd/compile: change testing.B.Loop keep alive semantic
+ 2025-11-21 cfb9d2eb73 net: remove unused linknames
+ 2025-11-21 65ef314f89 net/http: remove unused linknames
+ 2025-11-21 0f32fbc631 net/http: populate Response.Request when using NewFileTransport
+ 2025-11-21 3e0a8e7867 net/http: preserve original path encoding in redirects
+ 2025-11-21 831af61120 net/http: use HTTP 307 redirects in ServeMux
+ 2025-11-21 87269224cb net/http: update Response.Request.URL after redirects on GOOS=js
+ 2025-11-21 7aa9ca729f net/http/cookiejar: treat localhost as secure origin
+ 2025-11-21 f870a1d398 net/url: warn that JoinPath arguments should be escaped
+ 2025-11-21 9962d95fed crypto/internal/fips140/mldsa: unroll NTT and inverseNTT
+ 2025-11-21 f821fc46c5 crypto/internal/fisp140test: update acvptool, test data
+ 2025-11-21 b59efc38a0 crypto/internal/fips140/mldsa: new package
+ 2025-11-21 62741480b8 runtime: remove linkname for gopanic
+ 2025-11-21 7db2f0bb9a crypto/internal/hpke: separate KEM and PublicKey/PrivateKey interfaces
+ 2025-11-21 e15800c0ec crypto/internal/hpke: add ML-KEM and hybrid KEMs, and SHAKE KDFs
+ 2025-11-21 7c985a2df4 crypto/internal/hpke: modularize API and support more ciphersuites
+ 2025-11-21 e7d47ac33d cmd/compile: simplify negative on multiplication
+ 2025-11-21 35d2712b32 net/http: fix typo in Transport docs
+ 2025-11-21 90c970cd0f net: remove unnecessary loop variable copies in tests
+ 2025-11-21 9772d3a690 cmd/cgo: strip top-level const qualifier from argument frame struct
+ 2025-11-21 1903782ade errors: add examples for custom Is/As matching
+ 2025-11-21 ec92bc6d63 cmd/compile: rewrite Rsh to RshU if arguments are proved positive
+ 2025-11-21 3820f94c1d cmd/compile: propagate unsigned relations for Rsh if arguments are positive
+ 2025-11-21 d474f1fd21 cmd/compile: make dse track multiple shadowed ranges
+ 2025-11-21 d0d0a72980 cmd/compile/internal/ssa: correct type of ARM64 conditional instructions
+ 2025-11-21 a9704f89ea internal/runtime/gc/scan: add AVX512 impl of filterNil.
+ 2025-11-21 ccd389036a cmd/internal/objabi: remove -V=goexperiment internal special case
+ 2025-11-21 e7787b9eca runtime: go fmt
+ 2025-11-21 17b3b98796 internal/strconv: go fmt
+ 2025-11-21 c851827c68 internal/trace: go fmt
+ 2025-11-21 f87aaec53d cmd/compile: fix integer overflow in prove pass
+ 2025-11-21 dbd2ab9992 cmd/compile/internal: fix typos
+ 2025-11-21 b9d86baae3 cmd/compile/internal/devirtualize: fix typos
+ 2025-11-20 4b0e3cc1d6 cmd/link: support loading R_LARCH_PCREL20_S2 and R_LARCH_CALL36 relocs
+ 2025-11-20 cdba82c7d6 cmd/internal/obj/loong64: add {,X}VSLT.{B/H/W/V}{,U} instructions support
+ 2025-11-20 bd2b117c2c crypto/tls: add QUICErrorEvent
+ 2025-11-20 3ad2e113fc net/http/httputil: wrap ReverseProxy's outbound request body so Close is a noop
+ 2025-11-20 d58b733646 runtime: track goroutine location until actual STW
+ 2025-11-20 1bc54868d4 cmd/vendor: update to x/tools@68724af
+ 2025-11-20 8c3195973b runtime: disable stack allocation tests on sanitizers
+ 2025-11-20 ff654ea100 net/url: permit colons in the host of postgresql:// URLs
+ 2025-11-20 a662badab9 encoding/json: remove linknames
+ 2025-11-20 5afe237d65 mime: add missing path for mime types in godoc
+ 2025-11-20 c1b7112af8 os/signal: make NotifyContext cancel the context with a cause

Change-Id: Ib93ef643be610dfbdd83ff45095a7b1ca2537b8b

4 weeks agoRevert "[dev.simd] internal/runtime/gc: add simd package based greentea kernels"
Cherry Mui [Sat, 22 Nov 2025 02:17:10 +0000 (18:17 -0800)]
Revert "[dev.simd] internal/runtime/gc: add simd package based greentea kernels"

This reverts CL 719520.

Reason for revert: Naming is confusing. Also, this has a semantic merge
conflict with CL 722040. Let's revert, fix the naming and conflict, and
do it again.

Change-Id: I0dc0c7c58470d63d48a4f69adb38c18f95db0beb
Reviewed-on: https://go-review.googlesource.com/c/go/+/723220
Reviewed-by: Junyang Shao <shaojunyang@google.com>
TryBot-Bypass: David Chase <drchase@google.com>

4 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>

4 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>

4 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>
4 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>
4 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>
4 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>
4 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>
5 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>
5 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>
5 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>
5 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>
5 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>

5 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>
5 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>

5 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>
5 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>

5 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>
5 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>
5 weeks ago[dev.simd] internal/runtime/gc: add simd package based greentea kernels
Junyang Shao [Sun, 9 Mar 2025 17:19:48 +0000 (17:19 +0000)]
[dev.simd] internal/runtime/gc: add simd package based greentea kernels

This CL adds a new generator to internal/runtime/gc/scan that generates expander
kernels in Go SIMD. This CL also includes a Go SIMD scan kernel and a
Go SIMD filter kernel.

This CL also includes the plumbing, it will use the Go SIMD kernels if
goexperiment.simd is on.

Benchmark results:
...
ScanSpanPacked/cache=tiny/pages=1/sizeclass=26/pct=80-88     354.8n ±  1%   272.4n ±  0%  -23.22% (p=0.002 n=6)
ScanSpanPacked/cache=tiny/pages=1/sizeclass=26/pct=90-88     375.7n ±  0%   287.1n ±  0%  -23.58% (p=0.002 n=6)
ScanSpanPacked/cache=tiny/pages=1/sizeclass=26/pct=100-88    450.0n ±  1%   327.4n ±  0%  -27.24% (p=0.002 n=6)
geomean                                                      246.5n         199.4n        -19.10%

Throughput +25%.

Change-Id: Ib85e01b7de18181db9e7b6026863209a993aa85f
Reviewed-on: https://go-review.googlesource.com/c/go/+/719520
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
5 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>
5 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>

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>

5 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>
5 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>
5 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>
5 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>

5 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>

5 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>

5 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>
5 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>
5 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>
5 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>
5 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>

5 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>

5 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>
5 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>
5 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>

5 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>
5 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>

5 weeks ago[dev.simd] cmd/compile, simd: update conversion API names
Junyang Shao [Tue, 18 Nov 2025 20:39:10 +0000 (20:39 +0000)]
[dev.simd] cmd/compile, simd: update conversion API names

This CL is to address some API audit discussion decisions.

Change-Id: Iaa206832c41852fec8fa25c23da12f65df736098
Reviewed-on: https://go-review.googlesource.com/c/go/+/721780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
5 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>

5 weeks ago[dev.simd] cmd/compile: fix incorrect mapping of SHA256MSG2128
Neal Patel [Thu, 20 Nov 2025 22:28:41 +0000 (22:28 +0000)]
[dev.simd] cmd/compile: fix incorrect mapping of SHA256MSG2128

Change-Id: Iff00fdb5cfc83c546ad564fa7618ec34d0352fdc
Reviewed-on: https://go-review.googlesource.com/c/go/+/722640
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
5 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>
5 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>

5 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>
5 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>
5 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>

5 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>

5 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>
5 weeks ago[dev.simd] simd, cmd/compile: add more element types for Select128FromPair
David Chase [Wed, 19 Nov 2025 22:17:54 +0000 (17:17 -0500)]
[dev.simd] simd, cmd/compile: add more element types for Select128FromPair

Also includes a comment cleanup pass.
Fixed NAME processing for additional documentation.

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

5 weeks ago[dev.simd] simd: fix signatures for PermuteConstant* methods
David Chase [Mon, 17 Nov 2025 20:31:36 +0000 (15:31 -0500)]
[dev.simd] simd: fix signatures for PermuteConstant* methods

This moves the packed-immediate methods to package-private,
and adds exported versions with four parameters.

Rename PermuteConstant to PermuteScalars
Rename VPSHUFB Permute to PermuteOrZero
Rename Permute2 to ConcatPermute

Comments were repaired/enhanced.

Modified the generator to support an additional tag
"hideMaskMethods : true" to suppress method, intrinsic,
generic, and generic translation generation for said
mask-modified versions of such methods (this is already
true for exported methods).

Change-Id: I91e208c1fff1f28ebce4edb4e73d26003715018c
Reviewed-on: https://go-review.googlesource.com/c/go/+/721342
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
5 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>

5 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>
5 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>

5 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>

5 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>

5 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>
5 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>
5 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>
5 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>

5 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>
5 weeks ago[dev.simd] all: merge master (ca37d24) into dev.simd
Cherry Mui [Thu, 20 Nov 2025 19:40:43 +0000 (14:40 -0500)]
[dev.simd] all: merge master (ca37d24) into dev.simd

Conflicts:

- src/cmd/compile/internal/typecheck/builtin.go

Merge List:

+ 2025-11-20 ca37d24e0b net/http: drop unused "broken" field from persistConn
+ 2025-11-20 4b740af56a cmd/internal/obj/x86: handle global reference in From3 in dynlink mode
+ 2025-11-20 790384c6c2 spec: adjust rule for type parameter on RHS of alias declaration
+ 2025-11-20 a49b0302d0 net/http: correctly close fake net.Conns
+ 2025-11-20 32f5aadd2f cmd/compile: stack allocate backing stores during append
+ 2025-11-20 a18aff8057 runtime: select GC mark workers during start-the-world
+ 2025-11-20 829779f4fe runtime: split findRunnableGCWorker in two
+ 2025-11-20 ab59569099 go/version: use "custom" as an example of a version suffix
+ 2025-11-19 c4bb9653ba cmd/compile: Implement LoweredZeroLoop with LSX Instruction on loong64
+ 2025-11-19 7f2ae21fb4 cmd/internal/obj/loong64: add MULW.D.W[U] instructions
+ 2025-11-19 a2946f2385 crypto: add Encapsulator and Decapsulator interfaces
+ 2025-11-19 6b83bd7146 crypto/ecdh: add KeyExchanger interface
+ 2025-11-19 4fef9f8b55 go/types, types2: fix object path for grouped declaration statements
+ 2025-11-19 33529db142 spec: escape double-ampersands
+ 2025-11-19 dc42565a20 cmd/compile: fix control flow for unsigned divisions proof relations
+ 2025-11-19 e64023dcbf cmd/compile: cleanup useless if statement in prove
+ 2025-11-19 2239520d1c test: go fmt prove.go tests
+ 2025-11-19 489d3dafb7 math: switch s390x math.Pow to generic implementation
+ 2025-11-18 8c41a482f9 runtime: add dlog.hexdump
+ 2025-11-18 e912618bd2 runtime: add hexdumper
+ 2025-11-18 2cf9d4b62f Revert "net/http: do not discard body content when closing it within request handlers"
+ 2025-11-18 4d0658bb08 cmd/compile: prefer fixed registers for values
+ 2025-11-18 ba634ca5c7 cmd/compile: fold boolean NOT into branches
+ 2025-11-18 8806d53c10 cmd/link: align sections, not symbols after DWARF compress
+ 2025-11-18 c93766007d runtime: do not print recovered when double panic with the same value
+ 2025-11-18 9859b43643 cmd/asm,cmd/compile,cmd/internal/obj/riscv: use compressed instructions on riscv64
+ 2025-11-17 b9ef0633f6 cmd/internal/sys,internal/goarch,runtime: enable the use of compressed instructions on riscv64
+ 2025-11-17 a087dea869 debug/elf: sync new loong64 relocation types up to LoongArch ELF psABI v20250521
+ 2025-11-17 e1a12c781f cmd/compile: use 32x32->64 multiplies on arm64
+ 2025-11-17 6caab99026 runtime: relax TestMemoryLimit on darwin a bit more
+ 2025-11-17 eda2e8c683 runtime: clear frame pointer at thread entry points
+ 2025-11-17 6919858338 runtime: rename findrunnable references to findRunnable
+ 2025-11-17 8e734ec954 go/ast: fix BasicLit.End position for raw strings containing \r
+ 2025-11-17 592775ec7d crypto/mlkem: avoid a few unnecessary inverse NTT calls
+ 2025-11-17 590cf18daf crypto/mlkem/mlkemtest: add derandomized Encapsulate768/1024
+ 2025-11-17 c12c337099 cmd/compile: teach prove about subtract idioms
+ 2025-11-17 bc15963813 cmd/compile: clean up prove pass
+ 2025-11-17 1297fae708 go/token: add (*File).End method
+ 2025-11-17 65c09eafdf runtime: hoist invariant code out of heapBitsSmallForAddrInline
+ 2025-11-17 594129b80c internal/runtime/maps: update doc for table.Clear
+ 2025-11-15 c58d075e9a crypto/rsa: deprecate PKCS#1 v1.5 encryption
+ 2025-11-14 d55ecea9e5 runtime: usleep before stealing runnext only if not in syscall
+ 2025-11-14 410ef44f00 cmd: update x/tools to 59ff18c
+ 2025-11-14 50128a2154 runtime: support runtime.freegc in size-specialized mallocs for noscan objects
+ 2025-11-14 c3708350a4 cmd/go: tests: rename git-min-vers->git-sha256
+ 2025-11-14 aea881230d std: fix printf("%q", int) mistakes
+ 2025-11-14 120f1874ef runtime: add more precise test of assist credit handling for runtime.freegc
+ 2025-11-14 fecfcaa4f6 runtime: add runtime.freegc to reduce GC work
+ 2025-11-14 5a347b775e runtime: set GOEXPERIMENT=runtimefreegc to disabled by default
+ 2025-11-14 1a03d0db3f runtime: skip tests for GOEXPERIMENT=arenas that do not handle clobberfree=1
+ 2025-11-14 cb0d9980f5 net/http: do not discard body content when closing it within request handlers
+ 2025-11-14 03ed43988f cmd/compile: allow multi-field structs to be stored directly in interfaces
+ 2025-11-14 1bb1f2bf0c runtime: put AddCleanup cleanup arguments in their own allocation
+ 2025-11-14 9fd2e44439 runtime: add AddCleanup benchmark
+ 2025-11-14 80c91eedbb runtime: ensure weak handles end up in their own allocation
+ 2025-11-14 7a8d0b5d53 runtime: add debug mode to extend _Grunning-without-P windows
+ 2025-11-14 710abf74da internal/runtime/cgobench: add Go function call benchmark for comparison
+ 2025-11-14 b24aec598b doc, cmd/internal/obj/riscv: document the riscv64 assembler
+ 2025-11-14 a0e738c657 cmd/compile/internal: remove incorrect riscv64 SLTI rule
+ 2025-11-14 2cdcc4150b cmd/compile: fold negation into multiplication
+ 2025-11-14 b57962b7c7 bytes: fix panic in bytes.Buffer.Peek
+ 2025-11-14 0a569528ea cmd/compile: optimize comparisons with single bit difference
+ 2025-11-14 1e5e6663e9 cmd/compile: remove unnecessary casts and types from riscv64 rules
+ 2025-11-14 ddd8558e61 go/types, types2: swap object.color for Checker.objPathIdx
+ 2025-11-14 9daaab305c cmd/link/internal/ld: make runtime.buildVersion with experiments valid
+ 2025-11-13 d50a571ddf test: fix tests to work with sizespecializedmalloc turned off
+ 2025-11-13 704f841eab cmd/trace: annotation proc start/stop with thread and proc always
+ 2025-11-13 17a02b9106 net/http: remove unused isLitOrSingle and isNotToken
+ 2025-11-13 ff61991aed cmd/go: fix flaky TestScript/mod_get_direct
+ 2025-11-13 129d0cb543 net/http/cgi: accept INCLUDED as protocol for server side includes
+ 2025-11-13 77c5130100 go/types: minor simplification
+ 2025-11-13 7601cd3880 go/types: generate cycles.go
+ 2025-11-13 7a372affd9 go/types, types2: rename definedType to declaredType and clarify docs

Change-Id: Ibaa9bdb982364892f80e511c1bb12661fcd5fb86

5 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>
5 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>
5 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>