Skip to content

[cxx-interop] Fix SR-13785 #34476

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

Conversation

scentini
Copy link
Contributor

@scentini scentini commented Oct 28, 2020

Currently, when Swift tries to validate that only visible declarations are used in the module's public interface, it sometimes rejects decls that come from @_implementationOnly modules, even in the case where there is a second, non @_implementationOnly module that exports the decl (SR-13785). It is common that a single C/C++ header ends up being textually included in multiple Clang modules, triggering the issue.

To address this, before rejecting a decl as not visible, we inspect all non-implementation-only modules transitively reachable from the source file. If a redeclaration exists in one of those modules, Swift won't error out anymore.

This allows us to fix build failures on Foundation caused by PR #32404.

@scentini
Copy link
Contributor Author

@swift-ci please test

@scentini scentini changed the title [cxx-interop] [cxx-interop] Fix SR-13785 Oct 28, 2020
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e1ec45e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e1ec45e

@scentini scentini force-pushed the implementation-only-symbol-visibility-fix branch from e1ec45e to 679ce36 Compare October 29, 2020 15:57
@scentini
Copy link
Contributor Author

scentini commented Nov 6, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Nov 6, 2020

Build failed
Swift Test OS X Platform
Git Sha - 58ff402

@scentini
Copy link
Contributor Author

scentini commented Nov 9, 2020

@swift-ci please test

@scentini
Copy link
Contributor Author

@swift-ci please test

@scentini scentini marked this pull request as ready for review November 10, 2020 12:18
@scentini scentini requested a review from CodaFi November 10, 2020 12:19
@scentini scentini added the c++ interop Feature: Interoperability with C++ label Nov 10, 2020
@scentini
Copy link
Contributor Author

cc/ @gribozavr

@CodaFi
Copy link
Contributor

CodaFi commented Nov 11, 2020

The approach makes sense, but I have some (possibly half-baked) ideas about the implementation. The main point is that this patch’s algorithm to gather transitive modular dependencies shouldn’t be needed. The set of modules given by swift::namelookup::getAllImports
will already have done that calculation, and I would expect the cost of a find_ifover that to be comparably performant. The second note is that you can also check against the full set of imported modules without filtering (even overlays) by asking for the wrapper module of the ClangModule of a given redeclaration.

@scentini
Copy link
Contributor Author

I'm not sure I understand the idea.

Say we have the following module structures, with -> denoting an import statement:

A -> @_implementationOnly B -> C -> clangModule D
A -> @_implementationOnly B -> C -> clangModule D
  -> E --------------------------------^

In the first example the clang module D is not visible, so we cannot use decls from it, while in the second example D is visible, so Swift shouldn't error out when A is using decls from D.

How would swift::namelookup::getAllImports with find_if help determine whether there exists an import path from A to D that does not have @_implementationOnly imports?

you can also check against the full set of imported modules without filtering (even overlays) by asking for the wrapper module of the ClangModule of a given redeclaration

IIUC what you suggest would allow us to lookup the wrapper module of the ClangModule directly in the set of transitive modules as opposed to collecting the clang modules. We could do this even with the current code, if that's your preference.

@hlopko
Copy link
Contributor

hlopko commented Nov 11, 2020

CC @hlopko

@scentini
Copy link
Contributor Author

@CodaFi - I learned that swift::namelookup::getAllImports will indeed do the calculation I'm interested in. I also learned about ModuleDecl::isImportedImplementationOnly() which in turn calls getAllImports so I went ahead and used it. Thanks for the hints! PTAL

@scentini
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@hlopko
Copy link
Contributor

hlopko commented Nov 19, 2020

@swift-ci please test

Copy link
Contributor

@CodaFi CodaFi left a comment

Choose a reason for hiding this comment

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

LGTM as a first go. I'm concerned about the average running time of this new check. It might be worth it to e.g. build a table in the clang importer to amortize the cost here.

@CodaFi
Copy link
Contributor

CodaFi commented Nov 23, 2020

@swift-ci test compiler performance

@swift-ci
Copy link
Contributor

Summary for main full

Unexpected test results, excluded stats for RxCocoa, Kingfisher, Surge

Regressions found (see below)

Debug-batch

debug-batch brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 124,911,391,785,371 124,874,186,842,792 -37,204,942,579 -0.03%
LLVM.NumLLVMBytesOutput 2,138,572,766 2,138,583,990 11,224 0.0%
time.swift-driver.wall 9362.8s 9346.0s -16.8s -0.18%

debug-batch detailed

Regressed (0)
name old new delta delta_pct
Improved (2)
name old new delta delta_pct
Driver.NumDriverPipePolls 84,533 83,344 -1,189 -1.41% ✅
Driver.NumDriverPipeReads 70,335 69,218 -1,117 -1.59% ✅
Unchanged (delta < 1.0% or delta < 100.0ms) (255)
name old new delta delta_pct
AST.ImportSetCacheHit 2,488,415 2,488,377 -38 -0.0%
AST.ImportSetCacheMiss 704,416 704,428 12 0.0%
AST.ImportSetFoldHit 218,836 218,835 -1 -0.0%
AST.ImportSetFoldMiss 485,579 485,593 14 0.0%
AST.ModuleShadowCacheHit 4,924 4,924 0 0.0%
AST.ModuleShadowCacheMiss 2,294 2,294 0 0.0%
AST.ModuleVisibilityCacheHit 46,039 46,039 0 0.0%
AST.ModuleVisibilityCacheMiss 11,359 11,359 0 0.0%
AST.NumASTBytesAllocated 75,241,752,775 75,228,653,503 -13,099,272 -0.02%
AST.NumASTScopeLookups 6,776,610 6,776,601 -9 -0.0%
AST.NumBraceStmtASTScopeExpansions 683,197 683,197 0 0.0%
AST.NumBraceStmtASTScopes 683,197 683,197 0 0.0%
AST.NumDecls 157,790 157,790 0 0.0%
AST.NumDependencies 534,776 534,777 1 0.0%
AST.NumIncrementalDependencies 0 0 0 0.0%
AST.NumIterableTypeBodyASTScopeExpansions 287,845 287,843 -2 -0.0%
AST.NumIterableTypeBodyASTScopes 415,282 415,290 8 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 421,916 421,916 0 0.0%
AST.NumLocalTypeDecls 297 297 0 0.0%
AST.NumModuleLookupClassMember 8,186 8,186 0 0.0%
AST.NumModuleLookupValue 73,525,700 73,526,949 1,249 0.0%
AST.NumObjCMethods 28,982 28,982 0 0.0%
AST.NumOperators 584 584 0 0.0%
AST.NumPrecedenceGroups 126 126 0 0.0%
AST.NumReferencedDynamicNames 204 204 0 0.0%
AST.NumReferencedMemberNames 10,909,002 10,909,002 0 0.0%
AST.NumReferencedTopLevelNames 1,292,722 1,292,722 0 0.0%
AST.NumSourceBuffers 661,008 661,008 0 0.0%
AST.NumSourceLines 5,426,310 5,426,310 0 0.0%
AST.NumSourceLinesPerSecond 2,158,691 2,155,010 -3,681 -0.17%
AST.NumTotalClangImportedEntities 4,595,315 4,594,847 -468 -0.01%
Driver.ChildrenMaxRSS 326,320,457,728 327,408,291,840 1,087,834,112 0.33%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 31,877 31,877 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 2,064,233,135,928 2,066,263,935,624 2,030,799,696 0.1%
Frontend.NumInstructionsExecuted 124,911,391,785,371 124,874,186,842,792 -37,204,942,579 -0.03%
Frontend.NumProcessFailures 0 0 0 0.0%
IRGen.IRGenRequest 30,493 30,493 0 0.0%
IRGen.OptimizedIRRequest 0 0 0 0.0%
IRGen.SymbolObjectCodeRequest 0 0 0 0.0%
IRModule.NumGOTEntries 267,750 267,750 0 0.0%
IRModule.NumIRAliases 229,481 229,481 0 0.0%
IRModule.NumIRBasicBlocks 8,167,733 8,167,733 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 4,082,909 4,082,909 0 0.0%
IRModule.NumIRGlobals 4,303,012 4,303,012 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 100,034,149 100,034,149 0 0.0%
IRModule.NumIRNamedMetaData 154,685 154,685 0 0.0%
IRModule.NumIRValueSymbols 7,690,985 7,690,985 0 0.0%
LLVM.NumLLVMBytesOutput 2,138,572,766 2,138,583,990 11,224 0.0%
Parse.CodeCompletionSecondPassRequest 0 0 0 0.0%
Parse.NumFunctionsParsed 310,358 310,358 0 0.0%
Parse.NumIterableDeclContextParsed 912,556 912,547 -9 -0.0%
Parse.ParseAbstractFunctionBodyRequest 285,477 285,477 0 0.0%
Parse.ParseMembersRequest 825,559 825,550 -9 -0.0%
Parse.ParseSourceFileRequest 658,406 658,406 0 0.0%
SILGen.ASTLoweringRequest 31,865 31,865 0 0.0%
SILGen.ParseSILModuleRequest 0 0 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 2,507,941 2,507,941 0 0.0%
SILModule.NumSILGenGlobalVariables 69,345 69,345 0 0.0%
SILModule.NumSILGenVtables 36,155 36,155 0 0.0%
SILModule.NumSILGenWitnessTables 150,336 150,336 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 3,193,229 3,193,229 0 0.0%
SILModule.NumSILOptGlobalVariables 70,830 70,830 0 0.0%
SILModule.NumSILOptVtables 36,292 36,292 0 0.0%
SILModule.NumSILOptWitnessTables 204,441 204,441 0 0.0%
SILOptimizer.ExecuteSILPipelineRequest 123,410 123,410 0 0.0%
SILOptimizer.LoweredSILRequest 0 0 0 0.0%
Sema.AbstractGenericSignatureRequest 57,042 57,042 0 0.0%
Sema.AccessLevelRequest 16,678,898 16,669,139 -9,759 -0.06%
Sema.ActorIsolationRequest 936,203 936,203 0 0.0%
Sema.AnyObjectLookupRequest 300 300 0 0.0%
Sema.AreAllStoredPropertiesDefaultInitableRequest 28,258 28,258 0 0.0%
Sema.AttachedPropertyWrapperTypeRequest 14,372,710 14,372,710 0 0.0%
Sema.AttachedPropertyWrappersRequest 16,841,628 16,841,628 0 0.0%
Sema.AttachedResultBuilderRequest 801,023 801,023 0 0.0%
Sema.BodyInitKindRequest 55,873 55,873 0 0.0%
Sema.CallerSideDefaultArgExprRequest 84,644 84,644 0 0.0%
Sema.CanBeAsyncHandlerRequest 288,294 288,294 0 0.0%
Sema.CheckInconsistentImplementationOnlyImportsRequest 14,296 14,296 0 0.0%
Sema.CheckRedeclarationRequest 1,122,522 1,122,522 0 0.0%
Sema.ClassAncestryFlagsRequest 136,937 136,937 0 0.0%
Sema.ClosureHasExplicitResultRequest 100,002 100,002 0 0.0%
Sema.CodeCompletionFileRequest 0 0 0 0.0%
Sema.CollectOverriddenDeclsRequest 10,349,265 10,346,850 -2,415 -0.02%
Sema.CompareDeclSpecializationRequest 567,378 567,599 221 0.04%
Sema.CursorInfoRequest 0 0 0 0.0%
Sema.CustomAttrNominalRequest 1,399 1,399 0 0.0%
Sema.CustomAttrTypeRequest 798 798 0 0.0%
Sema.DefaultAndMaxAccessLevelRequest 69,594 69,593 -1 -0.0%
Sema.DefaultArgumentExprRequest 45,535 45,535 0 0.0%
Sema.DefaultArgumentInitContextRequest 324 324 0 0.0%
Sema.DefaultDefinitionTypeRequest 7,626 7,626 0 0.0%
Sema.DefaultTypeRequest 600,637 600,637 0 0.0%
Sema.DerivativeAttrOriginalDeclRequest 0 0 0 0.0%
Sema.DifferentiableAttributeTypeCheckRequest 0 0 0 0.0%
Sema.DirectLookupRequest 42,259,804 42,255,069 -4,735 -0.01%
Sema.DirectOperatorLookupRequest 2,741,457 2,741,511 54 0.0%
Sema.DirectPrecedenceGroupLookupRequest 763,606 763,606 0 0.0%
Sema.DynamicallyReplacedDeclRequest 1,293,906 1,293,906 0 0.0%
Sema.EnumRawTypeRequest 30,214 30,214 0 0.0%
Sema.EnumRawValuesRequest 12,433 12,433 0 0.0%
Sema.ExistentialConformsToSelfRequest 18,112 18,105 -7 -0.04%
Sema.ExistentialTypeSupportedRequest 20,245 20,245 0 0.0%
Sema.ExpandASTScopeRequest 7,159,013 7,159,021 8 0.0%
Sema.ExtendedNominalRequest 1,038,723 1,038,723 0 0.0%
Sema.ExtendedTypeRequest 96,384 96,383 -1 -0.0%
Sema.FragileFunctionKindRequest 1,818,227 1,818,254 27 0.0%
Sema.FunctionOperatorRequest 85,680 85,680 0 0.0%
Sema.GenericParamListRequest 6,352,195 6,352,164 -31 -0.0%
Sema.GenericSignatureRequest 3,580,532 3,580,258 -274 -0.01%
Sema.GetDestructorRequest 32,876 32,876 0 0.0%
Sema.GlobalActorAttributeRequest 992,247 992,247 0 0.0%
Sema.GlobalActorInstanceRequest 235 235 0 0.0%
Sema.HasCircularInheritedProtocolsRequest 11,806 11,806 0 0.0%
Sema.HasCircularRawValueRequest 10,174 10,174 0 0.0%
Sema.HasDefaultInitRequest 66,766 66,766 0 0.0%
Sema.HasDynamicCallableAttributeRequest 0 0 0 0.0%
Sema.HasDynamicMemberLookupAttributeRequest 758,427 758,418 -9 -0.0%
Sema.HasImplementationOnlyImportsRequest 658,406 658,406 0 0.0%
Sema.HasMemberwiseInitRequest 23,937 23,937 0 0.0%
Sema.HasMissingDesignatedInitializersRequest 31,508 31,508 0 0.0%
Sema.HasUserDefinedDesignatedInitRequest 66,778 66,778 0 0.0%
Sema.InferredGenericSignatureRequest 213,159 213,158 -1 -0.0%
Sema.InheritedDeclsReferencedRequest 8,424,538 8,423,673 -865 -0.01%
Sema.InheritedProtocolsRequest 870,190 870,229 39 0.0%
Sema.InheritedTypeRequest 338,356 338,422 66 0.02%
Sema.InheritsSuperclassInitializersRequest 35,626 35,626 0 0.0%
Sema.InitKindRequest 115,384 115,384 0 0.0%
Sema.InterfaceTypeRequest 18,401,747 18,398,008 -3,739 -0.02%
Sema.IsABICompatibleOverrideRequest 158,819 158,819 0 0.0%
Sema.IsAccessorTransparentRequest 384,032 384,032 0 0.0%
Sema.IsActorRequest 755,748 755,721 -27 -0.0%
Sema.IsAsyncHandlerRequest 1,844,664 1,844,751 87 0.0%
Sema.IsCallableNominalTypeRequest 2,393 2,393 0 0.0%
Sema.IsDeclApplicableRequest 0 0 0 0.0%
Sema.IsDynamicRequest 2,042,055 2,042,055 0 0.0%
Sema.IsFinalRequest 3,407,667 3,407,725 58 0.0%
Sema.IsGetterMutatingRequest 504,944 504,944 0 0.0%
Sema.IsImplicitlyUnwrappedOptionalRequest 3,094,785 3,094,898 113 0.0%
Sema.IsObjCRequest 1,854,552 1,854,363 -189 -0.01%
Sema.IsSetterMutatingRequest 393,856 393,856 0 0.0%
Sema.IsStaticRequest 1,657,564 1,657,539 -25 -0.0%
Sema.LazyStoragePropertyRequest 3,366 3,366 0 0.0%
Sema.LookupAllConformancesInContextRequest 136,948 136,948 0 0.0%
Sema.LookupConformanceInModuleRequest 46,083,254 46,077,808 -5,446 -0.01%
Sema.LookupInModuleRequest 10,379,193 10,380,669 1,476 0.01%
Sema.LookupInfixOperatorRequest 105,640 105,640 0 0.0%
Sema.LookupPostfixOperatorRequest 200 200 0 0.0%
Sema.LookupPrecedenceGroupRequest 31,090 31,090 0 0.0%
Sema.LookupPrefixOperatorRequest 1,151 1,151 0 0.0%
Sema.MangleLocalTypeDeclRequest 594 594 0 0.0%
Sema.ModuleImplicitImportsRequest 15,646 15,646 0 0.0%
Sema.ModuleQualifiedLookupRequest 5,749,700 5,751,183 1,483 0.03%
Sema.NamedLazyMemberLoadSuccessCount 27,267,057 27,267,605 548 0.0%
Sema.NamingPatternRequest 285,046 285,046 0 0.0%
Sema.NeedsNewVTableEntryRequest 831,482 831,482 0 0.0%
Sema.NumAccessorBodiesSynthesized 219,228 219,228 0 0.0%
Sema.NumAccessorsSynthesized 355,156 355,156 0 0.0%
Sema.NumConformancesDeserialized 13,380,954 13,378,757 -2,197 -0.02%
Sema.NumConstraintScopes 29,596,607 29,596,457 -150 -0.0%
Sema.NumConstraintsConsideredForEdgeContraction 87,502,735 87,503,054 319 0.0%
Sema.NumCrossImportsChecked 0 0 0 0.0%
Sema.NumCrossImportsFound 0 0 0 0.0%
Sema.NumCyclicOneWayComponentsCollapsed 566 566 0 0.0%
Sema.NumDeclsDeserialized 138,791,749 138,760,818 -30,931 -0.02%
Sema.NumDeclsTypechecked 1,615,228 1,615,228 0 0.0%
Sema.NumGenericSignatureBuilders 1,531,269 1,531,716 447 0.03%
Sema.NumLazyIterableDeclContexts 16,172,553 16,171,339 -1,214 -0.01%
Sema.NumLazyRequirementSignatures 1,426,671 1,426,599 -72 -0.01%
Sema.NumLazyRequirementSignaturesLoaded 831,317 831,263 -54 -0.01%
Sema.NumLeafScopes 18,894,502 18,894,241 -261 -0.0%
Sema.NumTypesDeserialized 39,404,549 39,407,897 3,348 0.01%
Sema.NumUnloadedLazyIterableDeclContexts 9,557,699 9,558,252 553 0.01%
Sema.OpaqueReadOwnershipRequest 346,714 346,714 0 0.0%
Sema.OpaqueResultTypeRequest 428 428 0 0.0%
Sema.OperatorPrecedenceGroupRequest 681 681 0 0.0%
Sema.OverriddenDeclsRequest 3,306,425 3,307,581 1,156 0.03%
Sema.ParamSpecifierRequest 1,509,743 1,509,742 -1 -0.0%
Sema.PatternBindingEntryRequest 568,935 568,935 0 0.0%
Sema.PatternTypeRequest 658,743 658,743 0 0.0%
Sema.PreCheckResultBuilderRequest 962 962 0 0.0%
Sema.PrimarySourceFilesRequest 15,646 15,646 0 0.0%
Sema.PropertyWrapperBackingPropertyInfoRequest 14,365,275 14,365,275 0 0.0%
Sema.PropertyWrapperBackingPropertyTypeRequest 14,372,710 14,372,710 0 0.0%
Sema.PropertyWrapperLValuenessRequest 609 609 0 0.0%
Sema.PropertyWrapperMutabilityRequest 697,475 697,475 0 0.0%
Sema.PropertyWrapperTypeInfoRequest 229 229 0 0.0%
Sema.ProtocolRequiresClassRequest 47,263 47,311 48 0.1%
Sema.ProvideDefaultImplForRequest 10,349,265 10,346,850 -2,415 -0.02%
Sema.QualifiedLookupRequest 6,893,374 6,892,942 -432 -0.01%
Sema.RangeInfoRequest 0 0 0 0.0%
Sema.RequirementRequest 124,429 124,428 -1 -0.0%
Sema.RequirementSignatureRequest 911,302 911,323 21 0.0%
Sema.RequiresOpaqueAccessorsRequest 1,478,315 1,478,315 0 0.0%
Sema.RequiresOpaqueModifyCoroutineRequest 331,649 331,649 0 0.0%
Sema.ResolveEffectiveMemberwiseInitRequest 0 0 0 0.0%
Sema.ResolveImplicitMemberRequest 489,680 489,547 -133 -0.03%
Sema.ResolveProtocolNameRequest 0 0 0 0.0%
Sema.ResolveTypeEraserTypeRequest 0 0 0 0.0%
Sema.ResolveTypeRequest 4,137,755 4,137,748 -7 -0.0%
Sema.ResultBuilderTypeRequest 418,107 418,107 0 0.0%
Sema.ResultTypeRequest 811,704 811,702 -2 -0.0%
Sema.RootAndResultTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.RootTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.SPIGroupsRequest 19,761,069 19,755,963 -5,106 -0.03%
Sema.ScopedImportLookupRequest 1,094 1,094 0 0.0%
Sema.SelfAccessKindRequest 847,321 847,300 -21 -0.0%
Sema.SelfBoundsFromWhereClauseRequest 2,268,021 2,268,654 633 0.03%
Sema.SemanticMembersRequest 33,382 33,382 0 0.0%
Sema.SetterAccessLevelRequest 170,154 170,154 0 0.0%
Sema.SimpleDidSetRequest 3,090,843 3,088,795 -2,048 -0.07%
Sema.SpecializeAttrTargetDeclRequest 20,777 20,777 0 0.0%
Sema.StorageImplInfoRequest 1,698,710 1,698,710 0 0.0%
Sema.StoredPropertiesAndMissingMembersRequest 40,599 40,599 0 0.0%
Sema.StoredPropertiesRequest 459,189 459,189 0 0.0%
Sema.StructuralTypeRequest 2,287 2,287 0 0.0%
Sema.SuperclassDeclRequest 590,483 590,502 19 0.0%
Sema.SuperclassTypeRequest 67,775 67,775 0 0.0%
Sema.SynthesizeAccessorRequest 355,156 355,156 0 0.0%
Sema.SynthesizeDefaultInitRequest 6,841 6,841 0 0.0%
Sema.SynthesizeMainFunctionRequest 31,091 31,091 0 0.0%
Sema.SynthesizeMemberwiseInitRequest 4,497 4,497 0 0.0%
Sema.TangentStoredPropertyRequest 0 0 0 0.0%
Sema.TypeCheckASTNodeAtLocRequest 0 0 0 0.0%
Sema.TypeCheckFunctionBodyRequest 592,549 592,549 0 0.0%
Sema.TypeCheckSourceFileRequest 30,937 30,937 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 35,193 35,192 -1 -0.0%
Sema.TypeEraserHasViableInitRequest 0 0 0 0.0%
Sema.TypeRelationCheckRequest 0 0 0 0.0%
Sema.TypeWitnessRequest 10,920 10,920 0 0.0%
Sema.USRGenerationRequest 11,874,449 11,872,130 -2,319 -0.02%
Sema.UnderlyingTypeDeclsReferencedRequest 475,382 475,424 42 0.01%
Sema.UnderlyingTypeRequest 44,677 44,677 0 0.0%
Sema.UnqualifiedLookupRequest 5,605,557 5,605,548 -9 -0.0%
Sema.ValidatePrecedenceGroupRequest 201,866 201,866 0 0.0%
Sema.ValueWitnessRequest 83,633 83,633 0 0.0%
TBDGen.GenerateTBDRequest 0 0 0 0.0%
TBDGen.PublicSymbolsRequest 30,515 30,515 0 0.0%
TBDGen.SymbolSourceMapRequest 0 0 0 0.0%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 64,949,759,888,299 64,940,415,543,106 -9,344,345,193 -0.01%
LLVM.NumLLVMBytesOutput 2,102,222,336 2,102,225,924 3,588 0.0%
time.swift-driver.wall 12984.7s 12951.7s -33.0s -0.25%

release detailed

Regressed (2)
name old new delta delta_pct
Driver.NumDriverPipePolls 79,776 81,493 1,717 2.15% ⛔
Driver.NumDriverPipeReads 78,269 79,986 1,717 2.19% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (255)
name old new delta delta_pct
AST.ImportSetCacheHit 1,415,577 1,415,577 0 0.0%
AST.ImportSetCacheMiss 74,001 74,001 0 0.0%
AST.ImportSetFoldHit 33,257 33,257 0 0.0%
AST.ImportSetFoldMiss 40,744 40,744 0 0.0%
AST.ModuleShadowCacheHit 3,972 3,972 0 0.0%
AST.ModuleShadowCacheMiss 1,494 1,494 0 0.0%
AST.ModuleVisibilityCacheHit 24,218 24,218 0 0.0%
AST.ModuleVisibilityCacheMiss 4,120 4,120 0 0.0%
AST.NumASTBytesAllocated 12,338,230,715 12,338,222,575 -8,140 -0.0%
AST.NumASTScopeLookups 4,700,301 4,700,301 0 0.0%
AST.NumBraceStmtASTScopeExpansions 680,190 680,190 0 0.0%
AST.NumBraceStmtASTScopes 680,190 680,190 0 0.0%
AST.NumDecls 160,422 160,422 0 0.0%
AST.NumDependencies 61,536 61,528 -8 -0.01%
AST.NumIncrementalDependencies 0 0 0 0.0%
AST.NumIterableTypeBodyASTScopeExpansions 94,133 94,133 0 0.0%
AST.NumIterableTypeBodyASTScopes 100,893 100,893 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 31,034 31,034 0 0.0%
AST.NumLocalTypeDecls 297 297 0 0.0%
AST.NumModuleLookupClassMember 7,886 7,886 0 0.0%
AST.NumModuleLookupValue 33,229,941 33,229,941 0 0.0%
AST.NumObjCMethods 28,718 28,718 0 0.0%
AST.NumOperators 584 584 0 0.0%
AST.NumPrecedenceGroups 126 126 0 0.0%
AST.NumReferencedDynamicNames 0 0 0 0.0%
AST.NumReferencedMemberNames 3,424 3,424 0 0.0%
AST.NumReferencedTopLevelNames 364 364 0 0.0%
AST.NumSourceBuffers 32,412 32,412 0 0.0%
AST.NumSourceLines 5,513,253 5,513,253 0 0.0%
AST.NumSourceLinesPerSecond 307,107 307,410 303 0.1%
AST.NumTotalClangImportedEntities 703,955 703,955 0 0.0%
Driver.ChildrenMaxRSS 399,453,661,184 399,652,106,240 198,445,056 0.05%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 1,507 1,507 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 324,948,457,328 325,132,143,344 183,686,016 0.06%
Frontend.NumInstructionsExecuted 64,949,759,888,299 64,940,415,543,106 -9,344,345,193 -0.01%
Frontend.NumProcessFailures 0 0 0 0.0%
IRGen.IRGenRequest 12 12 0 0.0%
IRGen.OptimizedIRRequest 0 0 0 0.0%
IRGen.SymbolObjectCodeRequest 0 0 0 0.0%
IRModule.NumGOTEntries 257,948 257,948 0 0.0%
IRModule.NumIRAliases 183,680 183,680 0 0.0%
IRModule.NumIRBasicBlocks 5,405,654 5,405,654 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 3,239,784 3,239,784 0 0.0%
IRModule.NumIRGlobals 3,892,096 3,892,096 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 55,254,571 55,254,571 0 0.0%
IRModule.NumIRNamedMetaData 157,875 157,875 0 0.0%
IRModule.NumIRValueSymbols 6,766,190 6,766,190 0 0.0%
LLVM.NumLLVMBytesOutput 2,102,222,336 2,102,225,924 3,588 0.0%
Parse.CodeCompletionSecondPassRequest 0 0 0 0.0%
Parse.NumFunctionsParsed 315,779 315,779 0 0.0%
Parse.NumIterableDeclContextParsed 105,794 105,794 0 0.0%
Parse.ParseAbstractFunctionBodyRequest 288,356 288,356 0 0.0%
Parse.ParseMembersRequest 409 409 0 0.0%
Parse.ParseSourceFileRequest 31,599 31,599 0 0.0%
SILGen.ASTLoweringRequest 1,397 1,397 0 0.0%
SILGen.ParseSILModuleRequest 0 0 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 1,389,332 1,389,332 0 0.0%
SILModule.NumSILGenGlobalVariables 69,339 69,339 0 0.0%
SILModule.NumSILGenVtables 22,139 22,139 0 0.0%
SILModule.NumSILGenWitnessTables 79,063 79,063 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,179,749 1,179,749 0 0.0%
SILModule.NumSILOptGlobalVariables 107,869 107,869 0 0.0%
SILModule.NumSILOptVtables 24,762 24,762 0 0.0%
SILModule.NumSILOptWitnessTables 81,201 81,201 0 0.0%
SILOptimizer.ExecuteSILPipelineRequest 5,576 5,576 0 0.0%
SILOptimizer.LoweredSILRequest 0 0 0 0.0%
Sema.AbstractGenericSignatureRequest 32,508 32,508 0 0.0%
Sema.AccessLevelRequest 1,801,631 1,801,631 0 0.0%
Sema.ActorIsolationRequest 560,309 560,309 0 0.0%
Sema.AnyObjectLookupRequest 300 300 0 0.0%
Sema.AreAllStoredPropertiesDefaultInitableRequest 16,947 16,947 0 0.0%
Sema.AttachedPropertyWrapperTypeRequest 14,309,035 14,309,035 0 0.0%
Sema.AttachedPropertyWrappersRequest 16,079,749 16,079,749 0 0.0%
Sema.AttachedResultBuilderRequest 774,670 774,670 0 0.0%
Sema.BodyInitKindRequest 54,763 54,763 0 0.0%
Sema.CallerSideDefaultArgExprRequest 84,637 84,637 0 0.0%
Sema.CanBeAsyncHandlerRequest 223,106 223,106 0 0.0%
Sema.CheckInconsistentImplementationOnlyImportsRequest 1,393 1,393 0 0.0%
Sema.CheckRedeclarationRequest 1,146,089 1,146,089 0 0.0%
Sema.ClassAncestryFlagsRequest 57,340 57,340 0 0.0%
Sema.ClosureHasExplicitResultRequest 100,587 100,587 0 0.0%
Sema.CodeCompletionFileRequest 0 0 0 0.0%
Sema.CollectOverriddenDeclsRequest 0 0 0 0.0%
Sema.CompareDeclSpecializationRequest 434,106 434,106 0 0.0%
Sema.CursorInfoRequest 0 0 0 0.0%
Sema.CustomAttrNominalRequest 430 430 0 0.0%
Sema.CustomAttrTypeRequest 336 336 0 0.0%
Sema.DefaultAndMaxAccessLevelRequest 46,201 46,201 0 0.0%
Sema.DefaultArgumentExprRequest 45,949 45,949 0 0.0%
Sema.DefaultArgumentInitContextRequest 119 119 0 0.0%
Sema.DefaultDefinitionTypeRequest 3,337 3,337 0 0.0%
Sema.DefaultTypeRequest 588,346 588,346 0 0.0%
Sema.DerivativeAttrOriginalDeclRequest 0 0 0 0.0%
Sema.DifferentiableAttributeTypeCheckRequest 0 0 0 0.0%
Sema.DirectLookupRequest 36,520,884 36,520,792 -92 -0.0%
Sema.DirectOperatorLookupRequest 1,401,928 1,401,928 0 0.0%
Sema.DirectPrecedenceGroupLookupRequest 717,043 717,043 0 0.0%
Sema.DynamicallyReplacedDeclRequest 899,534 899,534 0 0.0%
Sema.EnumRawTypeRequest 10,255 10,255 0 0.0%
Sema.EnumRawValuesRequest 11,236 11,236 0 0.0%
Sema.ExistentialConformsToSelfRequest 4,860 4,860 0 0.0%
Sema.ExistentialTypeSupportedRequest 9,413 9,413 0 0.0%
Sema.ExpandASTScopeRequest 3,251,044 3,251,044 0 0.0%
Sema.ExtendedNominalRequest 50,213 50,213 0 0.0%
Sema.ExtendedTypeRequest 50,195 50,195 0 0.0%
Sema.FragileFunctionKindRequest 1,145,053 1,145,053 0 0.0%
Sema.FunctionOperatorRequest 10,172 10,172 0 0.0%
Sema.GenericParamListRequest 1,415,937 1,415,937 0 0.0%
Sema.GenericSignatureRequest 1,205,623 1,205,623 0 0.0%
Sema.GetDestructorRequest 23,465 23,465 0 0.0%
Sema.GlobalActorAttributeRequest 592,918 592,918 0 0.0%
Sema.GlobalActorInstanceRequest 40 40 0 0.0%
Sema.HasCircularInheritedProtocolsRequest 9,606 9,606 0 0.0%
Sema.HasCircularRawValueRequest 10,254 10,254 0 0.0%
Sema.HasDefaultInitRequest 35,373 35,373 0 0.0%
Sema.HasDynamicCallableAttributeRequest 0 0 0 0.0%
Sema.HasDynamicMemberLookupAttributeRequest 310,909 310,909 0 0.0%
Sema.HasImplementationOnlyImportsRequest 31,599 31,599 0 0.0%
Sema.HasMemberwiseInitRequest 13,242 13,242 0 0.0%
Sema.HasMissingDesignatedInitializersRequest 23,874 23,874 0 0.0%
Sema.HasUserDefinedDesignatedInitRequest 35,373 35,373 0 0.0%
Sema.InferredGenericSignatureRequest 79,855 79,855 0 0.0%
Sema.InheritedDeclsReferencedRequest 1,320,709 1,320,709 0 0.0%
Sema.InheritedProtocolsRequest 109,338 109,338 0 0.0%
Sema.InheritedTypeRequest 179,544 179,544 0 0.0%
Sema.InheritsSuperclassInitializersRequest 17,353 17,353 0 0.0%
Sema.InitKindRequest 68,756 68,756 0 0.0%
Sema.InterfaceTypeRequest 3,725,408 3,725,408 0 0.0%
Sema.IsABICompatibleOverrideRequest 157,734 157,734 0 0.0%
Sema.IsAccessorTransparentRequest 305,561 305,561 0 0.0%
Sema.IsActorRequest 104,983 104,983 0 0.0%
Sema.IsAsyncHandlerRequest 798,734 798,734 0 0.0%
Sema.IsCallableNominalTypeRequest 2,399 2,399 0 0.0%
Sema.IsDeclApplicableRequest 0 0 0 0.0%
Sema.IsDynamicRequest 1,396,603 1,396,603 0 0.0%
Sema.IsFinalRequest 1,135,787 1,135,787 0 0.0%
Sema.IsGetterMutatingRequest 370,422 370,422 0 0.0%
Sema.IsImplicitlyUnwrappedOptionalRequest 2,181,881 2,181,881 0 0.0%
Sema.IsObjCRequest 1,227,281 1,227,281 0 0.0%
Sema.IsSetterMutatingRequest 353,948 353,948 0 0.0%
Sema.IsStaticRequest 637,627 637,627 0 0.0%
Sema.LazyStoragePropertyRequest 815 815 0 0.0%
Sema.LookupAllConformancesInContextRequest 95,806 95,806 0 0.0%
Sema.LookupConformanceInModuleRequest 64,608,199 64,603,805 -4,394 -0.01%
Sema.LookupInModuleRequest 2,685,807 2,685,807 0 0.0%
Sema.LookupInfixOperatorRequest 60,598 60,598 0 0.0%
Sema.LookupPostfixOperatorRequest 29 29 0 0.0%
Sema.LookupPrecedenceGroupRequest 30,299 30,299 0 0.0%
Sema.LookupPrefixOperatorRequest 190 190 0 0.0%
Sema.MangleLocalTypeDeclRequest 317 317 0 0.0%
Sema.ModuleImplicitImportsRequest 1,397 1,397 0 0.0%
Sema.ModuleQualifiedLookupRequest 646,625 646,625 0 0.0%
Sema.NamedLazyMemberLoadSuccessCount 10,051,663 10,051,663 0 0.0%
Sema.NamingPatternRequest 76,975 76,975 0 0.0%
Sema.NeedsNewVTableEntryRequest 622,260 622,260 0 0.0%
Sema.NumAccessorBodiesSynthesized 223,579 223,579 0 0.0%
Sema.NumAccessorsSynthesized 227,639 227,639 0 0.0%
Sema.NumConformancesDeserialized 4,203,878 4,203,878 0 0.0%
Sema.NumConstraintScopes 28,982,475 28,982,475 0 0.0%
Sema.NumConstraintsConsideredForEdgeContraction 87,514,450 87,514,450 0 0.0%
Sema.NumCrossImportsChecked 0 0 0 0.0%
Sema.NumCrossImportsFound 0 0 0 0.0%
Sema.NumCyclicOneWayComponentsCollapsed 566 566 0 0.0%
Sema.NumDeclsDeserialized 17,745,197 17,745,197 0 0.0%
Sema.NumDeclsTypechecked 1,648,622 1,648,622 0 0.0%
Sema.NumGenericSignatureBuilders 255,954 255,954 0 0.0%
Sema.NumLazyIterableDeclContexts 2,024,876 2,024,876 0 0.0%
Sema.NumLazyRequirementSignatures 154,359 154,359 0 0.0%
Sema.NumLazyRequirementSignaturesLoaded 97,940 97,940 0 0.0%
Sema.NumLeafScopes 18,365,256 18,365,256 0 0.0%
Sema.NumTypesDeserialized 6,894,405 6,894,405 0 0.0%
Sema.NumUnloadedLazyIterableDeclContexts 1,164,712 1,164,712 0 0.0%
Sema.OpaqueReadOwnershipRequest 214,441 214,441 0 0.0%
Sema.OpaqueResultTypeRequest 356 356 0 0.0%
Sema.OperatorPrecedenceGroupRequest 512 512 0 0.0%
Sema.OverriddenDeclsRequest 1,143,220 1,143,220 0 0.0%
Sema.ParamSpecifierRequest 888,107 888,107 0 0.0%
Sema.PatternBindingEntryRequest 345,895 345,895 0 0.0%
Sema.PatternTypeRequest 436,153 436,153 0 0.0%
Sema.PreCheckResultBuilderRequest 888 888 0 0.0%
Sema.PrimarySourceFilesRequest 1,397 1,397 0 0.0%
Sema.PropertyWrapperBackingPropertyInfoRequest 14,305,002 14,305,002 0 0.0%
Sema.PropertyWrapperBackingPropertyTypeRequest 14,309,035 14,309,035 0 0.0%
Sema.PropertyWrapperLValuenessRequest 609 609 0 0.0%
Sema.PropertyWrapperMutabilityRequest 559,295 559,295 0 0.0%
Sema.PropertyWrapperTypeInfoRequest 39 39 0 0.0%
Sema.ProtocolRequiresClassRequest 10,284 10,284 0 0.0%
Sema.ProvideDefaultImplForRequest 0 0 0 0.0%
Sema.QualifiedLookupRequest 4,299,660 4,299,660 0 0.0%
Sema.RangeInfoRequest 0 0 0 0.0%
Sema.RequirementRequest 78,256 78,256 0 0.0%
Sema.RequirementSignatureRequest 110,093 110,093 0 0.0%
Sema.RequiresOpaqueAccessorsRequest 1,291,158 1,291,158 0 0.0%
Sema.RequiresOpaqueModifyCoroutineRequest 209,701 209,701 0 0.0%
Sema.ResolveEffectiveMemberwiseInitRequest 0 0 0 0.0%
Sema.ResolveImplicitMemberRequest 341,181 341,181 0 0.0%
Sema.ResolveProtocolNameRequest 0 0 0 0.0%
Sema.ResolveTypeEraserTypeRequest 0 0 0 0.0%
Sema.ResolveTypeRequest 2,162,981 2,162,981 0 0.0%
Sema.ResultBuilderTypeRequest 385,540 385,540 0 0.0%
Sema.ResultTypeRequest 463,310 463,310 0 0.0%
Sema.RootAndResultTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.RootTypeOfKeypathDynamicMemberRequest 0 0 0 0.0%
Sema.SPIGroupsRequest 2,377,182 2,377,182 0 0.0%
Sema.ScopedImportLookupRequest 1,189 1,189 0 0.0%
Sema.SelfAccessKindRequest 368,820 368,820 0 0.0%
Sema.SelfBoundsFromWhereClauseRequest 530,559 530,559 0 0.0%
Sema.SemanticMembersRequest 23,053 23,053 0 0.0%
Sema.SetterAccessLevelRequest 140,946 140,946 0 0.0%
Sema.SimpleDidSetRequest 379,788 379,788 0 0.0%
Sema.SpecializeAttrTargetDeclRequest 6,280 6,280 0 0.0%
Sema.StorageImplInfoRequest 1,415,337 1,415,337 0 0.0%
Sema.StoredPropertiesAndMissingMembersRequest 31,565 31,565 0 0.0%
Sema.StoredPropertiesRequest 161,155 161,155 0 0.0%
Sema.StructuralTypeRequest 529 529 0 0.0%
Sema.SuperclassDeclRequest 111,985 111,985 0 0.0%
Sema.SuperclassTypeRequest 29,250 29,250 0 0.0%
Sema.SynthesizeAccessorRequest 227,639 227,639 0 0.0%
Sema.SynthesizeDefaultInitRequest 3,488 3,488 0 0.0%
Sema.SynthesizeMainFunctionRequest 22,131 22,131 0 0.0%
Sema.SynthesizeMemberwiseInitRequest 2,816 2,816 0 0.0%
Sema.TangentStoredPropertyRequest 0 0 0 0.0%
Sema.TypeCheckASTNodeAtLocRequest 0 0 0 0.0%
Sema.TypeCheckFunctionBodyRequest 601,491 601,491 0 0.0%
Sema.TypeCheckSourceFileRequest 31,575 31,575 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 25,443 25,443 0 0.0%
Sema.TypeEraserHasViableInitRequest 0 0 0 0.0%
Sema.TypeRelationCheckRequest 0 0 0 0.0%
Sema.TypeWitnessRequest 4,590 4,590 0 0.0%
Sema.USRGenerationRequest 443,095 443,095 0 0.0%
Sema.UnderlyingTypeDeclsReferencedRequest 69,970 69,970 0 0.0%
Sema.UnderlyingTypeRequest 21,332 21,332 0 0.0%
Sema.UnqualifiedLookupRequest 2,508,203 2,508,203 0 0.0%
Sema.ValidatePrecedenceGroupRequest 203,529 203,529 0 0.0%
Sema.ValueWitnessRequest 41,889 41,889 0 0.0%
TBDGen.GenerateTBDRequest 0 0 0 0.0%
TBDGen.PublicSymbolsRequest 1,393 1,393 0 0.0%
TBDGen.SymbolSourceMapRequest 0 0 0 0.0%

@scentini
Copy link
Contributor Author

@CodaFi can you PTAL at the results? Seems like there is no impact on average running time, is it okay to merge this?

@CodaFi
Copy link
Contributor

CodaFi commented Nov 30, 2020

@CodaFi CodaFi merged commit 356946f into swiftlang:main Nov 30, 2020
@CodaFi
Copy link
Contributor

CodaFi commented Nov 30, 2020

These results confirm that we're not setup to measure the full impact here. Because we're just running source compat a bunch of times on macOS builders, it's unlikely we're hitting this code path with enough regularity to see a win or a loss.

@scentini scentini deleted the implementation-only-symbol-visibility-fix branch November 30, 2020 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants