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

Force fuzzyspec expansion to always resolve the ns #47

Merged
merged 5 commits into from
May 12, 2021

Conversation

Zaharid
Copy link
Contributor

@Zaharid Zaharid commented Apr 29, 2021

If a namespace depends on a production rule (e.g. one that returns
a dictionary or list of dictionaries that are then used in collect) the
namespace would be resolved once but then be oblivious to the changes in
the input of the production rule, that would make it required to
reevaluate it.

Rather than adding more special cases, just force all keys to be
revaluated by the config object so as to keep them up to date within the
current namespace. I cannot think of many downsides to this change,
other than having to needlessly reevaluate a few inputs (which are
assumed to be cheap in the first place).

The test in test_complexinput.py represents a minimal example of input
that would fail in master and work correctly with this change.

Zaharid added 3 commits April 29, 2021 15:53
If a namespace depends on a production rule (e.g. one that returns
a dictionary or list of dictionaries that are then used in collect) the
namespace would be resolved once but then be oblivious to the changes in
the input of the production rule, that would make it required to
reevaluate it.

Rather than adding more special cases, just force all keys to be
revaluated by the config object so as to keep them up to date within the
current namespace. I cannot think of many downsides to this change,
other than having to needlessly reevaluate a few inputs (which are
assumed to be cheap in the first place).

The test in test_complexinput.py represents a minimal example of input
that would fail in master and work correctly with this change.
Replace old tests that rely on the behaviour of expand_partial.
@Zaharid Zaharid requested review from wilsonmr and siranipour April 29, 2021 15:01
@Zaharid
Copy link
Contributor Author

Zaharid commented Apr 29, 2021

Unfortunately this doesn't help with #38, which I am yet to understand.

Zaharid added 2 commits April 29, 2021 18:48
This fails because the collect node is resolved at compile time which
works differently.
This avoids and edge case where collect is resolved at compile time
(because we are collecting over a production rule) and the dependencies
have changed inadvertently. To remedy that we simply force the node to
always be reevaluated.
@siranipour
Copy link
Contributor

Will review with high priority because this breaks a lot of stuff in vp

@wilsonmr
Copy link
Contributor

This may take me a while to understand. I always accepted fuzzyspec at face value without really knowing what it meant, well done on fix though! I'll review ASAP

Copy link
Contributor

@wilsonmr wilsonmr left a comment

Choose a reason for hiding this comment

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

Ok I'm fairly happy this makes sense

@Zaharid Zaharid merged commit c009824 into master May 12, 2021
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.

3 participants