-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
AutoDiffattributesFeature: Declaration and type attributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itself
Description
Previous ID | SR-12154 |
Radar | None |
Original Reporter | @dan-zheng |
Type | Sub-task |
Additional Detail from JIRA
Votes | 0 |
Component/s | |
Labels | Sub-task |
Assignee | None |
Priority | Medium |
md5: 66daea3fab4a15a8539d2d766d092b41
is blocked by:
- TF-625 [AD] Change differentials/pullbacks to be maximally indirect
Issue Description:
Reproducer:
class Super : Differentiable {
var base: Float = 0
// Dummy to make `Super.AllDifferentiableVariables` be nontrivial.
// var _nontrivial: [Float] = []
@differentiable(wrt: self)
func f() -> Float {
return 1
}
}
class Sub : Super {
@differentiable(wrt: self)
override func f() -> Float {
return 1
}
}
SIL verification failed: vtable entry for #Super.f!1.jvp.1.S must be ABI-compatible
ABI incompatible return values
@convention(method) (@guaranteed Super) -> (Float, @owned @callee_guaranteed (@guaranteed Super.AllDifferentiableVariables) -> Float)
@convention(method) (@guaranteed Sub) -> (Float, @owned @callee_guaranteed (Super.AllDifferentiableVariables) -> Float)
This error occurs because class Super
is non-trivial but struct Super.AllDifferentiableVariables
is trivial.
Should be fixed by TF-625 by making differentials/pullbacks maximally indirect.
Metadata
Metadata
Assignees
Labels
AutoDiffattributesFeature: Declaration and type attributesFeature: Declaration and type attributesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itself