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 / docs / independent-verification / README.md
| 1 | # Independently reproduce one native GPU result |
| 2 | |
| 3 | **Status: PROPOSED collection protocol. Independent hardware replication is |
| 4 | NOT_RUN.** This directory does not contain a physical receipt, an executable |
| 5 | validator or new GPU harness behavior. [Issue #91](https://github.com/aien-dev/CUDApp/issues/91#issuecomment-6407638311) |
| 6 | owns this evidence work under [#88](https://github.com/aien-dev/CUDApp/issues/88). |
| 7 | [#79](https://github.com/aien-dev/CUDApp/issues/79) retains .om migration. |
| 8 | The [agent prompt](AGENT_PROMPT.md) describes the remaining implementation. |
| 9 | |
| 10 | ## What the current evidence establishes |
| 11 | |
| 12 | The immutable [teardown candidate receipt](../../evidence/speculation/release-candidate-teardown/receipt.json) |
| 13 | reports an owner-operated physical vector result for CUDApp |
| 14 | `2e2421694f6110bd84885ae0b2d3caf249809d34`, with compiler source |
| 15 | `omega-mv@d7390d88d07dbf48cfbb0583070599c350f814d3` and compiler SHA256 |
| 16 | `9749f38841a55917d41924a68bce31463ec2339910bddd5e6cbf6ea4420551db`. |
| 17 | It records wrong-math and restored-program controls and a privately retained |
| 18 | syscall trace. It explicitly leaves a second person's or machine's hardware |
| 19 | rerun NOT_RUN. It does not qualify a later source revision. |
| 20 | |
| 21 | The [native kernel description](../speculation/NATIVE-KERNEL.md) and |
| 22 | `native/nvrm/context.om`, `native/blackwell/vector.om` and |
| 23 | `native/blackwell/launch.om` expose the direct device-client and native |
| 24 | instruction path. Source inspection and artifact hashes are not independent |
| 25 | physical execution. A matching hash identifies bytes; a signature identifies |
| 26 | an attestation under a key. Neither proves that the attested event occurred. |
| 27 | NVIDIA open kernel modules and GSP firmware remain required. A runtime that |
| 28 | does not use CUDA userspace is not evidence that the toolkit is absent. |
| 29 | |
| 30 | ## Freeze the experiment before collecting results |
| 31 | |
| 32 | An operator independent of candidate generation owns the challenge and records |
| 33 | their relationship to the author. Self-reported independence is not verified |
| 34 | independence. Document who reviewed it, what they checked, and remaining trust |
| 35 | assumptions. An agent reviewing source is not an independent hardware operator. |
| 36 | A second operator on the same machine is distinct from a second machine. |
| 37 | |
| 38 | 1. Clone the exact public candidate and compiler revisions into clean workspaces. |
| 39 | Save the full Git SHAs, clean/dirty status and any patch bytes and hashes. |
| 40 | Freeze the harness and oracle revisions too. A dirty build is a different |
| 41 | candidate, not a result on the clean SHA. |
| 42 | 2. Record tool versions, build environment and the complete source composition |
| 43 | and build commands. Rebuild the pinned seed compiler using its repository's |
| 44 | accepted path on the supported architecture. Compare its hash with an |
| 45 | independently recorded expected digest, not a sidecar just regenerated by |
| 46 | the same build. Never execute a failed or partial compile output. |
| 47 | 3. Hash the source unit, executable, reviewed kernel variants, descriptor |
| 48 | builder/template and invariant configuration. Repeat the build in a fresh output directory and |
| 49 | report exact byte agreement or a diagnosed difference. A rebuilt compiler's |
| 50 | fixpoint is not a proof of compiler correctness. Runtime descriptors and |
| 51 | arguments contain fresh sizes and allocation addresses: hash their finalized |
| 52 | bytes per arm after challenge selection/allocation and before submission. |
| 53 | Bind them to the frozen builder and challenge, not a preselected address. |
| 54 | 4. Run the repository's host suite and relevant native host tests. Capture every |
| 55 | command and exit. x86_64 cross-compilation or interpretation is not native |
| 56 | AArch64 execution. Do not replace architecture-specific barriers with no-ops. |
| 57 | 5. Freeze the candidate digest before challenge generation. The operator chooses |
| 58 | fresh unpredictable inputs and publishes a timestamped commitment to the |
| 59 | exact input bytes and generation recipe before launch. The candidate author |
| 60 | must not select, replace or learn the challenge in advance. Runtime inputs |
| 61 | necessarily reach the candidate; expected outputs remain with the referee. |
| 62 | Record that chronology and its witness, not just self-asserted timestamps. |
| 63 | 6. Use an independently implemented CPU oracle in a separate process/workspace. |
| 64 | It consumes the exact input bytes and emits every expected uint32 result |
| 65 | under the documented wraparound semantics. Do not reuse the candidate's |
| 66 | generator, result buffer, checker or lookup table as the sole oracle. |
| 67 | Publish its source/provenance, versions, command, exits and output digest. |
| 68 | |
| 69 | Start with the bounded vector addition already supported by the native path. |
| 70 | Do not substitute a full model, arbitrary shader or benchmark. Preserve the |
| 71 | existing refusal cases and supported size bounds. After freeze, the operator |
| 72 | chooses challenge sizes within those bounds, including tails and boundaries. |
| 73 | Rebuilding to bake fresh values into candidate code breaks the freeze; add |
| 74 | reviewed runtime input transport first instead. |
| 75 | |
| 76 | ## Existing harness seams and missing work |
| 77 | |
| 78 | Reuse `tests/speculation/native-kernel-test.om`, `vector-checks.om` and |
| 79 | `vector-checks-test.om`. Today the main function uses fixed salts; expected |
| 80 | values are computed inside the same test process. Its checks cover every |
| 81 | logical result and up to 64 unused output words, but there are no unused tail |
| 82 | words at maximum capacity. These are useful regressions, not the independent |
| 83 | challenge/CPU-oracle protocol above. |
| 84 | |
| 85 | Before a device run, extend that existing harness in seeded .om for external |
| 86 | input and output artifacts, separate reference comparison, and properly |
| 87 | allocated guards. Do not move pointers or enlarge allocations without review |
| 88 | of launcher bounds and admission. Add host refusals for malformed/truncated |
| 89 | inputs, wrong size/digest, stale outputs, missing writes and oracle tampering. |
| 90 | The withheld-submission control below is missing and must be implemented and |
| 91 | host-tested before use. No new permanent C implementation or foreign fallback. |
| 92 | |
| 93 | ## Physical run, only after admission |
| 94 | |
| 95 | The issue, this document and a PR are not permission to open a device. Obtain |
| 96 | the existing owner reservation and safe admission for the named machine, |
| 97 | bounded allocation/workload and observation window. Leave the resident model, |
| 98 | other workers, gates, installed toolkit, driver and firmware untouched. If |
| 99 | safe admission or supported hardware is unavailable, record NOT_RUN or the |
| 100 | exact blocker and stop the dependent work. |
| 101 | |
| 102 | Record OS/architecture, GPU model and PCI identity, public-safe stable device |
| 103 | identity, loaded driver version and GSP dependency. Keep private device IDs in |
| 104 | raw custody when necessary, with a reviewed stable public alias. Do not infer |
| 105 | a second machine merely from a different alias. Record approved memory/time |
| 106 | limits, pre/post health checks scoped to the reservation and cleanup outcome. |
| 107 | No private service URLs, prompts, model data or unrelated process listings. |
| 108 | |
| 109 | For each arm, use fresh input/output allocations as supported, poison the |
| 110 | entire output, snapshot input and guard bytes, and retain full readback. Ensure |
| 111 | poison is independently chosen and checked by the referee not to equal that |
| 112 | element's expected output. Do not expose expected values through a reversible |
| 113 | poison pattern such as their bitwise complement. Preserve all failures and |
| 114 | attempts. Do not discard failed attempts or selectively repeat runs to report |
| 115 | only successes. Diagnose failures, retain all attempts and never reuse an |
| 116 | earlier successful buffer. |
| 117 | |
| 118 | | Arm | Required observation | |
| 119 | | --- | --- | |
| 120 | | Correct kernel | Actual submission/completion and every output matches the separate oracle. Input bytes and allocation guards remain intact. | |
| 121 | | Wrong-math kernel | Reviewed mutation changes arithmetic only, not addressing, bounds or termination. Submission completes, the oracle rejects wrong results, and guards stay intact. | |
| 122 | | Restored kernel | Fresh correctly restored code and output buffers pass again; record code identities for both versions. | |
| 123 | | No submission | Initialize normally but do not enqueue GPU work and do not enter a wait that can never complete. Readback stays at the fresh poison, not the oracle result. Trace evidence contains no launch for this arm. | |
| 124 | | Guards | Before/after guards for each accessible allocation and unused output extent remain unchanged in every arm. Explicitly report inaccessible/uncovered regions; do not claim total memory safety. | |
| 125 | |
| 126 | A wrong-math control must not send malformed opcodes, invalid pointers or a |
| 127 | hang to the device. A no-submission arm is not a timed-out GPU experiment. |
| 128 | Use the existing cleanup path; an uncertain device state requires the owner's |
| 129 | recovery procedure, not an agent-initiated reset or driver reload. |
| 130 | |
| 131 | The external referee checks all output bytes, guards and expected failures. |
| 132 | Candidate stdout saying PASS is not the result. A host routine that writes the |
| 133 | expected outputs would pass arithmetic comparison; the dynamic observation, |
| 134 | no-submission control and independent review must address that alternative. |
| 135 | This remains scoped empirical evidence, not formal hardware attestation. |
| 136 | |
| 137 | ## Dependencies and observation |
| 138 | |
| 139 | Keep separate inventories for build tools, optional test/oracle tools and the |
| 140 | runtime process tree. Record installed `nvcc`/toolkit separately from whether |
| 141 | any component was executed or loaded by the measured path. Do not claim |
| 142 | "toolkit absent" from a clean dependency scan. Testing absence requires a |
| 143 | separately approved environment; never uninstall software from the Spark. |
| 144 | |
| 145 | Use the existing `make zero-cuda-gate` for its actual static ELF scope. Add |
| 146 | reviewed static inspection of the exact native ELF: headers, dynamic entries, |
| 147 | imports, interpreter, and build inputs. Static linking alone cannot exclude |
| 148 | embedded code, subprocesses or dynamic loading. Static output is one evidence |
| 149 | row, not a verdict about everything that could execute. |
| 150 | |
| 151 | Collect full raw process/device-call logs across the relevant process tree, |
| 152 | including exec/load/open/ioctl/mmap/submission/completion and exits where the |
| 153 | observer supports them. The historical command was |
| 154 | `strace -f -o kernel-syscalls.log ./kernel.elf`; this is a reference, not an |
| 155 | authorized command to run now. Explain trace coverage and limitations rather |
| 156 | than claiming a tool decoded more than it did. Correlate buffers and commands |
| 157 | with the exact kernel/launch artifacts and the bounded readback. An ioctl or |
| 158 | an NVIDIA device open by itself does not establish the claimed computation. |
| 159 | Any profiler or observation tool is separately inventoried and admitted. |
| 160 | |
| 161 | Record provenance and license obligations for the exact source/tool closure. |
| 162 | Unresolved current-tree licensing or vendor-listing questions belong to |
| 163 | [#89](https://github.com/aien-dev/CUDApp/issues/89); do not assert that the whole |
| 164 | tree has one license or change headers to make an audit appear clean. This |
| 165 | protocol does not authorize redistribution of material under review. |
| 166 | |
| 167 | ## Public evidence and raw custody |
| 168 | |
| 169 | Create a new immutable `evidence/<run-id>/` bundle. Never rewrite the old |
| 170 | receipt. Save commands, start/end UTC, exit codes, stdout/stderr, full outputs, |
| 171 | input/oracle/kernel/launch digests, pre/post checks and all control failures. |
| 172 | For each artifact record byte count and SHA256. Publish source-owned artifacts |
| 173 | only; never add vendor binaries, firmware, cubins/PTX or vendor listings. |
| 174 | |
| 175 | Before publishing, scan and manually review commands, logs, patches, device |
| 176 | identifiers and manifests for secrets and private information. Sanitization |
| 177 | must preserve evidence-bearing event order, operation/result fields and |
| 178 | consistent alias relationships. State every removed class and its effect on |
| 179 | verification. If critical evidence cannot be published, label that check |
| 180 | incomplete for public verification instead of hiding the limitation. |
| 181 | |
| 182 | For every sanitized file, retain the raw original under authorized custody, |
| 183 | record both hashes, the transformation specification, reviewer, and access |
| 184 | conditions. Do not publish the private path. A raw hash is a commitment, not |
| 185 | access to the raw trace. If later confidential inspection is needed, seek |
| 186 | separate authorization; this protocol does not grant disclosure permission. |
| 187 | |
| 188 | The operator writes a report naming what they personally rebuilt, generated, |
| 189 | observed and checked, their relationship to the author, and what remained |
| 190 | unobserved. A reviewer verifies identities, chronology, artifact bytes and |
| 191 | controls before accepting a narrow claim. Optional signatures cover exact |
| 192 | report bytes and key identity without introducing a new trust root or a |
| 193 | physical-proof claim. An optional separately admitted second-machine run gets |
| 194 | its own bundle and retains all platform differences. |
| 195 | |
| 196 | ## Manifest contract and review checklist |
| 197 | |
| 198 | [manifest.NOT_RUN.json](manifest.NOT_RUN.json) is an empty **template**, not a |
| 199 | receipt. [manifest.schema.json](manifest.schema.json) uses JSON Schema draft |
| 200 | 2020-12. A standard external validator can check its structure. This PR does |
| 201 | not add a validator dependency, CI acceptance gate or manifest consumer. |
| 202 | |
| 203 | - `claim_status` is always `NOT_EVALUATED`. There is no automatic PASS value. |
| 204 | - Check statuses are NOT_RUN, BLOCKED, FAILED or COLLECTED. COLLECTED means |
| 205 | evidence was attached, not that it is authentic, sufficient or successful. |
| 206 | - A template cannot carry commands, artifacts, identities, operator claims or |
| 207 | a completed check. Never present generated schema-test data as run evidence. |
| 208 | - An operator report may be incomplete. Describe exactly why a row is missing; |
| 209 | optional second-machine/toolkit-absent checks can remain NOT_RUN without |
| 210 | inventing broader claims. Preserve failed observations as FAILED. |
| 211 | - Every command must identify its script/argv context, UTC times, exit status, |
| 212 | and stdout/stderr artifact IDs. Timestamps use UTC `Z` with a lexical |
| 213 | date/time range check, excluding leap seconds. Calendar validity needs a |
| 214 | validator with date-time format support or a separate calendar check; the |
| 215 | locally installed referee lacks that optional format checker. Public paths |
| 216 | are bundle-relative, never |
| 217 | private machine paths. The schema cannot sanitize free text for you. |
| 218 | - Review must resolve every referenced command/artifact ID, reject duplicates, |
| 219 | verify every byte count/hash, chronology and identity against actual files, |
| 220 | enforce admission and check semantics. JSON Schema does **not** perform |
| 221 | these cross-record or physical checks. Self-filled fields are unverified. |
| 222 | - Hash/signature validity, schema validity, host tests and code review cannot |
| 223 | be substituted for a hardware observation. Keep owner hardware, independent |
| 224 | operator hardware, second-machine hardware, host and simulator claims apart. |
| 225 | |
| 226 | The [host-only contract checks](../../evidence/independent-verification/host-contract-20261026/README.md) |
| 227 | record structural/refusal validation and unchanged repository test blockers. |
| 228 | |
| 229 | Issue #91 stays open until its actual acceptance evidence is reviewed. This |
| 230 | first slice does not establish performance, full-model correctness, other GPU |
| 231 | support, C retirement, deployment or replacement of NVIDIA kernel/firmware. |