Skip to content

Commit 07f632a

Browse files
authored
[AutoDiff] NFC: document test suite. (swiftlang#35194)
Add README files explaining the differentiable programming test suite. Add lit.local.cfg files so individual tests do not need to add `REQUIRES: asserts` in these directories: - test/AutoDiff/compiler_crashers - test/AutoDiff/compiler_crashers_fixed Motivation: it is important for compiler crasher tests to require assertions enabled, because many of these tests crash on compiler assertions.
1 parent dbcf7fe commit 07f632a

20 files changed

+21
-18
lines changed

test/AutoDiff/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Differentiable Programming Test Suite
2+
3+
This directory tests differentiable programming in Swift, described in
4+
`docs/DifferentiableProgramming.md`.
5+
6+
Tests are categorized in subdirectories mimicking the directories in `test/`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This directory tests compiler crashers related to differentiable programming in
2+
Swift.
3+
4+
`lit.local.cfg` checks for `asserts` as a `lit` available feature, so there is
5+
no need to add `REQUIRES: asserts` to individual test files.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if 'asserts' not in config.available_features:
2+
config.unsupported = True

test/AutoDiff/compiler_crashers/sr13866-library-evolution-mode-tbdgen-crasher-protocool-requirement.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: not --crash %target-swift-frontend -c -enable-library-evolution %s
2-
// REQUIRES: asserts
32

43
// SR-13866: TBDGen crasher on protocol with differentiable requirement
54

test/AutoDiff/compiler_crashers/tf1181-apply-opened-opened-existential-argument.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: not --crash %target-swift-frontend -disable-availability-checking -emit-sil -verify %s
2-
// REQUIRES: asserts
32

43
// TF-1181: Differentiation transform crash for `apply` with opened existential arguments.
54

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This directory tests fixed compiler crashers related to differentiable
2+
programming in Swift.
3+
4+
`lit.local.cfg` checks for `asserts` as a `lit` available feature, so there is
5+
no need to add `REQUIRES: asserts` to individual test files.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
if 'asserts' not in config.available_features:
2+
config.unsupported = True

test/AutoDiff/compiler_crashers_fixed/rdar71319547-generated-decls-shall-not-be-resilient.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import _Differentiation
88

9-
109
// Assertion failed: (mainPullbackStruct->getType() == pbStructLoweredType), function run, file swift/lib/SILOptimizer/Differentiation/PullbackCloner.cpp, line 1899.
1110
// Stack dump:
1211
// 1. Swift version 5.3-dev (LLVM 618cb952e0f199a, Swift d74c261f098665c)
@@ -20,7 +19,6 @@ public func i_have_a_pullback_struct(_ x: Float) -> Float {
2019
return x
2120
}
2221

23-
2422
// Assertion failed: (v->getType().isObject()), function operator(), file swift/lib/SIL/Utils/ValueUtils.cpp, line 22.
2523
// Stack dump:
2624
// 1. Swift version 5.3-dev (LLVM 618cb952e0f199a, Swift d74c261f098665c)

test/AutoDiff/compiler_crashers_fixed/sr12641-silgen-immutable-address-use-verification-failure.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-swift-frontend -enable-resilience -emit-sil -verify %s
2-
// REQUIRES: asserts
32

43
// SR-12641: SILGen verification error regarding `ImmutableAddressUseVerifier` and AutoDiff-generated code.
54

test/AutoDiff/compiler_crashers_fixed/sr12642-differentiable-derivation-redeclared-property.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-swift-frontend -typecheck -verify %s
2-
// REQUIRES: asserts
32

43
// SR-12642: Crash regarding `Differentiable` derived conformances and
54
// redeclared properties. This crash surfaced only briefly during the

0 commit comments

Comments
 (0)