-
Notifications
You must be signed in to change notification settings - Fork 50
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 link conditions for 'stop-at' expression in ExploreRecursive selector #214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly questions; one thing I'm pretty sure is a bug.
* don't skip decides based on stop_at * don't push explore context into parse context for parsing condition
bcfe881
to
cef2a56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I think I'm good with this.
More tests would be nice, but Will faught me out-of-band about what a pain that is right now, and we agree to punt until someone has time to renovate all these selector tests to be serial-fixture-driven. (Tests written after that point will be both A) easier to write, and B) more useful as specs and to ensure other implementations are compatible.) So: onward.
Note: this allows stopping recursion at a sub-dag, but doesn't fully de-duplicate 'only new stuff not in the sub-dag i already have' when doing a graph sync which is something you might hope for. Imagine you're doing something like synchronizing a blockchain, and you want to express 'i already have things up to block '. where each block links to a state tree that evolves over blocks. The functionality of this stop-at isn't quite what you might intuitively what which would be 'don't recurse into parts of the state tree on the new blocks that haven't changed since the block i already have'. The problem with that is that you don't know what all those cids are. You could have a selector to stop at 'all the cids', but that's a huge list to transfer, or you could imagine a form of selector to ask the other side to actually form a set out of the subdag represented by the block you have and not send any of those again, but that's asking for a lot of of computational work from the other side (it would have to walk the full history of the blockchain to generate such a set). |
Yeah, I think I could still also image a feature someday which might propose something like:
Such a feature would differ from this by putting all the stop points in one place towards the root of a protocol conversation, and taking global effect for the walk (e.g. you don't have to know where in the topology the stop is at), and also by being a set (whereas to get that by extending the condition feature, we'd be presumably be implementing 'or' clauses, and I suspect that might become... harder to optimize). This |
I am looking one more time at the specification that we have for it is not well specifiedThe current degree of specification we have is this excerpt from schema for the
There is no actual specification, at this time, of what any of those types ( (The same doc also says """The "Condition" system is not fully specified -- it is a placeholder awaiting further design.""" under the "known issues" heading. It's highly disclaimed.) why I'm wondering about thisI don't really know why The name would seem to imply it's a special case of Or, if it's doing equality check, as the comment seems to suggest, I don't know why (And to be clear: I wrote all these lines. I'm saying I don't know what I was thinking at the time. This looks like a sketch kicked out by a tired brain that never ever got reviewed.) what we seem to have locked in on, with this PRWe seem to have decided that this would be appended to the Selector schema:
And that We're just quietly ignoring the fact that Okay. 🤷 This is probably fine. If it is duplicate feature, we're pushing a bit of silly work into future implementors, but... not very much. There's a lot going on right now, and this is not something I think anyone contributing in the area is willing to chase right now. |
allows selectors of the form: