Getting Started
Requirements
- Linux.
- Python 3, standard library only. Nothing to install with
pip. - A llama.cpp server (v1.0.0 or later) hosting the model.
- The toolchains of the tested languages.
- SQLite 3.35 or later, through Python's built-in
sqlite3.
Install the toolchains
On Debian:
sudo apt update && sudo apt install -y default-jdk-headless dotnet10 gcc g++ mono-mcs php-cli
C and C++ answers are also built with AddressSanitizer and UndefinedBehaviorSanitizer. On Debian, gcc and g++ already bring them. If they are unavailable, the script says so at start-up and memory errors go undetected.
Get the script
The whole benchmark is one file, codebench.py:
git clone https://github.com/nerun/3L2Mark.git
cd 3L2Mark
Check your machine
The self-test needs no model. It compiles and runs the reference solution of every task, which must score 100%, and the original buggy or slow programs, which must score low. It takes about two minutes and must end with Self-test PASSED.
python3 codebench.py --selftest
C# can be built with .NET or with Mono. To test a specific one, add --csharp dotnet or --csharp mcs.
Code written by the model runs on your machine with your user's privileges. It gets a temporary directory and time and memory limits, but it is not sandboxed. Use a container or virtual machine if that is a concern.