Skip to content

[Incremental] Obviate the need for a reverse mapping from swiftdeps to swift #728

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 2 commits into from
Jun 25, 2021

Conversation

davidungar
Copy link
Contributor

@davidungar davidungar commented Jun 24, 2021

Obviate the need for a reverse mapping from swiftdeps to swift by keeping the swift file in the dependency source of the graph nodes.
Remove BidirectionalMap and InputDependencySourceMap.
Bump the minor version number of the priors.
Fixes rdar://77998890

@davidungar davidungar requested review from CodaFi and artemcm June 24, 2021 04:57
@davidungar
Copy link
Contributor Author

@swift-ci please test

@davidungar davidungar changed the title [WIP, DNM, Incremental] Obviate the need for a reverse mapping from swiftdeps to swift [DNM, Incremental] Obviate the need for a reverse mapping from swiftdeps to swift Jun 24, 2021
…ping the swift file in the dependency source of the graph nodes
@davidungar davidungar changed the title [DNM, Incremental] Obviate the need for a reverse mapping from swiftdeps to swift [Incremental] Obviate the need for a reverse mapping from swiftdeps to swift Jun 25, 2021
@davidungar
Copy link
Contributor Author

@swift-ci please test

}
}
self.previous = previous
self.disappeared = disappeared.sorted {$0.name < $1.name}
}

func isANewInput(_ file: VirtualPath) -> Bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this traffic in handles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll look into it--good thought!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that changing SourceFile to only traffic in handles would be a good idea, but it leaks out into other code and it might be better to keep this PR as narrow as reasonable. I'll address this idea in a future PR.

@CodaFi
Copy link
Contributor

CodaFi commented Jun 25, 2021

Took a brief pass over this and LGTM. Thanks for fixing up the modeling here. Going to hold off on approving and leave that to @artemcm who can give you a more thorough review.

@davidungar
Copy link
Contributor Author

davidungar commented Jun 25, 2021

Took a brief pass over this and LGTM. Thanks for fixing up the modeling here. Going to hold off on approving and leave that to @artemcm who can give you a more thorough review.

Thank you very much for taking a look so quickly. You are welcome. I'll look into your suggestion about using handles. I like it.

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

This is a huuuge improvement not just to the model, but to the readability of much of the affected code. Thanks!

let currentSet: Set<VirtualPath.Handle>

/// Handles of the input files in the previous invocation
private let previous: Set<VirtualPath.Handle>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Would be nice if this was called previousSet to match the above property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, done!

@@ -269,12 +269,13 @@ extension IncrementalCompilationState.FirstWaveComputer {

return inputsToBeCertainlyRecompiled.reduce(into: Set()) {
speculativelyRecompiledInputs, certainlyRecompiledInput in
let speculativeDependents = moduleDependencyGraph.collectInputsInvalidatedBy(input: certainlyRecompiledInput)
let speculativeDependents = moduleDependencyGraph.collectInputsInvalidatedBy(changedInput: certainlyRecompiledInput)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the names cleanup!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My pleasure!

@davidungar
Copy link
Contributor Author

@artemcm Thank you for the quick review and the kind words.

@davidungar
Copy link
Contributor Author

@swift-ci please test

@davidungar davidungar merged commit 4059f25 into swiftlang:main Jun 25, 2021
@finagolfin
Copy link
Member

The macOS CI appears broken right now, could this pull be the culprit? No hurry, just reporting it so it can be fixed eventually, cc @drexin.

@davidungar
Copy link
Contributor Author

davidungar commented Jun 26, 2021 via email

@davidungar
Copy link
Contributor Author

davidungar commented Jun 27, 2021 via email

@davidungar davidungar deleted the wed2 branch July 3, 2021 16:50
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.

4 participants