{"id":13601229,"url":"https://github.com/intel/yarpgen","last_synced_at":"2025-04-11T03:32:41.410Z","repository":{"id":11928019,"uuid":"70835797","full_name":"intel/yarpgen","owner":"intel","description":"Yet Another Random Program Generator","archived":false,"fork":false,"pushed_at":"2024-08-08T20:42:32.000Z","size":1920,"stargazers_count":486,"open_issues_count":19,"forks_count":53,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-11-07T04:39:47.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-13T18:25:16.000Z","updated_at":"2024-11-06T13:03:28.000Z","dependencies_parsed_at":"2023-11-16T02:31:11.637Z","dependency_job_id":"3b606739-1998-41e4-b26e-a7f7c5a5bf72","html_url":"https://github.com/intel/yarpgen","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fyarpgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fyarpgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fyarpgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intel%2Fyarpgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intel","download_url":"https://codeload.github.com/intel/yarpgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248335581,"owners_count":21086622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T18:00:58.935Z","updated_at":"2025-04-11T03:32:36.391Z","avatar_url":"https://github.com/intel.png","language":"C++","readme":"Yet Another Random Program Generator\n====================================\n\n[![TravisCI build status (Linux and Mac)](https://travis-ci.org/intel/yarpgen.svg?branch=main)](https://travis-ci.org/intel/yarpgen)\n[![Appveyor build status (Windows and Ubuntu)](https://ci.appveyor.com/api/projects/status/meuyl409mtd4cljb/branch/main?svg=true)](https://ci.appveyor.com/project/webmasterintel/yarpgen/branch/main)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/intel/yarpgen/blob/main/LICENSE.txt)\n\n``yarpgen`` is a random program generator, which produces correct runnable C/C++ and DPC++(this work is in an early stage) programs. The generator is specifically designed to trigger compiler optimization bugs and is intended for compiler testing.\n\nA generated random program is guaranteed to be statically and dynamically correct program. This implies no undefined behavior, but allows for implementation defined behavior.\n\nCurrently, there exist two versions of YARPGen: one is designed to test loops (it is under development and lives in the main branch), and the other one is designed to test scalar optimizations (it lives in [v1 branch](https://github.com/intel/yarpgen/tree/v1)).\nThe information about YARPGen and loop version can be found in [this talk](https://youtu.be/Yyj2Fex9yEo) and [this paper](papers/yarpgen-pldi-2023.pdf), published at PLDI23.\nMore information about scalar version can be found in [this talk](https://www.youtube.com/watch?v=mb9aRoXnicE) and [this paper](papers/yarpgen-ooplsa-2020.pdf), published at the OOPSLA 2020 and received an ACM SIGPLAN distinguished paper award.\n\nEach generated program consists of several files and after being compiled and run produces a decimal number, which is hash of all program global variable values. This number is supposed to be the same for all compilers and optimization levels. If the output differs for different compilers and/or optimization levels, you should have encountered a compiler bug.\n\nSeveral techniques are used to increase the probability of triggering compiler bugs:\n\n* all variable types, alignments and values / value ranges are known at the time of generation, which allows the accurate detection of undefined behavior and provides maximum variability of produced code.\n* the generation is random, but it is guided by a number of policies, which increase the likelihood of applying optimizations to the generated code.\n* in some cases a high level model of computations with known properties is generated first and then augmented with other random computations. This ensures that the code is \"meaningful\" and is more similar to code written by a human being.\n\nCompiler bugs found by YARP Generator\n-------------------------------------\n\n``yarpgen`` managed to find more than 260 bugs in [``gcc``](https://gcc.gnu.org/), [``clang``](https://clang.llvm.org/), [``ispc``](https://ispc.github.io/), [``dpc++``](https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-compiler.html), [``sde``](https://software.intel.com/content/www/us/en/develop/articles/intel-software-development-emulator.html), [`alive2`](https://github.com/AliveToolkit/alive2) and a comparable number of bugs in\nproprietary compilers. For the list of the bugs in ``gcc``, ``clang``, ``ispc``, and ``alive2`` see [bugs.rst](bugs.rst).\n\nIf you have used ``yarpgen`` to find bugs in open source compilers, please update bugs.rst. We are also excited to hear about your experience using it with proprietary compilers and other tools you might want to validate.\n\nBuilding and running\n--------------------\n\nBuilding ``yarpgen`` is trivial.  All you have to do is to use cmake:\n\n```sh\nmkdir build\ncd build\ncmake ..\nmake\n```\n\nTo run ``yarpgen`` we recommend using [``run_gen.py``](scripts/run_gen.py) script, which will run the generator for you\non a number of available compilers with a set of pre-defined options. Feel free to hack\n[``test_sets.txt``](scripts/test_sets.txt) to add or remove compiler options.\n\nThe script will run several compilers with several compiler options and run executables to compare the output results. If the results mismatch, the test program will be saved in \"testing/results\" folder for your analysis.\n\nAlso you may want to test compilers for future hardware, which is not available to you at the moment. The standard way to do that is to download the [Intel® Software Development Emulator](http://www.intel.com/software/sde). ``run_gen.py`` assumes that it is available in your ``$PATH``.\n\nISPC testing\n------------\n\nIf you want to test [ISPC](https://ispc.github.io/), make sure that it is present in your path, as well as\n[``ispc-proxy``](scripts/ispc-proxy) and [``ispc-disp``](scripts/ispc-disp). After that you can use\n[``run_gen.py``](scripts/run_gen.py)  with ``--std=ispc`` as usual.\n\nContacts\n--------\n\nTo contact authors, ask questions, or leave your feedback please use Github [issues](https://github.com/intel/yarpgen/issues) or reach out directly through contacts available in Github profiles.\n\nPeople\n------\n\n* Vsevolod Livinskii\n* Dmitry Babokin\n* John Regehr\n\nSpecial thanks to Martin Liška and Detlef Riekenberg who used YARPGen to find bugs in various compilers.\n","funding_links":[],"categories":["blog","C++"],"sub_categories":["编译器"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintel%2Fyarpgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintel%2Fyarpgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintel%2Fyarpgen/lists"}