Skip to content

[AutoDiff] fix array subscript lookup when there are multiple #31723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2020

Conversation

marcrasi
Copy link

The differentiation transform sometimes tries to call the wrong subscript when there are multiple subscripts.

This concretely causes problems when you import TensorFlow because this subscript has different conformances in its generic signature than the correct subscript, so you get an assertion failure while trying to construct a substitution map for it:

Assertion failed: (conformances.size() == numConformanceRequirements), function Storage, file /Users/danielzheng/swift-debug/swift/lib/AST/SubstitutionMap.cpp, line 46.

@marcrasi marcrasi requested review from rxwei and dan-zheng May 12, 2020 00:29
@marcrasi
Copy link
Author

@swift-ci please test

Copy link
Contributor

@dan-zheng dan-zheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! That looks interesting to debug 🙂

@dan-zheng dan-zheng merged commit 619d0b0 into swiftlang:master May 12, 2020
rxwei pushed a commit to rxwei/swift that referenced this pull request Jun 3, 2020
…ang#31723)

Fix `PullbackEmitter::getArrayAdjointElementBuffer` to always lookup
`Array.TangentVector.subscript` from the stdlib.

Resolves compiler crash when user code also defines
`Array.TangentVector.subscript`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants