For determinate patch, what would be a test case

For the latest patch to det/1. What would be a test case?

I tired to understand the code but being at the C level I don’t understand it all.

It is a bit complicated. The problem arises after putting a spy point on a det predicate and after this is trapped use nodebug to continue. That leaves a so called DEBUG choicepoint in the environment. DEBUG choicepoints are not real choicepoints but are created by the debugger to allow retrying a goal. The dummy choicepoint gives a place to backtrack to and prevents the goal arguments from being garbage collected.

Claiming this as a failure for det is IMO inappropriate. At least quite annoying as one gets regular claims on left over choicepoints during debugging where there is no problem during normal execution.

So, for a test you’d need to control the debugger using the tracer hook. The exact conditions under which the above happens is also not entirely clear. I merely noticed that DEBUG choicepoints were the cause of the error in one of the situations I managed to reproduce this. I’d leave it untested. After all, it is only the debugger that is affected and this isn’t likely to be an issue again.

1 Like

Thanks.

I still don’t understand all of that at the moment but working with prolog_trace_interception/4 there is enough meat on the bone for me to figure more of it out. :slightly_smiling_face: