Skip to content
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

Test time analyses csmith #243

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Test time analyses csmith #243

wants to merge 13 commits into from

Conversation

ailrst
Copy link
Contributor

@ailrst ailrst commented Sep 16, 2024

This profiles the default static analysis pipeline against a set of random C programs generated by csmith.

It outputs the results in CSV and gnuplot format to produce plots like:

large

usage:

cd examples/csmith && python3 gen.py && cd ../..
mill test.testOnly '*TimeStaticAnalysis'
gnuplot src/test/analysisTiming/plot.gp
xdg-open  src/test/analysisTiming/analysisres.svg

The generation script and tests all run singlethreaded so this takes quite a while to run unfortunately. Tests could possibly be multithreaded via Future.sequence but I don't know of a good way to avoid the JVM running out of memory by loading everything at once.

# produces programs that we can't handle
# cmd = ["csmith", "--seed", str(seed), "--max-block-size", str(max_blocksize), "--max-funcs", str(max_funcs), "--output", f"{fname}.c"]

csmith_safe = "--no-arrays --no-bitfields --no-checksum --no-comma-operators --no-longlong --no-int8 --no-uint8 --no-float --no-math64 --no-inline-function --no-safe-math --no-packed-struct --no-pointers --no-structs --no-unions --no-volatile-pointers --no-const-pointers".split(" ")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, what can't we handle about each of these things that have been disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just an incompleteness in steensgaard wrt MemoryLoads, this list is being overly conservative I'm not sure precisely what its disabling that makes it not generate that case, I'll dig up the example again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please share whatever case broke the Steensgaard, and maybe file an issue for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OUTS=$(addsuffix .out,$(SOURCENAMES))
CHECKSUMS=$(addsuffix .checksum,$(SOURCENAMES))

CSMITH_HEADER = "/nix/store/6rawnpny818v7wki6zlr3i0f3phmysyb-csmith-2.3.0/include/csmith-2.3.0/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is hardcoding this a good idea/going to be useful to anyone else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, It should be at least the normal install location /usr/include/csmith

@ailrst ailrst mentioned this pull request Oct 9, 2024
@ailrst ailrst force-pushed the test-time-analyses-csmith branch from c9e2f4e to a890ebb Compare December 10, 2024 04:21
@ailrst ailrst force-pushed the test-time-analyses-csmith branch from d2356dd to 0ea390c Compare December 10, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants