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

ReverseTopological -> AdjacencyMap #5430

Merged
merged 1 commit into from
Jul 3, 2023
Merged

Conversation

alexkirsz
Copy link
Contributor

@alexkirsz alexkirsz commented Jun 30, 2023

Description

This PR renames the ReverseTopological graph store implementation to AdjacencyMap. The reasoning here is that we can implement any graph traversal algorithm on top of AdjacencyMap, not just reverse topological.

This PR also adds a reverse_topological_from_node iterator method to only traverse the subgraph from a given node.

Next.js PR: https://github.com/vercel/next.js/compare/alexkirsz/web-866-adjacency-map?expand=1

Testing Instructions

N/A

@alexkirsz alexkirsz requested a review from a team as a code owner June 30, 2023 11:49
@vercel
Copy link

vercel bot commented Jun 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
turbo-site ✅ Ready (Inspect) Visit Preview Jun 30, 2023 11:49am
10 Ignored Deployments
Name Status Preview Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-cra-web ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-designsystem-docs ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-gatsby-web ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-native-web ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-nonmonorepo ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-svelte-web ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-tailwind-web ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am
examples-vite-web ⬜️ Ignored (Inspect) Jun 30, 2023 11:49am

@github-actions
Copy link
Contributor

⚠️ This change may fail to build next-swc.

Logs

packages/next-swc/crates/next-core/src/app_source.rs:35:17: �[38;5;9merror[E0432]: unresolved import `turbopack_binding::turbopack::dev_server::source::specificity`
packages/next-swc/crates/next-core/src/manifest.rs:17:71: �[38;5;9merror[E0432]: unresolved import `turbopack_binding::turbopack::dev_server::source::ContentSourceResultVc`
packages/next-swc/crates/next-core/src/next_image/content_source.rs:17:13: �[38;5;9merror[E0432]: unresolved imports `turbopack_binding::turbopack::dev_server::source::wrapping_source::encode_pathname_to_url`, `turbopack_binding::turbopack::dev_server::source::wrapping_source::WrappedContentSourceVc`, `turbopack_binding::turbopack::dev_server::source::ContentSourceResultVc`, `turbopack_binding::turbopack::dev_server::source::NeededData`
packages/next-swc/crates/next-core/src/page_source.rs:29:17: �[38;5;9merror[E0432]: unresolved import `turbopack_binding::turbopack::dev_server::source::specificity`
packages/next-swc/crates/next-core/src/pages_structure.rs:5:36: �[38;5;9merror[E0432]: unresolved import `turbopack_binding::turbopack::dev_server::source::specificity`
packages/next-swc/crates/next-core/src/router_source.rs:12:9: �[38;5;9merror[E0432]: unresolved imports `turbopack_binding::turbopack::dev_server::source::ContentSourceResultVc`, `turbopack_binding::turbopack::dev_server::source::NeededData`
packages/next-swc/crates/next-core/src/manifest.rs:154:1: �[38;5;9merror[E0407]: method `get` is not a member of trait `ContentSource`
packages/next-swc/crates/next-core/src/next_image/content_source.rs:42:1: �[38;5;9merror[E0407]: method `get` is not a member of trait `ContentSource`
packages/next-swc/crates/next-core/src/router_source.rs:89:1: �[38;5;9merror[E0407]: method `get` is not a member of trait `ContentSource`
packages/next-swc/crates/next-core/src/app_source.rs:674:24: �[38;5;9merror[E0277]: the trait bound `FileSystemPathVc: From<NextParamsMatcherVc>` is not satisfied
packages/next-swc/crates/next-core/src/app_source.rs:687:10: �[38;5;9merror[E0277]: the trait bound `StringVc: From<AppRendererVc>` is not satisfied
packages/next-swc/crates/next-core/src/app_source.rs:669:18: �[38;5;9merror[E0061]: this function takes 11 arguments but 10 arguments were supplied
packages/next-swc/crates/next-core/src/app_source.rs:718:38: �[38;5;9merror[E0277]: the trait bound `FileSystemPathVc: From<NextFallbackMatcherVc>` is not satisfied
packages/next-swc/crates/next-core/src/app_source.rs:731:10: �[38;5;9merror[E0277]: the trait bound `StringVc: From<AppRendererVc>` is not satisfied
packages/next-swc/crates/next-core/src/app_source.rs:713:18: �[38;5;9merror[E0061]: this function takes 11 arguments but 10 arguments were supplied
packages/next-swc/crates/next-core/src/app_source.rs:763:24: �[38;5;9merror[E0277]: the trait bound `FileSystemPathVc: From<NextParamsMatcherVc>` is not satisfied
packages/next-swc/crates/next-core/src/app_source.rs:776:10: �[38;5;9merror[E0277]: the trait bound `StringVc: From<AppRouteVc>` is not satisfied
packages/next-swc/crates/next-core/src/app_source.rs:758:18: �[38;5;9merror[E0061]: this function takes 10 arguments but 9 arguments were supplied
packages/next-swc/crates/next-core/src/manifest.rs:154:1: �[38;5;9merror[E0046]: not all trait items implemented, missing: `get_routes`
packages/next-swc/crates/next-core/src/next_image/content_source.rs:102:26: �[38;5;9merror[E0599]: no method named `content_source` found for struct `RewriteBuilder` in the current scope
packages/next-swc/crates/next-core/src/next_image/content_source.rs:42:1: �[38;5;9merror[E0046]: not all trait items implemented, missing: `get_routes`
packages/next-swc/crates/next-core/src/page_source.rs:411:27: �[38;5;9merror[E0277]: the trait bound `FileSystemPathVc: From<NextParamsMatcherVc>` is not satisfied
packages/next-swc/crates/next-core/src/page_source.rs:424:14: �[38;5;9merror[E0277]: the trait bound `StringVc: From<SsrEntryVc>` is not satisfied
packages/next-swc/crates/next-core/src/page_source.rs:406:9: �[38;5;9merror[E0061]: this function takes 10 arguments but 9 arguments were supplied
packages/next-swc/crates/next-core/src/page_source.rs:465:31: �[38;5;9merror[E0277]: the trait bound `FileSystemPathVc: From<NextParamsMatcherVc>` is not satisfied
packages/next-swc/crates/next-core/src/page_source.rs:444:10: �[38;5;9merror[E0277]: the trait bound `StringVc: From<SsrEntryVc>` is not satisfied
packages/next-swc/crates/next-core/src/page_source.rs:460:13: �[38;5;9merror[E0061]: this function takes 11 arguments but 10 arguments were supplied
packages/next-swc/crates/next-core/src/page_source.rs:477:36: �[38;5;9merror[E0277]: the trait bound `FileSystemPathVc: From<NextPrefixSuffixParamsMatcherVc>` is not satisfied
packages/next-swc/crates/next-core/src/page_source.rs:457:10: �[38;5;9merror[E0277]: the trait bound `StringVc: From<SsrEntryVc>` is not satisfied
packages/next-swc/crates/next-core/src/page_source.rs:472:13: �[38;5;9merror[E0061]: this function takes 11 arguments but 10 arguments were supplied
packages/next-swc/crates/next-core/src/page_source.rs:577:6: �[38;5;9merror[E0277]: the trait bound `StringVc: From<SsrEntryVc>` is not satisfied
packages/next-swc/crates/next-core/src/page_source.rs:588:9: �[38;5;9merror[E0061]: this function takes 11 arguments but 10 arguments were supplied
packages/next-swc/crates/next-core/src/router_source.rs:105:18: �[38;5;9merror[E0599]: no method named `get` found for struct `ContentSourceVc` in the current scope
packages/next-swc/crates/next-core/src/router_source.rs:156:18: �[38;5;9merror[E0599]: no method named `get` found for struct `ContentSourceVc` in the current scope
packages/next-swc/crates/next-core/src/router_source.rs:158:73: �[38;5;9merror[E0599]: no method named `content_source` found for struct `RewriteBuilder` in the current scope
packages/next-swc/crates/next-core/src/router_source.rs:89:1: �[38;5;9merror[E0046]: not all trait items implemented, missing: `get_routes`
error: could not compile `next-core` (lib) due to 36 previous errors

See job summary for details

@github-actions
Copy link
Contributor

github-actions bot commented Jun 30, 2023

🟢 CI successful 🟢

Thanks

@github-actions
Copy link
Contributor

Linux Benchmark for c056dcf

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 6003.13µs ± 54.53µs 6075.43µs ± 52.95µs +1.20%
bench_hmr_to_eval/Turbopack CSR/1000 modules 5611.42µs ± 25.86µs 5698.73µs ± 82.52µs +1.56%
bench_startup/Turbopack CSR/1000 modules 907.27ms ± 0.90ms 913.85ms ± 3.75ms +0.73%

@github-actions
Copy link
Contributor

MacOS Benchmark for c056dcf

Test Base PR % Significant %
bench_hmr_to_eval/Turbopack CSR/1000 modules 26.53ms ± 0.07ms 27.07ms ± 0.19ms +2.04% +0.15%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 27.49ms ± 0.15ms 27.80ms ± 0.06ms +1.11%
bench_hmr_to_eval/Turbopack CSR/1000 modules 26.53ms ± 0.07ms 27.07ms ± 0.19ms +2.04% +0.15%
bench_startup/Turbopack CSR/1000 modules 3368.65ms ± 19.16ms 3502.32ms ± 127.15ms +3.97%

@alexkirsz alexkirsz merged commit 8936f1d into main Jul 3, 2023
@alexkirsz alexkirsz deleted the alexkirsz/web-866-adjacency-map branch July 3, 2023 09:08
sokra pushed a commit to vercel/next.js that referenced this pull request Jul 3, 2023
See vercel/turborepo#5430

## Turbopack changes

* vercel/turborepo#5430 <!-- Alex Kirszenberg -
ReverseTopological -> AdjacencyMap -->
shuding pushed a commit to vercel/next.js that referenced this pull request Jul 8, 2023
See vercel/turborepo#5430

## Turbopack changes

* vercel/turborepo#5430 <!-- Alex Kirszenberg -
ReverseTopological -> AdjacencyMap -->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
### Description

This PR renames the `ReverseTopological` graph store implementation to
`AdjacencyMap`. The reasoning here is that we can implement any graph
traversal algorithm on top of `AdjacencyMap`, not just reverse
topological.

This PR also adds a `reverse_topological_from_node` iterator method to
only traverse the subgraph from a given node.

Next.js PR:
https://github.com/vercel/next.js/compare/alexkirsz/web-866-adjacency-map?expand=1

### Testing Instructions

N/A
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
### Description

This PR renames the `ReverseTopological` graph store implementation to
`AdjacencyMap`. The reasoning here is that we can implement any graph
traversal algorithm on top of `AdjacencyMap`, not just reverse
topological.

This PR also adds a `reverse_topological_from_node` iterator method to
only traverse the subgraph from a given node.

Next.js PR:
https://github.com/vercel/next.js/compare/alexkirsz/web-866-adjacency-map?expand=1

### Testing Instructions

N/A
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
### Description

This PR renames the `ReverseTopological` graph store implementation to
`AdjacencyMap`. The reasoning here is that we can implement any graph
traversal algorithm on top of `AdjacencyMap`, not just reverse
topological.

This PR also adds a `reverse_topological_from_node` iterator method to
only traverse the subgraph from a given node.

Next.js PR:
https://github.com/vercel/next.js/compare/alexkirsz/web-866-adjacency-map?expand=1

### Testing Instructions

N/A
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.

2 participants