-
Notifications
You must be signed in to change notification settings - Fork 1
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
Re-asking a locked-pointer question causes endless loop #15
Comments
A variation:
So we have to forbid sub-questions that consist of a pointer that points to hypertext containing a pointer to the context's question? There might be scenarios when this is needed, but I don't have time to think up an example now. |
Note that if
In general, it doesn't make sense to ask a question like Therefore, we should forbid sub-questions of the form |
It also leads to failure in this case:
I think this arises because the locked root question and the locked sub-question look the same to the memoizer. |
The infinite loop in the initial issue is a bug, but the later |
So you're against forbidding things like sub-questions of the form […]? In a case that detectably doesn't make sense, I would not let the system run until it's out of budget. It would introduce mysterious load spikes, make generative tests slow or less useful, and generally screw up client code that probes the boundaries of what Patchwork accepts. |
It's not so much that I'm against it, but that I want general solutions instead of patching specific cases. Both the current cycle detection scheme and budgets are general, and you're right that in the long run, we want something even better, so that we don't have to rely on letting the system run until it's out of budget. If you have ideas for other general solutions, I'm definitely interested. |
I see. And I just realized that patching specific cases won't cut it anyway, because they keep turning up, seemingly every time I think that I can finish the PR for the Hypothesis tests:
I'm not sure if this counts as a general solution, but for debugging I modified
So far all endless loops have occurred in that place, so this modification catches all of them. However, I feel that this is not as close to the root of the problem as I can get. I have to clarify my understanding of the memoizer and the datastore. |
In case you're curious about the Hypothesis test: https://github.com/rmoehn/patchwork/blob/test-hypothesis-2/tests/test_randomly.py |
Take the last failure case. We have this context, call it c1:
And the user takes action
Looks the same as the previous one, right? That's what the memoizer thinks, too, so it returns Why doesn't |
We assume that H takes the same action B whenever she sees a context A. The purpose of the memoizer is to save H's work by learning H's context-to-action mapping. Since the only information H gets about a context is its string representation, the memoizer must work with only the string representation as well. What I don't understand is why |
There are valid cases where a context looks the same (when stringified) as one of its ancestors, but differs based on the values behind pointers (which depend on the workspace link). For example, consider the following context:
In the process of applying the function to one of the values in |
Ah, makes sense. Sometimes I need to be shown the forest again. Here is Ben's answer, which is similar:
|
I guess there is no general way of detecting cycles, then. (On Patchwork With an Application to the Entscheidungsproblem?) For one, the user might ask for infinite data:
Of course, this is not a sensible way to use the system, but there might be less obvious infinite-data-generating loops than this one. As one can see from Andreas' and Ben's answers, the system has to permit a cycle of stringified context → action → … → same stringified context → same action (scasca), because this cycle might be using up data that the contexts are pointing to. When all data is used up, the cycle terminates. From this we can derive a necessary condition for a finite scasca cycle: It contains an Unlock. If it doesn't contain an unlock, it doesn't use data to decide whether or not to terminate and therefore never decides to terminate. Are there other necessary conditions? We could use them to improve the cycle detector. I'm not sure if these statements are true. I'm tempted to prove them instead of waving my hands, but probably there are more important things to do. |
Don't try to understand the title. Look at this scenario instead:
The same happens with sub-questions of sub-questions.
The endless loop occurs in
Context.is_own_ancestor
:Apparently the context has become its own ancestor, so
context.parent
never isNone
.Of course it doesn't make sense to re-ask a context's question, so patchwork should detect this kind of scenario and raise an error. More concretely: Raise an error if the argument to
AskSubquestion
is a pointer to the current context's question.This is related to issue #12.
The text was updated successfully, but these errors were encountered: