-
Notifications
You must be signed in to change notification settings - Fork 11
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
Speculation -spec-type=coverage not working on one example. #364
Comments
I ran master-0df7858a09741d0e19809dcc1a19fffd1179e445 without spec avoid file but it not finished on my machine |
@sanghu: on |
@xuanlinhha To run master branch in speculation mode I have used this command: /home/sanghu/TracerX/tracerx/Release+Asserts/bin/klee --max-memory=32000 --max-time=600 -solver-backend=z3 --search=dfs -allow-external-sym-calls --watchdog -dump-states-on-halt=0 -write-BB-cov=4 -no-output -spec-dependency=/home/sanghu/Desktop/Speculation-fix -spec-strategy=custom -spec-type=coverage ${BENCHMARK}.bc Here, Please note that for 'spec_custom_dyn' we dont provide '-spec-dependency' command, in that case the current directory will be the place where Spec_Avoid files should be kept. |
Hi @sanghu1790 I tried to reproduce your result but for this branch
|
@xuanlinhha Can you please cross verify the command options: Secondly also cross verify the Spec_Avoid files placed at the current directory where your "c" program and make script are running. I believe the problem is just run issue. |
/home/xuanlinhha/TracerX/tracerx/Release+Asserts/bin/klee --max-memory=32000 --max-time=600 -solver-backend=z3 --search=dfs -allow-external-sym-calls --watchdog -dump-states-on-halt=0 -write-BB-cov=4 -no-output -speculation -output-dir=/home/xuanlinhha/TracerX/run-test/output/Mpals6-B2-cil /home/xuanlinhha/TracerX/run-test/output/Mpals6-B2-cil.bc |
Yes. This is correct command option. Can you run and check? The program should finished in approx 35 sec. |
no, it is timeouts on my machine, attached is the result: |
Can you check if Spec_Avoid files are stored here "/home/xuanlinhha/TracerX/run-test/output/" on your machine. |
This is yours @xuanlinhha This is mine results: It shows that your run doesn't read spec avoid files. |
I fixed the path into source code, and it prints: |
And I am working on this commit:
it can see all the files in the folder but just only have 1 BB |
@xuanlinhha First of all tell me this new run was faster? Did it finished in 35 sec. |
no @sanghu1790, it does not run faster at all, it was a timeout |
I just ran the same program ans it finished in 36 sec.
|
Hi @sanghu1790,
|
Hi @xuanlinhha Point B: 1 vs 3: The numbers in spec.txt are different because in 3 we count independenceYes/independenceNo and dynamicYes/dynamicNo in speculationFork. If we delete the increasing in speculationFork, the numbers will be the same. You can check again this Now @xuanlinhha , can you also try above without Spec_Avoid files? We need to check, why 1 and 3 took more than 600 sec and 2 finished in 36 sec (on machine). Is it the only difference of disabling "Independence Checks" in "speculationFork" or something else? If it is the case then why in master branch we dont follow disabling "Independence Checks" in "speculationFork"? |
@sanghu1790 When running without spec avoid files, 1-3 is corresponded to |
slow-running.zip When running without speculation avoid file, the independency check always returns |
@xuanlinhha Thanks linh.
But, I dont see any other stuff above which will take heavy time. |
Yes, this is
Yes, this is
Why it runs slow, this is I also don't know |
@xuanlinhha Can we try running with marking for this special case and let see what happens? Copy this below code and let us see what happens here.
|
it also gives a timeout @sanghu1790 |
Hi @xuanlinhha
|
@xuanlinhha I ran on
I think if we are able to get to know that why without specavoid files TIMID isn't working, then automatically the CUSTOM issue will also get fixed. But interesting fact is below:
Both 1 and 2 above tool huge time of 200 sec. It should be rapidly work. |
We don't need to commit with just a comment @sanghu1790 , I commented and tested on my local machine, but it is still slow |
@sanghu1790 the problem now is becoming like this: I remove The strange statistics is like this:
|
Hi @xuanlinhha , What I am thinking now is to put "dynamic check" inside "Independence check YES" to check the situation what will happen. What I can estimate here is that, if this is true then we need to make below: For coverage mode
Whats your opinion? |
May I also confirm here that the current implementation with spec-avoid files is working fine with the following setting? 1- With spec avoid files: Keep "Independence check", "dynamic check", and "New BB check". If so, I think I agree with @sanghu1790 for setting 2 when we don't have spec-avoid files. |
|
ok, for conclusion let's consider these two cases and confirm they are correct for coverage mode: 1- With complete set of spec avoid files: Keep "Independence check", "dynamic check" , and "New BB check". 2- Without any spec avoid files: Keep "dynamic check", and "New BB check" ( remove "Independence check" just like safety) |
Yes I agree with this. @xuanlinhha Whats your opinion? @rasoolmaghareh honestly I and linh didn't got the real answer why "independence check YES" is taking huge time. My proposal was based on the several attempts we made to see the best results, and we found this case. Do you have any idea about the above case where "independence check YES" is so expensive? |
=> In safety we don't have "New BB check" @sanghu1790: I think if users run with coverage but not provide spec avoid files, we can print an error message and ask them to run with safety |
Hi @xuanlinhha Regarding the printing message, I agree @xuanlinhha but we need to facilitate the users to use without specavoid files too. Hence we require point 2 for that. But we can give warning message. |
yes. |
But if like this:
Cannot resolve the program of @sanghu1790 |
I am referring your comment #364 (comment)
will run faster based on your sample run. But yeah before merging to master branch we should run couple of programs. But, overall my view would be to run coverage with mandatory spec avoid files. We will take final decision based on experiments. |
I have checked on my side, and no non-speculation states are deleted when backjump |
Can you please share the generated interpolants in both speculation tree and outside speculation tree here? |
The second file is big, so I zipped it: interpolant-out-spec-output.txt.zip You see the marked variables are global ones. |
I have checked these files and the better interpolants are due to the point that speculation is successful. So no errors in this part. May I ask if you @sanghu1790 @xuanlinhha see any issues in the speculations? If no issues I think the programs are fine. In order to recap, @sanghu1790 Can you please advice on the matrix what are the current issues that we have to look at? |
@sanghu1790 @xuanlinhha Can you please give an update here? |
Hi @rasoolmaghareh @xuanlinhha
======================================================================= Here, we may have two sub-options -spec-Independence=YES or NO B1- -spec-strategy=custom -spec-type=coverage -spec-Independence=YES NOTE: It should be complete set (after pre-processing). Supply of partial spec avoid files (either supply one file or (n-1) where n is the total spec avoid files) is not recommended it may hamper performance. B2- -spec-strategy=custom -spec-type=coverage -spec-Independence=NO =======================================================================
Please share your views on above, so that we can close this thread. Thanks, |
@sanghu1790 So do you want 1 more option |
Hi @xuanlinhha , Separately, |
|
For this option: -spec-Independence: For one option in speculationFork: There is no NEW BB check in this function, it only has independence and dynamic checkings. This option does not have any effects to branchFork? and what is the behavior do you want? |
What I mean is that in |
Ohh I see, NEW BB check doesn't belong to speculationFork. I am sorry for this. Yeah you are correct, we please ignore that part where I said on NEW BB check, and consider other checks. |
@sanghu1790 I want to apply the new option to Coverage mode only because currently I see in Safety mode we don't have any independence check at all and I want to keep this setting for Safety mode. Do you agree? |
I agree with the conversation. Let's apply these changes to coverage and close this issue. |
I have added one more option |
Thanks @xuanlinhha Now I will work on that. |
@sanghu1790 Can you please check this issue and in case the code is correct we close this issue. |
Hi @xuanlinhha , |
Hi @sanghu1790
If you provide |
@sanghu1790, I moved your message to a new issue. I think the two issues in
speculation
are different.Hi Rasool and Linh,
I experimented the program for the speculation slowness issue.
I ran "Mpals6-B2-cil.c" program which is big in size, but to see the difference
I found it suitable. Later we can reduce the size or take some other small program.
After my current investigation and recalling previous conversations, the issue of slowness
is due to running a program with and without providing "Spec_Avoid" files (these are dependent
files after prepossessing).
I ran the programs with and without Spec_Avoid file on following commits:
A. For the experiment with Spec_Avoid files on 1, 2, and 3, all finished in
35 sec approx. And also I see their stats are also same. But, some numbers
in spec.txt files of all these three results are little changed, that I think
we can check, why it had happened.
B. For the experiment without Spec_Avoid files on 1 and 3 above are very slow (THE PROBLEM WE ARE DEALING),
whereas for 2, it is very fast and finished in 34 sec approx, just like happened in A above.
Also, here the info stats and spec.txt files are very different.
From the above investigation, I have observed that "Removing Independence checks" and without Spec_Avoid files
works very faster as compared to others. My question is why providing dependency files or not so much matter
in performance? If we provide dependency files then the checking time should be more so it should be more expensive,
but if we dont provide any such files so still it should be faster. At least the master branch should be align with
spec_custom_dyn (most recent) branch. But, I remember this during the preparation of master branch we took the decision
to not to "Removing Independence checks" from speculation sub-tree. Now, we can discuss after looking into consequences.
Still, @linh, please check why our metrics stats of info and spec.txt files of these are different. Is there any mistake or
every thing is fine.
@rasool, Just to tell you, if you remember I encountored this issues because we were trying to run spec, with different number of
Spec_Avoid files (like all files, no files, only one file, deleting one file) etc. And our observation was different performance on different runs.
Then we discussed and agreed that, if we dont provide any files still it should work fine, but this is not the case now in master branch.
All, files and results are in zip folder, have a look.
Speculation-fix.zip
I ran with these commands:
Run master branch
/home/sanghu/TracerX/tracerx/Release+Asserts/bin/klee --max-memory=32000 --max-time=600 -solver-backend=z3 --search=dfs -allow-external-sym-calls --watchdog -dump-states-on-halt=0 -write-BB-cov=4 -no-output -spec-dependency=/home/sanghu/Desktop/Speculation-fix -spec-strategy=custom -spec-type=coverage ${BENCHMARK}.bc
Run spec_custom_dyn branch
/home/sanghu/TracerX/tracerx/Release+Asserts/bin/klee --max-memory=32000 --max-time=600 -solver-backend=z3 --search=dfs -allow-external-sym-calls --watchdog -dump-states-on-halt=0 -write-BB-cov=4 -no-output -speculation ${BENCHMARK}.bc
Thanks,
sanghu
The text was updated successfully, but these errors were encountered: