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 / evidence / bw-matmul-realize-om / 2026-11-06 / repeat-om_bw_realize_oracle.c.gcov
| 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: |
| 12 | function 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; |
| 15 | branch 0 taken 1 (fallthrough) |
| 16 | branch 1 taken 8 |
| 17 | -: 13: sha256_ctx ctx; |
| 18 | 8: 14: sha256_init(&ctx); |
| 19 | call 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)); |
| 22 | call 0 returned 8 |
| 23 | 8: 17: sha256_final(&ctx, out_machine_id->bytes); |
| 24 | call 0 returned 8 |
| 25 | 8: 18: return 0; |
| 26 | -: 19:} |
| 27 | -: 20: |
| 28 | function 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; |
| 31 | branch 0 taken 1 (fallthrough) |
| 32 | branch 1 taken 107 |
| 33 | -: 23: sha256_ctx ctx; |
| 34 | 107: 24: sha256_init(&ctx); |
| 35 | call 0 returned 107 |
| 36 | 107: 25: sha256_update(&ctx, real->spec_id.bytes, OMEGA_ID_BYTES); |
| 37 | call 0 returned 107 |
| 38 | 107: 26: sha256_update(&ctx, real->machine_id.bytes, OMEGA_ID_BYTES); |
| 39 | call 0 returned 107 |
| 40 | 107: 27: sha256_update(&ctx, real->code_digest, sizeof(real->code_digest)); |
| 41 | call 0 returned 107 |
| 42 | 107: 28: sha256_update(&ctx, (const uint8_t *)&real->sm_architecture, sizeof(real->sm_architecture)); |
| 43 | call 0 returned 107 |
| 44 | 107: 29: sha256_final(&ctx, real->realization_digest); |
| 45 | call 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: |
| 51 | function 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; |
| 54 | branch 0 taken 8 (fallthrough) |
| 55 | branch 1 taken 1 |
| 56 | branch 2 taken 1 (fallthrough) |
| 57 | branch 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; |
| 62 | call 0 returned 7 |
| 63 | branch 1 taken 0 (fallthrough) |
| 64 | branch 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; |
| 73 | call 0 returned 7 |
| 74 | branch 1 taken 0 (fallthrough) |
| 75 | branch 2 taken 7 |
| 76 | 7*: 49: if (omega_blackwell_compute_code_digest(code_buf, encoded_len, out_real->code_digest) != 0) return -1; |
| 77 | call 0 returned 7 |
| 78 | branch 1 taken 0 (fallthrough) |
| 79 | branch 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; |
| 86 | branch 0 taken 2 (fallthrough) |
| 87 | branch 1 taken 5 |
| 88 | -: 56: |
| 89 | 7: 57: return omega_blackwell_realization_compute_id(out_real); |
| 90 | call 0 returned 7 |
| 91 | -: 58:} |
| 92 | -: 59: |
| 93 | -: 60:#endif |