omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / bench / prime_race / README.md
| 1 | # AIEN Prime Drag Race: implementation side |
| 2 | |
| 3 | This folder holds the code every Prime Drag Race entry is built on. The Drag Race is a benchmark where |
| 4 | each entry sieves for prime numbers as many times as it can in a fixed time, and the runner checks every |
| 5 | answer before any speed is believed. |
| 6 | |
| 7 | What is here: |
| 8 | |
| 9 | - `prime_race_impl.om`: the pure seeded OM-2 shared protocol. It reads the command line, runs the |
| 10 | timed loop, writes the report file and the one-line result. (`prime_race_impl.h` and `prime_race_impl.c` |
| 11 | remain for the legacy GB10 C targets in `mk/prime_race_gb10.mk`.) |
| 12 | - `cpu_base.om` and `cpu_base_main.om`: the plain, conventional CPU sieve in pure seeded OM-2 (one thread, |
| 13 | one bit per odd number, built the way the upstream "base" rules describe). It is the yardstick the faster |
| 14 | entries are compared to. |
| 15 | - `tests/prime_race_host_test.om`: pure seeded OM-2 host test checking `cpu_base` against a slow, |
| 16 | independent trial-division oracle for every limit from 0 to 3000, the design limit list up to 2,000,000, |
| 17 | and known prime counts. |
| 18 | |
| 19 | ## Build and run |
| 20 | |
| 21 | From the repository root: |
| 22 | |
| 23 | make prime-race-cpu |
| 24 | ./bench/prime_race/build/cpu_base --limit 1000000 --min-seconds 5 |
| 25 | |
| 26 | make prime-race-host-test |
| 27 | |
| 28 | Options: `--limit N` (default 1000000, at most 2^40), `--min-seconds S` (default 5), `--bitmap-out PATH`, |
| 29 | `--report-out PATH`, `--audit-passes K`. Exit code 0 is success, 2 is an execution failure (no result |
| 30 | line is printed), 64 is a usage mistake. Audit mode runs K passes and saves each pass's answer so the |
| 31 | runner can prove every pass really recomputed; it prints no result line because it makes no timing claim. |
| 32 | |
| 33 | ## The result line and the labels |
| 34 | |
| 35 | On success the program prints one line in the upstream format: |
| 36 | |
| 37 | aien-<name>;<passes>;<elapsed seconds>;<threads>;algorithm=..,faithful=..,bits=.. |
| 38 | |
| 39 | The labels say honestly what the entry does. `cpu_base` is `algorithm=base`, `faithful=yes` (it builds a |
| 40 | fresh sieve each pass, like upstream), `bits=1`, one thread. |
| 41 | |
| 42 | The line is upstream compatible, but the entry is NONCONFORMING for upstream submission (different |
| 43 | license and not an upstream language), so results are kept as AIEN receipts, not submitted upstream. |
| 44 | |
| 45 | ## The answer format |
| 46 | |
| 47 | The canonical answer is the contract: bit k of the output is set exactly when 2k+1 is prime. The number 2 |
| 48 | is implied. Unused bits at the end are zero. A previous pass's result is never reused. |
| 49 | |
| 50 | The full contract will live in the aien-spark/benchmarks repository once it exists (link to be added). |