Skip to content

Commit 6e55af9

Browse files
author
Cocapn Fleet
committed
Add CONTRIBUTING.md + review doc
- Created CONTRIBUTING.md with repo-specific build/test/contribute guidance - (constraint-theory-core: existing CONTRIBUTING.md verified, review doc only) - Added review document explaining what was missing and why
1 parent 181fd5d commit 6e55af9

2 files changed

Lines changed: 156 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Contributing to MUD Arena
2+
3+
> *"The game plays itself. The agent coaches from the sidelines. The GPU runs the plays."*
4+
5+
## Quick Start
6+
7+
MUD Arena uses multiple build targets depending on your hardware:
8+
9+
### GPU Build (CUDA, recommended)
10+
```bash
11+
make gpu
12+
```
13+
14+
### CPU Build
15+
```bash
16+
make cpu
17+
```
18+
19+
### Zig Build (ARM64 / x86_64)
20+
```bash
21+
# x86_64 dev machine
22+
zig build -Doptimize=ReleaseSmall
23+
24+
# ARM64 (Jetson, Pi)
25+
zig build -Dtarget=aarch64-linux -Doptimize=ReleaseSmall
26+
27+
# WASM (browser)
28+
emcc -O3 -s WASM=1 src/wasm_mud.c
29+
```
30+
31+
### Run Evolution
32+
```bash
33+
python3 src/evolve.py --generations 100 --population 200 --scenarios 20
34+
```
35+
36+
### Docker
37+
```bash
38+
docker build -t mud-arena .
39+
docker run --gpus all mud-arena
40+
```
41+
42+
## Making Changes
43+
44+
1. **Read the Charter** — Start with `CHARTER.md` and `BOARDING-MANIFESTO.md` to understand the vision
45+
2. **Fork the repo**
46+
3. **Create a feature branch** (`git checkout -b feature/my-feature`)
47+
4. **Make your changes** — CUDA kernels go in `src/mud_arena.cu`, Zig in `src/mud_arena.zig`, Python scripts in `src/`
48+
5. **Test your changes** (see Testing section below)
49+
6. **Commit** (`git commit -m "feat: add my feature"`)
50+
7. **Push** (`git push origin feature/my-feature`)
51+
8. **Open a PR**
52+
53+
## Code Style
54+
55+
### CUDA
56+
- Follow standard CUDA best practices (coalesced memory access, bank conflict avoidance)
57+
- Thread = agent, block = room — maintain this abstraction
58+
- Use `__shared__` memory for room-level state
59+
- Document kernel launch parameters (grid, block dims)
60+
61+
### Zig
62+
- Run `zig fmt` before committing
63+
- Follow Zig standard naming conventions
64+
- Binary must be <100KB target size
65+
66+
### Python
67+
- Use `make lint` or `ruff check src/`
68+
- Type hints required for all public functions
69+
- Document in Google-style docstrings
70+
71+
## Testing
72+
73+
### CUDA Kernels
74+
- Tests are in `src/tests/` — run via `make test`
75+
- Verify correctness vs CPU reference implementation
76+
- Benchmark performance across hardware targets
77+
78+
### Python
79+
```bash
80+
# Run Python tests
81+
make test-py
82+
# or
83+
python3 -m pytest tests/
84+
```
85+
86+
### Evolution
87+
Test a short evolution run before committing:
88+
```bash
89+
python3 src/evolve.py --generations 10 --population 20 --scenarios 5
90+
```
91+
92+
## Boarding Manifesto
93+
94+
Before contributing architecture decisions, read `BOARDING-MANIFESTO.md`. It describes the vision:
95+
- MUD runs on any device (Pi, Jetson, ESP32)
96+
- Humans board via SSH, brief agents, then beam off
97+
- Agents execute autonomously with battery awareness
98+
- Comm resolution drops with distance — agents must work disconnected
99+
100+
This isn't just a codebase. It's a holodeck running at GPU speed.
101+
102+
## Hardware Targets
103+
104+
| Hardware | Threads | Scenarios/sec | Build Target |
105+
|----------|---------|--------------|-------------|
106+
| Jetson Orin Nano | 1,024 | ~10,000 | `zig build -Dtarget=aarch64-linux` |
107+
| RTX 4090 | 16,384 | ~100,000 | `make gpu` |
108+
| A100 | 69,120 | ~500,000 | `make gpu` |
109+
| Pi 5 (CPU) | 4 | ~100 | `zig build` or `make cpu` |
110+
111+
Contributions that optimize for specific hardware targets are welcome.
112+
113+
## Reporting Issues
114+
115+
Open an [Issue](https://github.com/SuperInstance/mud-arena/issues) with:
116+
- Hardware specs (GPU model, RAM, OS)
117+
- Build target being used
118+
- Reproduction steps
119+
120+
## Questions?
121+
122+
- Open a [Discussion](https://github.com/SuperInstance/mud-arena/discussions)
123+
- Read the [Charter](CHARTER.md)
124+
- Read the [Boarding Manifesto](BOARDING-MANIFESTO.md)
125+
- Check existing [Issues](https://github.com/SuperInstance/mud-arena/issues)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# CONTRIBUTING.md Added — MUD Arena
2+
3+
**Date:** 2026-05-17
4+
**Action:** Created `CONTRIBUTING.md`
5+
6+
## Why This Repo Needed It
7+
8+
MUD Arena is the gold-standard README in the SuperInstance org, but it had zero contribution guidance. Despite having an excellent README, BUILD.md, BOARDING-MANIFESTO.md, and CHARTER.md, there was no single place telling a new developer:
9+
10+
- How to set up a dev environment
11+
- What build targets are available (Zig, CUDA, CPU, WASM, Docker)
12+
- What coding standards to follow
13+
- How to write tests
14+
- How to propose changes
15+
16+
New contributors had to piece together guidance from multiple files. The CONTRIBUTING.md now serves as the single entry point for development workflow.
17+
18+
## What the Contribution Workflow Looks Like
19+
20+
1. Read `CHARTER.md` and `BOARDING-MANIFESTO.md` first (vision context)
21+
2. Fork and create a feature branch
22+
3. Build for target platform (`make gpu`, `zig build`, etc.)
23+
4. Write tests for CUDA kernels, Python scripts, or Zig code
24+
5. Run `make test` / `make test-py` / `zig test`
25+
6. Open PR with clear description of changes and hardware tested
26+
27+
## Special Notes
28+
29+
- **Boarding Manifesto**: This repo isn't just code — it's a holodeck vision. Contributors should read `BOARDING-MANIFESTO.md` before making architecture decisions. The MUD is designed to run on edge devices (Pi, Jetson, ESP32) with battery awareness and disconnected operation.
30+
- **Multiple Build Targets**: Unlike typical repos, MUD Arena has four build paths (CUDA GPU, CPU fallback, Zig native, WASM). The CONTRIBUTING.md documents all of them.
31+
- **Multi-Language**: Code lives in CUDA (`src/mud_arena.cu`), Zig (`src/mud_arena.zig`), C (`src/wasm_mud.c`), and Python (`src/evolve.py`). Each has its own conventions.

0 commit comments

Comments
 (0)