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 / nvrm-alloc-20261106 / README.md

173 lines · 9285 bytes Raw Blame History Rendered
1# NVRM_ALLOC — host receipts, 2026-11-06
2
3## Scope and provenance
4
5IMPLEMENTED and EXERCISED (host/fake RM). Hardware QUALIFIED: NOT_RUN.
6MERGED: no. DEPLOYED: no. This is stacked on PR #336,
7`feat/nvrm-struct-om` at `b9ef8f14eaa2e5810e8fc9ed06db540ff92990d2`.
8The registration-first commit is `ae8ff1d62b7402e0ac10b1a993606ca062b1b753`.
9The #281 vendor-header baseline is untouched. No public API signature changes.
10
11The Omega default owns VA sorted insertion, overlap refusal, first-fit reuse,
12pad/tail splitting, coalescing, capacity refusal, bump arithmetic, recycled-slot
13stack operations, counter successor, proc-line decimal parsing/reductions,
14method-header encoding and Ampere packet validation. Packet admission composes
15the existing `amp_runtime.om` policy. C retains file reads, lock/CAS effects,
16mapped pointer construction, state/error publication and the original oracle
17behind `CUDAPP_MIGRATION_PENDING_C_NVRM_ALLOC=1` (default 0).
18The VA table is borrowed in place; no allocation or whole-table copy is added.
19
20Generation 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
30Verification oracles: GCC `13.3.0` (Ubuntu `13.3.0-6ubuntu2~24.04.1`),
31Python `3.12.3`, existing C/vendor fixtures. They are not production replacements.
32No new host implementation dependency is adopted. Harness skill review: no
33language/compiler/ABI/pin/repository/gate contract is changed; the family source
34map and commands are updated in `nvrm/README.md`.
35
36## Executed commands
37
38For all commands below, `W` denotes exactly:
39
40```sh
41bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10
42```
43
44Environment used:
45
46```sh
47OMEGA_OMC=$HOME/work/cudastack/omega-mv/seed/out/omc
48OMEGA_BRIDGE=/tmp/bridge-pin-merge
49OMEGA_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
61Policy's inherited script uses fixed `/tmp` names. Its execution isolated those
62names with an additional tmpfs, while preserving the pinned converter and its
63writable, uniquely named build scratch:
64
65```sh
66bwrap --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
71An initial read-only bridge bind refused its temporary build directory; it did
72not exercise mutants. The writable bind above completed successfully. Initial
73migration-gate compilation exposed missing hosted fixed-view length arguments;
74those callers were corrected before the passing receipts. A mutant that changed
75the method mode was caught by the direct header assertion, rather than by a
76completed trace; the runner now records that assertion as the semantic kill.
77No 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.
82After every operation the runner byte-compares return value, bump position,
83free count, fault state, error buffer and every active range (not a checksum).
84There are 32768 seeded random alloc/free operations, plus deterministic exact
85fits, alignment pad/tail splits, both-direction coalescing, overlap/zero/overflow
86releases, corrupt-range overflow refusal and table-capacity cases. Capacity is
87exercised below/at the bound and with an insertion beyond it. Size/alignment
88classes include zero, neighboring page/power-of-two values, UINT32_MAX and
89UINT64_MAX neighborhoods. Counter edges straddle the nonwrapping increment
90limit; the recycled pool is filled beyond capacity and drained through reuse
91and fresh allocation.
92
93Method inputs cross field boundaries and include zero and UINT32_MAX. Packet
94cases cover envelope/count/subchannel/method/class refusals, admitted mixed
95streams, unmapped CPU storage, non-discrete bypass and word counts 2097149,
962097150, 2097151. The latter crosses the implicit million-iteration bound using
97minimum-sized admitted packets. The changed-result red control flips one result
98bit before comparison and must be rejected.
99
100`tests/nvrm_counts_test.c` independently retains the original sscanf/token
101algorithm. It checks optional signs, whitespace, digit prefixes, absent digits,
102saturating overflow, prefix/colon mismatch and buddy orders 0..33 across zone
103and token variants. Existing fake-RM/native/struct/wire/streams gates remain PASS.
104
105Four missing-entry controls each require link failure naming the corresponding
106strong 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
111All were generated from changed `.om` source and compiled successfully before
112execution. 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
127Existing struct and policy gates also killed their own 12 and 6 mutants;
128these are separate from the ten new allocation-family mutants.
129
130## Remaining gates and chip runbook — NOT_RUN
131
132Full repository integration belongs to the integrator and was not run here.
133Live RM, device launch, chip parity, VFIO and hardware qualification are NOT_RUN.
134No service, driver/module, GPU lock or protected port was changed.
135
136Only a new, explicit operator-authorized exclusive window permits hardware
137work. Use current `AGENTS.md` and `nvrm/README.md` live-RM procedures, resolve the
138native transport's pending compiler/bridge prerequisites, record exact source
139and tool identities and allocate a new evidence directory. Do not treat this
140receipt as authorization, or remove the isolated `/dev` barrier in a host test.
141
142In that authorized procedure:
143
1441. 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.
1492. 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.
1523. 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.
1564. 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
172These are source constants and modeled bounds, not measurements or hardware
173qualification. Test reference computations are verification oracles.