interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / om / standalone-oracles / README.md

97 lines · 5661 bytes Raw Blame History Rendered
1# Standalone checker computation
2
3`oracles.om` owns the reference arithmetic and verdict predicates shared by the
4standalone CUDA fixture, interop probe, attention dispatcher, prefill cache and
5scoped checks, and exact-head checks. `om/units.sh` generates the committed
6`src/cudapp_om_standalone_oracles.c` and its identity record. The generated entry
7is `omega_so_oracles`; `oracle.h` makes a strong reference and aborts if the
8checked bridge reports a trap. There is no weak-symbol or runtime C fallback.
9
10`CUDAPP_MIGRATION_PENDING_C_STANDALONE_ORACLES` defaults to zero. Setting it to
11one selects the independent C snapshot in `oracle.h`, solely for migration
12comparison. `oracle-c.c` exposes that snapshot to the differential checker.
13The test builds compare the original target sources from the specified base,
14the default Omega path, and this C snapshot separately.
15
16## Private operation interface
17
18The entry takes five `ulong` arguments: operation, a, b, c, d. Float values
19cross the interface as their IEEE bit encodings. Unused arguments are zero.
20This is a private checker interface, not a public CUDA++ API.
21
22| Operation | Result |
23|---|---|
24| 0, 1, 2 | vadd a input, b input, and uint32 sum with C-compatible wrapping |
25| 3, 4 | integer equality and three-way nonzero conjunction |
26| 5, 6, 7 | ulong sum, `(a+c)*b` extent, and 256-thread grid rounding |
27| 8, 9, 10 | low/high pointer assembly, mirror extent, expected copy time |
28| 11, 12, 13, 14 | cache fixture tile, mutation index, expected allocation count, paired equality |
29| 15, 16, 17 | reading tile/group boundary and exact-head admission reserve |
30| 18, 19 | exactly representable f32 inputs for the BF16 matmul fixture |
31| 20, 21 | f64 absolute difference between f32 values and strict `> 0.0001` test |
32| 22, 23 | wrapped RNG transition and its f32 sample |
33| 24, 25 | finite f32 predicate and absolute-weight maximum |
34| 26, 27 | interval and dense/sparse/alternating normalizer fixture values |
35| 28 | increment the failure count if its predicate is zero |
36| 29, 30 | f32 greater-or-equal and ordered maximum, preserving operand order |
37| 31, 32 | interval fixture exponents |
38| 33, 34, 35, 36 | unsigned greater/less/subtract and matching success/failure classes |
39| 37, 38 | f32 greater-than and ordered f64 maximum |
40| 39, 40 | adversarial weight sign and negative normalizer exponent |
41| 41 | select b when a is zero, otherwise c |
42| 42 | exact BF16 fixture bit narrowing; not a general quantizer |
43| 43 | one separately rounded f32 BF16 product and accumulator addition |
44| 44 | three-way nonzero disjunction |
45
46Explicit masks precede Omega's checked numeric narrowing where the original C
47operation truncates to uint32. Negative exponents cross the ulong ABI as
48modular two's-complement encodings. Float arithmetic and C comparison builds
49use `-ffp-contract=off`; there is no contracted multiply-add substitution.
50
51## Independent higher-precision reference
52
53binary128 oracle stays C: seeded Omega has no binary128 type; proposal = f128 soft type or u64-pair arithmetic in om/numeric
54
55The existing long-double interval reference, slack calculations, square/sum,
56square root, and their higher-precision comparisons remain independent C
57oracles. Their Boolean combinations, finite f32 checks, maxima on f32 results,
58shape/budget calculations and failure aggregation use Omega. The Spark compiler
59reports `__LDBL_MANT_DIG__ = 113`; no reference is silently reduced to f64.
60Existing `ldexpf`, `nextafterl` and `sqrtl` calls remain recorded libm sites.
61
62## Focused host checks
63
64Every test, simulation and mutant must run with devices hidden:
65
66```sh
67export OMEGA_OMC="$HOME/work/cudastack/omega-mv/seed/out/omc"
68export OMEGA_BRIDGE="$HOME/work/cudastack/omega-bridge"
69bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make test-standalone-oracles
70bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make test-standalone-oracles-family
71bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make test-standalone-oracles-mutants
72```
73
74The family target needs the CUDA 13 header but not a CUDA library or device.
75`host-cuda.c` is a verification-only CPU transport linked instead of libcuda;
76it runs the two CUDA-calling sources without loading a driver. It is not a
77replacement CUDA library or an implementation fallback. `host-norm.c` supplies
78CPU memory and executes the real emitted normalizer IR with the existing warp
79simulator. The `--chip` argument in this host-only variant does not make its
80result chip qualification. The real `make cubin-probe` remains outside host
81acceptance targets and still requires its existing operator window.
82
83`family-check.py --base REV ...` extracts only the eight original checker
84sources from REV and compares their output with the migrated versions against
85the same unchanged host dependencies. Without `--base`, it compares the C
86snapshot with Omega. It rejects a corrupted transport result or Omega predicate
87for every check, and also requires a missing-unit link to fail.
88
89`scalar-check.c` crosses source-derived boundaries at v-1/v/v+1 and integer
90endpoints, including uint32 truncation, tile/row thresholds, sparse tail, and
91both IEEE float classes. NaNs compare by class, not payload. Tolerance bit
92neighbors come from the Wolfram query recorded in the evidence README.
93`mutants.py` compiles each changed `.om` source through the pinned bridge and
94requires a behavioral mismatch; compile failures do not count as killed mutants.
95
96See `evidence/standalone-oracles-20261106/README.md` for exact runs, outputs,
97fixture v2 identities, limitations and the NOT_RUN chip runbook.