interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / docs / zig-cc-lane.md

71 lines · 3555 bytes Raw Blame History Rendered
1# Zig cc cross-check lane
2
3Workflow: `.github/workflows/zig-cc.yml` ("Zig cc cross-check"). It runs on every
4pull request and on pushes to `main`, on the same `ubuntu-24.04-arm` hosted runner
5as `pr-smoke.yml`.
6
7## What it is
8
9Omega is built with gcc everywhere else. This lane builds the same sources with
10`zig cc` from a pinned Zig 0.17.0 (clang 22) and asks one question: does an
11independent compiler agree with gcc about what the code means? It is a
12cross-check, not a second source of truth. The gcc lanes (`pr-smoke.yml` and the
13host-suites workflows) stay authoritative, and this is not a migration to Zig.
14
15The Zig tarball is downloaded from ziglang.org and checked against a pinned
16SHA-256 before it is unpacked. The version and digest live in the workflow file;
17changing the version means changing both together.
18
19## What it checks
20
211. `omegatool` and the compiler tests build under clang with the Makefile's own
22 flags (`-Wall -Wextra -Werror`). A warning that clang reports and gcc does not
23 fails the lane.
242. `make test` passes with the same assertions as `pr-smoke.yml`: every
25 `TOTAL GATES` line shows zero failures.
263. `make test-language` (Omega language V0 golden, 407 cases) passes.
274. `make test-compiler-quick` (OSC compiler smoke) passes.
285. Gate and demonstration output from the zig-built `omegatool` is compared with a
29 gcc-built `omegatool` from the same commit, for 18 suites: `--run-gates`,
30 `--run-m6-gates` to `--run-m14-gates`, and the arithmetic, physics, self-host,
31 verify, program, synthesis, library and discovery demonstrations. The output
32 must be byte-identical, so every gate total and every printed 64-hex identity
33 matches.
34
35## What it does not check
36
37- Any GPU or chip suite. Nothing here touches `/dev/nvidia*`, the GB10, or the
38 M15 and later gate sets. Chip qualification stays on the Spark.
39- The QEMU-backed pieces: `--run-m5-gates` and `--reference-demonstrate-realization`.
40 No omega workflow installs QEMU, so they are left out of the hosted comparison.
41 They were run by hand against both compilers on the Spark (QEMU present) when
42 this lane was added, with identical output.
43- Makefile targets that hard-code `gcc` instead of `$(CC)` (the numeric CPU,
44 reduce and transcendental checks). They do not exercise Zig.
45- AddressSanitizer. `zig cc` accepts `-fsanitize=address` but does not instrument
46 the code with it, so the `_asan` test binaries in `test-compiler-quick` run as
47 plain builds. UBSan is applied (through Zig's own runtime). The gcc lanes remain
48 the ASan evidence.
49- Byte-for-byte reproducible binaries. Two clean zig builds of the same commit
50 gave different `omegatool` bytes (the gcc builds were identical), so the lane
51 compares program behaviour, not binary hashes.
52
53## Resolved item
54
55clang 22 reported `-Wunterminated-string-initialization` for
56`src/omega_blackwell_encoder.c` (`static const char HEXDIGITS[16] =
57"0123456789abcdef";` left no room for the terminating NUL; gcc 13 does not
58warn). The array is now declared `HEXDIGITS[]` (17 bytes, omega#432), and the
59lane no longer passes `-Wno-error=unterminated-string-initialization`: every
60warning is an error, as in the gcc lanes.
61
62## Running it by hand
63
64From a checkout with the pinned Physics at `PHYSICS_DIR`:
65
66 ZIG=/path/to/zig-aarch64-linux-0.17.0/zig
67 make CC="$ZIG cc" PHYSICS_DIR=../physics test
68
69Use a separate `OUT_DIR` per compiler if you want both builds side by side. The M5
70QEMU gate writes to a fixed `build/` directory, so create `build/` first when
71`OUT_DIR` is something else.