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 / evidence / bw-matmul-realize-om / 2026-11-06 / repeat-om_bw_realize_oracle.c.gcov

93 lines · 4639 bytes Raw Blame History
1 -: 0:Source:/home/drakestapleton/work/cudastack/lanes/BwMatmulRealize/tests/om_bw_realize_oracle.c
2 -: 1:#if defined(CUDAPP_MIGRATION_PENDING_BW_MATMUL) && CUDAPP_MIGRATION_PENDING_BW_MATMUL
3 -: 2:/* Frozen b774723 independent verification oracle; never production linked. */
4 -: 3:#define omega_blackwell_get_machine_id oracle_omega_blackwell_get_machine_id
5 -: 4:#define omega_blackwell_realization_compute_id oracle_omega_blackwell_realization_compute_id
6 -: 5:#define omega_blackwell_realize_vector oracle_omega_blackwell_realize_vector
7 -: 6:/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */
8 -: 7:#include "omega_blackwell_realize.h"
9 -: 8:#include "sha256.h"
10 -: 9:#include <string.h>
11 -: 10:
12function oracle_omega_blackwell_get_machine_id called 9 returned 100% blocks executed 100%
13 9: 11:int omega_blackwell_get_machine_id(SemanticId *out_machine_id) {
14 9: 12: if (!out_machine_id) return -1;
15branch 0 taken 1 (fallthrough)
16branch 1 taken 8
17 -: 13: sha256_ctx ctx;
18 8: 14: sha256_init(&ctx);
19call 0 returned 8
20 8: 15: const char *machine_str = "NVIDIA_DGX_SPARK_GB10_SM121";
21 8: 16: sha256_update(&ctx, (const uint8_t *)machine_str, strlen(machine_str));
22call 0 returned 8
23 8: 17: sha256_final(&ctx, out_machine_id->bytes);
24call 0 returned 8
25 8: 18: return 0;
26 -: 19:}
27 -: 20:
28function oracle_omega_blackwell_realization_compute_id called 108 returned 100% blocks executed 100%
29 108: 21:int omega_blackwell_realization_compute_id(OmegaBlackwellRealization *real) {
30 108: 22: if (!real) return -1;
31branch 0 taken 1 (fallthrough)
32branch 1 taken 107
33 -: 23: sha256_ctx ctx;
34 107: 24: sha256_init(&ctx);
35call 0 returned 107
36 107: 25: sha256_update(&ctx, real->spec_id.bytes, OMEGA_ID_BYTES);
37call 0 returned 107
38 107: 26: sha256_update(&ctx, real->machine_id.bytes, OMEGA_ID_BYTES);
39call 0 returned 107
40 107: 27: sha256_update(&ctx, real->code_digest, sizeof(real->code_digest));
41call 0 returned 107
42 107: 28: sha256_update(&ctx, (const uint8_t *)&real->sm_architecture, sizeof(real->sm_architecture));
43call 0 returned 107
44 107: 29: sha256_final(&ctx, real->realization_digest);
45call 0 returned 107
46 -: 30:
47 107: 31: memcpy(real->realization_id.bytes, real->realization_digest, OMEGA_ID_BYTES);
48 107: 32: return 0;
49 -: 33:}
50 -: 34:
51function oracle_omega_blackwell_realize_vector called 9 returned 100% blocks executed 82%
52 9: 35:int omega_blackwell_realize_vector(const OmegaVectorSpec *spec, OmegaBlackwellRealization *out_real) {
53 9: 36: if (!spec || !out_real) return -1;
54branch 0 taken 8 (fallthrough)
55branch 1 taken 1
56branch 2 taken 1 (fallthrough)
57branch 3 taken 7
58 7: 37: memset(out_real, 0, sizeof(*out_real));
59 -: 38:
60 7: 39: out_real->spec_id = spec->spec_id;
61 7*: 40: if (omega_blackwell_get_machine_id(&out_real->machine_id) != 0) return -1;
62call 0 returned 7
63branch 1 taken 0 (fallthrough)
64branch 2 taken 7
65 -: 41:
66 7: 42: out_real->sm_architecture = OMEGA_BW_SM_ARCH_121;
67 7: 43: out_real->code_len = OMEGA_BW_VECADD_CODE_SIZE;
68 -: 44:
69 -: 45: /* Verify and digest generated Blackwell machine code */
70 -: 46: uint8_t code_buf[OMEGA_BW_VECADD_CODE_SIZE];
71 7: 47: size_t encoded_len = 0;
72 7*: 48: if (omega_blackwell_encode_vecadd(code_buf, sizeof(code_buf), &encoded_len) != 0) return -1;
73call 0 returned 7
74branch 1 taken 0 (fallthrough)
75branch 2 taken 7
76 7*: 49: if (omega_blackwell_compute_code_digest(code_buf, encoded_len, out_real->code_digest) != 0) return -1;
77call 0 returned 7
78branch 1 taken 0 (fallthrough)
79branch 2 taken 7
80 -: 50:
81 -: 51: /* Default launch geometry */
82 7: 52: out_real->qmd_cfg.num_elements = spec->element_count;
83 7: 53: out_real->qmd_cfg.threads_per_block = 64;
84 7: 54: out_real->qmd_cfg.grid_width = (spec->element_count + 63) / 64;
85 7: 55: if (out_real->qmd_cfg.grid_width == 0) out_real->qmd_cfg.grid_width = 1;
86branch 0 taken 2 (fallthrough)
87branch 1 taken 5
88 -: 56:
89 7: 57: return omega_blackwell_realization_compute_id(out_real);
90call 0 returned 7
91 -: 58:}
92 -: 59:
93 -: 60:#endif