Skip to content
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

[SR-15205] [AutoDiff] Assertion failure when accessing inout parameter in differentiable nested function #57527

Closed
BradLarson opened this issue Sep 16, 2021 · 8 comments
Assignees
Labels
AutoDiff bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@BradLarson
Copy link
Collaborator

Previous ID SR-15205
Radar rdar://problem/83248762
Original Reporter @BradLarson
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AutoDiff
Assignee @asl
Priority Medium

md5: 5d119c20bc93637cdd9b92802993c67c

Issue Description:

When using an inout parameter from an enclosing function within a nested differentiable function, two different assertions can be triggered. In the following single-file reproducer:

import _Differentiation

func outerFunc(value: inout Float) -> (Float, (Float) -> (Float, Float)) {
  
  @differentiable(reverse, wrt: param)
  func innerFunc(param: Float, other: Float) -> Float {
    value += param
    return value * param * 2.0
  }
  
  let valAndPullback = valueWithPullback(at: value, 2.0, of: innerFunc)
  return (value + valAndPullback.value, valAndPullback.pullback)
}

an assertion is produced of "(newCapacity >= capacity), function extendingCapacity, file /Users/bradlarson/Development/BradLarson2/swift-source/swift/lib/AST/IndexSubset.cpp, line 72".

In the following, slightly more complicated single-file reproducer:

import _Differentiation

func outerFunc(value: inout Float) -> (Float, (Float) -> Float) {
  
  @differentiable(reverse, wrt: param)
  func innerFunc(param: Float, other: Float) -> Float {
    value += param * other
    return param * other * 2.0
  }
  
  @differentiable(reverse)
  func curriedFunc(param: Float) -> Float {
    return innerFunc(param: param, other: 3.0)
  }
  
  let valAndPullback = valueWithPullback(at: value, of: curriedFunc)
  return (value + valAndPullback.value, valAndPullback.pullback)
}

an assertion of "Pullback value type is not ABI-compatible with the returned pullback type" is generated. Both assertion failures have occurred with toolchains since the start of the year, so I don't believe this is a new regression.

The full stack traces of the two assertion failures are as follows:

Assertion failed: (newCapacity >= capacity), function extendingCapacity, file /Users/bradlarson/Development/BradLarson2/swift-source/swift/lib/AST/IndexSubset.cpp, line 72.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.  Program arguments: /Users/bradlarson/Development/BradLarson2/swift-source/build/Xcode-ReleaseAssert+swift-DebugAssert/swift-macosx-x86_64/Debug/bin/swift-frontend -frontend -c -primary-file ../../CompilerBugs/ABIStabilityCrasher.swift -target x86_64-apple-macosx11.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -color-diagnostics -O -new-driver-path /Users/bradlarson/Development/BradLarson2/swift-source/build/Xcode-ReleaseAssert+swift-DebugAssert/swift-macosx-x86_64/Debug/bin/swift-driver -resource-dir /Users/bradlarson/Development/BradLarson2/swift-source/build/Xcode-ReleaseAssert+swift-DebugAssert/swift-macosx-x86_64/Debug/lib/swift -module-name ABIStabilityCrasher -target-sdk-version 11.3.0 -o /var/folders/1s/z_s04yq55wq2jvgqghm8zm7w0000gp/T/TemporaryDirectory.L8Gzyt/ABIStabilityCrasher-1.o
1.  Swift version 5.6-dev (LLVM dc8233efdefef2a, Swift 7bc090907c169d0)
2.  Compiling with the current language version
3.  While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for ABIStabilityCrasher)
4.  While running pass #​58 SILModuleTransform "Differentiation".
5.  While canonicalizing `differentiable_function` SIL node   %16 = differentiable_function [parameters 0 1] [results 0] %15 : $@callee_guaranteed (Float, Float) -> Float // users: %37, %17
6.  While ...in SIL function "@$s19ABIStabilityCrasher9outerFunc5valueSf_Sf_SftSfctSfz_tF".
 for 'outerFunc(value:)' (at ../../CompilerBugs/ABIStabilityCrasher.swift:3:1)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x00000001124c68a7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x00000001124c56c8 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x00000001124c70f6 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff204c0d7d _sigtramp + 29
4  swift-frontend           0x0000000114bb4000 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 250390
5  libsystem_c.dylib        0x00007fff203d0411 abort + 120
6  libsystem_c.dylib        0x00007fff203cf7e8 err + 0
7  swift-frontend           0x000000010e0853ba swift::IndexSubset::extendingCapacity(swift::ASTContext&, unsigned int) const + 90
8  swift-frontend           0x000000010bfbea41 swift::autodiff::findMinimalDerivativeConfiguration(swift::AbstractFunctionDecl*, swift::IndexSubset*, swift::IndexSubset*&) + 273
9  swift-frontend           0x000000010bfbec32 swift::autodiff::getOrCreateMinimalASTDifferentiabilityWitness(swift::SILModule&, swift::SILFunction*, swift::DifferentiabilityKind, swift::IndexSubset*, swift::IndexSubset*) + 146
10 swift-frontend           0x000000010c33baa6 emitDerivativeFunctionReference((anonymous namespace)::DifferentiationTransformer&, swift::SILBuilder&, swift::AutoDiffConfig const&, swift::AutoDiffDerivativeFunctionKind, swift::SILValue, swift::autodiff::DifferentiationInvoker, llvm::SmallVectorImpl<swift::AllocStackInst*>&) + 1670
11 swift-frontend           0x000000010c33924b (anonymous namespace)::DifferentiationTransformer::promoteToDifferentiableFunction(swift::DifferentiableFunctionInst*, swift::SILBuilder&, swift::SILLocation, swift::autodiff::DifferentiationInvoker) + 827
12 swift-frontend           0x000000010c32da6e (anonymous namespace)::DifferentiationTransformer::processDifferentiableFunctionInst(swift::DifferentiableFunctionInst*) + 526
13 swift-frontend           0x000000010c32c889 (anonymous namespace)::Differentiation::run() + 2153
14 swift-frontend           0x000000010c4173ac swift::SILPassManager::runModulePass(unsigned int) + 892
15 swift-frontend           0x000000010c41a9a5 swift::SILPassManager::execute() + 677
16 swift-frontend           0x000000010c41337b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 427
17 swift-frontend           0x000000010c413155 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 101
18 swift-frontend           0x000000010c46213a std::__1::tuple<> swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 138
19 swift-frontend           0x000000010c462060 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 32
20 swift-frontend           0x000000010c4349dd llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 317
21 swift-frontend           0x000000010c4135cb llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::operator()<swift::ExecuteSILPipelineRequest, (void*)0>(swift::ExecuteSILPipelineRequest const&) + 43
22 swift-frontend           0x000000010c41345e swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 142
23 swift-frontend           0x000000010c45a547 swift::runSILDiagnosticPasses(swift::SILModule&) + 119
24 swift-frontend           0x000000010ad53a1e performMandatorySILPasses(swift::CompilerInvocation&, swift::SILModule*) + 94
25 swift-frontend           0x000000010ad5388a swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 42
26 swift-frontend           0x000000010aa8531b performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 811
27 swift-frontend           0x000000010aa84d00 performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 656
28 swift-frontend           0x000000010aa84a60 performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*)::$_18::operator()(swift::CompilerInstance&) const + 144
29 swift-frontend           0x000000010aa849c0 bool llvm::function_ref<bool (swift::CompilerInstance&)>::callback_fn<performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*)::$_18>(long, swift::CompilerInstance&) + 48
30 swift-frontend           0x000000010aa7aacc llvm::function_ref<bool (swift::CompilerInstance&)>::operator()(swift::CompilerInstance&) const + 60
31 swift-frontend           0x000000010aa79212 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>) + 354
32 swift-frontend           0x000000010aa720d3 performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1059
33 swift-frontend           0x000000010aa63982 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 290
34 swift-frontend           0x000000010aa627e5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2613
35 swift-frontend           0x000000010a9cd6b2 run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) + 354
36 swift-frontend           0x000000010a9cca19 swift::mainEntry(int, char const**) + 1737
37 swift-frontend           0x000000010a9a07d2 main + 34
38 libdyld.dylib            0x00007fff20496f5d start + 1

and

<unknown>:0: error: fatal error encountered during compilation; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
<unknown>:0: note: Pullback value type is not ABI-compatible with the returned pullback type
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.  Program arguments: /Users/bradlarson/Development/BradLarson2/swift-source/build/Xcode-ReleaseAssert+swift-DebugAssert/swift-macosx-x86_64/Debug/bin/swift-frontend -frontend -c -primary-file ../../CompilerBugs/ABIStabilityCrasher2.swift -target x86_64-apple-macosx11.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -color-diagnostics -O -new-driver-path /Users/bradlarson/Development/BradLarson2/swift-source/build/Xcode-ReleaseAssert+swift-DebugAssert/swift-macosx-x86_64/Debug/bin/swift-driver -resource-dir /Users/bradlarson/Development/BradLarson2/swift-source/build/Xcode-ReleaseAssert+swift-DebugAssert/swift-macosx-x86_64/Debug/lib/swift -module-name ABIStabilityCrasher2 -target-sdk-version 11.3.0 -o /var/folders/1s/z_s04yq55wq2jvgqghm8zm7w0000gp/T/TemporaryDirectory.9jVgPT/ABIStabilityCrasher2-1.o
1.  Swift version 5.6-dev (LLVM dc8233efdefef2a, Swift 7bc090907c169d0)
2.  Compiling with the current language version
3.  While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for ABIStabilityCrasher2)
4.  While running pass #&#8203;52 SILModuleTransform "Differentiation".
5.  While canonicalizing `differentiable_function` SIL node   %9 = differentiable_function [parameters 0 2] [results 0 1] %8 : $@convention(thin) (Float, Float, @inout_aliasable Float) -> Float // user: %10
6.  While ...in SIL function "@$s20ABIStabilityCrasher29outerLoop5valueSf_S2fctSfz_tF07curriedD0L_14paramsAndStateS2f_tFTJrSUpSr".
 for 'curriedLoop(paramsAndState:)' (at ../../CompilerBugs/ABIStabilityCrasher2.swift:12:3)
7.  While processing // differentiability witness for innerLoop #&#8203;1 (paramsAndState:other:) in outerLoop(value:)
sil_differentiability_witness private [reverse] [parameters 0 2] [results 0 1] @$s20ABIStabilityCrasher29outerLoop5valueSf_S2fctSfz_tF05innerD0L_14paramsAndState5otherS2f_SftF : $@convention(thin) (Float, Float, @inout_aliasable Float) -> Float {
}

 on SIL function "@$s20ABIStabilityCrasher29outerLoop5valueSf_S2fctSfz_tF05innerD0L_14paramsAndState5otherS2f_SftF".
 for 'innerLoop(paramsAndState:other:)' (at ../../CompilerBugs/ABIStabilityCrasher2.swift:6:3)
8.  While generating VJP for SIL function "@$s20ABIStabilityCrasher29outerLoop5valueSf_S2fctSfz_tF05innerD0L_14paramsAndState5otherS2f_SftF".
 for 'innerLoop(paramsAndState:other:)' (at ../../CompilerBugs/ABIStabilityCrasher2.swift:6:3)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x00000001154868a7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x00000001154856c8 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x00000001154870f6 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff204c0d7d _sigtramp + 29
4  libdyld.dylib            0x00007fff20495d08 _dyld_fast_stub_entry(void*, long) + 65
5  libsystem_c.dylib        0x00007fff203d0411 abort + 120
6  swift-frontend           0x000000010da24393 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_29::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const + 1091
7  swift-frontend           0x000000010da23f48 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_1::operator()(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const + 56
8  swift-frontend           0x000000010da23efb swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*)::$_1::__invoke(void*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 43
9  swift-frontend           0x000000011542c476 llvm::report_fatal_error(llvm::Twine const&, bool) + 278
10 swift-frontend           0x000000011542c35b llvm::report_fatal_error(char const*, bool) + 43
11 swift-frontend           0x000000010f046338 swift::autodiff::VJPCloner::Implementation::visitReturnInst(swift::ReturnInst*) + 2392
12 swift-frontend           0x000000010f03853d swift::SILInstructionVisitor<swift::autodiff::VJPCloner::Implementation, void>::visit(swift::SILInstruction*) + 3949
13 swift-frontend           0x000000010f0375ca swift::autodiff::VJPCloner::Implementation::visit(swift::SILInstruction*) + 58
14 swift-frontend           0x000000010f037355 swift::SILCloner<swift::autodiff::VJPCloner::Implementation>::visitTerminator(swift::SILBasicBlock*) + 53
15 swift-frontend           0x000000010f036bf7 swift::SILCloner<swift::autodiff::VJPCloner::Implementation>::visitBlocksDepthFirst(swift::SILBasicBlock*) + 1447
16 swift-frontend           0x000000010f03237e swift::SILCloner<swift::autodiff::VJPCloner::Implementation>::cloneFunctionBody(swift::SILFunction*, swift::SILBasicBlock*, llvm::ArrayRef<swift::SILValue>, bool) + 798
17 swift-frontend           0x000000010f031aa4 swift::autodiff::VJPCloner::Implementation::run() + 596
18 swift-frontend           0x000000010f0323bc swift::autodiff::VJPCloner::run() + 28
19 swift-frontend           0x000000010f2ed77d (anonymous namespace)::DifferentiationTransformer::canonicalizeDifferentiabilityWitness(swift::SILDifferentiabilityWitness*, swift::autodiff::DifferentiationInvoker, swift::IsSerialized_t) + 2045
20 swift-frontend           0x000000010f2fc37e emitDerivativeFunctionReference((anonymous namespace)::DifferentiationTransformer&, swift::SILBuilder&, swift::AutoDiffConfig const&, swift::AutoDiffDerivativeFunctionKind, swift::SILValue, swift::autodiff::DifferentiationInvoker, llvm::SmallVectorImpl<swift::AllocStackInst*>&) + 3934
21 swift-frontend           0x000000010f2f924b (anonymous namespace)::DifferentiationTransformer::promoteToDifferentiableFunction(swift::DifferentiableFunctionInst*, swift::SILBuilder&, swift::SILLocation, swift::autodiff::DifferentiationInvoker) + 827
22 swift-frontend           0x000000010f2eda6e (anonymous namespace)::DifferentiationTransformer::processDifferentiableFunctionInst(swift::DifferentiableFunctionInst*) + 526
23 swift-frontend           0x000000010f2ec889 (anonymous namespace)::Differentiation::run() + 2153
24 swift-frontend           0x000000010f3d73ac swift::SILPassManager::runModulePass(unsigned int) + 892
25 swift-frontend           0x000000010f3da9a5 swift::SILPassManager::execute() + 677
26 swift-frontend           0x000000010f3d337b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 427
27 swift-frontend           0x000000010f3d3155 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 101
28 swift-frontend           0x000000010f42213a std::__1::tuple<> swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 138
29 swift-frontend           0x000000010f422060 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 32
30 swift-frontend           0x000000010f3f49dd llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 317
31 swift-frontend           0x000000010f3d35cb llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::operator()<swift::ExecuteSILPipelineRequest, (void*)0>(swift::ExecuteSILPipelineRequest const&) + 43
32 swift-frontend           0x000000010f3d345e swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 142
33 swift-frontend           0x000000010f41a547 swift::runSILDiagnosticPasses(swift::SILModule&) + 119
34 swift-frontend           0x000000010dd13a1e performMandatorySILPasses(swift::CompilerInvocation&, swift::SILModule*) + 94
35 swift-frontend           0x000000010dd1388a swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 42
36 swift-frontend           0x000000010da4531b performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 811
37 swift-frontend           0x000000010da44d00 performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 656
38 swift-frontend           0x000000010da44a60 performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*)::$_18::operator()(swift::CompilerInstance&) const + 144
39 swift-frontend           0x000000010da449c0 bool llvm::function_ref<bool (swift::CompilerInstance&)>::callback_fn<performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*)::$_18>(long, swift::CompilerInstance&) + 48
40 swift-frontend           0x000000010da3aacc llvm::function_ref<bool (swift::CompilerInstance&)>::operator()(swift::CompilerInstance&) const + 60
41 swift-frontend           0x000000010da39212 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>) + 354
42 swift-frontend           0x000000010da320d3 performAction(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1059
43 swift-frontend           0x000000010da23982 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 290
44 swift-frontend           0x000000010da227e5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2613
45 swift-frontend           0x000000010d98d6b2 run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) + 354
46 swift-frontend           0x000000010d98ca19 swift::mainEntry(int, char const**) + 1737
47 swift-frontend           0x000000010d9607d2 main + 34
48 libdyld.dylib            0x00007fff20496f5d start + 1
49 libdyld.dylib            0x0000000000000016 start + 18446603339974480058
@typesanitizer
Copy link

@swift-ci create

@eeckstein
Copy link
Member

Dan, can you please take a look?

@dan-zheng
Copy link
Collaborator

Thanks for the ping. Yes, in a few days, perhaps the weekend.

@dan-zheng
Copy link
Collaborator

Discussed with @BradLarson last week.

The issue occurs for @differentiable nested declarations with captures, whose wrt: clause is a subset of differentiability parameters.

I asked if the issue is blocking. Brad mentioned it's possible to work around the issue using local variables, which is alright but may incur extra TangentVector copies.


Thorough handling of capture info and partially applied differentiable functions (so that IndexSubset::extendingCapacity hacks are no longer needed) seems non-trivial.

I think a reasonable fix could be an ad-hoc but tasteful check (like existing ones) before the assertion failure. @BradLarson mentioned he may have time to take a look.

@rxwei
Copy link
Member

rxwei commented Feb 17, 2022

#41401

@asl
Copy link
Collaborator

asl commented Feb 17, 2022

The second issue was fixed. Let us keep this bug open until slightly better solution will be delivered for the first issue (currently it's a workaround with TODO)

@rxwei
Copy link
Member

rxwei commented Feb 17, 2022

The PR says "resolves SR-15205" though. Might be worth opening a new ticket to track the replacement of the workarounds?

@asl
Copy link
Collaborator

asl commented Feb 17, 2022

Ah, right. And it was automatically closed 🙂 Yes, I will open new issue for TODO then

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoDiff bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

6 participants