From 71e4681a2c7c80510d261c4096f3aee4ec0a5778 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Tue, 28 May 2024 20:01:20 +0100 Subject: [PATCH 1/3] Swift 6 preparedness Motivation We should feel confident that we compile clean under the strict checks of Swift 6. As this is a data-processing-only framework it's not a surprise that it turns out to be fine, but this patch adds the necessary docker-compose steps to ensure it continues to work. Modifications - Add docker-compose file for Swift 6 nightlies - Extend docker-compose to pass explicit sendable and strict concurrency checks - Add those checks to 6.0 and main nightlies Result Better confidence that we don't break our downstreams in Swift 6 support. --- docker/docker-compose.2204.60.yaml | 28 ++++++++++++++++++++++++++++ docker/docker-compose.2204.main.yaml | 2 ++ docker/docker-compose.yaml | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 docker/docker-compose.2204.60.yaml diff --git a/docker/docker-compose.2204.60.yaml b/docker/docker-compose.2204.60.yaml new file mode 100644 index 0000000..dd05938 --- /dev/null +++ b/docker/docker-compose.2204.60.yaml @@ -0,0 +1,28 @@ +version: "3" + +services: + + runtime-setup: + image: swift-asn1:22.04-6.0 + build: + args: + base_image: "swiftlang/swift:nightly-6.0-jammy" + + test: + image: swift-asn1:22.04-6.0 + environment: + - SWIFT_VERSION=6.0 + - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors + - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error + - EXPLICIT_SENDABLE_ARG=-Xswiftc -require-explicit-sendable + - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete + # - SANITIZER_ARG=--sanitize=thread # TSan broken still + + shell: + image: swift-asn1:22.04-6.0 + + update-benchmark-baseline: + image: swift-asn1:22.04-6.0 + environment: + - SWIFT_VERSION=6.0 + diff --git a/docker/docker-compose.2204.main.yaml b/docker/docker-compose.2204.main.yaml index 993599c..f814abb 100644 --- a/docker/docker-compose.2204.main.yaml +++ b/docker/docker-compose.2204.main.yaml @@ -14,6 +14,8 @@ services: - SWIFT_VERSION=main - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error + - EXPLICIT_SENDABLE_ARG=-Xswiftc -require-explicit-sendable + - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete # - SANITIZER_ARG=--sanitize=thread # TSan broken still shell: diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 329650b..af68822 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -25,7 +25,7 @@ services: test: <<: *common - command: /bin/bash -xcl "swift $${SWIFT_TEST_VERB-test} $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} && cd Benchmarks && swift package benchmark baseline check --check-absolute-path Thresholds/$${SWIFT_VERSION-}/" + command: /bin/bash -xcl "swift $${SWIFT_TEST_VERB-test} $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} $${EXPLICIT_SENDABLE_ARG-} $${STRICT_CONCURRENCY_ARG} && cd Benchmarks && swift package benchmark baseline check --check-absolute-path Thresholds/$${SWIFT_VERSION-}/" update-benchmark-baseline: <<: *common @@ -36,3 +36,4 @@ services: shell: <<: *common entrypoint: /bin/bash + From 6e24ab8e664bf8b2682cccb563614d4320c4fcfb Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Thu, 30 May 2024 21:05:18 +0100 Subject: [PATCH 2/3] Update benchmark thresholds --- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 +- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 +- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 +- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 2140900..6089a41 100644 --- a/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -1,5 +1,5 @@ { - "mallocCountTotal" : 960, + "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, "releaseCount" : 13983, diff --git a/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 11e53bf..64c0a1c 100644 --- a/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -1,5 +1,5 @@ { - "mallocCountTotal" : 960, + "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, "releaseCount" : 17688, diff --git a/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 4508250..37b1c69 100644 --- a/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -1,5 +1,5 @@ { - "mallocCountTotal" : 960, + "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, "releaseCount" : 13846, diff --git a/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 2140900..6089a41 100644 --- a/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -1,5 +1,5 @@ { - "mallocCountTotal" : 960, + "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, "releaseCount" : 13983, From cbee10a21fc1c23309a7a3ca410b62ce177d2275 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Sun, 9 Jun 2024 20:44:59 +0100 Subject: [PATCH 3/3] Stop counting retain/releases --- Benchmarks/Benchmarks/SwiftASN1Benchmark/Benchmarks.swift | 2 -- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 -- ...k.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json | 2 -- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 -- ...k.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json | 2 -- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 -- ...k.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json | 2 -- ...enchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json | 2 -- ...k.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json | 2 -- 9 files changed, 18 deletions(-) diff --git a/Benchmarks/Benchmarks/SwiftASN1Benchmark/Benchmarks.swift b/Benchmarks/Benchmarks/SwiftASN1Benchmark/Benchmarks.swift index 1ffb2ab..f4a1a76 100644 --- a/Benchmarks/Benchmarks/SwiftASN1Benchmark/Benchmarks.swift +++ b/Benchmarks/Benchmarks/SwiftASN1Benchmark/Benchmarks.swift @@ -23,8 +23,6 @@ let benchmarks = { .readSyscalls, .writeSyscalls, .memoryLeaked, - .retainCount, - .releaseCount, ] ) diff --git a/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 6089a41..58feaac 100644 --- a/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 13983, - "retainCount" : 12200, "writeSyscalls" : 0 } \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json b/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json index bcc1b4e..874113d 100644 --- a/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json +++ b/Benchmarks/Thresholds/5.10/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 967, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 12900, - "retainCount" : 11382, "writeSyscalls" : 0 } \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 64c0a1c..58feaac 100644 --- a/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 17688, - "retainCount" : 15905, "writeSyscalls" : 0 } \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json b/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json index 86f5fe2..874113d 100644 --- a/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json +++ b/Benchmarks/Thresholds/5.8/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 967, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 16605, - "retainCount" : 15087, "writeSyscalls" : 0 } \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 37b1c69..58feaac 100644 --- a/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 13846, - "retainCount" : 12063, "writeSyscalls" : 0 } \ No newline at end of file diff --git a/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json b/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json index f62a53c..874113d 100644 --- a/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json +++ b/Benchmarks/Thresholds/5.9/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 967, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 12763, - "retainCount" : 11245, "writeSyscalls" : 0 } \ No newline at end of file diff --git a/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json b/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json index 6089a41..58feaac 100644 --- a/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json +++ b/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_PEM_to_PEMDocument.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 976, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 13983, - "retainCount" : 12200, "writeSyscalls" : 0 } \ No newline at end of file diff --git a/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json b/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json index bcc1b4e..874113d 100644 --- a/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json +++ b/Benchmarks/Thresholds/main/SwiftASN1Benchmark.Parse_WebPKI_Roots_from_multi_PEM_to_PEMDocument_.p90.json @@ -2,7 +2,5 @@ "mallocCountTotal" : 967, "memoryLeaked" : 0, "readSyscalls" : 0, - "releaseCount" : 12900, - "retainCount" : 11382, "writeSyscalls" : 0 } \ No newline at end of file