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
CUDApp / om / standalone-oracles / README.md
| 1 | # Standalone checker computation |
| 2 | |
| 3 | `oracles.om` owns the reference arithmetic and verdict predicates shared by the |
| 4 | standalone CUDA fixture, interop probe, attention dispatcher, prefill cache and |
| 5 | scoped 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 |
| 7 | is `omega_so_oracles`; `oracle.h` makes a strong reference and aborts if the |
| 8 | checked 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 |
| 11 | one selects the independent C snapshot in `oracle.h`, solely for migration |
| 12 | comparison. `oracle-c.c` exposes that snapshot to the differential checker. |
| 13 | The test builds compare the original target sources from the specified base, |
| 14 | the default Omega path, and this C snapshot separately. |
| 15 | |
| 16 | ## Private operation interface |
| 17 | |
| 18 | The entry takes five `ulong` arguments: operation, a, b, c, d. Float values |
| 19 | cross the interface as their IEEE bit encodings. Unused arguments are zero. |
| 20 | This 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 | |
| 46 | Explicit masks precede Omega's checked numeric narrowing where the original C |
| 47 | operation truncates to uint32. Negative exponents cross the ulong ABI as |
| 48 | modular two's-complement encodings. Float arithmetic and C comparison builds |
| 49 | use `-ffp-contract=off`; there is no contracted multiply-add substitution. |
| 50 | |
| 51 | ## Independent higher-precision reference |
| 52 | |
| 53 | binary128 oracle stays C: seeded Omega has no binary128 type; proposal = f128 soft type or u64-pair arithmetic in om/numeric |
| 54 | |
| 55 | The existing long-double interval reference, slack calculations, square/sum, |
| 56 | square root, and their higher-precision comparisons remain independent C |
| 57 | oracles. Their Boolean combinations, finite f32 checks, maxima on f32 results, |
| 58 | shape/budget calculations and failure aggregation use Omega. The Spark compiler |
| 59 | reports `__LDBL_MANT_DIG__ = 113`; no reference is silently reduced to f64. |
| 60 | Existing `ldexpf`, `nextafterl` and `sqrtl` calls remain recorded libm sites. |
| 61 | |
| 62 | ## Focused host checks |
| 63 | |
| 64 | Every test, simulation and mutant must run with devices hidden: |
| 65 | |
| 66 | ```sh |
| 67 | export OMEGA_OMC="$HOME/work/cudastack/omega-mv/seed/out/omc" |
| 68 | export OMEGA_BRIDGE="$HOME/work/cudastack/omega-bridge" |
| 69 | bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make test-standalone-oracles |
| 70 | bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make test-standalone-oracles-family |
| 71 | bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make test-standalone-oracles-mutants |
| 72 | ``` |
| 73 | |
| 74 | The 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; |
| 76 | it runs the two CUDA-calling sources without loading a driver. It is not a |
| 77 | replacement CUDA library or an implementation fallback. `host-norm.c` supplies |
| 78 | CPU memory and executes the real emitted normalizer IR with the existing warp |
| 79 | simulator. The `--chip` argument in this host-only variant does not make its |
| 80 | result chip qualification. The real `make cubin-probe` remains outside host |
| 81 | acceptance targets and still requires its existing operator window. |
| 82 | |
| 83 | `family-check.py --base REV ...` extracts only the eight original checker |
| 84 | sources from REV and compares their output with the migrated versions against |
| 85 | the same unchanged host dependencies. Without `--base`, it compares the C |
| 86 | snapshot with Omega. It rejects a corrupted transport result or Omega predicate |
| 87 | for 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 |
| 90 | endpoints, including uint32 truncation, tile/row thresholds, sparse tail, and |
| 91 | both IEEE float classes. NaNs compare by class, not payload. Tolerance bit |
| 92 | neighbors come from the Wolfram query recorded in the evidence README. |
| 93 | `mutants.py` compiles each changed `.om` source through the pinned bridge and |
| 94 | requires a behavioral mismatch; compile failures do not count as killed mutants. |
| 95 | |
| 96 | See `evidence/standalone-oracles-20261106/README.md` for exact runs, outputs, |
| 97 | fixture v2 identities, limitations and the NOT_RUN chip runbook. |