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 / core / README.md

104 lines · 5825 bytes Raw Blame History Rendered
1# Core utilities in seeded Omega
2
3The default core algorithms are first-party `.om`. `CUDAPP_MIGRATION_PENDING_C_CORE`
4selects the handwritten C differential oracle, not a platform fallback. The cubin
5writer remains in CUDApp. Nothing is imported from another repository at build time.
6
7| Public implementation | Computation |
8| --- | --- |
9| `sha256.c` | `sha256.om` |
10| `omega_canonical.c` | `canonical.om`, `idparse.om` and their entry wrappers |
11| `omega_core.c` | `object.om`, `graph.om`, `payload.om`, `param.om`, `effect.om`, `eval.om` |
12| `omega_vector.c` | `vector.om`, `vecspec.om`, `vpay.om` |
13| `omega_gpu_fmt.c` | `fmt.om`, `fmtnum.om`, `fmtclip.om` |
14| `omega_gpu_hostmath.c` | `hostmath.om` |
15| `omega_cubin.c` | Existing `../cubin/cubin_elf.om`; `cubinmsg.om` renders layout refusals; `cubadmit.om` decides target and null-parameter admission |
16| `omega_ampere_codegen.c` | Existing `../encoder/ampere_enc_sm86.om`; `ampack.om` sign-extends and packs instruction fields |
17| `cudapp_freest_f16.c`, `cudapp_freest_revision.c`, `cudapp_freest_epoch.c` | Existing generated bindings, already sourced from Omega |
18
19The SHA implementation is a local, attributed copy of
20`aien-dev/omega-mv@acb3f15cdc691b1b046b48b0dad0f9255a12ba4b:om/sha256/sha256.om`.
21Its original Apache-2.0 attribution is preserved. The adapter also preserves the C
22context's post-padding count and repeated-finalization behavior. Official NIST
23byte-oriented CAVP short/long vectors and their provenance are in
24`tests/vectors/core/`.
25
26## ABI and memory ownership
27
28C retains allocation, release, bounded staging, pointer/span adaptation and C
29variadic argument extraction. Sorting, validation, serialization, hashing, checked
30arithmetic, vector operations, format parsing/rendering and floating-point
31polynomials are in Omega. Cubin target admission, the null-parameter check and the
32error-message decision tree are also Omega; Ampere field sign-extension and flag
33packing are in `ampack.om`.
34`tests/core_cubin_refusal_ref.inc` is an independent frozen C oracle, not a
35production implementation. No new runtime public API or version is introduced.
36
37Bootstrap object layouts have compile-time size/offset assertions. Short caller
38buffers are staged into the fixed-size views accepted by the pinned compiler.
39Canonical output retains partial writes on refusal. Overlapping vector inputs
40retain the C sequential aliasing behavior. The formatter keeps truncation and
41unsupported-token behavior. Host arithmetic is compared bit-for-bit against the C
42oracle compiled with `-ffp-contract=off`; each Omega operation is non-contracting.
43
44`native.sh` composes the same local sources into OM-2 native units, with 23 core
45exports plus separate existing cubin/Ampere units. Native aggregate registration
46and no-libc qualification belong to the integration lane. Composition is not
47native execution evidence. There is no `NO_POSIX` C fallback.
48
49## Native realization identity composition
50
51Compose `om/cache/digest.om`, `om/blackwell/identity.om` and
52`om/blackwell/id_native.om` after an `om2` prefix. The adapter exposes
53`bw_id_native` with the native public `long` result while retaining the
54canonical `bw_identity` integer result and policy. The digest and identity
55output parameters are named `dst`: `out` is reserved in OM-2. Their types,
56function names and byte behavior do not change.
57
58`tests/identity_native.om` emits the complete digest bytes for 4096 distinct
59machine-wire and 4096 distinct realization-wire inputs. It also checks the
60length refusal. Run its composition against both the pre-rename and renamed
61units and compare stdout. Native root registration in the production aggregate
62is separate from this compatibility prerequisite. These are host checks, not
63physical identity or GPU qualification.
64
65## Host gates
66
67Every test and compiler-driven mutant must run with device nodes hidden:
68
69```sh
70run_host() {
71 bwrap --dev-bind / / --dev /dev --proc /proc -- \
72 taskset -c 10-14 nice -n 10 "$@"
73}
74export OMEGA_OMC="$HOME/work/cudastack/omega-mv/seed/out/omc"
75export OMEGA_BRIDGE="$HOME/work/cudastack/omega-bridge"
76run_host sh om/units.sh
77run_host make -j3 test-core-util test-core-cubin-message test-core-mutants
78run_host make -j3 test-om-cubin test-ampere-cubin test-ampere-encoder test-ampere-plan
79run_host sh om/core/native.sh
80run_host sh om/core/native.sh --check
81run_host sh om/units.sh --check
82```
83
84`test-core-util` covers FIPS/CAVP SHA, 10,000 random one-shot and streaming
85comparisons, padding/context boundaries, canonical objects and all header pairs,
86parser quirks, effects/evaluation, vector overlap/refusal boundaries, formatter
87truncation, host math, constructors and all 65,536 binary16 encodings.
88`test-core-cubin-message` compares 10,000 diagnostic cases and output-capacity
89boundaries. Negative controls flip records. `test-core-mutants` recompiles six
90independent semantic SHA mutants, requires the baseline to pass and treats a
91compiler failure as a broken mutant rather than a kill.
92
93The existing cubin gate compares image bytes, status and diagnostics against the
94legacy writer and includes an image-bit negative control. `test-core-residue`
95checks target and null-parameter admission against the C `snprintf` format, packs
96one cubin per accepted target under `/tmp` and unlinks it, and compares Ampere
97field packing with the inline sign-extend formula. Its red check flips one image
98bit. `test-core-residue-mutants` recompiles eight semantic mutants. Ampere's plan
99target uses the warp simulator, not hardware. Missing-device failures are never
100grounds to rerun outside the namespace. Hardware authorization and qualification
101are separate; see the lane receipt and `CHIP.md`.
102
103Receipts: [core utilities](../../evidence/core-util/2026-11-06/README.md),
104[core residue](../../evidence/core-residue/2026-11-06/README.md).