{"id":25705402,"url":"https://github.com/mmore500/signalgp-lite","last_synced_at":"2025-04-30T10:13:12.080Z","repository":{"id":40720854,"uuid":"301607601","full_name":"mmore500/signalgp-lite","owner":"mmore500","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-14T13:24:26.000Z","size":28152,"stargazers_count":3,"open_issues_count":7,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T10:13:05.750Z","etag":null,"topics":["artificial-life","digital-evolution","genetic-programming"],"latest_commit_sha":null,"homepage":"https://osf.io/j8pge/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmore500.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-06T03:51:23.000Z","updated_at":"2025-03-14T13:24:27.000Z","dependencies_parsed_at":"2025-04-11T20:38:18.793Z","dependency_job_id":null,"html_url":"https://github.com/mmore500/signalgp-lite","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/mmore500%2Fsignalgp-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmore500%2Fsignalgp-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmore500%2Fsignalgp-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmore500%2Fsignalgp-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmore500","download_url":"https://codeload.github.com/mmore500/signalgp-lite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251683356,"owners_count":21626953,"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":["artificial-life","digital-evolution","genetic-programming"],"created_at":"2025-02-25T06:47:38.236Z","updated_at":"2025-04-30T10:13:12.052Z","avatar_url":"https://github.com/mmore500.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# signalgp-lite\n\n[![version](https://img.shields.io/endpoint?url=https%3A%2F%2Fmmore500.github.io%2Fsignalgp-lite%2Fversion-badge.json)](https://github.com/mmore500/signalgp-lite/releases)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d4ec421f786a4d00bd850bf0d1719d5d)](https://www.codacy.com/gh/mmore500/signalgp-lite/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=mmore500/signalgp-lite\u0026amp;utm_campaign=Badge_Grade)\n[![continuous integration](https://github.com/mmore500/signalgp-lite/workflows/CI/badge.svg)](https://github.com/mmore500/signalgp-lite/actions?query=workflow%3ACI)\n[![Documentation Status](https://readthedocs.org/projects/signalgp-lite/badge/?version=latest)](https://signalgp-lite.readthedocs.io/en/latest/?badge=latest)\n[![documentation coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fmmore500.github.io%2Fsignalgp-lite%2Fdocumentation-coverage-badge.json)](https://signalgp-lite.readthedocs.io/en/latest/)\n[![code coverage status](https://codecov.io/gh/mmore500/signalgp-lite/branch/master/graph/badge.svg)](https://codecov.io/gh/mmore500/signalgp-lite)\n[![dotos](https://img.shields.io/endpoint?url=https%3A%2F%2Fmmore500.com%2Fsignalgp-lite%2Fdoto-badge.json)](https://github.com/mmore500/signalgp-lite/search?q=todo+OR+fixme\u0026type=)\n[![GitHub stars](https://img.shields.io/github/stars/mmore500/signalgp-lite.svg?style=flat-square\u0026logo=github\u0026label=Stars\u0026logoColor=white)](https://github.com/mmore500/signalgp-lite)\n\n\u003c!-- Check out the live in-browser web app at \u003chttps://mmore500.github.io/signalgp-lite\u003e. --\u003e\n\n-   Free software: MIT license\n-   Documentation: \u003chttps://signalgp-lite.readthedocs.io\u003e\n-   header-only, namespace-encapsulated software\n\nA genetic programming implementation designed for large-scale artificial life applications.\nOrganized as a header-only C++ library.\nInspired by [Alex Lalejini](http://lalejini.com/)'s [SignalGP](https://github.com/amlalejini/signalgp).\n\n## Quick Start\n\nThis \"hello world\" example throws together\n* a custom hardware peripheral to manage greeting information,\n* a custom operation to print a greeting, and\n* generation of a random program,\n* execution of that random program on a virtual multi-core CPU.\n\n`say-hello.cpp`:\n```cpp\n#include \u003ciostream\u003e\n#include \u003cratio\u003e\n#include \u003cstring\u003e\n\n#include \"Empirical/include/emp/math/Random.hpp\"\n\n#include \"sgpl/algorithm/execute_cpu.hpp\"\n#include \"sgpl/spec/Spec.hpp\"\n#include \"sgpl/hardware/Cpu.hpp\"\n#include \"sgpl/library/OpLibraryCoupler.hpp\"\n#include \"sgpl/library/prefab/ControlFlowOpLibrary.hpp\"\n#include \"sgpl/program/Program.hpp\"\n\nemp::Random rng;\n\n// custom hardware peripheral, can be written to or read from during execution\nstruct Peripheral {\n  size_t greet_count{};\n  std::string name;\n};\n\n// custom CPU operation\nstruct SayHello {\n\n  template\u003ctypename Spec\u003e\n  static void run(\n    sgpl::Core\u003cSpec\u003e\u0026,\n    const sgpl::Instruction\u003cSpec\u003e\u0026,\n    const sgpl::Program\u003cSpec\u003e\u0026,\n    typename Spec::peripheral_t\u0026 peripheral\n  ) {\n    std::cout \u003c\u003c \"for the \" \u003c\u003c peripheral.greet_count++ \u003c\u003c \"th time... \";\n    std::cout \u003c\u003c \"hello there \" \u003c\u003c peripheral.name \u003c\u003c '\\n';\n  }\n\n  static std::string name() { return \"SayHello\"; }\n\n  static size_t prevalence() { return 1; }\n\n};\n\n// extends prefab ControlFlowOpLibrary with SayHello operation\nusing library_t = sgpl::OpLibraryCoupler\u003csgpl::ControlFlowOpLibrary, SayHello\u003e;\n\n// custom compile-time configurator type\nusing spec_t = sgpl::Spec\u003clibrary_t, Peripheral\u003e;\n\nint main() {\n\n  sgpl::Cpu\u003cspec_t\u003e cpu;\n  Peripheral peripheral;\n  peripheral.name = \"Grace Hopper\";\n\n  sgpl::Program\u003cspec_t\u003e program{ 100 }; // randomly generated, 100 instructions\n\n  cpu.InitializeAnchors( program ); // load program onto CPU\n\n  // generate random signals to launch available virtual cores\n  while ( cpu.TryLaunchCore( emp::BitSet\u003c64\u003e(rng) ) ) ;\n\n  // execute up to one thousand instructions\n  sgpl::execute_cpu\u003cspec_t\u003e( std::kilo::num, cpu, program, peripheral );\n\n}\n```\n\ncompile:\n```bash\ng++ --std=c++17 -Iinclude/ -Ithird-party/ say-hello.cpp -o say-hello.out\n```\n\nrun:\n```bash\n./say-hello.out\n```\n\n## Benchmarks\n\nsignalgp-lite provides several-times speedup over the current \"vanilla\" SignalGP implementation.\n\n[![lite speedup, compared to vanilla](docs/assets/measurement=wall-speedup+ext=.png)](https://osf.io/2pdur/)\n*[Speedup](https://en.wikipedia.org/wiki/Speedup) of mean instruction execution time provided by signalgp-lite compared to vanilla SignalGP.\nSpeedup is measured for random programs generated from different subsets of instructions (\"libraries\") over different-size populations of virtual CPUs (\"num agents\").*\n\nFor randomly-generated programs composed of arbitrary instructions, signalgp-lite approaches a virtual instruction execution rate of around 10Mhz on a 3.5Ghz processor.\nVirtual nop instructions execute at rate of around 200Mhz.\n\n[![raw timings of lite and vanilla](docs/assets/fliers=True+measurement=wall-nanoseconds+ext=.png)](https://osf.io/6te73/)\n*[Wall clock](https://en.wikipedia.org/wiki/Elapsed_real_time) timings of twenty randomly-generated programs composed of instructions from different libraries.*\n\nTimings for `nop` and `arithmetic` libraries report the mean time to execute sixteen instructions on one core.\nTimings for `complete` and `sans_regulation` libraries report timings for executing sixteen instructions, one each across sixteen virtual threads.\n(`sans_regulation` refers to the `complete` library with tag-matching regulation disabled.)\n\nThese results are associated with [commit c10ed70](https://github.com/mmore500/signalgp-lite/commit/c10ed70), measured at 1602292830 seconds since epoch.\nDetails on the machine used to perform these benchmarks are available via [Open Science Framework](https://osf.io/), e.g., \u003chttps://osf.io/hu8m2/\u003e.\n[mimalloc](https://github.com/microsoft/mimalloc) memory allocator.\n\nMicrobenchmarks are performed, graphed, and uploaded as part of the project's CI build, so check the [project's OSF page](https://osf.io/j8pge/) for up-to-the-minute profiling information!\n\n## Citing\n\nIf signalgp-lite contributes to a scientific publication, please cite it as\n\n\u003e Moreno, M. A., Rodriguez Papa, S., \u0026 Ofria, C. (2021). SignalGP-Lite: Event Driven Genetic Programming Library for Large-Scale Artificial Life Applications. arXiv preprint arXiv:2108.00382.\n\n```bibtex\n@misc{moreno2021signalgp,\n  doi = {10.48550/ARXIV.2108.00382},\n  url = {https://arxiv.org/abs/2108.00382},\n  author = {Moreno, Matthew Andres and Rodriguez Papa, Santiago and Lalejini, Alexander and Ofria, Charles},\n  keywords = {Neural and Evolutionary Computing (cs.NE), FOS: Computer and information sciences, FOS: Computer and information sciences},\n  title = {SignalGP-Lite: Event Driven Genetic Programming Library for Large-Scale Artificial Life Applications},\n  publisher = {arXiv},\n  year = {2021},\n  copyright = {arXiv.org perpetual, non-exclusive license}\n}\n```\n\nConsider also citing [Empirical](https://github.com/devosoft/Empirical).\nAnd don't forget to leave a [star on GitHub](https://github.com/mmore500/signalgp-lite/stargazers)!\n\n## Credits\n\nThis library draws heavily on Alex Lalejini's work with SignalGP.\n\nThis package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [devosoft/cookiecutter-empirical-project](https://github.com/devosoft/cookiecutter-empirical-project) project template.\n\nThis package uses [Empirical](https://github.com/devosoft/Empirical#readme), a library of tools for scientific software development, with emphasis on also being able to build web interfaces using [Emscripten](https://emscripten.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmore500%2Fsignalgp-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmore500%2Fsignalgp-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmore500%2Fsignalgp-lite/lists"}