souffle icon indicating copy to clipboard operation
souffle copied to clipboard

Profiler: 'Rule ceased to exist' when querying 'usage'

Open langston-barrett opened this issue 3 years ago • 3 comments

If I profile this program:

.decl num1(x: number)
.decl num2(x: number)
.decl test(x: number, y: number)

num1(0).
num1(1).
num2(2).
num2(3).

test(x, x) :- num1(x).
test(x, x + 1) :- test(_, x), num2(x + 1).

.output test(IO=stdout)

And try to view the usage of the recursive rule, then I get a weird error message:

$ souffle --version
Souffle: 2.0.2-1248-g17bef0b5(32bit Domains)
$ souffle -p test.json test.dl
$ souffle-profile test.json
...
> rul 
  ----- Rule Table -----
   TOT_T  NREC_T   REC_T  TUPLES   TUP/s      ID RELATION

   .000s   .000s   .000s       2 36.3636    C3.1 test
> usage C3.1
Rule ceased to exist. Odd.

langston-barrett avatar Jul 13 '21 22:07 langston-barrett

It seems a problem with the reporting. The relation is too fast to record any usage. You may need to increase the runtime of that relation to see any usage data.

b-scholz avatar Jul 14 '21 08:07 b-scholz

I would suggest a different message, i.e., no usage data for a relation does not mean that the relation does not exist; it might be simply too fast so that utilisation/memory consumption cannot be captured.

b-scholz avatar Jul 14 '21 08:07 b-scholz

It seems a problem with the reporting. The relation is too fast to record any usage. You may need to increase the runtime of that relation to see any usage data.

Thanks for the suggestion. This is actually just a toy example I constructed because I was seeing the same error message for every single rule in a profile of my larger/more realistic program, so I think that the issue might not just be that this rule is particularly fast. I changed the program to the following:

.decl num(x: number)
.decl test(x: number, y: number)

num(0).

test(x, x) :- num(x).
test(x + 1, x + 1) :- test(x, _), x < 1000000.

.output test(IO=stdout)

And got the same output, even though this rule now takes 2.39s:

> rul 
  ----- Rule Table -----
   TOT_T  NREC_T   REC_T  TUPLES   TUP/s      ID RELATION

   2.39s   .000s   2.39s    100K 416.836    C2.1 test
   .000s   .000s   .000s       1 76.9231    N1.1 num
   .000s   .000s   .000s       1 166.667    N2.1 test

> usage C2.1 
Rule ceased to exist. Odd.

langston-barrett avatar Jul 14 '21 17:07 langston-barrett