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 / nvrm-alloc-20261106 / README.md
| 1 | # NVRM_ALLOC — host receipts, 2026-11-06 |
| 2 | |
| 3 | ## Scope and provenance |
| 4 | |
| 5 | IMPLEMENTED and EXERCISED (host/fake RM). Hardware QUALIFIED: NOT_RUN. |
| 6 | MERGED: no. DEPLOYED: no. This is stacked on PR #336, |
| 7 | `feat/nvrm-struct-om` at `b9ef8f14eaa2e5810e8fc9ed06db540ff92990d2`. |
| 8 | The registration-first commit is `ae8ff1d62b7402e0ac10b1a993606ca062b1b753`. |
| 9 | The #281 vendor-header baseline is untouched. No public API signature changes. |
| 10 | |
| 11 | The Omega default owns VA sorted insertion, overlap refusal, first-fit reuse, |
| 12 | pad/tail splitting, coalescing, capacity refusal, bump arithmetic, recycled-slot |
| 13 | stack operations, counter successor, proc-line decimal parsing/reductions, |
| 14 | method-header encoding and Ampere packet validation. Packet admission composes |
| 15 | the existing `amp_runtime.om` policy. C retains file reads, lock/CAS effects, |
| 16 | mapped pointer construction, state/error publication and the original oracle |
| 17 | behind `CUDAPP_MIGRATION_PENDING_C_NVRM_ALLOC=1` (default 0). |
| 18 | The VA table is borrowed in place; no allocation or whole-table copy is added. |
| 19 | |
| 20 | Generation retains the existing `om/units.sh` pins: |
| 21 | |
| 22 | - omc e5b32567: `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f` |
| 23 | - converter: `d84fd6ebd258170a023ed5235880cd3e1ca8664703a2542542a7f8d103120538` |
| 24 | - seeded frontend: `a3a455bd77381e132215924295763e8728889d7d578278ae376de78324be8629` |
| 25 | - checked converter checkout used: `/tmp/bridge-pin-merge`; the current ordinary |
| 26 | bridge checkout has a different converter digest and was not substituted. |
| 27 | - existing freest units require `OMEGA_SEED` baseline |
| 28 | `191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`. |
| 29 | |
| 30 | Verification oracles: GCC `13.3.0` (Ubuntu `13.3.0-6ubuntu2~24.04.1`), |
| 31 | Python `3.12.3`, existing C/vendor fixtures. They are not production replacements. |
| 32 | No new host implementation dependency is adopted. Harness skill review: no |
| 33 | language/compiler/ABI/pin/repository/gate contract is changed; the family source |
| 34 | map and commands are updated in `nvrm/README.md`. |
| 35 | |
| 36 | ## Executed commands |
| 37 | |
| 38 | For all commands below, `W` denotes exactly: |
| 39 | |
| 40 | ```sh |
| 41 | bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 |
| 42 | ``` |
| 43 | |
| 44 | Environment used: |
| 45 | |
| 46 | ```sh |
| 47 | OMEGA_OMC=$HOME/work/cudastack/omega-mv/seed/out/omc |
| 48 | OMEGA_BRIDGE=/tmp/bridge-pin-merge |
| 49 | OMEGA_SEED=$HOME/work/cudastack/omega-bridge/build/bootstrap/omc |
| 50 | ``` |
| 51 | |
| 52 | | Command | rc | Final line / result | Receipt | |
| 53 | | --- | --- | --- | --- | |
| 54 | | `W sh om/units.sh` | 0 | `wrote checked portable Omega units to .../src` | generation command output; committed C and identity files | |
| 55 | | `W make -j3 test-nvrm-alloc` | 0 | `NVRM ALLOC MIGRATION PASS (10 compiled semantic mutants; HOST_ONLY)` | `alloc.log` | |
| 56 | | `W make -j3 test-nvrm-wire test-nvrm-native test-nvrm-boundary test-nvrm-differential test-nvrm-struct test-ampere-runtime test-streams-submit build/test_nvrm_va_slots` | 0 | `test_omega_gpu_platform_linux (reference only, simulated driver): 17 passed, 0 failed` | `host.log` | |
| 57 | | `W ./build/test_nvrm_va_slots` | 0 | `SUMMARY passed=10 failed=0` | `slots.log` | |
| 58 | | isolated policy command below | 0 | `NVRM POLICY MUTANTS PASS (6 killed)`; EXIT trap regenerated originals | `policy.log` | |
| 59 | | Extracted qualification-script gcc commands, each with allocator oracle flag 0 and 1, under `W` | 0 | `NVRM QUALIFICATION SCRIPT BUILD PASS (6 builds; execution NOT_RUN)` | `script-build.log` | |
| 60 | |
| 61 | Policy's inherited script uses fixed `/tmp` names. Its execution isolated those |
| 62 | names with an additional tmpfs, while preserving the pinned converter and its |
| 63 | writable, uniquely named build scratch: |
| 64 | |
| 65 | ```sh |
| 66 | bwrap --dev-bind / / --dev /dev --proc /proc --tmpfs /tmp \ |
| 67 | --bind /tmp/bridge-pin-merge /tmp/bridge-pin-merge -- \ |
| 68 | taskset -c 10-14 nice -n 10 make -j3 test-nvrm-policy |
| 69 | ``` |
| 70 | |
| 71 | An initial read-only bridge bind refused its temporary build directory; it did |
| 72 | not exercise mutants. The writable bind above completed successfully. Initial |
| 73 | migration-gate compilation exposed missing hosted fixed-view length arguments; |
| 74 | those callers were corrected before the passing receipts. A mutant that changed |
| 75 | the method mode was caught by the direct header assertion, rather than by a |
| 76 | completed trace; the runner now records that assertion as the semantic kill. |
| 77 | No failed run is labelled PASS. |
| 78 | |
| 79 | ## Oracle coverage |
| 80 | |
| 81 | `tests/nvrm_alloc_test.c` is compiled twice, selecting the original C or Omega. |
| 82 | After every operation the runner byte-compares return value, bump position, |
| 83 | free count, fault state, error buffer and every active range (not a checksum). |
| 84 | There are 32768 seeded random alloc/free operations, plus deterministic exact |
| 85 | fits, alignment pad/tail splits, both-direction coalescing, overlap/zero/overflow |
| 86 | releases, corrupt-range overflow refusal and table-capacity cases. Capacity is |
| 87 | exercised below/at the bound and with an insertion beyond it. Size/alignment |
| 88 | classes include zero, neighboring page/power-of-two values, UINT32_MAX and |
| 89 | UINT64_MAX neighborhoods. Counter edges straddle the nonwrapping increment |
| 90 | limit; the recycled pool is filled beyond capacity and drained through reuse |
| 91 | and fresh allocation. |
| 92 | |
| 93 | Method inputs cross field boundaries and include zero and UINT32_MAX. Packet |
| 94 | cases cover envelope/count/subchannel/method/class refusals, admitted mixed |
| 95 | streams, unmapped CPU storage, non-discrete bypass and word counts 2097149, |
| 96 | 2097150, 2097151. The latter crosses the implicit million-iteration bound using |
| 97 | minimum-sized admitted packets. The changed-result red control flips one result |
| 98 | bit before comparison and must be rejected. |
| 99 | |
| 100 | `tests/nvrm_counts_test.c` independently retains the original sscanf/token |
| 101 | algorithm. It checks optional signs, whitespace, digit prefixes, absent digits, |
| 102 | saturating overflow, prefix/colon mismatch and buddy orders 0..33 across zone |
| 103 | and token variants. Existing fake-RM/native/struct/wire/streams gates remain PASS. |
| 104 | |
| 105 | Four missing-entry controls each require link failure naming the corresponding |
| 106 | strong symbol: `omega_nvrm_va`, `omega_nvrm_alloc_scalar`, `omega_nvrm_counts`, |
| 107 | `omega_nvrm_alloc_push`. No weak fallback is present. |
| 108 | |
| 109 | ## Compiled semantic mutants |
| 110 | |
| 111 | All were generated from changed `.om` source and compiled successfully before |
| 112 | execution. Compilation refusal is not counted as a kill. |
| 113 | |
| 114 | | Mutant | Changed computation | Verdict | |
| 115 | | --- | --- | --- | |
| 116 | | overlap-edge | previous-end comparison includes equality | KILLED | |
| 117 | | coalesce-next | reverse following-range adjacency | KILLED | |
| 118 | | exact-fit | reverse exact end comparison | KILLED | |
| 119 | | split-tail | omit split count increment | KILLED | |
| 120 | | pool-reuse | replace recycled value by zero | KILLED | |
| 121 | | counter-step | decrement stride | KILLED | |
| 122 | | method-mode | change encoding dispatch mode | KILLED (header assertion) | |
| 123 | | packet-envelope | change incrementing packet opcode | KILLED | |
| 124 | | decimal-digit | replace decimal digit by zero | KILLED (counter assertion) | |
| 125 | | order-edge | exclude equal buddy order | KILLED (counter assertion) | |
| 126 | |
| 127 | Existing struct and policy gates also killed their own 12 and 6 mutants; |
| 128 | these are separate from the ten new allocation-family mutants. |
| 129 | |
| 130 | ## Remaining gates and chip runbook — NOT_RUN |
| 131 | |
| 132 | Full repository integration belongs to the integrator and was not run here. |
| 133 | Live RM, device launch, chip parity, VFIO and hardware qualification are NOT_RUN. |
| 134 | No service, driver/module, GPU lock or protected port was changed. |
| 135 | |
| 136 | Only a new, explicit operator-authorized exclusive window permits hardware |
| 137 | work. Use current `AGENTS.md` and `nvrm/README.md` live-RM procedures, resolve the |
| 138 | native transport's pending compiler/bridge prerequisites, record exact source |
| 139 | and tool identities and allocate a new evidence directory. Do not treat this |
| 140 | receipt as authorization, or remove the isolated `/dev` barrier in a host test. |
| 141 | |
| 142 | In that authorized procedure: |
| 143 | |
| 144 | 1. Build separate Omega-default and `-DCUDAPP_MIGRATION_PENDING_C_NVRM_ALLOC=1` |
| 145 | oracle artifacts, recording the actual compiler command, not merely an |
| 146 | environment variable. Both M16 compiler commands and the lifecycle compiler |
| 147 | command now forward this flag; all six default/oracle builds passed without |
| 148 | executing the resulting hardware programs. |
| 149 | 2. Run existing lifecycle gates and M16 requalification with the authorized |
| 150 | hardware runner. Include repeated alloc/free reuse and split/coalesce, |
| 151 | independent clients/slot growth, stale/duplicate frees and failure injection. |
| 152 | 3. Compare RM statuses, allocation/free accounting, VA ownership/refusal and |
| 153 | packet outcomes. Pointer-bearing request fields must reference the same |
| 154 | parameter spans, not fabricated addresses. Preserve quarantine on uncertain |
| 155 | cleanup. Run a real negative control and retain its refusal evidence. |
| 156 | 4. Capture fresh driver diagnostics and receipt identities. Call the hardware |
| 157 | tier PASS only for that exact exercised revision; otherwise leave NOT_RUN. |
| 158 | |
| 159 | ## Wolfram queries |
| 160 | |
| 161 | `WolframLanguageEvaluator`: |
| 162 | |
| 163 | ```text |
| 164 | {2^64-1-2^32,2^32,2^13-1,FromDigits["c7c0",16], |
| 165 | FromDigits["02b4",16],FromDigits["02c0",16],FromDigits["005c",16], |
| 166 | FromDigits["0028",16],FromDigits["021c",16],BitOr[2^0,2^4,2^12]} |
| 167 | -> {18446744069414584319,4294967296,8191,51136,692,704,92,40,540,4113} |
| 168 | {Floor[2097151/2],Ceiling[Floor[2097151/2]/999999]} |
| 169 | -> {1048575,2} |
| 170 | ``` |
| 171 | |
| 172 | These are source constants and modeled bounds, not measurements or hardware |
| 173 | qualification. Test reference computations are verification oracles. |