]> Cypherpunks repositories - gostls13.git/log
gostls13.git
7 weeks agocmd/go: remove fips140 dependency on global Fetcher_
Ian Alexander [Tue, 18 Nov 2025 17:40:06 +0000 (12:40 -0500)]
cmd/go: remove fips140 dependency on global Fetcher_

This commit makes Unzip a method on the *Fetcher type, and updates
fips140 initialization to use a new Fetcher instance instead of the
global Fetcher_ variable.

Change-Id: Iea8d9ee4dd6e6a2be43520c144aaec6e75c9cd63
Reviewed-on: https://go-review.googlesource.com/c/go/+/722581
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
7 weeks agointernal/strconv: add testbase tests
Russ Cox [Tue, 11 Nov 2025 13:47:14 +0000 (05:47 -0800)]
internal/strconv: add testbase tests

Add ability to test against inputs chosen by from the stress
tests computed by Vern Paxson's testbase program.

Checked that 'go test -testbase' passes.

Change-Id: I81057e55df6cd369b40ce623a59884e6ead0ed76
Reviewed-on: https://go-review.googlesource.com/c/go/+/719620
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agointernal/strconv: delete ftoaryu
Russ Cox [Mon, 24 Nov 2025 19:03:34 +0000 (14:03 -0500)]
internal/strconv: delete ftoaryu

CL 700075 made this dead code.

Benchmarks below for CL 700075, testing Dragonbox vs the old Ryu being deleted.
The "Fixed" benchmarks are unchanged, which gives a sense of the noise level.

benchmark \ host                  linux-amd64       s7  linux-arm64    local  linux-386  s7:GOARCH=386  linux-arm
                                      vs base  vs base      vs base  vs base    vs base        vs base    vs base
AppendFloat/Decimal                    -2.68%   +2.76%       +4.99%   -7.44%    +11.93%        +10.51%    +21.84%
AppendFloat/Float                     -21.98%  -13.32%      -16.50%  -11.54%    -33.37%        -28.66%    -15.64%
AppendFloat/Exp                       -32.44%  -25.54%      -28.85%  -31.79%    -39.60%        -35.92%    -20.89%
AppendFloat/NegExp                    -33.31%  -25.91%      -28.90%  -31.29%    -41.17%        -35.52%    -21.32%
AppendFloat/LongExp                   -19.35%   -9.51%      -15.29%  -12.36%    -30.46%        -25.10%    -10.18%
AppendFloat/Big                       -24.40%  -15.84%      -22.56%  -24.05%    -43.23%        -36.28%    -26.45%
AppendFloat/BinaryExp                  -0.52%   -1.20%            ~        ~          ~         +0.96%     +1.94%
AppendFloat/32Integer                 -14.24%   -7.01%      -12.82%  -18.99%    -12.12%        -10.85%     -0.32%
AppendFloat/32ExactFraction           -34.53%  -28.47%      -34.50%  -30.50%    -43.75%        -38.73%    -25.44%
AppendFloat/32Point                   -25.83%  -18.54%      -23.52%  -21.26%    -36.74%        -33.11%    -20.72%
AppendFloat/32Exp                     -37.55%  -33.36%      -37.74%  -39.06%    -51.37%        -44.53%    -31.76%
AppendFloat/32NegExp                  -35.99%  -31.96%      -36.02%  -37.13%    -44.62%        -39.03%    -26.91%
AppendFloat/32Shortest                -23.25%  -18.02%      -21.41%  -23.07%    -35.56%        -32.89%    -20.13%
AppendFloat/32Fixed8Hard               +1.09%   -1.94%            ~        ~     -2.33%         -1.36%     -0.10%
AppendFloat/32Fixed9Hard               +1.45%   -2.10%       +0.10%        ~     -4.20%         -0.72%     +1.31%
AppendFloat/64Fixed1                   +0.45%        ~            ~   -1.66%     -3.74%         -2.13%          ~
AppendFloat/64Fixed2                   +0.32%   -0.92%       +0.53%   -1.75%     -2.69%              ~     -0.49%
AppendFloat/64Fixed2.5                 +0.38%   -0.38%            ~        ~     -5.14%         -1.15%     -0.97%
AppendFloat/64Fixed3                   +0.97%   -0.53%            ~   +0.23%     -3.57%         -4.04%     -0.27%
AppendFloat/64Fixed4                   +0.95%   -2.77%       +0.45%   -1.57%     -3.99%         -2.58%     -0.91%
AppendFloat/64Fixed5Hard               +0.52%   -1.22%            ~   -0.87%     -3.20%         -1.60%     +0.49%
AppendFloat/64Fixed12                  +1.15%   -0.62%            ~        ~     -3.37%         -1.43%     -0.72%
AppendFloat/64Fixed16                  +1.13%        ~       -0.21%   -0.59%     -3.65%              ~     +0.74%
AppendFloat/64Fixed12Hard              +0.78%   -1.26%            ~   -0.95%     -4.82%         -2.98%     +0.26%
AppendFloat/64Fixed17Hard                   ~        ~       -0.32%   -6.34%     -2.44%         -2.19%     +1.00%
AppendFloat/64Fixed18Hard                   ~        ~            ~        ~          ~              ~     +0.06%
AppendFloat/64FixedF1                  +0.44%        ~       +0.43%   -1.87%     -2.75%              ~     -1.24%
AppendFloat/64FixedF2                  +1.35%   -1.04%       +0.81%   +1.26%     -2.21%         -2.36%          ~
AppendFloat/64FixedF3                       ~   -1.14%       +0.39%   -1.58%     -3.46%              ~     -1.08%
AppendFloat/Slowpath64                -15.51%   -7.05%      -14.59%   -7.86%    -22.54%        -19.63%     -5.90%
AppendFloat/SlowpathDenormal64        -15.10%   -8.19%      -14.62%   -9.36%    -26.86%        -23.10%    -14.48%

host: linux-amd64
goos: linux
goarch: amd64
pkg: internal/strconv
cpu: Intel(R) Xeon(R) CPU @ 2.30GHz
                                     │ 3c26aef8fba  │             8a958b0d9c1             │
                                     │    sec/op    │   sec/op     vs base                │
AppendFloat/Decimal-16                  63.37n ± 0%   61.67n ± 0%   -2.68% (p=0.000 n=20)
AppendFloat/Float-16                    92.83n ± 0%   72.43n ± 0%  -21.98% (p=0.000 n=20)
AppendFloat/Exp-16                      98.60n ± 0%   66.61n ± 0%  -32.44% (p=0.000 n=20)
AppendFloat/NegExp-16                  100.15n ± 0%   66.79n ± 0%  -33.31% (p=0.000 n=20)
AppendFloat/LongExp-16                 105.35n ± 0%   84.96n ± 0%  -19.35% (p=0.000 n=20)
AppendFloat/Big-16                     108.50n ± 0%   82.03n ± 0%  -24.40% (p=0.000 n=20)
AppendFloat/BinaryExp-16                47.27n ± 0%   47.03n ± 0%   -0.52% (p=0.000 n=20)
AppendFloat/32Integer-16                63.29n ± 0%   54.28n ± 0%  -14.24% (p=0.000 n=20)
AppendFloat/32ExactFraction-16          89.72n ± 0%   58.74n ± 0%  -34.53% (p=0.000 n=20)
AppendFloat/32Point-16                  87.32n ± 0%   64.77n ± 0%  -25.83% (p=0.000 n=20)
AppendFloat/32Exp-16                    94.89n ± 0%   59.26n ± 0%  -37.55% (p=0.000 n=20)
AppendFloat/32NegExp-16                 92.68n ± 0%   59.32n ± 0%  -35.99% (p=0.000 n=20)
AppendFloat/32Shortest-16               82.12n ± 0%   63.04n ± 0%  -23.25% (p=0.000 n=20)
AppendFloat/32Fixed8Hard-16             57.76n ± 0%   58.38n ± 0%   +1.09% (p=0.000 n=20)
AppendFloat/32Fixed9Hard-16             66.44n ± 0%   67.41n ± 0%   +1.45% (p=0.000 n=20)
AppendFloat/64Fixed1-16                 51.00n ± 0%   51.24n ± 0%   +0.45% (p=0.000 n=20)
AppendFloat/64Fixed2-16                 50.86n ± 0%   51.03n ± 0%   +0.32% (p=0.000 n=20)
AppendFloat/64Fixed2.5-16               49.31n ± 0%   49.49n ± 0%   +0.38% (p=0.000 n=20)
AppendFloat/64Fixed3-16                 51.98n ± 0%   52.48n ± 0%   +0.97% (p=0.000 n=20)
AppendFloat/64Fixed4-16                 50.05n ± 0%   50.52n ± 0%   +0.95% (p=0.000 n=20)
AppendFloat/64Fixed5Hard-16             58.01n ± 0%   58.31n ± 0%   +0.52% (p=0.000 n=20)
AppendFloat/64Fixed12-16                82.81n ± 0%   83.77n ± 0%   +1.15% (p=0.000 n=20)
AppendFloat/64Fixed16-16                70.66n ± 0%   71.46n ± 0%   +1.13% (p=0.000 n=20)
AppendFloat/64Fixed12Hard-16            68.25n ± 0%   68.79n ± 0%   +0.78% (p=0.000 n=20)
AppendFloat/64Fixed17Hard-16            79.78n ± 0%   79.82n ± 0%        ~ (p=0.136 n=20)
AppendFloat/64Fixed18Hard-16            4.881µ ± 0%   4.876µ ± 0%        ~ (p=0.432 n=20)
AppendFloat/64FixedF1-16                68.74n ± 0%   69.04n ± 0%   +0.44% (p=0.000 n=20)
AppendFloat/64FixedF2-16                57.36n ± 0%   58.13n ± 0%   +1.35% (p=0.000 n=20)
AppendFloat/64FixedF3-16                52.59n ± 0%   52.77n ± 0%        ~ (p=0.001 n=20)
AppendFloat/Slowpath64-16               99.56n ± 0%   84.12n ± 0%  -15.51% (p=0.000 n=20)
AppendFloat/SlowpathDenormal64-16       97.35n ± 0%   82.65n ± 0%  -15.10% (p=0.000 n=20)
AppendFloat/ShorterIntervalCase32-16                  56.27n ± 0%
AppendFloat/ShorterIntervalCase64-16                  57.42n ± 0%
geomean                                 82.53n        71.80n       -11.68%

host: s7
cpu: AMD Ryzen 9 7950X 16-Core Processor
                                     │ 3c26aef8fba │             8a958b0d9c1             │
                                     │   sec/op    │   sec/op     vs base                │
AppendFloat/Decimal-32                 22.30n ± 0%   22.91n ± 0%   +2.76% (p=0.000 n=20)
AppendFloat/Float-32                   34.54n ± 0%   29.94n ± 0%  -13.32% (p=0.000 n=20)
AppendFloat/Exp-32                     34.55n ± 0%   25.72n ± 0%  -25.54% (p=0.000 n=20)
AppendFloat/NegExp-32                  35.08n ± 0%   25.99n ± 1%  -25.91% (p=0.000 n=20)
AppendFloat/LongExp-32                 36.85n ± 0%   33.35n ± 1%   -9.51% (p=0.000 n=20)
AppendFloat/Big-32                     38.28n ± 0%   32.21n ± 1%  -15.84% (p=0.000 n=20)
AppendFloat/BinaryExp-32               17.52n ± 0%   17.30n ± 0%   -1.20% (p=0.000 n=20)
AppendFloat/32Integer-32               22.31n ± 0%   20.75n ± 0%   -7.01% (p=0.000 n=20)
AppendFloat/32ExactFraction-32         32.74n ± 1%   23.41n ± 1%  -28.47% (p=0.000 n=20)
AppendFloat/32Point-32                 32.88n ± 0%   26.79n ± 0%  -18.54% (p=0.000 n=20)
AppendFloat/32Exp-32                   34.10n ± 0%   22.72n ± 1%  -33.36% (p=0.000 n=20)
AppendFloat/32NegExp-32                33.17n ± 1%   22.57n ± 0%  -31.96% (p=0.000 n=20)
AppendFloat/32Shortest-32              29.85n ± 1%   24.47n ± 0%  -18.02% (p=0.000 n=20)
AppendFloat/32Fixed8Hard-32            22.62n ± 1%   22.19n ± 1%   -1.94% (p=0.000 n=20)
AppendFloat/32Fixed9Hard-32            25.75n ± 1%   25.21n ± 0%   -2.10% (p=0.000 n=20)
AppendFloat/64Fixed1-32                19.02n ± 1%   18.98n ± 0%        ~ (p=0.351 n=20)
AppendFloat/64Fixed2-32                18.94n ± 0%   18.76n ± 0%   -0.92% (p=0.000 n=20)
AppendFloat/64Fixed2.5-32              18.23n ± 0%   18.16n ± 0%   -0.38% (p=0.001 n=20)
AppendFloat/64Fixed3-32                19.79n ± 0%   19.68n ± 0%   -0.53% (p=0.000 n=20)
AppendFloat/64Fixed4-32                18.93n ± 0%   18.40n ± 1%   -2.77% (p=0.000 n=20)
AppendFloat/64Fixed5Hard-32            21.81n ± 0%   21.54n ± 1%   -1.22% (p=0.000 n=20)
AppendFloat/64Fixed12-32               30.58n ± 1%   30.39n ± 0%   -0.62% (p=0.000 n=20)
AppendFloat/64Fixed16-32               26.98n ± 1%   26.80n ± 1%        ~ (p=0.010 n=20)
AppendFloat/64Fixed12Hard-32           26.20n ± 0%   25.86n ± 1%   -1.26% (p=0.000 n=20)
AppendFloat/64Fixed17Hard-32           30.01n ± 1%   30.10n ± 1%        ~ (p=0.112 n=20)
AppendFloat/64Fixed18Hard-32           1.809µ ± 1%   1.806µ ± 0%        ~ (p=0.713 n=20)
AppendFloat/64FixedF1-32               26.78n ± 1%   26.59n ± 0%        ~ (p=0.005 n=20)
AppendFloat/64FixedF2-32               20.24n ± 1%   20.03n ± 0%   -1.04% (p=0.000 n=20)
AppendFloat/64FixedF3-32               18.88n ± 0%   18.67n ± 0%   -1.14% (p=0.000 n=20)
AppendFloat/Slowpath64-32              35.37n ± 0%   32.88n ± 1%   -7.05% (p=0.000 n=20)
AppendFloat/SlowpathDenormal64-32      35.17n ± 0%   32.29n ± 1%   -8.19% (p=0.000 n=20)
AppendFloat/ShorterIntervalCase32-32                 21.76n ± 0%
AppendFloat/ShorterIntervalCase64-32                 22.11n ± 0%
geomean                                30.34n        27.23n        -8.96%

host: linux-arm64
goarch: arm64
cpu: unknown
                                    │ 3c26aef8fba  │             8a958b0d9c1             │
                                    │    sec/op    │   sec/op     vs base                │
AppendFloat/Decimal-8                  60.08n ± 0%   63.07n ± 0%   +4.99% (p=0.000 n=20)
AppendFloat/Float-8                    88.53n ± 0%   73.92n ± 0%  -16.50% (p=0.000 n=20)
AppendFloat/Exp-8                      93.07n ± 0%   66.22n ± 0%  -28.85% (p=0.000 n=20)
AppendFloat/NegExp-8                   93.35n ± 0%   66.38n ± 0%  -28.90% (p=0.000 n=20)
AppendFloat/LongExp-8                 100.15n ± 0%   84.84n ± 0%  -15.29% (p=0.000 n=20)
AppendFloat/Big-8                     103.80n ± 0%   80.38n ± 0%  -22.56% (p=0.000 n=20)
AppendFloat/BinaryExp-8                47.36n ± 0%   47.34n ± 0%        ~ (p=0.033 n=20)
AppendFloat/32Integer-8                60.28n ± 0%   52.55n ± 0%  -12.82% (p=0.000 n=20)
AppendFloat/32ExactFraction-8          86.11n ± 0%   56.40n ± 0%  -34.50% (p=0.000 n=20)
AppendFloat/32Point-8                  82.88n ± 0%   63.39n ± 0%  -23.52% (p=0.000 n=20)
AppendFloat/32Exp-8                    89.33n ± 0%   55.62n ± 0%  -37.74% (p=0.000 n=20)
AppendFloat/32NegExp-8                 87.48n ± 0%   55.97n ± 0%  -36.02% (p=0.000 n=20)
AppendFloat/32Shortest-8               76.31n ± 0%   59.97n ± 0%  -21.41% (p=0.000 n=20)
AppendFloat/32Fixed8Hard-8             52.83n ± 0%   52.82n ± 0%        ~ (p=0.370 n=20)
AppendFloat/32Fixed9Hard-8             60.90n ± 0%   60.96n ± 0%   +0.10% (p=0.000 n=20)
AppendFloat/64Fixed1-8                 46.96n ± 0%   46.95n ± 0%        ~ (p=0.702 n=20)
AppendFloat/64Fixed2-8                 46.96n ± 0%   47.21n ± 0%   +0.53% (p=0.000 n=20)
AppendFloat/64Fixed2.5-8               44.24n ± 0%   44.29n ± 0%        ~ (p=0.006 n=20)
AppendFloat/64Fixed3-8                 47.73n ± 0%   47.78n ± 0%        ~ (p=0.020 n=20)
AppendFloat/64Fixed4-8                 44.40n ± 0%   44.60n ± 0%   +0.45% (p=0.000 n=20)
AppendFloat/64Fixed5Hard-8             52.52n ± 0%   52.50n ± 0%        ~ (p=0.722 n=20)
AppendFloat/64Fixed12-8                78.57n ± 0%   78.56n ± 0%        ~ (p=0.222 n=20)
AppendFloat/64Fixed16-8                65.36n ± 0%   65.22n ± 0%   -0.21% (p=0.000 n=20)
AppendFloat/64Fixed12Hard-8            62.04n ± 0%   61.97n ± 0%        ~ (p=0.004 n=20)
AppendFloat/64Fixed17Hard-8            74.30n ± 0%   74.06n ± 0%   -0.32% (p=0.000 n=20)
AppendFloat/64Fixed18Hard-8            4.282µ ± 0%   4.284µ ± 0%        ~ (p=0.296 n=20)
AppendFloat/64FixedF1-8                66.05n ± 0%   66.33n ± 0%   +0.43% (p=0.000 n=20)
AppendFloat/64FixedF2-8                53.67n ± 0%   54.11n ± 0%   +0.81% (p=0.000 n=20)
AppendFloat/64FixedF3-8                47.41n ± 0%   47.59n ± 0%   +0.39% (p=0.000 n=20)
AppendFloat/Slowpath64-8               97.42n ± 0%   83.21n ± 0%  -14.59% (p=0.000 n=20)
AppendFloat/SlowpathDenormal64-8       94.74n ± 0%   80.88n ± 0%  -14.62% (p=0.000 n=20)
AppendFloat/ShorterIntervalCase32-8                  53.77n ± 0%
AppendFloat/ShorterIntervalCase64-8                  55.22n ± 0%
geomean                                77.14n        67.89n       -10.73%

host: local
goos: darwin
cpu: Apple M3 Pro
                                     │ 3c26aef8fba │             8a958b0d9c1             │
                                     │   sec/op    │   sec/op     vs base                │
AppendFloat/Decimal-12                 21.09n ± 0%   19.52n ± 0%   -7.44% (p=0.000 n=20)
AppendFloat/Float-12                   32.36n ± 0%   28.63n ± 1%  -11.54% (p=0.000 n=20)
AppendFloat/Exp-12                     31.77n ± 0%   21.67n ± 0%  -31.79% (p=0.000 n=20)
AppendFloat/NegExp-12                  31.56n ± 1%   21.68n ± 0%  -31.29% (p=0.000 n=20)
AppendFloat/LongExp-12                 33.33n ± 0%   29.21n ± 0%  -12.36% (p=0.000 n=20)
AppendFloat/Big-12                     35.24n ± 1%   26.77n ± 0%  -24.05% (p=0.000 n=20)
AppendFloat/BinaryExp-12               18.88n ± 1%   19.38n ± 2%        ~ (p=0.031 n=20)
AppendFloat/32Integer-12               21.32n ± 1%   17.27n ± 0%  -18.99% (p=0.000 n=20)
AppendFloat/32ExactFraction-12         30.85n ± 1%   21.44n ± 0%  -30.50% (p=0.000 n=20)
AppendFloat/32Point-12                 31.02n ± 1%   24.42n ± 0%  -21.26% (p=0.000 n=20)
AppendFloat/32Exp-12                   31.55n ± 0%   19.23n ± 0%  -39.06% (p=0.000 n=20)
AppendFloat/32NegExp-12                30.32n ± 1%   19.06n ± 0%  -37.13% (p=0.000 n=20)
AppendFloat/32Shortest-12              26.68n ± 0%   20.52n ± 0%  -23.07% (p=0.000 n=20)
AppendFloat/32Fixed8Hard-12            17.34n ± 1%   17.24n ± 0%        ~ (p=0.017 n=20)
AppendFloat/32Fixed9Hard-12            19.05n ± 1%   19.25n ± 1%        ~ (p=0.155 n=20)
AppendFloat/64Fixed1-12                15.66n ± 0%   15.40n ± 0%   -1.66% (p=0.000 n=20)
AppendFloat/64Fixed2-12                15.39n ± 0%   15.12n ± 0%   -1.75% (p=0.000 n=20)
AppendFloat/64Fixed2.5-12              15.14n ± 0%   15.14n ± 0%        ~ (p=0.645 n=20)
AppendFloat/64Fixed3-12                15.53n ± 0%   15.56n ± 0%   +0.23% (p=0.000 n=20)
AppendFloat/64Fixed4-12                15.28n ± 0%   15.04n ± 0%   -1.57% (p=0.000 n=20)
AppendFloat/64Fixed5Hard-12            18.32n ± 0%   18.16n ± 0%   -0.87% (p=0.000 n=20)
AppendFloat/64Fixed12-12               25.51n ± 1%   25.48n ± 0%        ~ (p=0.256 n=20)
AppendFloat/64Fixed16-12               21.32n ± 0%   21.20n ± 0%   -0.59% (p=0.000 n=20)
AppendFloat/64Fixed12Hard-12           21.11n ± 1%   20.91n ± 1%   -0.95% (p=0.001 n=20)
AppendFloat/64Fixed17Hard-12           26.89n ± 1%   25.18n ± 3%   -6.34% (p=0.000 n=20)
AppendFloat/64Fixed18Hard-12           2.057µ ± 6%   2.065µ ± 1%        ~ (p=0.856 n=20)
AppendFloat/64FixedF1-12               24.65n ± 0%   24.19n ± 0%   -1.87% (p=0.000 n=20)
AppendFloat/64FixedF2-12               20.68n ± 0%   20.94n ± 0%   +1.26% (p=0.000 n=20)
AppendFloat/64FixedF3-12               16.44n ± 0%   16.18n ± 0%   -1.58% (p=0.000 n=20)
AppendFloat/Slowpath64-12              31.68n ± 0%   29.18n ± 0%   -7.86% (p=0.000 n=20)
AppendFloat/SlowpathDenormal64-12      29.92n ± 1%   27.12n ± 0%   -9.36% (p=0.000 n=20)
AppendFloat/ShorterIntervalCase32-12                 18.44n ± 1%
AppendFloat/ShorterIntervalCase64-12                 18.57n ± 0%
geomean                                26.90n        23.50n       -11.27%

host: linux-386
goos: linux
goarch: 386
cpu: Intel(R) Xeon(R) CPU @ 2.30GHz
                                     │ 3c26aef8fba │             8a958b0d9c1             │
                                     │   sec/op    │   sec/op     vs base                │
AppendFloat/Decimal-16                 128.2n ± 0%   143.5n ± 0%  +11.93% (p=0.000 n=20)
AppendFloat/Float-16                   236.3n ± 0%   157.5n ± 0%  -33.37% (p=0.000 n=20)
AppendFloat/Exp-16                     245.3n ± 0%   148.2n ± 0%  -39.60% (p=0.000 n=20)
AppendFloat/NegExp-16                  251.2n ± 0%   147.8n ± 0%  -41.17% (p=0.000 n=20)
AppendFloat/LongExp-16                 253.2n ± 0%   176.0n ± 0%  -30.46% (p=0.000 n=20)
AppendFloat/Big-16                     278.6n ± 0%   158.1n ± 0%  -43.23% (p=0.000 n=20)
AppendFloat/BinaryExp-16               89.72n ± 0%   89.47n ± 0%        ~ (p=0.155 n=20)
AppendFloat/32Integer-16               127.1n ± 0%   111.7n ± 0%  -12.12% (p=0.000 n=20)
AppendFloat/32ExactFraction-16         206.9n ± 1%   116.3n ± 1%  -43.75% (p=0.000 n=20)
AppendFloat/32Point-16                 196.9n ± 0%   124.5n ± 1%  -36.74% (p=0.000 n=20)
AppendFloat/32Exp-16                   235.1n ± 1%   114.3n ± 0%  -51.37% (p=0.000 n=20)
AppendFloat/32NegExp-16                206.4n ± 0%   114.3n ± 1%  -44.62% (p=0.000 n=20)
AppendFloat/32Shortest-16              189.7n ± 0%   122.3n ± 0%  -35.56% (p=0.000 n=20)
AppendFloat/32Fixed8Hard-16            137.2n ± 0%   134.0n ± 0%   -2.33% (p=0.000 n=20)
AppendFloat/32Fixed9Hard-16            160.8n ± 0%   154.0n ± 0%   -4.20% (p=0.000 n=20)
AppendFloat/64Fixed1-16                140.2n ± 0%   135.0n ± 0%   -3.74% (p=0.000 n=20)
AppendFloat/64Fixed2-16                135.5n ± 0%   131.8n ± 0%   -2.69% (p=0.000 n=20)
AppendFloat/64Fixed2.5-16              133.3n ± 0%   126.5n ± 0%   -5.14% (p=0.000 n=20)
AppendFloat/64Fixed3-16                135.8n ± 0%   130.9n ± 0%   -3.57% (p=0.000 n=20)
AppendFloat/64Fixed4-16                127.9n ± 0%   122.8n ± 0%   -3.99% (p=0.000 n=20)
AppendFloat/64Fixed5Hard-16            140.7n ± 0%   136.2n ± 0%   -3.20% (p=0.000 n=20)
AppendFloat/64Fixed12-16               166.1n ± 0%   160.5n ± 0%   -3.37% (p=0.000 n=20)
AppendFloat/64Fixed16-16               160.1n ± 0%   154.2n ± 0%   -3.65% (p=0.000 n=20)
AppendFloat/64Fixed12Hard-16           156.6n ± 0%   149.0n ± 0%   -4.82% (p=0.000 n=20)
AppendFloat/64Fixed17Hard-16           173.9n ± 1%   169.6n ± 0%   -2.44% (p=0.000 n=20)
AppendFloat/64Fixed18Hard-16           10.59µ ± 1%   10.60µ ± 0%        ~ (p=0.664 n=20)
AppendFloat/64FixedF1-16               158.5n ± 0%   154.1n ± 0%   -2.75% (p=0.000 n=20)
AppendFloat/64FixedF2-16               147.1n ± 0%   143.8n ± 0%   -2.21% (p=0.000 n=20)
AppendFloat/64FixedF3-16               135.8n ± 0%   131.1n ± 0%   -3.46% (p=0.000 n=20)
AppendFloat/Slowpath64-16              244.9n ± 0%   189.7n ± 0%  -22.54% (p=0.000 n=20)
AppendFloat/SlowpathDenormal64-16      241.8n ± 0%   176.9n ± 0%  -26.86% (p=0.000 n=20)
AppendFloat/ShorterIntervalCase32-16                 114.9n ± 0%
AppendFloat/ShorterIntervalCase64-16                 130.6n ± 0%
geomean                                195.7n        157.4n       -18.30%

host: s7:GOARCH=386
cpu: AMD Ryzen 9 7950X 16-Core Processor
                                     │ 3c26aef8fba │             8a958b0d9c1             │
                                     │   sec/op    │   sec/op     vs base                │
AppendFloat/Decimal-32                 42.76n ± 0%   47.25n ± 0%  +10.51% (p=0.000 n=20)
AppendFloat/Float-32                   71.44n ± 1%   50.97n ± 0%  -28.66% (p=0.000 n=20)
AppendFloat/Exp-32                     75.51n ± 0%   48.39n ± 1%  -35.92% (p=0.000 n=20)
AppendFloat/NegExp-32                  74.70n ± 0%   48.17n ± 1%  -35.52% (p=0.000 n=20)
AppendFloat/LongExp-32                 76.52n ± 0%   57.32n ± 1%  -25.10% (p=0.000 n=20)
AppendFloat/Big-32                     83.05n ± 0%   52.92n ± 1%  -36.28% (p=0.000 n=20)
AppendFloat/BinaryExp-32               31.92n ± 1%   32.22n ± 0%   +0.96% (p=0.000 n=20)
AppendFloat/32Integer-32               41.29n ± 1%   36.81n ± 0%  -10.85% (p=0.000 n=20)
AppendFloat/32ExactFraction-32         62.29n ± 1%   38.16n ± 0%  -38.73% (p=0.000 n=20)
AppendFloat/32Point-32                 60.45n ± 1%   40.44n ± 1%  -33.11% (p=0.000 n=20)
AppendFloat/32Exp-32                   69.32n ± 1%   38.45n ± 1%  -44.53% (p=0.000 n=20)
AppendFloat/32NegExp-32                63.39n ± 0%   38.64n ± 1%  -39.03% (p=0.000 n=20)
AppendFloat/32Shortest-32              58.90n ± 1%   39.53n ± 0%  -32.89% (p=0.000 n=20)
AppendFloat/32Fixed8Hard-32            43.30n ± 0%   42.70n ± 1%   -1.36% (p=0.000 n=20)
AppendFloat/32Fixed9Hard-32            49.96n ± 1%   49.60n ± 0%   -0.72% (p=0.000 n=20)
AppendFloat/64Fixed1-32                42.99n ± 1%   42.08n ± 0%   -2.13% (p=0.000 n=20)
AppendFloat/64Fixed2-32                41.58n ± 0%   41.42n ± 1%        ~ (p=0.077 n=20)
AppendFloat/64Fixed2.5-32              40.47n ± 1%   40.00n ± 1%   -1.15% (p=0.000 n=20)
AppendFloat/64Fixed3-32                43.43n ± 1%   41.67n ± 0%   -4.04% (p=0.000 n=20)
AppendFloat/64Fixed4-32                40.44n ± 0%   39.40n ± 0%   -2.58% (p=0.000 n=20)
AppendFloat/64Fixed5Hard-32            43.41n ± 0%   42.72n ± 0%   -1.60% (p=0.000 n=20)
AppendFloat/64Fixed12-32               52.00n ± 0%   51.26n ± 0%   -1.43% (p=0.000 n=20)
AppendFloat/64Fixed16-32               50.62n ± 1%   50.55n ± 0%        ~ (p=0.234 n=20)
AppendFloat/64Fixed12Hard-32           49.36n ± 0%   47.89n ± 0%   -2.98% (p=0.000 n=20)
AppendFloat/64Fixed17Hard-32           56.91n ± 0%   55.66n ± 1%   -2.19% (p=0.000 n=20)
AppendFloat/64Fixed18Hard-32           3.983µ ± 0%   3.964µ ± 0%        ~ (p=0.014 n=20)
AppendFloat/64FixedF1-32               49.31n ± 1%   49.10n ± 1%        ~ (p=0.005 n=20)
AppendFloat/64FixedF2-32               45.06n ± 0%   44.00n ± 1%   -2.36% (p=0.000 n=20)
AppendFloat/64FixedF3-32               42.22n ± 0%   42.20n ± 1%        ~ (p=0.644 n=20)
AppendFloat/Slowpath64-32              75.77n ± 0%   60.89n ± 1%  -19.63% (p=0.000 n=20)
AppendFloat/SlowpathDenormal64-32      74.88n ± 1%   57.59n ± 1%  -23.10% (p=0.000 n=20)
AppendFloat/ShorterIntervalCase32-32                 37.66n ± 1%
AppendFloat/ShorterIntervalCase64-32                 42.49n ± 1%
geomean                                61.34n        51.27n       -15.08%

host: linux-arm
goarch: arm
cpu: ARMv8 Processor rev 1 (v8l)
                                    │ 3c26aef8fba │             8a958b0d9c1             │
                                    │   sec/op    │   sec/op     vs base                │
AppendFloat/Decimal-4                 110.8n ± 0%   135.0n ± 0%  +21.84% (p=0.000 n=20)
AppendFloat/Float-4                   172.0n ± 0%   145.1n ± 0%  -15.64% (p=0.000 n=20)
AppendFloat/Exp-4                     172.1n ± 0%   136.2n ± 0%  -20.89% (p=0.000 n=20)
AppendFloat/NegExp-4                  172.6n ± 0%   135.8n ± 0%  -21.32% (p=0.000 n=20)
AppendFloat/LongExp-4                 180.2n ± 0%   161.9n ± 0%  -10.18% (p=0.000 n=20)
AppendFloat/Big-4                     195.5n ± 0%   143.8n ± 0%  -26.45% (p=0.000 n=20)
AppendFloat/BinaryExp-4               84.75n ± 0%   86.40n ± 0%   +1.94% (p=0.000 n=20)
AppendFloat/32Integer-4               110.4n ± 0%   110.0n ± 0%   -0.32% (p=0.000 n=20)
AppendFloat/32ExactFraction-4         152.9n ± 0%   114.0n ± 0%  -25.44% (p=0.000 n=20)
AppendFloat/32Point-4                 151.5n ± 0%   120.1n ± 0%  -20.72% (p=0.000 n=20)
AppendFloat/32Exp-4                   163.1n ± 0%   111.3n ± 0%  -31.76% (p=0.000 n=20)
AppendFloat/32NegExp-4                152.0n ± 0%   111.1n ± 0%  -26.91% (p=0.000 n=20)
AppendFloat/32Shortest-4              145.8n ± 0%   116.5n ± 0%  -20.13% (p=0.000 n=20)
AppendFloat/32Fixed8Hard-4            104.1n ± 0%   104.0n ± 0%   -0.10% (p=0.000 n=20)
AppendFloat/32Fixed9Hard-4            114.2n ± 0%   115.7n ± 0%   +1.31% (p=0.000 n=20)
AppendFloat/64Fixed1-4                97.35n ± 0%   97.31n ± 0%        ~ (p=0.357 n=20)
AppendFloat/64Fixed2-4                95.74n ± 0%   95.28n ± 0%   -0.49% (p=0.000 n=20)
AppendFloat/64Fixed2.5-4              94.24n ± 0%   93.32n ± 0%   -0.97% (p=0.000 n=20)
AppendFloat/64Fixed3-4                95.56n ± 0%   95.30n ± 0%   -0.27% (p=0.000 n=20)
AppendFloat/64Fixed4-4                92.36n ± 0%   91.52n ± 0%   -0.91% (p=0.000 n=20)
AppendFloat/64Fixed5Hard-4            101.5n ± 0%   102.0n ± 0%   +0.49% (p=0.000 n=20)
AppendFloat/64Fixed12-4               125.5n ± 0%   124.6n ± 0%   -0.72% (p=0.000 n=20)
AppendFloat/64Fixed16-4               121.8n ± 0%   122.7n ± 0%   +0.74% (p=0.000 n=20)
AppendFloat/64Fixed12Hard-4           116.1n ± 0%   116.4n ± 0%   +0.26% (p=0.000 n=20)
AppendFloat/64Fixed17Hard-4           129.8n ± 0%   131.1n ± 0%   +1.00% (p=0.000 n=20)
AppendFloat/64Fixed18Hard-4           7.945µ ± 0%   7.950µ ± 0%   +0.06% (p=0.000 n=20)
AppendFloat/64FixedF1-4               112.8n ± 0%   111.4n ± 0%   -1.24% (p=0.000 n=20)
AppendFloat/64FixedF2-4               100.6n ± 0%   100.5n ± 0%        ~ (p=0.066 n=20)
AppendFloat/64FixedF3-4               96.45n ± 0%   95.41n ± 0%   -1.08% (p=0.000 n=20)
AppendFloat/Slowpath64-4              176.3n ± 0%   165.9n ± 0%   -5.90% (p=0.000 n=20)
AppendFloat/SlowpathDenormal64-4      178.2n ± 0%   152.4n ± 0%  -14.48% (p=0.000 n=20)
AppendFloat/ShorterIntervalCase32-4                 112.8n ± 0%
AppendFloat/ShorterIntervalCase64-4                 119.0n ± 0%
geomean                               144.6n        132.1n        -7.84%

Change-Id: I1eb3c7b8756ad6cf938bc9b81180e01fd8a4cd9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/723861
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Russ Cox <rsc@golang.org>

7 weeks agocompress/flate: move big non-pointer arrays to end of compressor
Ian Lance Taylor [Mon, 29 Sep 2025 04:38:53 +0000 (21:38 -0700)]
compress/flate: move big non-pointer arrays to end of compressor

The compressor type is fairly large: 656616 bytes on amd64.
Before this patch, it had fields of slice and interface type
near the end of the struct. As those types always contain pointers,
the ptrBytes value in the type descriptor was quite large.
That forces the garbage collector to do extra work scanning for pointers,
and wastes a bit of executable space recording the gcmask for the type.

This patch moves the arrays to the end of the type,
fixing those minor issues.

Change-Id: I849a75a19cc61137c8797a1ea5a4c97e0f69b4db
Reviewed-on: https://go-review.googlesource.com/c/go/+/707596
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
7 weeks agocmd/internal/obj/riscv: document compressed instructions
Mark Ryan [Mon, 10 Nov 2025 09:07:51 +0000 (10:07 +0100)]
cmd/internal/obj/riscv: document compressed instructions

We update the RISC-V assembler documentation to describe how
the RISC-V compressed instruction set is implemented by the
assembler and how compressed instructions can be disabled.

Change-Id: Ic7b1cb1586e6906af78adb8ff5fa10f5fbfde292
Reviewed-on: https://go-review.googlesource.com/c/go/+/719221
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Auto-Submit: Joel Sing <joel@sing.id.au>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
7 weeks agopath: add more examples for path.Clean
Louis Nyffenegger [Sun, 6 Jul 2025 11:18:42 +0000 (11:18 +0000)]
path: add more examples for path.Clean

Clarify that the function path.Clean only normalises paths and does not
protect against directory-traversal attacks.

Change-Id: I66f1267ac15900ac0cb6011ace0c79aabaebc68b
GitHub-Last-Rev: d669e1edf6221e7c8e0a9aa7bf46493c8ea85ba0
GitHub-Pull-Request: golang/go#74397
Reviewed-on: https://go-review.googlesource.com/c/go/+/684376
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>

7 weeks agomaps: use strings.EqualFold in example
guoguangwu [Tue, 20 Feb 2024 06:13:08 +0000 (06:13 +0000)]
maps: use strings.EqualFold in example

Change-Id: I40a9684a9465e844ff1de46601edf23de7b637e3
GitHub-Last-Rev: 15ef023853d1f18160b290f32468f1ce0c38d12d
GitHub-Pull-Request: golang/go#65541
Reviewed-on: https://go-review.googlesource.com/c/go/+/561855
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Ian Lance Taylor <iant@google.com>
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: Cherry Mui <cherryyz@google.com>
7 weeks agostrconv: replace Ryu ftoa with Dragonbox
Taichi Maeda [Thu, 20 Nov 2025 23:56:29 +0000 (23:56 +0000)]
strconv: replace Ryu ftoa with Dragonbox

Dragonbox is a faster ftoa algorithm that provides the same guarantees
as Ryu: round-trip conversion, shortest length, and correct rounding.
Dragonbox only supports shortest-precision conversion, so we continue to
use Ryu-printf for fixed precision.

The new implementation has been fuzz-tested against the current
Ryu implementation in addition to the existing test suite.
Benchmarks show at least ~15-20% performance improvement.

The following shows the relevant output from benchstat. Full benchmark
results and plots are available at:
https://github.com/taichimaeda/dragonbox-bench/

goos: darwin
goarch: arm64
pkg: strconv
cpu: Apple M1
                                    │   old.txt    │               new.txt                │
                                    │    sec/op    │    sec/op     vs base                │
FormatFloat/Decimal-8                 32.71n ± 14%   31.89n ± 12%        ~ (p=0.165 n=10)
FormatFloat/Float-8                   45.54n ±  1%   42.48n ±  0%   -6.70% (p=0.000 n=10)
FormatFloat/Exp-8                     50.06n ±  0%   32.27n ±  1%  -35.54% (p=0.000 n=10)
FormatFloat/NegExp-8                  47.15n ±  1%   31.33n ±  0%  -33.56% (p=0.000 n=10)
FormatFloat/LongExp-8                 46.15n ±  1%   43.66n ±  0%   -5.38% (p=0.000 n=10)
FormatFloat/Big-8                     50.02n ±  0%   39.36n ±  0%  -21.31% (p=0.000 n=10)
FormatFloat/BinaryExp-8               27.89n ±  0%   27.88n ±  1%        ~ (p=0.798 n=10)
FormatFloat/32Integer-8               31.41n ±  0%   23.00n ±  3%  -26.79% (p=0.000 n=10)
FormatFloat/32ExactFraction-8         44.93n ±  1%   29.91n ±  0%  -33.43% (p=0.000 n=10)
FormatFloat/32Point-8                 43.22n ±  1%   33.82n ±  0%  -21.74% (p=0.000 n=10)
FormatFloat/32Exp-8                   45.91n ±  0%   25.48n ±  0%  -44.50% (p=0.000 n=10)
FormatFloat/32NegExp-8                44.66n ±  0%   25.12n ±  0%  -43.76% (p=0.000 n=10)
FormatFloat/32Shortest-8              37.96n ±  0%   27.83n ±  1%  -26.68% (p=0.000 n=10)
FormatFloat/Slowpath64-8              47.74n ±  2%   45.85n ±  0%   -3.96% (p=0.000 n=10)
FormatFloat/SlowpathDenormal64-8      42.78n ±  1%   41.46n ±  0%   -3.07% (p=0.000 n=10)
FormatFloat/ShorterIntervalCase32-8                  25.49n ±  2%
FormatFloat/ShorterIntervalCase64-8                  27.72n ±  1%
geomean                               41.95n         31.89n        -22.11%

Fixes #74886

Co-authored-by: Junekey Jeon <j6jeon@ucsd.edu>
Change-Id: I923f7259c9cecd0896b2340a43d1041cc2ed7787
GitHub-Last-Rev: fd735db0b1e3fab5fbad4d8b75c8e29247069d94
GitHub-Pull-Request: golang/go#75195
Reviewed-on: https://go-review.googlesource.com/c/go/+/700075
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Bypass: Russ Cox <rsc@golang.org>

7 weeks agocrypto: fix dead links and correct SHA-512 algorithm comment
Neal Patel [Wed, 8 Oct 2025 18:13:56 +0000 (14:13 -0400)]
crypto: fix dead links and correct SHA-512 algorithm comment

Change-Id: I71d63b0b78a9fc4895574f6df465e22c9585e77c
Reviewed-on: https://go-review.googlesource.com/c/go/+/710196
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agocrypto/internal/fips140/sha512: interleave scheduling with rounds for 10.3% speed-up
Neal Patel [Tue, 14 Oct 2025 20:14:00 +0000 (16:14 -0400)]
crypto/internal/fips140/sha512: interleave scheduling with rounds for 10.3% speed-up

goos: linux
goarch: amd64
pkg: crypto/sha512
cpu: AMD EPYC 7B13
                    │   before    │               after                │
                    │   sec/op    │   sec/op     vs base               │
Hash8Bytes/New        486.7n ± 1%   440.3n ± 0%   -9.53% (p=0.001 n=7)
Hash8Bytes/New-2      487.3n ± 1%   442.6n ± 1%   -9.17% (p=0.001 n=7)
Hash8Bytes/New-4      488.0n ± 1%   442.3n ± 0%   -9.36% (p=0.001 n=7)
Hash8Bytes/Sum384     495.1n ± 0%   451.2n ± 1%   -8.87% (p=0.001 n=7)
Hash8Bytes/Sum384-2   495.0n ± 1%   450.8n ± 1%   -8.93% (p=0.001 n=7)
Hash8Bytes/Sum384-4   500.2n ± 2%   453.6n ± 2%   -9.32% (p=0.001 n=7)
Hash8Bytes/Sum512     497.3n ± 1%   452.1n ± 0%   -9.09% (p=0.001 n=7)
Hash8Bytes/Sum512-2   496.0n ± 1%   453.5n ± 0%   -8.57% (p=0.001 n=7)
Hash8Bytes/Sum512-4   498.5n ± 0%   452.3n ± 1%   -9.27% (p=0.001 n=7)
Hash1K/New            3.985µ ± 1%   3.543µ ± 1%  -11.09% (p=0.001 n=7)
Hash1K/New-2          4.004µ ± 2%   3.558µ ± 1%  -11.14% (p=0.001 n=7)
Hash1K/New-4          3.997µ ± 0%   3.563µ ± 1%  -10.86% (p=0.001 n=7)
Hash1K/Sum384         3.996µ ± 1%   3.560µ ± 1%  -10.91% (p=0.001 n=7)
Hash1K/Sum384-2       4.011µ ± 1%   3.576µ ± 1%  -10.85% (p=0.001 n=7)
Hash1K/Sum384-4       4.004µ ± 0%   3.564µ ± 0%  -10.99% (p=0.001 n=7)
Hash1K/Sum512         3.998µ ± 1%   3.555µ ± 1%  -11.08% (p=0.001 n=7)
Hash1K/Sum512-2       3.996µ ± 0%   3.560µ ± 1%  -10.91% (p=0.001 n=7)
Hash1K/Sum512-4       4.004µ ± 1%   3.573µ ± 1%  -10.76% (p=0.001 n=7)
Hash8K/New            28.34µ ± 1%   25.29µ ± 1%  -10.77% (p=0.001 n=7)
Hash8K/New-2          28.45µ ± 1%   25.48µ ± 1%  -10.44% (p=0.001 n=7)
Hash8K/New-4          28.42µ ± 1%   25.37µ ± 1%  -10.71% (p=0.001 n=7)
Hash8K/Sum384         28.38µ ± 0%   25.18µ ± 0%  -11.28% (p=0.001 n=7)
Hash8K/Sum384-2       28.50µ ± 1%   25.35µ ± 1%  -11.07% (p=0.001 n=7)
Hash8K/Sum384-4       28.51µ ± 1%   25.35µ ± 0%  -11.07% (p=0.001 n=7)
Hash8K/Sum512         28.34µ ± 1%   25.23µ ± 0%  -10.96% (p=0.001 n=7)
Hash8K/Sum512-2       28.33µ ± 1%   25.23µ ± 1%  -10.95% (p=0.001 n=7)
Hash8K/Sum512-4       28.48µ ± 1%   25.31µ ± 1%  -11.13% (p=0.001 n=7)
geomean               3.828µ        3.433µ       -10.34%

                    │    before    │                after                │
                    │     B/s      │     B/s       vs base               │
Hash8Bytes/New        15.68Mi ± 1%   17.33Mi ± 0%  +10.52% (p=0.001 n=7)
Hash8Bytes/New-2      15.66Mi ± 1%   17.23Mi ± 1%  +10.05% (p=0.001 n=7)
Hash8Bytes/New-4      15.63Mi ± 0%   17.25Mi ± 0%  +10.37% (p=0.001 n=7)
Hash8Bytes/Sum384     15.41Mi ± 0%   16.91Mi ± 1%   +9.72% (p=0.001 n=7)
Hash8Bytes/Sum384-2   15.41Mi ± 1%   16.93Mi ± 1%   +9.84% (p=0.001 n=7)
Hash8Bytes/Sum384-4   15.25Mi ± 2%   16.82Mi ± 2%  +10.32% (p=0.001 n=7)
Hash8Bytes/Sum512     15.34Mi ± 1%   16.87Mi ± 0%   +9.94% (p=0.001 n=7)
Hash8Bytes/Sum512-2   15.38Mi ± 1%   16.82Mi ± 0%   +9.36% (p=0.001 n=7)
Hash8Bytes/Sum512-4   15.31Mi ± 0%   16.87Mi ± 1%  +10.22% (p=0.001 n=7)
Hash1K/New            245.0Mi ± 1%   275.6Mi ± 1%  +12.47% (p=0.001 n=7)
Hash1K/New-2          243.9Mi ± 2%   274.5Mi ± 1%  +12.55% (p=0.001 n=7)
Hash1K/New-4          244.3Mi ± 0%   274.1Mi ± 1%  +12.21% (p=0.001 n=7)
Hash1K/Sum384         244.4Mi ± 0%   274.3Mi ± 1%  +12.24% (p=0.001 n=7)
Hash1K/Sum384-2       243.5Mi ± 1%   273.1Mi ± 1%  +12.16% (p=0.001 n=7)
Hash1K/Sum384-4       243.9Mi ± 0%   274.0Mi ± 0%  +12.35% (p=0.001 n=7)
Hash1K/Sum512         244.3Mi ± 1%   274.7Mi ± 1%  +12.46% (p=0.001 n=7)
Hash1K/Sum512-2       244.4Mi ± 0%   274.3Mi ± 1%  +12.25% (p=0.001 n=7)
Hash1K/Sum512-4       243.9Mi ± 1%   273.3Mi ± 1%  +12.08% (p=0.001 n=7)
Hash8K/New            275.7Mi ± 1%   309.0Mi ± 1%  +12.07% (p=0.001 n=7)
Hash8K/New-2          274.6Mi ± 1%   306.6Mi ± 1%  +11.67% (p=0.001 n=7)
Hash8K/New-4          274.9Mi ± 1%   307.9Mi ± 1%  +11.99% (p=0.001 n=7)
Hash8K/Sum384         275.3Mi ± 0%   310.3Mi ± 0%  +12.71% (p=0.001 n=7)
Hash8K/Sum384-2       274.1Mi ± 1%   308.2Mi ± 1%  +12.45% (p=0.001 n=7)
Hash8K/Sum384-4       274.1Mi ± 1%   308.2Mi ± 0%  +12.44% (p=0.001 n=7)
Hash8K/Sum512         275.7Mi ± 1%   309.6Mi ± 0%  +12.31% (p=0.001 n=7)
Hash8K/Sum512-2       275.8Mi ± 1%   309.7Mi ± 1%  +12.29% (p=0.001 n=7)
Hash8K/Sum512-4       274.3Mi ± 1%   308.7Mi ± 1%  +12.52% (p=0.001 n=7)
geomean               101.2Mi        112.9Mi       +11.53%

                    │    before    │               after                │
                    │     B/op     │    B/op     vs base                │
Hash8Bytes/New        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-2      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-4      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum384     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum384-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum384-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum512     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum512-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum512-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum384         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum384-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum384-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum512         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum512-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum512-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum384         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum384-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum384-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum512         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum512-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum512-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
geomean                          ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                    │    before    │               after                │
                    │  allocs/op   │ allocs/op   vs base                │
Hash8Bytes/New        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-2      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-4      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum384     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum384-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum384-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum512     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum512-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum512-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum384         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum384-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum384-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum512         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum512-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum512-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum384         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum384-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum384-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum512         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum512-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum512-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
geomean                          ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

Change-Id: I3791244b3f69e093203f6aa46dc59428afcb9223
Reviewed-on: https://go-review.googlesource.com/c/go/+/711844
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
7 weeks agocrypto/internal/fips140/sha256: interleave scheduling and rounds for 11.2% speed-up
Neal Patel [Tue, 14 Oct 2025 19:31:44 +0000 (15:31 -0400)]
crypto/internal/fips140/sha256: interleave scheduling and rounds for 11.2% speed-up

goos: linux
goarch: amd64
pkg: crypto/sha256
cpu: AMD EPYC 7B13
                    │   before    │               after                │
                    │   sec/op    │   sec/op     vs base               │
Hash8Bytes/New        384.4n ± 2%   347.2n ± 0%   -9.68% (p=0.001 n=7)
Hash8Bytes/New-2      386.3n ± 2%   348.3n ± 1%   -9.84% (p=0.001 n=7)
Hash8Bytes/New-4      386.7n ± 1%   347.9n ± 1%  -10.03% (p=0.001 n=7)
Hash8Bytes/Sum224     406.9n ± 2%   358.8n ± 3%  -11.82% (p=0.001 n=7)
Hash8Bytes/Sum224-2   404.1n ± 1%   359.8n ± 1%  -10.96% (p=0.001 n=7)
Hash8Bytes/Sum224-4   409.5n ± 1%   360.9n ± 1%  -11.87% (p=0.001 n=7)
Hash8Bytes/Sum256     401.3n ± 1%   352.4n ± 0%  -12.19% (p=0.001 n=7)
Hash8Bytes/Sum256-2   402.0n ± 1%   354.2n ± 1%  -11.89% (p=0.001 n=7)
Hash8Bytes/Sum256-4   403.7n ± 1%   353.5n ± 1%  -12.43% (p=0.001 n=7)
Hash1K/New            5.836µ ± 1%   5.180µ ± 2%  -11.24% (p=0.001 n=7)
Hash1K/New-2          5.855µ ± 1%   5.177µ ± 5%  -11.58% (p=0.001 n=7)
Hash1K/New-4          5.878µ ± 0%   5.215µ ± 3%  -11.28% (p=0.001 n=7)
Hash1K/Sum224         5.860µ ± 1%   5.225µ ± 1%  -10.84% (p=0.001 n=7)
Hash1K/Sum224-2       5.852µ ± 1%   5.198µ ± 1%  -11.18% (p=0.001 n=7)
Hash1K/Sum224-4       5.867µ ± 1%   5.226µ ± 4%  -10.93% (p=0.001 n=7)
Hash1K/Sum256         5.851µ ± 0%   5.246µ ± 1%  -10.34% (p=0.001 n=7)
Hash1K/Sum256-2       5.863µ ± 1%   5.237µ ± 2%  -10.68% (p=0.001 n=7)
Hash1K/Sum256-4       5.873µ ± 1%   5.191µ ± 1%  -11.61% (p=0.001 n=7)
Hash8K/New            44.06µ ± 0%   38.93µ ± 1%  -11.63% (p=0.001 n=7)
Hash8K/New-2          44.23µ ± 0%   39.14µ ± 1%  -11.50% (p=0.001 n=7)
Hash8K/New-4          44.25µ ± 1%   39.04µ ± 1%  -11.77% (p=0.001 n=7)
Hash8K/Sum224         43.98µ ± 1%   40.47µ ± 2%   -7.98% (p=0.001 n=7)
Hash8K/Sum224-2       44.31µ ± 1%   39.54µ ± 3%  -10.76% (p=0.001 n=7)
Hash8K/Sum224-4       44.45µ ± 1%   39.04µ ± 2%  -12.16% (p=0.001 n=7)
Hash8K/Sum256         43.95µ ± 0%   39.23µ ± 0%  -10.75% (p=0.001 n=7)
Hash8K/Sum256-2       44.19µ ± 1%   39.39µ ± 2%  -10.87% (p=0.001 n=7)
Hash8K/Sum256-4       44.19µ ± 1%   39.27µ ± 1%  -11.13% (p=0.001 n=7)
Hash256K/New          1.397m ± 1%   1.238m ± 1%  -11.39% (p=0.001 n=7)
Hash256K/New-2        1.404m ± 1%   1.242m ± 1%  -11.53% (p=0.001 n=7)
Hash256K/New-4        1.402m ± 1%   1.243m ± 1%  -11.31% (p=0.001 n=7)
Hash256K/Sum224       1.398m ± 0%   1.237m ± 1%  -11.48% (p=0.001 n=7)
Hash256K/Sum224-2     1.402m ± 1%   1.239m ± 1%  -11.59% (p=0.001 n=7)
Hash256K/Sum224-4     1.409m ± 1%   1.245m ± 1%  -11.61% (p=0.001 n=7)
Hash256K/Sum256       1.402m ± 1%   1.242m ± 1%  -11.38% (p=0.001 n=7)
Hash256K/Sum256-2     1.397m ± 1%   1.240m ± 1%  -11.22% (p=0.001 n=7)
Hash256K/Sum256-4     1.404m ± 1%   1.250m ± 1%  -10.97% (p=0.001 n=7)
Hash1M/New            5.584m ± 2%   4.944m ± 1%  -11.46% (p=0.001 n=7)
Hash1M/New-2          5.609m ± 1%   4.974m ± 1%  -11.33% (p=0.001 n=7)
Hash1M/New-4          5.625m ± 2%   4.984m ± 2%  -11.40% (p=0.001 n=7)
Hash1M/Sum224         5.578m ± 0%   4.949m ± 0%  -11.28% (p=0.001 n=7)
Hash1M/Sum224-2       5.603m ± 1%   4.985m ± 1%  -11.02% (p=0.001 n=7)
Hash1M/Sum224-4       5.619m ± 1%   4.976m ± 1%  -11.44% (p=0.001 n=7)
Hash1M/Sum256         5.589m ± 1%   4.940m ± 0%  -11.61% (p=0.001 n=7)
Hash1M/Sum256-2       5.581m ± 1%   4.981m ± 1%  -10.75% (p=0.001 n=7)
Hash1M/Sum256-4       5.618m ± 3%   4.966m ± 1%  -11.59% (p=0.001 n=7)
geomean               60.48µ        53.71µ       -11.19%

                    │    before    │                after                │
                    │     B/s      │     B/s       vs base               │
Hash8Bytes/New        19.85Mi ± 2%   21.97Mi ± 0%  +10.72% (p=0.001 n=7)
Hash8Bytes/New-2      19.75Mi ± 2%   21.91Mi ± 1%  +10.91% (p=0.001 n=7)
Hash8Bytes/New-4      19.73Mi ± 1%   21.93Mi ± 1%  +11.16% (p=0.001 n=7)
Hash8Bytes/Sum224     18.75Mi ± 2%   21.27Mi ± 3%  +13.43% (p=0.001 n=7)
Hash8Bytes/Sum224-2   18.88Mi ± 1%   21.20Mi ± 1%  +12.27% (p=0.001 n=7)
Hash8Bytes/Sum224-4   18.63Mi ± 1%   21.14Mi ± 1%  +13.46% (p=0.001 n=7)
Hash8Bytes/Sum256     19.01Mi ± 1%   21.65Mi ± 0%  +13.90% (p=0.001 n=7)
Hash8Bytes/Sum256-2   18.98Mi ± 1%   21.54Mi ± 1%  +13.52% (p=0.001 n=7)
Hash8Bytes/Sum256-4   18.90Mi ± 1%   21.58Mi ± 1%  +14.18% (p=0.001 n=7)
Hash1K/New            167.4Mi ± 1%   188.5Mi ± 2%  +12.65% (p=0.001 n=7)
Hash1K/New-2          166.8Mi ± 1%   188.6Mi ± 5%  +13.11% (p=0.001 n=7)
Hash1K/New-4          166.1Mi ± 0%   187.3Mi ± 3%  +12.71% (p=0.001 n=7)
Hash1K/Sum224         166.7Mi ± 1%   186.9Mi ± 1%  +12.14% (p=0.001 n=7)
Hash1K/Sum224-2       166.9Mi ± 1%   187.9Mi ± 1%  +12.59% (p=0.001 n=7)
Hash1K/Sum224-4       166.5Mi ± 1%   186.9Mi ± 4%  +12.27% (p=0.001 n=7)
Hash1K/Sum256         166.9Mi ± 0%   186.1Mi ± 1%  +11.51% (p=0.001 n=7)
Hash1K/Sum256-2       166.6Mi ± 1%   186.5Mi ± 2%  +11.94% (p=0.001 n=7)
Hash1K/Sum256-4       166.3Mi ± 1%   188.1Mi ± 1%  +13.15% (p=0.001 n=7)
Hash8K/New            177.3Mi ± 0%   200.7Mi ± 1%  +13.17% (p=0.001 n=7)
Hash8K/New-2          176.6Mi ± 0%   199.6Mi ± 1%  +13.00% (p=0.001 n=7)
Hash8K/New-4          176.6Mi ± 1%   200.1Mi ± 1%  +13.34% (p=0.001 n=7)
Hash8K/Sum224         177.6Mi ± 1%   193.0Mi ± 2%   +8.67% (p=0.001 n=7)
Hash8K/Sum224-2       176.3Mi ± 1%   197.6Mi ± 3%  +12.06% (p=0.001 n=7)
Hash8K/Sum224-4       175.8Mi ± 1%   200.1Mi ± 2%  +13.84% (p=0.001 n=7)
Hash8K/Sum256         177.8Mi ± 0%   199.2Mi ± 0%  +12.04% (p=0.001 n=7)
Hash8K/Sum256-2       176.8Mi ± 1%   198.4Mi ± 2%  +12.20% (p=0.001 n=7)
Hash8K/Sum256-4       176.8Mi ± 1%   198.9Mi ± 1%  +12.52% (p=0.001 n=7)
Hash256K/New          179.0Mi ± 1%   202.0Mi ± 1%  +12.86% (p=0.001 n=7)
Hash256K/New-2        178.1Mi ± 1%   201.3Mi ± 1%  +13.03% (p=0.001 n=7)
Hash256K/New-4        178.4Mi ± 1%   201.1Mi ± 1%  +12.76% (p=0.001 n=7)
Hash256K/Sum224       178.8Mi ± 0%   202.0Mi ± 1%  +12.97% (p=0.001 n=7)
Hash256K/Sum224-2     178.3Mi ± 1%   201.7Mi ± 1%  +13.11% (p=0.001 n=7)
Hash256K/Sum224-4     177.5Mi ± 1%   200.8Mi ± 1%  +13.13% (p=0.001 n=7)
Hash256K/Sum256       178.3Mi ± 1%   201.2Mi ± 1%  +12.83% (p=0.001 n=7)
Hash256K/Sum256-2     179.0Mi ± 1%   201.6Mi ± 1%  +12.64% (p=0.001 n=7)
Hash256K/Sum256-4     178.0Mi ± 1%   200.0Mi ± 1%  +12.33% (p=0.001 n=7)
Hash1M/New            179.1Mi ± 2%   202.3Mi ± 1%  +12.94% (p=0.001 n=7)
Hash1M/New-2          178.3Mi ± 1%   201.1Mi ± 1%  +12.78% (p=0.001 n=7)
Hash1M/New-4          177.8Mi ± 2%   200.6Mi ± 2%  +12.87% (p=0.001 n=7)
Hash1M/Sum224         179.3Mi ± 0%   202.1Mi ± 0%  +12.71% (p=0.001 n=7)
Hash1M/Sum224-2       178.5Mi ± 1%   200.6Mi ± 1%  +12.39% (p=0.001 n=7)
Hash1M/Sum224-4       178.0Mi ± 1%   201.0Mi ± 1%  +12.92% (p=0.001 n=7)
Hash1M/Sum256         178.9Mi ± 1%   202.4Mi ± 0%  +13.13% (p=0.001 n=7)
Hash1M/Sum256-2       179.2Mi ± 1%   200.8Mi ± 1%  +12.04% (p=0.001 n=7)
Hash1M/Sum256-4       178.0Mi ± 3%   201.3Mi ± 1%  +13.12% (p=0.001 n=7)
geomean               112.5Mi        126.6Mi       +12.60%

                    │    before    │               after                │
                    │     B/op     │    B/op     vs base                │
Hash8Bytes/New        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-2      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-4      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum224     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum224-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum224-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum256     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum256-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum256-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum224         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum224-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum224-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum256         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum256-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum256-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum224         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum224-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum224-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum256         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum256-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum256-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/New          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/New-2        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/New-4        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum224       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum224-2     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum224-4     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum256       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum256-2     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum256-4     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum224         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum224-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum224-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum256         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum256-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum256-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
geomean                          ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                    │    before    │               after                │
                    │  allocs/op   │ allocs/op   vs base                │
Hash8Bytes/New        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-2      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/New-4      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum224     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum224-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum224-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum256     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum256-2   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8Bytes/Sum256-4   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum224         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum224-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum224-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum256         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum256-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1K/Sum256-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum224         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum224-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum224-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum256         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum256-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash8K/Sum256-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/New          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/New-2        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/New-4        0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum224       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum224-2     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum224-4     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum256       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum256-2     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash256K/Sum256-4     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/New            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/New-2          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/New-4          0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum224         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum224-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum224-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum256         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum256-2       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
Hash1M/Sum256-4       0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=7) ¹
geomean                          ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

Change-Id: I705f024221690532b2e891ab8e508d07eefe295b
Reviewed-on: https://go-review.googlesource.com/c/go/+/711843
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agointernal/runtime/cgroup: allow more tests to run on all OSes
胡玮文 [Fri, 21 Nov 2025 15:26:50 +0000 (23:26 +0800)]
internal/runtime/cgroup: allow more tests to run on all OSes

Move non-Linux specific part out of _linux.go. The parsing code itself
doesn't depend anything Linux specific, even if it the format is Linux
specific.

This should benefit developers working on non-Linux OSes.

Change-Id: I1692978d583c3dd9a57ff269c97e8fca53a7a057
Reviewed-on: https://go-review.googlesource.com/c/go/+/723240
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Carrillo Rodriguez <carrillorodriguez672@gmail.com>
7 weeks agocrypto/internal/fips140/bigmod: vector implementation of addMulVVWx on s390x
kmvijay [Thu, 30 Oct 2025 14:50:14 +0000 (14:50 +0000)]
crypto/internal/fips140/bigmod: vector implementation of addMulVVWx on s390x

addMulVVWx assembly routine is used to multiply bignum multiplicand with a 64-bit multiplier.
The new implementation for s390x architecture uses an algorithm based on vector instructions,
with a significant performance improvement.

Note: z13 is the minimum architecture for Go, which already has VX support.

The performance improvement is as below:

goos: linux
goarch: s390x
pkg: crypto/internal/fips140/bigmod
                  Orig.txt       Vector_Patch.txt
                   sec/op             sec/op          vs base
ModAdd          164.1n ± 0%   159.7n ± 0%      -2.7% (p=0.000 n=10)
ModSub          152.3n ± 1%   147.3n ± 0%      -3.25 (p=0.000 n=10)
MontgomeryRepr  4.806µ ± 3% 1.829µ ± 0%    -61.94% (p=0.000 n=10)
MontgomeryMul   4.812µ ± 5% 1.834µ ± 0%    -61.90% (p=0.000 n=10)
ModMul          9.646µ ± 3% 3.698µ ± 0%    -61.67% (p=0.000 n=10)
ExpBig          11.28m ± 0%   11.28m ± 0%      +0.04 (p=0.035 n=10)
Exp             12.284m ± 5%  5.004m ± 1%    -59.26  (p=0.000 n=10)
geomean         18.61µ        10.74µ         -42.2

Change-Id: I679944c9dac9f43f1626b018f72efa6da0d2442d
Cq-Include-Trybots: luci.golang.try:gotip-linux-s390x
Reviewed-on: https://go-review.googlesource.com/c/go/+/716480
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Srinivas Pokala <Pokala.Srinivas@ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agonet/url: fix example of Values.Encode
José Joaquín Atria [Mon, 24 Nov 2025 19:52:22 +0000 (19:52 +0000)]
net/url: fix example of Values.Encode

Calling url.Values.Encode generates a query string with the
values sorted by key. However, in the example in the documentation
this behaviour is not reflected. This change corrects this.

Change-Id: Id95a5d79b57dc20c3bff1f0c6975c76dcd8412b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/723960
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Sean Liao <sean@liao.dev>

7 weeks agocrypto/sha3: reduce cSHAKE allocations
Tom Thorogood [Sun, 15 Dec 2024 01:38:43 +0000 (12:08 +1030)]
crypto/sha3: reduce cSHAKE allocations

Consider a hypothetical SumCSHAKE256 function:

func SumCSHAKE256(N, S, data []byte, length int) []byte {
out := make([]byte, 64)
return sumCSHAKE256(out, N, S, data, length)
}

func sumCSHAKE256(out, N, S, data []byte, length int) []byte {
if len(out) < length {
out = make([]byte, length)
} else {
out = out[:length]
}
h := sha3.NewCSHAKE256(N, S)
h.Write(data)
h.Read(out)
return out
}

Currently this has 4 allocations:
- one for out (unless stack allocated),
- one for the SHAKE result of crypto/internal/fips140/sha3.newCShake,
- one for the initBlock allocation in crypto/internal/fips140/sha3.newCShake,
- one for the result of crypto/internal/fips140/sha3.bytepad.

We eliminate the SHAKE allocation by outlining the SHAKE allocation in
crypto/internal/fips140/sha3.NewCSHAKE128 and NewCSHAKE256. As
crypto/sha3.NewCSHAKE128 and NewCSHAKE256 immediately de-reference this
result, this allocation is eliminated.

We eliminate the bytepad allocation by instead writing the various
values directly with SHAKE.Write. Values passed to Write don't escape
and, with the exception of data (which is initBlock), all our Writes are
of fixed size allocations. We can't simply modify bytepad to return a
fixed size byte-slice as the length of data is not constant nor does it
have a reasonable upper bound.

We're stuck with the initBlock allocation because of the API (Reset and
the various marshallers), but we still net a substantial improvement.

benchstat output using the following benchmark:

        func BenchmarkSumCSHAKE256(b *testing.B) {
                N := []byte("N")
                S := []byte("S")
                data := []byte("testdata")

                b.SetBytes(64)

                for b.Loop() {
                        SumCSHAKE256(N, S, data, 64)
                }
        }

name             old time/op    new time/op    delta
SumCSHAKE256-12    1.09µs ±20%    0.79µs ± 1%  -27.41%  (p=0.000 n=10+9)

name             old speed      new speed      delta
SumCSHAKE256-12  59.8MB/s ±18%  81.0MB/s ± 1%  +35.33%  (p=0.000 n=10+9)

name             old alloc/op   new alloc/op   delta
SumCSHAKE256-12      536B ± 0%       88B ± 0%  -83.58%  (p=0.000 n=10+10)

name             old allocs/op  new allocs/op  delta
SumCSHAKE256-12      4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)

Updates #69982

Change-Id: If426ea8127c58f5ef062cf74712ec70fd26a7372
Reviewed-on: https://go-review.googlesource.com/c/go/+/636255
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
7 weeks agocrypto/hpke: expose crypto/internal/hpke
Filippo Valsorda [Sat, 22 Nov 2025 22:03:14 +0000 (23:03 +0100)]
crypto/hpke: expose crypto/internal/hpke

Fixes #75300

Change-Id: I6a83e0d040dba3366819d2afff704f886a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/723560
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
7 weeks agocrypto/ecdsa: clean up ECDSA parsing and serialization paths
Filippo Valsorda [Mon, 24 Nov 2025 19:46:14 +0000 (20:46 +0100)]
crypto/ecdsa: clean up ECDSA parsing and serialization paths

Check for invalid encodings and keys more systematically in
ParseRawPrivateKey/PrivateKey.Bytes,
ParseUncompressedPublicKey/PublicKey.Bytes, and
fips140/ecdsa.NewPrivateKey/NewPublicKey.

Also, use these functions throughout the codebase.

This should not change any observable behavior, because there were
multiple layers of checks and every path would hit at least one.

Change-Id: I6a6a46566c95de871a5a37996835a0e51495f1d8
Reviewed-on: https://go-review.googlesource.com/c/go/+/724000
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
7 weeks agoreflect: add iterator equivalents for NumField, NumIn, NumOut and NumMethod
Quentin Quaadgras [Wed, 19 Nov 2025 21:18:39 +0000 (21:18 +0000)]
reflect: add iterator equivalents for NumField, NumIn, NumOut and NumMethod

The new methods are Type.Fields, Type.Methods, Type.Ins, Type.Outs,
Value.Fields and Value.Methods.

These methods have been introduced into the reflect package (as well
as tests) replacing three-clause for loops where possible.

Fixes #66631

Change-Id: Iab346e52c0eadd7817afae96d9ef73a35db65fd2
GitHub-Last-Rev: 8768ef71b9fd74536094cb1072c7075dc732cd5c
GitHub-Pull-Request: golang/go#75646
Reviewed-on: https://go-review.googlesource.com/c/go/+/707356
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>

7 weeks agocrypto/x509: sub-quadratic name constraint checking
Roland Shoemaker [Fri, 26 Sep 2025 02:13:23 +0000 (19:13 -0700)]
crypto/x509: sub-quadratic name constraint checking

Previously, we implemented ~quadratic name constraint checking, wherein
we would check every SAN against every respective constraint in the
chain. This is the technique _basically everyone_ implements, because
it's easy, but it requires also capping the total number of constraint
checking operations to prevent denial of service.

Instead, this change implements a log-linear checking technique, as
originally described by davidben@google.com with some minor
modifications. The comment at the top of crypto/x509/constraints.go
describes this technique in detail.

This technique is faster than the existing quadratic approach in all but
one specific case, where there are a large number of constraints but
only a single name, since our previous algorithm resolves to linear in
that case.

Change-Id: Icb761f5f9898c04e266c0d0c2b07ab2637f03418
Reviewed-on: https://go-review.googlesource.com/c/go/+/711421
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
7 weeks agocrypto/x509: cleanup name constraint tests
Roland Shoemaker [Thu, 20 Nov 2025 21:32:48 +0000 (13:32 -0800)]
crypto/x509: cleanup name constraint tests

Make TestConstraintCases a bit clearer by adding actual subtest names,
mostly taken from the old comments. Also add a handful of extra test
cases.

Change-Id: Ie759d1ea85a353aeacab267bb6e175a90f20702c
Reviewed-on: https://go-review.googlesource.com/c/go/+/722481
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
7 weeks agocrypto/rsa: add EncryptOAEPWithOptions
Andrey Pshenkin [Fri, 12 Sep 2025 17:43:13 +0000 (18:43 +0100)]
crypto/rsa: add EncryptOAEPWithOptions

Co-authored-by: Filippo Valsorda <filippo@golang.org>
Change-Id: I78968794d609a7b343e5affc141d8ba96a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/722260
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
7 weeks agointernal/poll: replace t.Sub(time.Now()) with time.Until in test
guoguangwu [Mon, 18 Mar 2024 07:34:04 +0000 (07:34 +0000)]
internal/poll: replace t.Sub(time.Now()) with time.Until in test

Change-Id: Ia383d4d322008901cd1e57b05fb522db44076fa2
GitHub-Last-Rev: 5c7cbeb7371c6afa47c280e164087e45ca89f3d2
GitHub-Pull-Request: golang/go#66375
Reviewed-on: https://go-review.googlesource.com/c/go/+/572178
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Sean Liao <sean@liao.dev>
7 weeks agocrypto/tls: expose HelloRetryRequest state
Daniel McCarney [Mon, 3 Nov 2025 19:47:42 +0000 (14:47 -0500)]
crypto/tls: expose HelloRetryRequest state

This commit adds fields to the ClientHelloInfo and ConnectionState
structures to represent hello retry request state information.

ClientHelloInfo gains a new HelloRetryRequest bool field that indicates
if the client hello was sent in response to a TLS 1.3 hello retry
request message previously emitted by the server.

ConnectionState gains a new HelloRetryRequest bool field that indicates
(depending on the connection role) whether the client received a TLS 1.3
hello retry request message from the server, or whether the server sent
such a message to a client.

Fixes #74425

Change-Id: Ic1a5290b8a4ba1568da1d2c2cf9f148150955fa5
Reviewed-on: https://go-review.googlesource.com/c/go/+/717440
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>

7 weeks agodoc: pre-announce removal of 1.23 and earlier crypto GODEBUGs
Sean Liao [Fri, 21 Nov 2025 22:11:41 +0000 (22:11 +0000)]
doc: pre-announce removal of 1.23 and earlier crypto GODEBUGs

For #75316

Change-Id: Ife391b8c3e7fd2fec0e53b296d47b4756a787001
Reviewed-on: https://go-review.googlesource.com/c/go/+/723100
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
7 weeks agocrypto/fips140: add Version
Sean Liao [Fri, 21 Nov 2025 22:27:36 +0000 (22:27 +0000)]
crypto/fips140: add Version

Fixes #75301

Change-Id: If953b4382499570d5437491036f91cbe4fec7c01
Reviewed-on: https://go-review.googlesource.com/c/go/+/723101
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
7 weeks agocmd/go/internal/modfetch: rename State to Fetcher
Ian Alexander [Mon, 17 Nov 2025 21:38:22 +0000 (16:38 -0500)]
cmd/go/internal/modfetch: rename State to Fetcher

This change renames the type State to Fetcher to better reflect its
purpose.  The global variable ModuleFetchState is also renamed to
Fetcher_, which will continue to be gradually eliminated as with all
global state in the modfetch package.

[git-generate]
cd src/cmd/go/internal/modfetch
rf '
  mv State Fetcher
  mv ModuleFetchState Fetcher_
  mv NewState NewFetcher

  mv Fetcher.GoSumFile GoSumFile
  mv GoSumFile.s GoSumFile.f
  mv GoSumFile Fetcher.GoSumFile

  mv Fetcher.SetGoSumFile SetGoSumFile
  mv SetGoSumFile.s SetGoSumFile.f
  mv SetGoSumFile Fetcher.SetGoSumFile

  mv Fetcher.AddWorkspaceGoSumFile AddWorkspaceGoSumFile
  mv AddWorkspaceGoSumFile.s AddWorkspaceGoSumFile.f
  mv AddWorkspaceGoSumFile Fetcher.AddWorkspaceGoSumFile
'
rf '
  add NewFetcher:+0 f := new(Fetcher) \
  f.lookupCache = new(par.Cache[lookupCacheKey, Repo]) \
  f.downloadCache = new(par.ErrCache[module.Version, string]) \
  return f
'
rf 'rm NewFetcher:+5,8'
cd ../modload
rf '
  mv State.modfetchState State.fetcher
'

Change-Id: I7cb6c945ea0f1d2119e1615064f041e88c81c689
Reviewed-on: https://go-review.googlesource.com/c/go/+/721740
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
7 weeks agocmd/go/internal/modload: make State.modfetchState a pointer
Ian Alexander [Sun, 16 Nov 2025 04:08:02 +0000 (23:08 -0500)]
cmd/go/internal/modload: make State.modfetchState a pointer

This change aligns modfetch.State with modload.State by using pointer
parameters and receivers.

[git-generate]
cd src/cmd/go/internal/modload
sed -i '
  s/oldState/old/
  s/old := State{/old = \&State{/
  s/func (s \*State) setState(new State) State {/func (s *State) setState(new *State) (old *State) {/
  s/setState(State{})/setState(NewState())/
' init.go
cd ../modfetch
sed -i '
  s/oldState = State{/oldState = \&State{/
  s/func SetState(newState State) (oldState State) {/func SetState(newState *State) (oldState *State) {/
  s/SetState(State{})/SetState(NewState())/
' fetch.go
cd ../modload
sed -i '
  s/old.modfetchState = modfetch.SetState(new.modfetchState)/_ = modfetch.SetState(\&new.modfetchState)/
' init.go
rf '
  #
  # Prepare to swap the existing modfetchState field for a pointer type
  #
  mv State.modfetchState State.modfetchState_
  add State:/modfetchState_/+0 modfetchState *modfetch.State
  #
  # Update State.setState to set & restore additional values
  #
  add State.setState:/s\.requirements,/+0 workFilePath: s.workFilePath,
  add State.setState:/s\.workFilePath,/+0 modfetchState: s.modfetchState,
  #
  # Swap the existing modfetchState field for a pointer type
  #
  add init.go:/.* = modfetch.SetState\(.*\)/-0 s.modfetchState = new.modfetchState
  add init.go:/.* = modfetch.SetState\(.*\)/-0 old.modfetchState = modfetch.SetState(s.modfetchState) // TODO(jitsu): remove after completing global state elimination
  rm init.go:/_ = modfetch.SetState\(.*\)/
  rm State.modfetchState_
'
sed -i '
  s/return &State{}/s := new(State)\ns.modfetchState = modfetch.NewState()\nreturn s/
' init.go
go fmt

Change-Id: I0602ecf976fd3ee93844e77989291d729ad71595
Reviewed-on: https://go-review.googlesource.com/c/go/+/720900
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
7 weeks agocmd/go: add setters for critical State fields
Ian Alexander [Sun, 16 Nov 2025 00:19:10 +0000 (19:19 -0500)]
cmd/go: add setters for critical State fields

This commit unexports critical State fields and provides setter
methods to update their values.

[git-generate]
cd src/cmd/go/internal/modfetch
rf '
  add fetch.go:490 var jitsu int = 0 // rf marker
  mv State.GoSumFile State.GoSumFile_
  mv State.WorkspaceGoSumFiles State.WorkspaceGoSumFiles_
  add jitsu \
    func (s *State) GoSumFile() string { \
      return ""
    } \
    \
    func (s *State) SetGoSumFile(str string) { \
    } \
    \
    func (s *State) AddWorkspaceGoSumFile(file string) { \
        s.WorkspaceGoSumFiles_ = append(s.WorkspaceGoSumFiles_, file) \
    }
    \

  ex {
    var s *State
    var x string
    s.GoSumFile_ = x -> s.SetGoSumFile(x)
  }

  rm jitsu
'

cd ../modload
sed -i '
  s/modfetch.ModuleFetchState.WorkspaceGoSumFiles_ = append(modfetch.ModuleFetchState.WorkspaceGoSumFiles_, sumFile)/modfetch.ModuleFetchState.AddWorkspaceGoSumFile(sumFile)/
' init.go

for dir in modcmd modload ; do
 cd ../${dir}
 rf '
   ex {
     import "cmd/go/internal/modfetch"
     var s *modfetch.State
     var x string
     s.GoSumFile_ = x -> s.SetGoSumFile(x)
   }
 '
done

cd ../modfetch
rf '
 mv State.GoSumFile_ State.goSumFile
 mv State.WorkspaceGoSumFiles_ State.workspaceGoSumFiles
 add State.GoSumFile: return s.goSumFile
 rm State.GoSumFile://+1
 add State.SetGoSumFile: s.goSumFile = str
'

Change-Id: Iff694aad7ad1cc62d2096c210dbaa3cce2b4061d
Reviewed-on: https://go-review.googlesource.com/c/go/+/720840
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agoruntime: add GODEBUG=tracebacklabels=1 to include pprof labels in tracebacks
David Finkel [Fri, 23 May 2025 20:04:08 +0000 (16:04 -0400)]
runtime: add GODEBUG=tracebacklabels=1 to include pprof labels in tracebacks

Copy LabelSet to an internal package as label.Set, and include (escaped)
labels within goroutine stack dumps.

Labels are added to the goroutine header as quoted key:value pairs, so
the line may get long if there are a lot of labels.

To handle escaping, we add a printescaped function to the
runtime and hook it up to the print function in the compiler with a new
runtime.quoted type that's a sibling to runtime.hex. (in fact, we
leverage some of the machinery from printhex to generate escape
sequences).

The escaping can be improved for printable runes outside basic ASCII
(particularly for languages using non-latin stripts). Additionally,
invalid UTF-8 can be improved.

So we can experiment with the output format make this opt-in via a
a new tracebacklabels GODEBUG var.

Updates #23458
Updates #76349

Change-Id: I08e78a40c55839a809236fff593ef2090c13c036
Reviewed-on: https://go-review.googlesource.com/c/go/+/694119
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
7 weeks agonet/http: add Transport.NewClientConn
Damien Neil [Tue, 18 Nov 2025 22:15:05 +0000 (14:15 -0800)]
net/http: add Transport.NewClientConn

For #75772

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

7 weeks agoall: update to x/net@bff14c52567061031b9761881907c39e24792736
Damien Neil [Mon, 24 Nov 2025 19:32:38 +0000 (11:32 -0800)]
all: update to x/net@bff14c52567061031b9761881907c39e24792736

This brings in CL 722200 which adds necessary HTTP/2 support for
net/http.Transport.NewClientConn.

For #75772

Change-Id: I5489232401096982ed21002f293dd0f87fe2fba6
Reviewed-on: https://go-review.googlesource.com/c/go/+/723901
Reviewed-by: Nicholas Husin <nsh@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
7 weeks agocontext: don't return the wrong error when Cause races cancellation
Damien Neil [Fri, 6 Jun 2025 22:38:28 +0000 (15:38 -0700)]
context: don't return the wrong error when Cause races cancellation

Check to see if a context is canceled at all
before checking for the cancellaion cause.
If we can't find a cause, use the original error.

Avoids a data race where we look for a cause,
find none (because the context is not canceled),
the context is canceled,
and we then return ctx.Err() (even though there is now a cause).

Fixes #73390

Change-Id: I97f44aef25c6b02871d987970abfb4c215c5c80e
Reviewed-on: https://go-review.googlesource.com/c/go/+/679835
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
7 weeks agocrypto/x509: add ExtKeyUsage.String and KeyUsage.String methods
Filippo Valsorda [Sat, 22 Nov 2025 15:26:24 +0000 (16:26 +0100)]
crypto/x509: add ExtKeyUsage.String and KeyUsage.String methods

Fixes #56866

Change-Id: Icc8f067820f5d74e0d5073bce160429e6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/723360
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Roland Shoemaker <roland@golang.org>
7 weeks agocrypto/internal/fips140test: add ML-DSA coverage
Daniel McCarney [Fri, 7 Nov 2025 16:36:05 +0000 (11:36 -0500)]
crypto/internal/fips140test: add ML-DSA coverage

This commit integrates ML-DSA ACVP test coverage, describing the
capabilities of the crypto/internal/fips140/mldsa package and
adding the required command handlers to our ACVP module wrapper.

Change-Id: I2aee6f169752a6c6fec3a68591dde33e4f308081
Reviewed-on: https://go-review.googlesource.com/c/go/+/719703
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
7 weeks agocmd/compile: add cases for StringLen to prove
David Chase [Mon, 24 Nov 2025 20:00:11 +0000 (15:00 -0500)]
cmd/compile: add cases for StringLen to prove

Tricky index-offset logic had been added for slices,
but not for strings.  This fixes that, and also adds
tests for same behavior in string/slice cases, and adds
a new test for code in prove that had been added but not
explicitly tested.

Fixes #76270.

Change-Id: Ibd92b89e944d86b7f30b4486a9008e6f1ac6af7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/723980
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
7 weeks agocmd/go/internal/auth: fix typo
Jes Cok [Fri, 21 Nov 2025 15:59:20 +0000 (15:59 +0000)]
cmd/go/internal/auth: fix typo

Change-Id: Ic113d59144aa2d37c8988559fbc086f5c29c0b69
GitHub-Last-Rev: e2623be0a00464d9be845da53fb1a67520fc1716
GitHub-Pull-Request: golang/go#76397
Reviewed-on: https://go-review.googlesource.com/c/go/+/722861
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agoruntime: use m.profStack in traceStack
Michael Anthony Knyszek [Wed, 19 Nov 2025 23:42:06 +0000 (23:42 +0000)]
runtime: use m.profStack in traceStack

Turns out we spend a few percent of the trace event writing path in just
zero-initializing the stack space for pcBuf. We don't need zero
initialization, since we're going to write over whatever we actually
use. Use m.profStack instead, which is already sized correctly.

A side-effect of this change is that trace stacks now obey the GODEBUG
profstackdepth where they previously ignored it. The name clearly
doesn't match, but this is a positive: there's no reason the maximum
stack depth shouldn't apply to every diagnostic.

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

7 weeks agoruntime: don't write unique string to trace if it's length zero
Michael Anthony Knyszek [Wed, 19 Nov 2025 03:51:20 +0000 (03:51 +0000)]
runtime: don't write unique string to trace if it's length zero

While we're here, document that ID 0 is implicitly assigned to an empty
set of data for both stacks and strings.

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

7 weeks agoall: REVERSE MERGE dev.simd (7d65463) into master
Cherry Mui [Mon, 24 Nov 2025 21:02:01 +0000 (16:02 -0500)]
all: REVERSE MERGE dev.simd (7d65463) into master

This commit is a REVERSE MERGE.
It merges dev.simd back into its parent branch, master.
The development of simd will continue on (only) dev.simd,
and it will be merged to the master branch when necessary.

Merge List:

+ 2025-11-24 7d65463a54 [dev.simd] all: merge master (e704b09) into dev.simd
+ 2025-11-24 afd1721fc5 [dev.simd] all: merge master (02d1f3a) into dev.simd
+ 2025-11-24 a9914886da [dev.simd] internal/buildcfg: don't enable SIMD experiment by default
+ 2025-11-24 61a5a6b016 [dev.simd] simd: add goexperiment tag to generate.go
+ 2025-11-24 f045ed4110 [dev.simd] go/doc/comment: don't include experimental packages in std list
+ 2025-11-24 220d73cc44 [dev.simd] all: merge master (8dd5b13) into dev.simd
+ 2025-11-24 0c69e77343 Revert "[dev.simd] internal/runtime/gc: add simd package based greentea kernels"
+ 2025-11-21 da92168ec8 [dev.simd] internal/runtime/gc: add simd package based greentea kernels
+ 2025-11-21 3fdd183aef [dev.simd] cmd/compile, simd: update conversion API names
+ 2025-11-21 d3a0321dba [dev.simd] cmd/compile: fix incorrect mapping of SHA256MSG2128
+ 2025-11-20 74ebdd28d1 [dev.simd] simd, cmd/compile: add more element types for Select128FromPair
+ 2025-11-20 4d26d66a49 [dev.simd] simd: fix signatures for PermuteConstant* methods
+ 2025-11-20 e3d4645693 [dev.simd] all: merge master (ca37d24) into dev.simd
+ 2025-11-20 95b4ad525f [dev.simd] simd: reorganize internal tests so that simd does not import testing
+ 2025-11-18 3fe246ae0f [dev.simd] simd: make 'go generate' generate everything
+ 2025-11-18 cf45adf140 [dev.simd] simd: move template code generator into _gen
+ 2025-11-18 19b4a30899 [dev.simd] simd/_gen/simdgen: remove outdated asm.yaml.toy
+ 2025-11-18 9461db5c59 [dev.simd] simd: fix comment in file generator
+ 2025-11-18 4004ff3523 [dev.simd] simd: remove FlattenedTranspose from exports
+ 2025-11-18 896f293a25 [dev.simd] cmd/compile, simd: change DotProductQuadruple and add peepholes
+ 2025-11-18 be9c50c6a0 [dev.simd] cmd/compile, simd: change SHA ops names and types
+ 2025-11-17 0978935a99 [dev.simd] cmd/compile, simd: change AES op names and add missing size
+ 2025-11-17 95871e4a00 [dev.simd] cmd/compile, simd: add VPALIGNR
+ 2025-11-17 934dbcea1a [dev.simd] simd: update CPU feature APIs
+ 2025-11-17 e4d9484220 [dev.simd] cmd/compile: fix unstable output
+ 2025-11-13 d7a0c45642 [dev.simd] all: merge master (57362e9) into dev.simd
+ 2025-11-11 86b4fe31d9 [dev.simd] cmd/compile: add masked merging ops and optimizations
+ 2025-11-10 771a1dc216 [dev.simd] cmd/compile: add peepholes for all masked ops and bug fixes
+ 2025-11-10 972732b245 [dev.simd] simd, cmd/compile: remove move from API
+ 2025-11-10 bf77323efa [dev.simd] simd: put unexported methods to another file
+ 2025-11-04 fe040658b2 [dev.simd] simd/_gen: fix sorting ops slices
+ 2025-10-29 e452f4ac7d [dev.simd] cmd/compile: enhance inlining for closure-of-SIMD
+ 2025-10-27 ca1264ac50 [dev.simd] test: add some trickier cases to ternary-boolean simd test
+ 2025-10-24 f6b4711095 [dev.simd] cmd/compile, simd: add rewrite to convert logical expression trees into TERNLOG instructions
+ 2025-10-24 cf7c1a4cbb [dev.simd] cmd/compile, simd: add SHA features
+ 2025-10-24 2b8eded4f4 [dev.simd] simd/_gen: parse SHA features from XED
+ 2025-10-24 c75965b666 [dev.simd] simd: added String() method to SIMD vectors.
+ 2025-10-22 d03634f807 [dev.simd] cmd/compile, simd: add definitions for VPTERNLOG[DQ]
+ 2025-10-20 20b3339542 [dev.simd] simd: add AES feature check
+ 2025-10-14 fc3bc49337 [dev.simd] simd: clean up mask load comments
+ 2025-10-14 416332dba2 [dev.simd] cmd/compile, simd: update DotProd to DotProduct
+ 2025-10-14 647c790143 [dev.simd] cmd/compile: peephole simd mask load/stores from bits
+ 2025-10-14 2e71cf1a2a [dev.simd] cmd/compile, simd: remove mask load and stores
+ 2025-10-13 c4fbf3b4cf [dev.simd] simd/_gen: add mem peephole with feat mismatches
+ 2025-10-13 ba72ee0f30 [dev.simd] cmd/compile: more support for cpufeatures
+ 2025-10-09 be57d94c4c [dev.simd] simd: add emulated Not method
+ 2025-10-07 d2270bccbd [dev.simd] cmd/compile: track which CPU features are in scope
+ 2025-10-03 48756abd3a [dev.simd] cmd/compile: inliner tweaks to favor simd-handling functions
+ 2025-10-03 fb1749a3fe [dev.simd] all: merge master (adce7f1) into dev.simd
+ 2025-09-30 703a5fbaad [dev.simd] cmd/compile, simd: add AES instructions
+ 2025-09-29 1c961c2fb2 [dev.simd] simd: use new data movement instructions to do "fast" transposes
+ 2025-09-26 fe4af1c067 [dev.simd] simd: repair broken comments in generated ops_amd64.go
+ 2025-09-26 ea3b2ecd28 [dev.simd] cmd/compile, simd: add 64-bit select-from-pair methods
+ 2025-09-26 25c36b95d1 [dev.simd] simd, cmd/compile: add 128 bit select-from-pair
+ 2025-09-26 f0e281e693 [dev.simd] cmd/compile: don't require single use for SIMD load/store folding
+ 2025-09-26 b4d1e018a8 [dev.simd] cmd/compile: remove unnecessary code from early simd prototype
+ 2025-09-26 578777bf7c [dev.simd] cmd/compile: make condtion of CanSSA smarter for SIMD fields
+ 2025-09-26 c28b2a0ca1 [dev.simd] simd: generalize select-float32-from-pair
+ 2025-09-25 a693ae1e9a [dev.simd] all: merge master (d70ad4e) into dev.simd
+ 2025-09-25 5a78e1a4a1 [dev.simd] simd, cmd/compile: mark simd vectors uncomparable
+ 2025-09-23 bf00f5dfd6 [dev.simd] simd, cmd/compile: added simd methods for VSHUFP[DS]
+ 2025-09-23 8e60feeb41 [dev.simd] cmd/compile: improve slicemask removal
+ 2025-09-23 2b50ffe172 [dev.simd] cmd/compile: remove stores to unread parameters
+ 2025-09-23 2d8cb80d7c [dev.simd] all: merge master (9b2d39b) into dev.simd
+ 2025-09-22 63a09d6d3d [dev.simd] cmd/compile: fix SIMD const rematerialization condition
+ 2025-09-20 2ca96d218d [dev.simd] cmd/compile: enhance prove to infer bounds in slice len/cap calculations
+ 2025-09-19 c0f031fcc3 [dev.simd] cmd/compile: spill the correct SIMD register for morestack
+ 2025-09-19 58fa1d023e [dev.simd] cmd/compile: enhance the chunked indexing case to include reslicing
+ 2025-09-18 7ae0eb2e80 [dev.simd] cmd/compile: remove Add32x4 generic op
+ 2025-09-18 31b664d40b [dev.simd] cmd/compile: widen index for simd intrinsics jumptable
+ 2025-09-18 e34ad6de42 [dev.simd] cmd/compile: optimize VPTEST for 2-operand cases
+ 2025-09-18 f1e3651c33 [dev.simd] cmd/compile, simd: add VPTEST
+ 2025-09-18 d9751166a6 [dev.simd] cmd/compile: handle rematerialized op for incompatible reg constraint
+ 2025-09-18 4eb5c6e07b [dev.simd] cmd/compile, simd/_gen: add rewrite for const load ops
+ 2025-09-18 443b7aeddb [dev.simd] cmd/compile, simd/_gen: make rewrite rules consistent on CPU Features
+ 2025-09-16 bdd30e25ca [dev.simd] all: merge master (ca0e035) into dev.simd
+ 2025-09-16 0e590a505d [dev.simd] cmd/compile: use the right type for spill slot
+ 2025-09-15 dabe2bb4fb [dev.simd] cmd/compile: fix holes in mask peepholes
+ 2025-09-12 3ec0b25ab7 [dev.simd] cmd/compile, simd/_gen/simdgen: add const load mops
+ 2025-09-12 1e5631d4e0 [dev.simd] cmd/compile: peephole simd load
+ 2025-09-11 48f366d826 [dev.simd] cmd/compile: add memop peephole rules
+ 2025-09-11 9a349f8e72 [dev.simd] all: merge master (cf5e993) into dev.simd
+ 2025-09-11 5a0446d449 [dev.simd] simd/_gen/simdgen, cmd/compile: add memory op machine ops
+ 2025-09-08 c39b2fdd1e [dev.simd] cmd/compile, simd: add VPLZCNT[DQ]
+ 2025-09-07 832c1f76dc [dev.simd] cmd/compile: enhance prove to deal with double-offset IsInBounds checks
+ 2025-09-06 0b323350a5 [dev.simd] simd/_gen/simdgen: merge memory ops
+ 2025-09-06 f42c9261d3 [dev.simd] simd/_gen/simdgen: parse memory operands
+ 2025-09-05 356c48d8e9 [dev.simd] cmd/compile, simd: add ClearAVXUpperBits
+ 2025-09-03 7c8b9115bc [dev.simd] all: merge master (4c4cefc) into dev.simd
+ 2025-09-02 9125351583 [dev.simd] internal/cpu: report AVX1 and 2 as supported on macOS 15 Rosetta 2
+ 2025-09-02 b509516b2e [dev.simd] simd, cmd/compile: add Interleave{Hi,Lo} (VPUNPCK*)
+ 2025-09-02 6890aa2e20 [dev.simd] cmd/compile: add instructions and rewrites for scalar-> vector moves
+ 2025-08-24 5ebe2d05d5 [dev.simd] simd: correct SumAbsDiff documentation
+ 2025-08-22 a5137ec92a [dev.simd] cmd/compile: sample peephole optimization for SIMD broadcast
+ 2025-08-22 83714616aa [dev.simd] cmd/compile: remove VPADDD4
+ 2025-08-22 4a3ea146ae [dev.simd] cmd/compile: correct register mask of some AVX512 ops
+ 2025-08-22 8d874834f1 [dev.simd] cmd/compile: use X15 for zero value in AVX context
+ 2025-08-22 4c311aa38f [dev.simd] cmd/compile: ensure the whole X15 register is zeroed
+ 2025-08-22 baea0c700b [dev.simd] cmd/compile, simd: complete AVX2? u?int shuffles
+ 2025-08-22 fa1e78c9ad [dev.simd] cmd/compile, simd: make Permute 128-bit use AVX VPSHUFB
+ 2025-08-22 bc217d4170 [dev.simd] cmd/compile, simd: add packed saturated u?int conversions
+ 2025-08-22 4fa23b0d29 [dev.simd] cmd/compile, simd: add saturated u?int conversions
+ 2025-08-21 3f6bab5791 [dev.simd] simd: move tests to a subdirectory to declutter "simd"
+ 2025-08-21 aea0a5e8d7 [dev.simd] simd/_gen/unify: improve envSet doc comment
+ 2025-08-21 7fdb1da6b0 [dev.simd] cmd/compile, simd: complete truncating u?int conversions.
+ 2025-08-21 f4c41d9922 [dev.simd] cmd/compile, simd: complete u?int widening conversions
+ 2025-08-21 6af8881adb [dev.simd] simd: reorganize cvt rules
+ 2025-08-21 58cfc2a5f6 [dev.simd] cmd/compile, simd: add VPSADBW
+ 2025-08-21 f7c6fa709e [dev.simd] simd/_gen/unify: fix some missing environments
+ 2025-08-20 7c84e984e6 [dev.simd] cmd/compile: rewrite to elide Slicemask from len==c>0 slicing
+ 2025-08-20 cf31b15635 [dev.simd] simd, cmd/compile: added .Masked() peephole opt for many operations.
+ 2025-08-20 1334285862 [dev.simd] simd: template field name cleanup in genfiles
+ 2025-08-20 af6475df73 [dev.simd] simd: add testing hooks for size-changing conversions
+ 2025-08-20 ede64cf0d8 [dev.simd] simd, cmd/compile: sample peephole optimization for .Masked()
+ 2025-08-20 103b6e39ca [dev.simd] all: merge master (9de69f6) into dev.simd
+ 2025-08-20 728ac3e050 [dev.simd] simd: tweaks to improve test disassembly
+ 2025-08-20 4fce49b86c [dev.simd] simd, cmd/compile: add widening unsigned converts 8->16->32
+ 2025-08-19 0f660d675f [dev.simd] simd: make OpMasked machine ops only
+ 2025-08-19 a034826e26 [dev.simd] simd, cmd/compile: implement ToMask, unexport asMask.
+ 2025-08-18 8ccd6c2034 [dev.simd] simd, cmd/compile: mark BLEND instructions as not-zero-mask
+ 2025-08-18 9a934d5080 [dev.simd] cmd/compile, simd: added methods for "float" GetElem
+ 2025-08-15 7380213a4e [dev.simd] cmd/compile: make move/load/store dependent only on reg and width
+ 2025-08-15 908e3e8166 [dev.simd] cmd/compile: make (most) move/load/store lowering use reg and width only
+ 2025-08-14 9783f86bc8 [dev.simd] cmd/compile: accounts rematerialize ops's output reginfo
+ 2025-08-14 a4ad41708d [dev.simd] all: merge master (924fe98) into dev.simd
+ 2025-08-13 8b90d48d8c [dev.simd] simd/_gen/simdgen: rewrite etetest.sh
+ 2025-08-13 b7c8698549 [dev.simd] simd/_gen: migrate simdgen from x/arch
+ 2025-08-13 257c1356ec [dev.simd] go/types: exclude simd/_gen module from TestStdlib
+ 2025-08-13 858a8d2276 [dev.simd] simd: reorganize/rename generated emulation files
+ 2025-08-13 2080415aa2 [dev.simd] simd: add emulations for missing AVX2 comparisons
+ 2025-08-13 ddb689c7bb [dev.simd] simd, cmd/compile: generated code for Broadcast
+ 2025-08-13 e001300cf2 [dev.simd] cmd/compile: fix LoadReg so it is aware of register target
+ 2025-08-13 d5dea86993 [dev.simd] cmd/compile: fix isIntrinsic for methods; fix fp <-> gp moves
+ 2025-08-13 08ab8e24a3 [dev.simd] cmd/compile: generated code from 'fix generated rules for shifts'
+ 2025-08-11 702ee2d51e [dev.simd] cmd/compile, simd: update generated files
+ 2025-08-11 e33eb1a7a5 [dev.simd] cmd/compile, simd: update generated files
+ 2025-08-11 667add4f1c [dev.simd] cmd/compile, simd: update generated files
+ 2025-08-11 1755c2909d [dev.simd] cmd/compile, simd: update generated files
+ 2025-08-11 2fd49d8f30 [dev.simd] simd: imm doc improve
+ 2025-08-11 ce0e803ab9 [dev.simd] cmd/compile: keep track of multiple rule file names in ssa/_gen
+ 2025-08-11 38b76bf2a3 [dev.simd] cmd/compile, simd: jump table for imm ops
+ 2025-08-08 94d72355f6 [dev.simd] simd: add emulations for bitwise ops and for mask/merge methods
+ 2025-08-07 8eb5f6020e [dev.simd] cmd/compile, simd: API interface fixes
+ 2025-08-07 b226bcc4a9 [dev.simd] cmd/compile, simd: add value conversion ToBits for mask
+ 2025-08-06 5b0ef7fcdc [dev.simd] cmd/compile, simd: add Expand
+ 2025-08-06 d3cf582f8a [dev.simd] cmd/compile, simd: (Set|Get)(Lo|Hi)
+ 2025-08-05 7ca34599ec [dev.simd] simd, cmd/compile: generated files to add 'blend' and 'blendMasked'
+ 2025-08-05 82d056ddd7 [dev.simd] cmd/compile: add ShiftAll immediate variant
+ 2025-08-04 775fb52745 [dev.simd] all: merge master (7a1679d) into dev.simd
+ 2025-08-04 6b9b59e144 [dev.simd] simd, cmd/compile: rename some methods
+ 2025-08-04 d375b95357 [dev.simd] simd: move lots of slice functions and methods to generated code
+ 2025-08-04 3f92aa1eca [dev.simd] cmd/compile, simd: make bitwise logic ops available to all u?int vectors
+ 2025-08-04 c2d775d401 [dev.simd] cmd/compile, simd: change PairDotProdAccumulate to AddDotProd
+ 2025-08-04 2c25f3e846 [dev.simd] cmd/compile, simd: change Shift*AndFillUpperFrom to Shift*Concat
+ 2025-08-01 c25e5c86b2 [dev.simd] cmd/compile: generated code for K-mask-register slice load/stores
+ 2025-08-01 1ac5f3533f [dev.simd] cmd/compile: opcodes and rules and code generation to enable AVX512 masked loads/stores
+ 2025-08-01 f39711a03d [dev.simd] cmd/compile: test for int-to-mask conversion
+ 2025-08-01 08bec02907 [dev.simd] cmd/compile: add register-to-mask moves, other simd glue
+ 2025-08-01 09ff25e350 [dev.simd] simd: add tests for simd conversions to Int32/Uint32.
+ 2025-08-01 a24ffe3379 [dev.simd] simd: modify test generation to make it more flexible
+ 2025-08-01 ec5c20ba5a [dev.simd] cmd/compile: generated simd code to add some conversions
+ 2025-08-01 e62e377ed6 [dev.simd] cmd/compile, simd: generated code from repaired simdgen sort
+ 2025-08-01 761894d4a5 [dev.simd] simd: add partial slice load/store for 32/64-bits on AVX2
+ 2025-08-01 acc1492b7d [dev.simd] cmd/compile: Generated code for AVX2 SIMD masked load/store
+ 2025-08-01 a0b87a7478 [dev.simd] cmd/compile: changes for AVX2 SIMD masked load/store
+ 2025-08-01 88568519b4 [dev.simd] simd: move test generation into Go repo
+ 2025-07-31 6f7a1164e7 [dev.simd] cmd/compile, simd: support store to bits for mask
+ 2025-07-21 41054cdb1c [dev.simd] simd, internal/cpu: support more AVX CPU Feature checks
+ 2025-07-21 957f06c410 [dev.simd] cmd/compile, simd: support load from bits for mask
+ 2025-07-21 f0e9dc0975 [dev.simd] cmd/compile: fix opLen(2|3)Imm8_2I intrinsic function
+ 2025-07-17 03a3887f31 [dev.simd] simd: clean up masked op doc
+ 2025-07-17 c61743e4f0 [dev.simd] cmd/compile, simd: reorder PairDotProdAccumulate
+ 2025-07-15 ef5f6cc921 [dev.simd] cmd/compile: adjust param order for AndNot
+ 2025-07-15 6d10680141 [dev.simd] cmd/compile, simd: add Compress
+ 2025-07-15 17baae72db [dev.simd] simd: default mask param's name to mask
+ 2025-07-15 01f7f57025 [dev.simd] cmd/compile, simd: add variable Permute
+ 2025-07-14 f5f42753ab [dev.simd] cmd/compile, simd: add VDPPS
+ 2025-07-14 08ffd66ab2 [dev.simd] simd: updates CPU Feature in doc
+ 2025-07-14 3f789721d6 [dev.simd] cmd/compile: mark SIMD types non-fat
+ 2025-07-11 b69622b83e [dev.simd] cmd/compile, simd: adjust Shift.* operations
+ 2025-07-11 4993a91ae1 [dev.simd] simd: change imm param name to constant
+ 2025-07-11 bbb6dccd84 [dev.simd] simd: fix documentations
+ 2025-07-11 1440ff7036 [dev.simd] cmd/compile: exclude simd vars from merge local
+ 2025-07-11 ccb43dcec7 [dev.simd] cmd/compile: add VZEROUPPER and VZEROALL inst
+ 2025-07-11 21596f2f75 [dev.simd] all: merge master (88cf0c5) into dev.simd
+ 2025-07-10 ab7f839280 [dev.simd] cmd/compile: fix maskreg/simdreg chaos
+ 2025-07-09 47b07a87a6 [dev.simd] cmd/compile, simd: fix Int64x2 Greater output type to mask
+ 2025-07-09 08cd62e9f5 [dev.simd] cmd/compile: remove X15 from register mask
+ 2025-07-09 9ea33ed538 [dev.simd] cmd/compile: output of simd generator, more ... rewrite rules
+ 2025-07-09 aab8b173a9 [dev.simd] cmd/compile, simd: Int64x2 Greater and Uint* Equal
+ 2025-07-09 8db7f41674 [dev.simd] cmd/compile: use upper registers for AVX512 simd ops
+ 2025-07-09 574854fd86 [dev.simd] runtime: save Z16-Z31 registers in async preempt
+ 2025-07-09 5429328b0c [dev.simd] cmd/compile: change register mask names for simd ops
+ 2025-07-09 029d7ec3e9 [dev.simd] cmd/compile, simd: rename Masked$OP to $(OP)Masked.
+ 2025-07-09 983e81ce57 [dev.simd] simd: rename stubs_amd64.go to ops_amd64.go
+ 2025-07-08 56ca67682b [dev.simd] cmd/compile, simd: remove FP bitwise logic operations.
+ 2025-07-08 0870ed04a3 [dev.simd] cmd/compile: make compares between NaNs all false.
+ 2025-07-08 24f2b8ae2e [dev.simd] simd: {Int,Uint}{8x{16,32},16x{8,16}} subvector loads/stores from slices.
+ 2025-07-08 2bb45cb8a5 [dev.simd] cmd/compile: minor tweak for race detector
+ 2025-07-07 43a61aef56 [dev.simd] cmd/compile: add EXTRACT[IF]128 instructions
+ 2025-07-07 292db9b676 [dev.simd] cmd/compile: add INSERT[IF]128 instructions
+ 2025-07-07 d8fa853b37 [dev.simd] cmd/compile: make regalloc simd aware on copy
+ 2025-07-07 dfd75f82d4 [dev.simd] cmd/compile: output of simdgen with invariant type order
+ 2025-07-04 72c39ef834 [dev.simd] cmd/compile: fix the "always panic" code to actually panic
+ 2025-07-01 1ee72a15a3 [dev.simd] internal/cpu: add GFNI feature check
+ 2025-06-30 0710cce6eb [dev.simd] runtime: remove write barrier in xRegRestore
+ 2025-06-30 59846af331 [dev.simd] cmd/compile, simd: cleanup operations and documentations
+ 2025-06-30 f849225b3b [dev.simd] all: merge master (740857f) into dev.simd
+ 2025-06-30 9eeb1e7a9a [dev.simd] runtime: save AVX2 and AVX-512 state on asynchronous preemption
+ 2025-06-30 426cf36b4d [dev.simd] runtime: save scalar registers off stack in amd64 async preemption
+ 2025-06-30 ead249a2e2 [dev.simd] cmd/compile: reorder operands for some simd operations
+ 2025-06-30 55665e1e37 [dev.simd] cmd/compile: undoes reorder transform in prior commit, changes names
+ 2025-06-26 10c9621936 [dev.simd] cmd/compile, simd: add galois field operations
+ 2025-06-26 e61ebfce56 [dev.simd] cmd/compile, simd: add shift operations
+ 2025-06-26 35b8cf7fed [dev.simd] cmd/compile: tweak sort order in generator
+ 2025-06-26 7fadfa9638 [dev.simd] cmd/compile: add simd VPEXTRA*
+ 2025-06-26 0d8cb89f5c [dev.simd] cmd/compile: support simd(imm,fp) returns gp
+ 2025-06-25 f4a7c124cc [dev.simd] all: merge master (f8ccda2) into dev.simd
+ 2025-06-25 4fda27c0cc [dev.simd] cmd/compile: glue codes for Shift and Rotate
+ 2025-06-24 61c1183342 [dev.simd] simd: add test wrappers
+ 2025-06-23 e32488003d [dev.simd] cmd/compile: make simd regmask naming more like existing conventions
+ 2025-06-23 1fa4bcfcda [dev.simd] simd, cmd/compile: generated code for VPINSR[BWDQ], and test
+ 2025-06-23 dd63b7aa0e [dev.simd] simd: add AVX512 aggregated check
+ 2025-06-23 0cdb2697d1 [dev.simd] simd: add tests for intrinsic used as a func value and via reflection
+ 2025-06-23 88c013d6ff [dev.simd] cmd/compile: generate function body for bodyless intrinsics
+ 2025-06-20 a8669c78f5 [dev.simd] sync: correct the type of runtime_StoreReluintptr
+ 2025-06-20 7c6ac35275 [dev.simd] cmd/compile: add simdFp1gp1fp1Imm8 helper to amd64 code generation
+ 2025-06-20 4150372a5d [dev.simd] cmd/compile: don't treat devel compiler as a released compiler
+ 2025-06-18 1b87d52549 [dev.simd] cmd/compile: add fp1gp1fp1 register mask for AMD64
+ 2025-06-18 1313521f75 [dev.simd] cmd/compile: remove fused mul/add/sub shapes.
+ 2025-06-17 1be5eb2686 [dev.simd] cmd/compile: fix signature error of PairDotProdAccumulate.
+ 2025-06-17 3a4d10bfca [dev.simd] cmd/compile: removed a map iteration from generator; tweaked type order
+ 2025-06-17 21d6573154 [dev.simd] cmd/compile: alphabetize SIMD intrinsics
+ 2025-06-16 ee1d9f3f85 [dev.simd] cmd/compile: reorder stubs
+ 2025-06-13 6c50c8b892 [dev.simd] cmd/compile: move simd helpers into compiler, out of generated code
+ 2025-06-13 7392dfd43e [dev.simd] cmd/compile: generated simd*ops files weren't up to date
+ 2025-06-13 00a8dacbe4 [dev.simd] cmd/compile: remove unused simd intrinsics "helpers"
+ 2025-06-13 b9a548775f cmd/compile: add up-to-date test for generated files
+ 2025-06-13 ca01eab9c7 [dev.simd] cmd/compile: add fused mul add sub ops
+ 2025-06-13 ded6e0ac71 [dev.simd] cmd/compile: add more dot products
+ 2025-06-13 3df41c856e [dev.simd] simd: update documentations
+ 2025-06-13 9ba7db36b5 [dev.simd] cmd/compile: add dot product ops
+ 2025-06-13 34a9cdef87 [dev.simd] cmd/compile: add round simd ops
+ 2025-06-13 5289e0f24e [dev.simd] cmd/compile: updates simd ordering and docs
+ 2025-06-13 c81cb05e3e [dev.simd] cmd/compile: add simdGen prog writer
+ 2025-06-13 9b9af3d638 [dev.simd] internal/cpu: add AVX-512-CD and DQ, and derived "basic AVX-512"
+ 2025-06-13 dfa6c74263 [dev.simd] runtime: eliminate global state in mkpreempt.go
+ 2025-06-10 b2e8ddba3c [dev.simd] all: merge master (773701a) into dev.simd
+ 2025-06-09 884f646966 [dev.simd] cmd/compile: add fp3m1fp1 shape to regalloc
+ 2025-06-09 6bc3505773 [dev.simd] cmd/compile: add fp3fp1 regsiter shape
+ 2025-06-05 2eaa5a0703 [dev.simd] simd: add functions+methods to load-from/store-to slices
+ 2025-06-05 8ecbd59ebb [dev.simd] cmd/compile: generated codes for amd64 SIMD
+ 2025-06-02 baa72c25f1 [dev.simd] all: merge master (711ff94) into dev.simd
+ 2025-05-30 0ff18a9cca [dev.simd] cmd/compile: disable intrinsics test for new simd stuff
+ 2025-05-30 7800f3813c [dev.simd] cmd/compile: flip sense of intrinsics test for SIMD
+ 2025-05-29 eba2430c16 [dev.simd] simd, cmd/compile, go build, go/doc: test tweaks
+ 2025-05-29 71c0e550cd [dev.simd] cmd/dist: disable API check on dev branch
+ 2025-05-29 62e1fccfb9 [dev.simd] internal: delete unused internal/simd directory
+ 2025-05-29 1161228bf1 [dev.simd] cmd/compile: add a fp1m1fp1 register shape to amd64
+ 2025-05-28 fdb067d946 [dev.simd] simd: initialize directory to make it suitable for testing SIMD
+ 2025-05-28 11d2b28bff [dev.simd] cmd/compile: add and fix k register supports
+ 2025-05-28 04b1030ae4 [dev.simd] cmd/compile: adapters for simd
+ 2025-05-27 2ef7106881 [dev.simd] internal/buildcfg: enable SIMD GOEXPERIMENT for amd64
+ 2025-05-22 4d2c71ebf9 [dev.simd] internal/goexperiment: add SIMD goexperiment
+ 2025-05-22 3ac5f2f962 [dev.simd] codereview.cfg: set up dev.simd branch

Change-Id: I60f2cd2ea055384a3788097738c6989630207871

7 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

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

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

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

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

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

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

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

7 weeks agoruntime: mark race functions on s390x as ABIInternal
Srinivas Pokala [Tue, 11 Nov 2025 03:57:22 +0000 (04:57 +0100)]
runtime: mark race functions on s390x as ABIInternal

This adds ABIInternal to the race function declarations.

Update #40724

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

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

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

Updates #40724

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

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

Update #40724

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

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

Update #40724

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

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

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

Update #40724

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

Update #40724

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

Updates #40724

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

This CL adds the s390x information to the ABI doc.

Update #40724

Cq-Include-Trybots: luci.golang.try:gotip-linux-s390x
Change-Id: I1b4b25ef1003e2ab011e1b808aeb1c02288095c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/719460
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
TryBot-Bypass: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
7 weeks 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>
7 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

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

7 weeks agocmd/compile: relax stmtline_test on amd64
David Chase [Mon, 24 Nov 2025 14:37:43 +0000 (09:37 -0500)]
cmd/compile: relax stmtline_test on amd64

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

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

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

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

Gets rid of some sign extensions, like arm64.

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

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

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

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

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

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

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

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

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

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

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

For #75836

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

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

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

This commit changes the default version to the following behavior:

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

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

Fixes #74748.

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

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

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

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

Fixes #76283

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

For #75154

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

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

Fixes #75154

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

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

Fixes #68342

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

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

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

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

Fixes #63043
Updates #56029

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

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

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

Change-Id: I59b4fa86a12f6236890b82cd353a95706a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/722940
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
7 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>
7 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>
7 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>

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

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

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

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

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