Closed dalance closed 5 months ago
@dalance, I will have a look at it later today. Parol should in deed be deterministic. Maybe you found a bug. Infinite loops actually can only occur when the tokenizer can't make any progress in the input. Another scenario could be related to the recovery process that starts with the first error seen. If you have time you could have a look at the Q&A page of the parol book. There's a question https://jsinger67.github.io/QnA.html#q-i-get-strange-errors-while-commissioning-my-new-grammar-and-cant-figure-out-what-the-problem-is You can activate some traces to help pin down the problem.
I can reproduce this scenario.
If I enable trace logs I get a panic in main.rs: I'll try to circumvent this here locally.
The problem is related to the termination behavior of the recovery process. The reason for the non-deterministic behavior is not clear yet and I'll have to take a deeper investigation for this scenario. Thank you for reporting this issue, @dalance! I'll change the label to bug and try to provide a fix soon.
@dalance, in the meamwhile I have a fix. The reason for the unsettling non-deterministic behavior was due to my use of petgraph in recovery calculations. The graph data was obviously internally randomly sorted. Moreover there was a problem with the termination of recovery process which only occurred in certain scenarios. I will test this thoroughly and provide a new release for the parol_runtime crate at the weekend.
Fixed with commit 9e9a534
@dalance, please update to parol_runtime@0.24
and parol@0.31
Again, thanks for reporting and keep up your good work 👌
I found a strange issue which a broken source code causes infinite loop randomly. The reproduce way is below:
The expected behaviour is parse failure like below. Actually, infinite loop frequently occuers instead of it.
I thought the parsing by parol is deterministic. Is there any issue which causes the randomness?