summaryrefslogtreecommitdiff
path: root/readme.txt
blob: fa275a1f6c7150a00d2b061861b46b193a52c543 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
=== building ===

In order to compile this, you will need GNU Make, GCC, GNU LD, pkg-config, Open MPI, and gtkmm 4.

On Debian, you can install all of these with
  apt install make gcc binutils pkg-config openmpi-bin libgtkmm-4.0-dev

On macOS with Homebrew, you can install all of these with
  brew install make gcc binutils pkg-config open-mpi gtkmm4

Then, to build all of the software, just run make.

=== core war standard ===

lib94 attempts to follow the draft standard at <https://corewar.co.uk/standards/icws94.txt>, minus P-space. There are no read/write
limits (or if you prefer, they are the same as the core size). The minimum separation is always 0, and the core size is set at 8000.
To change the core size, change LIB94_CORE_SIZE in include/lib94/lib94.hpp, run make clean, and then run make. The maximum number of
processes is set at 16000. To change that, change LIB94_MAX_PROCESSES in include/lib94/lib94.hpp, run make clean, and then run make.

=== bench ===

The "bench" program (short for test bench) is intended for testing out warriors and seeing exactly what they do. It allows you to
single step, or run at a variety of rates. It has a large display which shows core reads/writes/executions as they happen, and a
listing of all of the instructions in the core. It also shows "alive" warriors, their instruction pointer for the next step, and
how many processes they have.

To open bench, just run bin/bench after building as above.

=== tabulator ===

The "tabulator" program runs every possible pairing of warriors from a selection against each other with every possible separation
and turn order, and then shows the number of wins of each warrior against each other warrior in a table format. The column header
is the winner, and the row header is the loser. This program uses MPI to run batches of these rounds in different processes, and
communicate the results back to a head process.

To run all of the included warriors against each other, run
  mpirun bin/tabulator-mpi warriors/*.red

Note that tabulator expects at least two processes (one head process and at least one worker). If you only have one core, you may run
  mpirun -np 2 --oversubscribe bin/tabulator-mpi warriors/*.red

=== evolver ===

The experimental "evolver" program attempts to create warriors who are good against a particular other
warrior via a process similar to genetic evolution. I may or may not attempt to improve it in the future.

The evolver takes an arbitrary number of input warriors as "seeds". To evolve a warrior against Dwarf, using
all of the included warriors as seeds, and storing the outputs from each round in a directory named output, run
  mpirun bin/evolver warriors/dwarf.red output warriors/*.red

As with tabulator, evolver requires at least two processes, and you will have to oversubscribe if you only have one core.