Skip to content

Commit bd28606

Browse files
committed
Gardening: Migrate test suite to GH issues: AutoDiff/validation-test
1 parent 189837e commit bd28606

8 files changed

+34
-28
lines changed

test/AutoDiff/validation-test/control_flow.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-run-simple-swift
22
// REQUIRES: executable_test
33

4-
// FIXME(SR-12741): Enable test for all platforms after debugging
4+
// FIXME: Enable test for all platforms after debugging (https://github.com/apple/swift/issues/55186).
55
// iphonesimulator-i386-specific failures.
66
// REQUIRES: CPU=x86_64
77

@@ -717,8 +717,9 @@ ControlFlowTests.test("Loops") {
717717
expectEqual((52, 80), valueWithGradient(at: 2, of: { x in nested_loop2(x, count: 3) }))
718718
expectEqual((24, 28), valueWithGradient(at: 2, of: { x in nested_loop2(x, count: 4) }))
719719

720-
// SR13945: Loops in methods caused a runtime segfault.
721-
struct SR13945 {
720+
// https://github.com/apple/swift/issues/56342
721+
// Loops in methods caused a runtime segfault.
722+
struct S_56342 {
722723
func loopInMethod(_ x: Float) -> Float {
723724
var result = x
724725
for _ in 0..<2 {
@@ -727,8 +728,8 @@ ControlFlowTests.test("Loops") {
727728
return result
728729
}
729730
}
730-
expectEqual((0, 0), valueWithGradient(at: 0, of: { SR13945().loopInMethod($0) }))
731-
expectEqual((1, 4), valueWithGradient(at: 1, of: { SR13945().loopInMethod($0) }))
731+
expectEqual((0, 0), valueWithGradient(at: 0, of: { S_56342().loopInMethod($0) }))
732+
expectEqual((1, 4), valueWithGradient(at: 1, of: { S_56342().loopInMethod($0) }))
732733
}
733734

734735
ControlFlowTests.test("BranchingCastInstructions") {

test/AutoDiff/validation-test/differentiable_protocol_requirements.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// RUN: %target-run-simple-swift
22
// REQUIRES: executable_test
33

4-
// Disabled due to test failure with `-O`: SR-13250.
5-
// SR-13250 is tracking the fix for compiling this test with optimizations.
4+
// FIXME: Disabled due to test failure with `-O` (https://github.com/apple/swift/issues/55690).
65
// XFAIL: swift_test_mode_optimize
76
// XFAIL: swift_test_mode_optimize_size
87
// XFAIL: swift_test_mode_optimize_unchecked

test/AutoDiff/validation-test/forward_mode_simd.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ ForwardModeTests.test("Generics") {
178178
let a = SIMD3<Double>(1, 2, 3)
179179
let g = SIMD3<Double>(1, 1, 1)
180180

181-
// FIXME(SR-13210): Fix forward-mode SIL verification error.
181+
// FIXME: Fix forward-mode SIL verification error (https://github.com/apple/swift/issues/55650).
182182
/*
183183
func testInit<Scalar, SIMDType: SIMD>(x: Scalar) -> SIMDType
184184
where SIMDType.Scalar == Scalar,

test/AutoDiff/validation-test/forward_mode_simple.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ ForwardModeTests.test("TupleNonDifferentiableElements") {
361361
tuple.2 = x
362362
return tuple.1.1 * tuple.2
363363
}
364-
// FIXME(SR-12911): Fix runtime segfault.
364+
// FIXME: Fix runtime segfault (https://github.com/apple/swift/issues/55357).
365365
// expectEqual((16, 8), valueWithDerivative(at: 4, of: nested))
366366

367367
struct Wrapper<T> {
@@ -746,7 +746,7 @@ ForwardModeTests.test("SimpleWrtSelf") {
746746
// FIXME(TF-648): Dummy to make `Super.AllDifferentiableVariables` be nontrivial.
747747
var _nontrivial: [Float] = []
748748

749-
// FIXME(SR-12175): Fix forward-mode differentiation tangent buffer crash.
749+
// FIXME: Fix forward-mode differentiation tangent buffer crash (https://github.com/apple/swift/issues/54600).
750750
// @differentiable(reverse)
751751
required init(base: Float) {
752752
self.base = base
@@ -792,7 +792,7 @@ ForwardModeTests.test("SimpleWrtSelf") {
792792
}
793793
}
794794

795-
// FIXME(SR-12175): Fix forward-mode differentiation tangent buffer crash.
795+
// FIXME: Fix forward-mode differentiation tangent buffer crash (https://github.com/apple/swift/issues/54600).
796796
// let v = Super.TangentVector(base: 100, _nontrivial: [])
797797
// expectEqual(100, pullback(at: 1337) { x in Super(base: x) }(v))
798798
// expectEqual(100, pullback(at: 1337) { x in SubOverride(base: x) }(v))
@@ -1070,7 +1070,7 @@ ForwardModeTests.test("ResultSelection") {
10701070
expectEqual(1, derivative(at: 3, 3, of: { x, y in tuple(x, y).0 }))
10711071
expectEqual(1, derivative(at: 3, 3, of: { x, y in tuple(x, y).1 }))
10721072

1073-
// FIXME(SR-12175): Fix forward-mode differentiation tangent buffer crash.
1073+
// FIXME: Fix forward-mode differentiation tangent buffer crash (https://github.com/apple/swift/issues/54600).
10741074
/*
10751075
func tupleGeneric<T>(_ x: T, _ y: T) -> (T, T) {
10761076
return (x, y)
@@ -1389,15 +1389,16 @@ ForwardModeTests.test("ApplyNonActiveIndirectResult") {
13891389
expectEqual(1.0, derivative(at: 2, of: applyNonactiveArgumentActiveIndirectResult))
13901390
}
13911391

1392-
ForwardModeTests.test("SR-13530") {
1393-
// SR-13530: Test "leaked owned value" ownership verification failure related
1394-
// to differential generation for `copy_value` instruction.
1392+
ForwardModeTests.test("https://github.com/apple/swift/issues/55967") {
1393+
// https://github.com/apple/swift/issues/55967
1394+
// Test "leaked owned value" ownership verification failure related to
1395+
// differential generation for `copy_value` instruction.
13951396
@differentiable(reverse)
1396-
func SR_13530(_ x: NonresilientTracked<Float>) -> NonresilientTracked<Float> {
1397+
func f(_ x: NonresilientTracked<Float>) -> NonresilientTracked<Float> {
13971398
precondition(x >= 0)
13981399
return x
13991400
}
1400-
expectEqual(1, derivative(at: 2, of: SR_13530))
1401+
expectEqual(1, derivative(at: 2, of: f))
14011402
}
14021403

14031404
runAllTests()

test/AutoDiff/validation-test/inout_control_flow.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import _Differentiation
66

77
var InoutControlFlowTests = TestSuite("InoutControlFlow")
88

9-
// SR-14218
9+
// https://github.com/apple/swift/issues/55999
10+
1011
struct Model: Differentiable {
1112
var first: Float = 3
1213
var second: Float = 1
@@ -38,7 +39,8 @@ InoutControlFlowTests.test("MutatingBeforeControlFlow") {
3839
expectEqual(0, grad.second)
3940
}
4041

41-
// SR-14053
42+
// https://github.com/apple/swift/issues/56444
43+
4244
@differentiable(reverse)
4345
func adjust(model: inout Model, multiplier: Float) {
4446
model.first = model.second * multiplier

test/AutoDiff/validation-test/inout_parameters.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,11 @@ InoutParameterAutoDiffTests.test("InoutClassParameter") {
191191
}
192192
}
193193

194-
// SR-13305: Test function with non-wrt `inout` parameter, which should be
194+
// https://github.com/apple/swift/issues/55745
195+
// Test function with non-wrt `inout` parameter, which should be
195196
// treated as a differentiability result.
196197

197-
protocol SR_13305_Protocol {
198+
protocol P_55745 {
198199
@differentiable(reverse, wrt: x)
199200
func method(_ x: Float, _ y: inout Float)
200201

@@ -203,7 +204,7 @@ protocol SR_13305_Protocol {
203204
}
204205

205206
InoutParameterAutoDiffTests.test("non-wrt inout parameter") {
206-
struct SR_13305_Struct: SR_13305_Protocol {
207+
struct Struct: P_55745 {
207208
@differentiable(reverse, wrt: x)
208209
func method(_ x: Float, _ y: inout Float) {
209210
y = y * x
@@ -216,20 +217,20 @@ InoutParameterAutoDiffTests.test("non-wrt inout parameter") {
216217
}
217218

218219
@differentiable(reverse, wrt: x)
219-
func foo(_ s: SR_13305_Struct, _ x: Float, _ y: Float) -> Float {
220+
func foo(_ s: Struct, _ x: Float, _ y: Float) -> Float {
220221
var y = y
221222
s.method(x, &y)
222223
return y
223224
}
224225

225226
@differentiable(reverse, wrt: x)
226-
func fooGeneric<T: SR_13305_Protocol>(_ s: T, _ x: Float, _ y: Float) -> Float {
227+
func fooGeneric<T: P_55745>(_ s: T, _ x: Float, _ y: Float) -> Float {
227228
var y = y
228229
s.method(x, &y)
229230
return x
230231
}
231232

232-
let s = SR_13305_Struct()
233+
let s = Struct()
233234

234235
do {
235236
let (value, (dx, dy)) = valueWithGradient(at: 2, 3, of: { foo(s, $0, $1) })

test/AutoDiff/validation-test/sr16094.swift renamed to test/AutoDiff/validation-test/issue-58353.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// RUN: %target-run-simple-swift
22
// REQUIRES: executable_test
33

4+
// https://github.com/apple/swift/issues/58353
5+
46
import _Differentiation
57
import StdlibUnittest
68

test/AutoDiff/validation-test/property_wrappers.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PropertyWrapperTests.test("SimpleStruct") {
4646
expectEqual((.init(x: 60, y: 0, z: 20), 300),
4747
gradient(at: Struct(), 2, of: setter))
4848

49-
// TODO(SR-12640): Support `modify` accessors.
49+
// TODO: Support `modify` accessors (https://github.com/apple/swift/issues/55084).
5050
/*
5151
func modify(_ s: Struct, _ x: Tracked<Float>) -> Tracked<Float> {
5252
var s = s
@@ -86,7 +86,7 @@ PropertyWrapperTests.test("GenericStruct") {
8686
expectEqual((.init(x: 60, y: 0, z: 20), 300),
8787
gradient(at: GenericStruct<Tracked<Float>>(y: 20), 2, of: setter))
8888

89-
// TODO(SR-12640): Support `modify` accessors.
89+
// TODO: Support `modify` accessors (https://github.com/apple/swift/issues/55084).
9090
/*
9191
func modify<T>(_ s: GenericStruct<T>, _ x: Tracked<Float>) -> Tracked<Float> {
9292
var s = s
@@ -131,7 +131,7 @@ PropertyWrapperTests.test("SimpleClass") {
131131
gradient(at: Class(), 2, of: setter))
132132
*/
133133

134-
// TODO(SR-12640): Support `modify` accessors.
134+
// TODO: Support `modify` accessors (https://github.com/apple/swift/issues/55084).
135135
/*
136136
func modify(_ c: Class, _ x: Tracked<Float>) -> Tracked<Float> {
137137
var c = c

0 commit comments

Comments
 (0)