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

how to limit function size #166

Open
JuliusNmn opened this issue Jan 28, 2024 · 4 comments
Open

how to limit function size #166

JuliusNmn opened this issue Jan 28, 2024 · 4 comments

Comments

@JuliusNmn
Copy link

Is there a way to limit the size of generated functions? I want smaller functions with fewer local variables, but none of the flags are useful to me.

@eeide
Copy link
Member

eeide commented Jan 28, 2024

Have you experimented with --max-block-size?

(This is off the top of my head; it has been a while since I've really used Csmith a lot!)

@regehr
Copy link
Member

regehr commented Jan 28, 2024

I know that we have ways to reduce the size of functions, if it's not what Eric said you can play around with likely-looking options or perhaps Xuejun will chime in.

but also, it often works to just discard generated code that has properties that you don't like, unless it has those properties almost all of the time in which case this becomes slow

@JuliusNmn
Copy link
Author

I can't find a max-block-size setting unfortunately, but . I played around with some options and was able to reduce function sizes significantly. --max-block-depth was useful of course, and setting --partial-expand to 'assignment' made a notable difference.
Would it be possible to implement a "max-function-size" option in csmith? I figured that the algorithm doesn't work that way, but maybe it could be "steered" to generate fewer statements?

@regehr
Copy link
Member

regehr commented Jan 28, 2024

glad you made some progress on this.

the issue with Csmith hacking is we don't have any Csmith hackers right now, the PhD students who did this have graduated long ago and neither Eric nor I has any time for this project now

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

No branches or pull requests

3 participants