Description
The goal of this issue is to ensure that the chalk engine's "inner loop" doesn't do an "unbounded" amount of work between invocations. The idea then is that the outer engine, the one that is driving chalk and asking for answers, is able to control how much work is done and to "give up" if it seems like things are taking too long. This is an alternative to #227, in that the "fuel" is pushed out from chalk to the surrounding context.
Actually, the design of the engine today is relatively close to this. For example, the result of asking for more answers (e.g., via ensure_root_answer
) always includes a QuantumExceeded
result, which basically means "didn't reach an answer yet, try again".
However, there are still a few bits of the engine that can do an "unbounded" amount of work. I'll elaborate on the changes needed to fix each of them in comments below:
- flounding (relatively easy)
- cycle handling (harder)