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

Add in the basics for Import ordering #5524

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

paultag
Copy link
Collaborator

@paultag paultag commented Feb 26, 2025

This will walk AST for import notes, and build up a mapping of relationships tying in the target of the import (the "dependency") to our current program (the "dependent").

This allows us to build up a mapping of what dependency and reverse dependency relationships look like, in order to sort dependencies by topologically sorting them.

Since I wanted to enable some parallelism here long-term, this returns the (kinda awkward) Vec<Vec<String>> type.

This is a list of list of required AST files which can safely be run concurrently, because they have no dependency relationship to eachother. Each list of dependencies should be fenced, and start the next list of dependencies after the first is complely done. This isn't ideal and will change long-term, but for now this will work to enable very basic opportunistic parallelism.

This will walk AST for import notes, and build up a mapping of
relationships tying in the target of the import (the "dependency")
to our current program (the "dependent").

This allows us to build up a mapping of what dependency and reverse
dependency relationships look like, in order to sort dependencies by
topologically sorting them.

Since I wanted to enable some parallelism here long-term, this returns
the (kinda awkward) `Vec<Vec<String>>` type.

This is a list of list of dependency targets which can safely be run
concurrently, because they have no dependency relationship to eachother.
Each list of dependencies should be gated, and start the next list of
dependencies after the first is complely done. This isn't ideal and will
change long-term, but for now this will work to enable very basic
opportunistic parallelism.
Copy link

qa-wolf bot commented Feb 26, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Feb 26, 2025

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

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Feb 26, 2025 8:57pm

@paultag paultag requested a review from jessfraz February 26, 2025 16:28
this lint doesn't apply here, order doesn't matter. Elsewhere in this
program where order does matter we do the intermediate vec.
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 98.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.37%. Comparing base (58a9c60) to head (d657dfb).

Files with missing lines Patch % Lines
src/wasm-lib/kcl/src/walk/import_graph.rs 98.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5524      +/-   ##
==========================================
+ Coverage   86.32%   86.37%   +0.05%     
==========================================
  Files          95       96       +1     
  Lines       36020    36170     +150     
==========================================
+ Hits        31093    31241     +148     
- Misses       4927     4929       +2     
Flag Coverage Δ
wasm-lib 86.37% <98.66%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paultag paultag enabled auto-merge (squash) February 26, 2025 18:48
@paultag paultag disabled auto-merge February 26, 2025 20:16
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