The BenchGen project aims to synthesize programs that are sufficiently expressive to stress-test computing systems, such as operating systems, compiler optimizations, memory allocation libraries and even computer architectures.
BenchGen implements an L-System to generate programs from a seed string and a set of production rules, enabling the creation of large programs through iterative expansion of the L-System. The program generator is entirely written in C++. To know more about how BenchGen works, you can read a brief report about it.
The BenchGen project is sponsored by FAPEMIG and by Google.
After cloning the repository, you can build the project by running the make command in the src/gen directory. Notice that CLANG++ is used as the default compiler.
git clone https://github.com/lac-dcc/BenchGen.git
cd src/gen
makeTo generate a program, you will need to create a file containing the production rules and a file containing the seed string to be used by the L-System.
You can find a set of examples in the directory src/gen. An example of production rules and seed string is:
Production Rule:
A = IF(A, new new new);Seed String:
new CALL(new LOOP(A) new new new) containsTo run BenchGen, you need to provide the following five parameters:
- Number of Iterations
- Production Rules (file containing the production rules)
- Seed String File (file containing the seed string)
- Program Name
- Variable Type. (
arrayorsortedlist)
An example of usage is:
./benchGen 1 productionRule.txt seedString.txt myProgram arrayAfter that, BenchGen will generate a program with the following structure:
myProgram/
├── Makefile
├── README.md
└── src
├── func0.c
├── func1.c
├── func2.c
├── func3.c
├── func4.c
├── rng.c
├── myProgram.c
└── myProgram.h
Generated programs have their own README. Here we have a simpler explanation.
Use the following command to compile a generated program:
makeAnd run a generated program with the following command:
./<program_name>Generated programs have their own README. Here we have a simpler explanation.
Use the following command to compile a generated program:
make llvmAnd run a generated program with the following command:
./<program_name>The Makefile will generate the programs in .ll format, which will be located in the ./ll directory.
Note: To confirm that the program is running correctly, simply check if it generates messages on stdout.
There are a main directories in the project, src:
src: code components of BenchGen can be found in the src folder, each documented in their own directories. \
Visit our documentation avaliable here
The BenchGen project is financed by FAPEMIG and Google. We appreciate their support and contributions to the development of this project.
To cite the BenchGen project, use the following BibTeX command below.
@misc{dasilva2025multilanguagebenchmarkgenerationlsystems,
title={Multi-Language Benchmark Generation via L-Systems},
author={Vinícius Francisco da Silva and Heitor Leite and Fernando Magno Quintão Pereira},
year={2025},
eprint={2512.17616},
archivePrefix={arXiv},
primaryClass={cs.PL},
url={https://arxiv.org/abs/2512.17616},
}