From f7a5a7b0163bf5229ed09adfffd892f9899e6667 Mon Sep 17 00:00:00 2001 From: cflmy Date: Sun, 22 Nov 2026 22:19:08 +0800 Subject: [PATCH] Allow a documented shared-node performance exception for a named RC --- .woodpecker/performance.yml | 2 +- docs/releasing.md | 19 ++++++++++++++----- tools/ci/release_evidence.py | 28 ++++++++++++++++++++++++---- tools/ci/test_release_evidence.py | 22 ++++++++++++++++++++++ tools/perf/README.md | 14 ++++++++------ 5 files changed, 69 insertions(+), 16 deletions(-) diff --git a/.woodpecker/performance.yml b/.woodpecker/performance.yml index ef660fc..8168ef5 100644 --- a/.woodpecker/performance.yml +++ b/.woodpecker/performance.yml @@ -1,5 +1,5 @@ # Manual performance comparison on the shared Woodpecker runner. -# G4 release evidence is measured separately on the approved dedicated node. +# Shared-node measurements may support an explicitly approved RC WARN. when: event: [manual] branch: [master] diff --git a/docs/releasing.md b/docs/releasing.md index 64ff320..d148262 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -13,7 +13,8 @@ Three profiles apply (see * **rc** — `-rc.N`. The current target is Linux x86_64 (glibc). Record Windows and macOS as UNSUPPORTED for this scope. Require same-SHA Linux CI, frozen extensions, clean install, version compatibility, strict - VM and fixed-node performance PASS. + VM PASS. Performance requires fixed-node PASS or the specific shared-node + exception documented below. * **stable** — `3.0.0`/LTS. Not covered by beta exceptions; see [`STABLE_RELEASE_IMPLEMENTATION.md`](STABLE_RELEASE_IMPLEMENTATION.md) (historical roadmap input) and the public support matrix. @@ -79,7 +80,12 @@ Use the frozen-SHA build and archive checks above. Additionally: correctness-verified baseline on the same node, CPU affinity, governor, kernel and toolchain. Record investigation and resolution for any p50 increase of at least 15% or median peak RSS increase of at least 20%. - Shared-host or unapproved measurements do not satisfy the RC gate. + A dedicated node is the default. For a prerelease approved by the + maintainer to use a shared node, take at least three paired beta/RC runs + under the same measured conditions and keep all reports. Verify all nine + workloads and investigate threshold breaches or unstable samples before + accepting a `WARN`. Record the approval, runner environment and limits in + the release notes. This exception applies to the named RC only. - Version compatibility covers the locked Rust minimum, CLI and Analysis product identity, Tool/project prerelease ranges, and beta migration. - Use Ubuntu 24.04 (glibc 2.39) for the independent archive-only runtime @@ -183,8 +189,11 @@ python3 tools/ci/release_evidence.py --profile beta --target-sha "$sha" \ `BETA_RELEASE_CANDIDATE` is the only acceptable decision for a beta tag. A missing, skipped, failed or SHA-mismatched gate is `DO_NOT_RELEASE`; never -hand-edit a manifest to PASS. For a Linux RC, replace the profile with `--profile rc --require-release`, -declare both excluded platforms, and supply PASS for all six Linux and contract gates. Use the generated +hand-edit a manifest to PASS. For a Linux RC, use +`--profile rc --require-release` and declare both excluded platforms. If +the shared-node exception applies, pass +`--rc-shared-performance-approval ` and supply +`performance=WARN::`. Use the generated `RC_RELEASE_CANDIDATE` decision before running the tagging commands. Stable releases use `--profile stable --require-release` and require native Windows and macOS PASS in addition to the Linux and contract gates. @@ -206,7 +215,7 @@ tarball and its `.sha256`, and include the release notes. The notes must state: * prerelease status, support lifetime and the Linux x86_64 platform scope; * the breaking RFC-LANG-0002 language change and no legacy path; * the strict policy (same-SHA evidence, or `strict: unsupported` fail-closed); -* the G4 result and its fixed-node comparison, or the documented exception for beta; +* the G4 result and its comparison, including any approved shared-node exception; * independently versioned protocols and stdlib/package versions; * the checksum-integrity-not-signature caveat and the known-limitations file; * the exact source SHA and links to the evidence manifest. diff --git a/tools/ci/release_evidence.py b/tools/ci/release_evidence.py index 382c15f..56d3aa2 100755 --- a/tools/ci/release_evidence.py +++ b/tools/ci/release_evidence.py @@ -8,8 +8,9 @@ does not query CI and cannot turn an UNVERIFIED gate into a release. The `rc` profile requires every gate on the target SHA. For a Linux-only RC, Windows and macOS must be explicitly UNSUPPORTED; the stable profile requires both to PASS. Strict VM, extension, clean install, version compatibility and -performance all require PASS in both profiles. The historical beta profile -retains its scoped exceptions, including a documented performance WARN. +performance require PASS. RC can record a shared-node performance WARN only +with an explicit maintainer approval reference. The historical beta profile +retains its own scoped exceptions. Gate spec: `name=STATE:tested_sha:run_url` (url may contain colons). @@ -100,13 +101,23 @@ def parse_gate(text: str) -> tuple[str, dict]: return name, {"state": state, "tested_sha": tested_sha, "run_url": run_url} -def build_manifest(target_sha: str, gates: list[str], profile: str = "stable") -> dict: +def build_manifest( + target_sha: str, + gates: list[str], + profile: str = "stable", + rc_shared_performance_approval: str = "", +) -> dict: if not SHA_RE.fullmatch(target_sha): raise ValueError(f"target SHA must be 40 lowercase hex characters: {target_sha!r}") try: release_decision, accepted_states, optional = PROFILES[profile] except KeyError: raise ValueError(f"unknown profile {profile!r}; expected {sorted(PROFILES)}") from None + approval = rc_shared_performance_approval.strip() + if approval and profile != "rc": + raise ValueError("shared-node approval is supported only by the rc profile") + if approval: + accepted_states = {**accepted_states, "performance": {"PASS", "WARN"}} parsed = {} for spec in gates: name, gate = parse_gate(spec) @@ -137,6 +148,8 @@ def build_manifest(target_sha: str, gates: list[str], profile: str = "stable") - decision = release_decision if not reasons else "DO_NOT_RELEASE" recorded = utc_now() + if approval and parsed["performance"]["state"] == "WARN": + parsed["performance"]["rc_shared_node_approval"] = approval return { "schema": SCHEMA, "profile": profile, @@ -160,6 +173,11 @@ def main(argv: list[str]) -> int: parser.add_argument("--profile", choices=sorted(PROFILES), default="stable") parser.add_argument("--gate", action="append", default=[]) parser.add_argument("--out", default="") + parser.add_argument( + "--rc-shared-performance-approval", + default="", + help="maintainer approval reference for the measured shared-node RC performance WARN", + ) parser.add_argument( "--require-release", action="store_true", @@ -167,7 +185,9 @@ def main(argv: list[str]) -> int: ) args = parser.parse_args(argv) try: - manifest = build_manifest(args.target_sha, args.gate, args.profile) + manifest = build_manifest( + args.target_sha, args.gate, args.profile, args.rc_shared_performance_approval + ) except ValueError as error: print(f"error: {error}", file=sys.stderr) return 2 diff --git a/tools/ci/test_release_evidence.py b/tools/ci/test_release_evidence.py index 84f84c4..5eb6207 100644 --- a/tools/ci/test_release_evidence.py +++ b/tools/ci/test_release_evidence.py @@ -73,6 +73,28 @@ class ReleaseEvidenceTests(unittest.TestCase): self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE") self.assertTrue(manifest["reasons"][0].startswith(f"{name}:")) + def test_rc_shared_performance_requires_explicit_approval_and_evidence(self) -> None: + approval = "release notes: maintainer approved the shared node for this RC" + inputs = [spec for spec in self.rc_gates() if not spec.startswith("performance=")] + inputs.append(gate("performance", "WARN")) + manifest = release_evidence.build_manifest(SHA, inputs, "rc", approval) + self.assertEqual(manifest["release_decision"], "RC_RELEASE_CANDIDATE") + self.assertEqual(manifest["gates"]["performance"]["rc_shared_node_approval"], approval) + manifest = release_evidence.build_manifest( + SHA, inputs[:-1] + [gate("performance", "WARN", OTHER)], "rc", approval + ) + self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE") + manifest = release_evidence.build_manifest( + SHA, inputs[:-1] + [gate("performance", "WARN", url="")], "rc", approval + ) + self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE") + manifest = release_evidence.build_manifest( + SHA, inputs[:-1] + [gate("performance", "FAIL")], "rc", approval + ) + self.assertEqual(manifest["release_decision"], "DO_NOT_RELEASE") + with self.assertRaises(ValueError): + release_evidence.build_manifest(SHA, inputs, "stable", approval) + def test_stable_requires_extension_install_version_and_performance(self) -> None: names = ("extension", "clean_install", "version_compat", "performance") for name in names: diff --git a/tools/perf/README.md b/tools/perf/README.md index c6f0af2..424de7a 100644 --- a/tools/perf/README.md +++ b/tools/perf/README.md @@ -10,9 +10,11 @@ workload whose wire output did not match the committed expected digest. `Cargo.lock` digest, `rustc -vV`, source SHA and profile. * Correctness comes first: every warmup run is parsed and hashed. A mismatch is `CORRECTNESS_FAIL`; its faster wall time is never reported. -* Release evidence needs at least 5 warmups and 20 samples per workload with - `--approved-node` on a dedicated, stable performance node. Shorter runs are - `SMOKE` and must not be cited as a release gate. +* Approved-node release evidence needs at least 5 warmups and 20 samples per + workload on a dedicated, stable node. A maintainer-approved shared-node + RC comparison needs the same sample counts in at least three paired runs. + Shared-node reports stay `SMOKE` and are eligible only for the RC + `WARN` exception described in [releasing.md](../../docs/releasing.md). * `--baseline` checks platform ID, build profile, CPU model, kernel, governor, CPU affinity and toolchain. For an approved-node comparison it also requires an approved, correctness-verified MEASURED baseline. @@ -47,11 +49,11 @@ it only when the output change is the intended one. ## RC comparison -On the approved dedicated node, run the beta benchmark from a checkout +On the designated node, run the beta benchmark from a checkout pinned to `v3.0.0-beta.1` and the candidate benchmark from the frozen candidate checkout. Use the same toolchain, CPU list and platform ID in both commands. Pass the extracted, verified candidate CLI via `--no-build --binary` and add `--baseline /path/to/beta.json` to the candidate command. Keep both reports and confirm all nine comparisons are present and correctness-verified. -The shared Woodpecker manual workflow runs the same comparison as a diagnostic -and produces SMOKE reports. +The shared Woodpecker manual workflow can reproduce the comparison and +produces SMOKE reports.