Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/patches/bd574b188cd10967 # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## test(device-trace): restore semantic runner coverage and negative controls merged `bd574b188cd10967` #131 · opened 2026-10-27 05:37 UTC · closed 2026-10-29 01:33 UTC · merged 2026-10-29 01:33 UTC Imported from GitHub aien-dev/CUDApp#131, by drakestapleton Labels: ready-to-merge Base `67f3135ef88d8f520dfc15a2b2bc3264f53f0d6a` · Head `e05860559b6db1440afc92eaa603e724b3494536` Merged on GitHub as `2982016a7d7a6d1d726ff397ba0c91c3ad32da09`; reachable from main `21d8de285f713adf09e0d6ba6db2b37139d0674e` (observed 2026-11-18T16:38:28Z) drakestapleton wrote on 2026-10-27 05:37 UTC ## Purpose and scope Follow-up to #93: put the existing emitter safety regressions on the supported runner path, rather than relying only on the partial opcode/address decode check. - `run-emitter-checks.sh` compiles and runs emitter, address, guard and body units before external decoding. Failed compilation, compiler stderr and failed units stop the runner before later stages. - The handwritten Omega address model checks GLOBALTIMERLO into R2 and each record field's store-source register. Retained negative controls cover both markers' branches, offsets, timer and registers. - `run-runner-controls.sh` tests orchestration with explicitly synthetic tools. The test guide distinguishes this from native execution. - No production emitter, C implementation, Makefile, driver, workflow, public API, admission or trust-policy change. No NVIDIA listing is restored. ## Evidence on the exact commit Publication head: `e05860559b6db1440afc92eaa603e724b3494536`, based on main `67f3135ef88d8f520dfc15a2b2bc3264f53f0d6a`. Tested local source commit: `679902827fa01b63fdb1288cf340f1e486437aa4`; later changes add receipts only. Connector publication assigned new commit metadata; the complete published tree `d13e3a1b9e910f923853e3a7a67e324f4190400d` is identical to reviewed local tip `3aae60ac9f9051bcc95d2d55c12fefe59a8a7630`. Local pins in the immutable receipts identify that testing history. Fresh rebase receipt and preserved earlier local receipt . On Linux x86_64: - PASS, host reference: all four literal-projected Omega units check and run with exit 0 and empty stderr under the unchanged frozen external referee. - PASS, compiler-source checks: the real compiler source accepts every original/projected pair and emits byte-identical AArch64 ELFs. Those ELFs were not executed. Compiler/referee pins, hashes and the explicit projection are in the receipts. - PASS, negative controls: six compiler-accepted source mutants are refused with the recorded expected statuses. The new semantic controls first failed against the old predicates; orchestration controls first failed because the runner omitted the address unit. - PASS: `sh tests/device-trace/run-runner-controls.sh`, shell syntax, whitespace and changed-file publication scans. The orchestration test uses synthetic compiler programs and decode rows, not a GPU or a real decoder. - PASS, independent source/host-reference review: reviewer reproduced the four units, compiler equivalence, source mutants and runner controls. Additional controls reject removed branch assertions and no-op branch/offset mutations. No blocking code finding remains. Full repository checks: - FAIL locally: `make test` exits 2 at unchanged AArch64 `ds` instructions in `src/omega_blackwell_engine.c:393/:558` on the x86 assembler (`Makefile:40`). The host suite did not execute locally. - NOT RUN here: `make test-native-artifact`, `make zero-cuda-gate`, `build/hello_gpu --sim`, and `make doctor` were not rerun for this test-only repair. - NOT RUN: native AArch64 execution of these Omega units and the full real emitter runner; every GB10 test. No hardware window was used. ## Correctness, compatibility and provenance - Negative controls and affected contracts documented. - No API/ABI or production emitter changes; no new hardware claim. - Added files checked for publication safety; no private machine paths, secrets, vendor binaries or listings included. - Historical receipts preserved unchanged; the rebase has an additive receipt. ## Known limitations The targeted generated `tests/device-trace/.crumb` was not refreshed: no trusted crumb executable or CUDApp `crumb.lock` is available in this executor. Compile/verify is NOT RUN; no generated fields were edited by hand and no root crumb was changed. The new ARM64 CI on main runs `make test`, but these Omega units are still outside `HOST_TESTS`. Green host CI therefore does not establish their native execution. These bounded assertions do not claim equivalence to every operand property in the removed whole-listing golden, nor GPU scheduling, memory visibility, clock or overhead qualification. ## Exact-head CI follow-up Head `e05860559b6db1440afc92eaa603e724b3494536` has 10/10 successful observed checks across six terminal-success workflow runs: CodeQL, drift, host library build, hello-sim, runtime-api and CI (host-tests plus SBOM). The ARM64 CI run `40456386742` finished successfully at 2026-10-27 05:48:48 UTC. The host-test job log prints `CUDA++ HOST TESTS PASS (39 targets)`. It checked out PR merge `bc8c08b71f5980643ee2893ec257a161a4421c75`, whose full tree is the same reviewed `d13e3a1b9e910f923853e3a7a67e324f4190400d`. This is a successful ARM64 repository host-suite run, not native execution of the separate Omega emitter units. Their native runner, targeted crumb verification and GB10 qualification remain NOT RUN as described above. No merge or deployment was performed. ### Apply it ``` git checkout -b patch-bd574b188cd10967 67f3135ef88d8f520dfc15a2b2bc3264f53f0d6a curl -fsSL https://interplane.io/drakestapleton/CUDApp/patches/bd574b188cd10967.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/CUDApp 131 e05860559b6db1440afc92eaa603e724b3494536 ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"CUDApp","number":131,"url":"https://github.com/aien-dev/CUDApp/pull/131","export_sha256":"0aafd51b77ff5776d6baaf9b88b48c8b36a6e27c8d829ae8ded561b71712b17a","imported_utc":"2026-11-18T16:38:28Z"} ``` ### Changes ``` diff --git a/evidence/device-trace/checker-coverage-host-20261027/receipt.json b/evidence/device-trace/checker-coverage-host-20261027/receipt.json new file mode 100644 index 00000000..2daace48 --- /dev/null +++ b/evidence/device-trace/checker-coverage-host-20261027/receipt.json @@ -0,0 +1,271 @@ +{ + "schema": "cudapp.device-trace.checker-coverage-host.v1", + "date_utc": "2026-10-27", + "status": "LOCAL_HOST_REFERENCE_ONLY; NATIVE_AND_GPU_NOT_RUN; CRUMB_TOOL_UNAVAILABLE", + "base_commit": "bba6da8045ba5baaf0a81f7152af44d52e24f563", + "source_commit": "81f74bbcfc6eece6665758037f144b80c4756b3a", + "platform": "Linux x86_64", + "source_sha256": { + "tests/device-trace/address-test.om": "658d551fbe85a161a11b0971873930677ab5fd79fd985b761a8ba7ed43ec8370", + "tests/device-trace/run-emitter-checks.sh": "9713639a136b670ac09d1e7cb15b80292068554d7a5e2649c173285a156bb8f1", + "tests/device-trace/run-runner-controls.sh": "203bb36dcea10fed641e16d1cda361116e7c00b08c9d4d43dce7fed478febabe", + "tests/device-trace/README-safety.md": "dcd14ab49e847ffe52a974c225fa1d19f5e097773e5ae69ed128e09ea758e08c" + }, + "change": [ + "Run emitter/address/guard/body units before external decode; reject failed compiler output or nonempty compiler stderr before execution.", + "Require GLOBALTIMERLO into R2 and the contract store-source registers in the independent Omega address model.", + "Retain timer, destination, store-source, branch-displacement and store-offset byte-mutation controls for both markers.", + "Add explicitly synthetic shell-orchestration controls; product emitter and Makefile unchanged." + ], + "oracle": { + "role": "Existing frozen external test referee, not product implementation or native execution.", + "repository": "aien-dev/omega-mv", + "commit": "190130b71d0a59b93f01c515218a5509b149a145", + "path": "tools/omega_ref/omega_ref.c", + "source_sha256": "52e747096c1d978103432460a2978b21a604cc5d3e961bbe4b253fcc7636290e", + "binary_sha256": "158d610d9f6337943674f08d00d6480bbdd817e5b526180017c616b49d89d90a", + "build_command": "cc -O2 -g -std=gnu11 -Wall -Wextra -Werror -o omega_ref omega_ref.c -lpthread", + "cc": "Debian 14.2.0-19", + "projection": "The frozen referee predates const. Remove const NAME ulong VALUE declarations and replace whole NAME tokens in non-note lines by ulong VALUE, exactly as the earlier emitter-safety receipt documents. Original source is not edited. Every original/projected pair is compiled by real compiler source under the referee; outputs are compared, not executed." + }, + "compiler": { + "repository": "aien-dev/omega-mv", + "source_revision": "7505b3a3e3cf5ee46933e3a89a021b4289037983", + "path": "seed/omc/omc.om", + "source_sha256": "c792b401193d8477d38965d6ddb0fd0cb8fd5ac24fcb92fae9af52037a765f1c", + "independently_expected_self_output_sha256": "499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec", + "measured_self_output_sha256": "499236398aabc652e2dae27fe4bdc4c5db3d3726314356e0dbef23e3345803ec", + "self_compile_exit": 0, + "self_compile_stderr_bytes": 0, + "output_arch": "AArch64; NOT_EXECUTED" + }, + "red": { + "semantic": "New timer/source controls against the old address predicates: checker/compiler accepted, projected run exit11, empty stderr.", + "orchestration": "New shell controls against base runner: exit1, missing compile address." + }, + "final_units": [ + { + "stage": "final", + "test": "emitter", + "source_sha256": "d8854d9067c74a334c9da38ca70e74f490e56bb07f2b10dc2383acc42a5ac04c", + "projected_sha256": "fd80925e2d04d40fdc11c48f5a62bcce6793a316c8f596e9d83c1aa534c9a51d", + "check_exit": 0, + "check_stderr": "", + "run_exit": 0, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "dc5773073ff4dbcd4895df0db0557470461af802526d1e5e5f4147e093d1304b", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "dc5773073ff4dbcd4895df0db0557470461af802526d1e5e5f4147e093d1304b", + "same_elf": true + }, + { + "stage": "final", + "test": "address", + "source_sha256": "03133702bfba2792f5fd2216bac71b40e883054e1d7abafe8c19213b9bdb1a97", + "projected_sha256": "1e262f31485d306c7e8133f2a495aeac58954f5f44e88d61d81470a50868224e", + "check_exit": 0, + "check_stderr": "", + "run_exit": 0, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "8bc11f9ec2253cdc3d9959e67a6b032d98e1340f7fefb83031a0b2a4b3b4d7dc", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "8bc11f9ec2253cdc3d9959e67a6b032d98e1340f7fefb83031a0b2a4b3b4d7dc", + "same_elf": true + }, + { + "stage": "final", + "test": "guard", + "source_sha256": "1137c36c1241f65b588beb4d163fecaf83f9a3c0368f727cbca08b095e1098b3", + "projected_sha256": "f471673a130f4a3bc0faf2ac3620d70da4e24bfaf5d5d4dbe40a6d7937a2eb70", + "check_exit": 0, + "check_stderr": "", + "run_exit": 0, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "68423524f52c03da9916749b4d78c24995983dbb818ddc56bd0a7c1c23a588d9", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "68423524f52c03da9916749b4d78c24995983dbb818ddc56bd0a7c1c23a588d9", + "same_elf": true + }, + { + "stage": "final", + "test": "body", + "source_sha256": "2bdae5f2e4a441397b3ebdfa7fd22789b6c97d59b67dc60b57f6bd635722c9af", + "projected_sha256": "2452e3783763e663f892d2800ee236469f2ae11320764de7979a868e14a7e2ce", + "check_exit": 0, + "check_stderr": "", + "run_exit": 0, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "a793ed62dc31e333682167bb0f2020062d84900479e0d9d883b7eaa8de499fe9", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "a793ed62dc31e333682167bb0f2020062d84900479e0d9d883b7eaa8de499fe9", + "same_elf": true + } + ], + "accepted_source_mutants": [ + { + "mutation": "timer_source", + "test": "address", + "expected_run_exit": 3, + "source_sha256": "4a8fc22a9c2b6414d70a18e288a9bb615b1121f034e1177797c7b82019bd8d00", + "check_exit": 0, + "check_stderr": "", + "run_exit": 3, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "df3c17bebfa316d16339bd28fe897b113e065ef14e5bddce932f1f21df196c62", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "df3c17bebfa316d16339bd28fe897b113e065ef14e5bddce932f1f21df196c62", + "same_elf": true + }, + { + "mutation": "timestamp_source", + "test": "address", + "expected_run_exit": 3, + "source_sha256": "d38a6804efa9aa2d4593b16cf12e78e663f6237fd66a1b79781f1ac982ab2907", + "check_exit": 0, + "check_stderr": "", + "run_exit": 3, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "89898a27ec22855315ed519bfecff5ef8565b81bb8e4fc18e0cf8fce2c441d91", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "89898a27ec22855315ed519bfecff5ef8565b81bb8e4fc18e0cf8fce2c441d91", + "same_elf": true + }, + { + "mutation": "store_offset", + "test": "address", + "expected_run_exit": 3, + "source_sha256": "36c2261ebdbba18dd6e4f65b91426df3ab4b4ed0b578cbcae64d0b5bf05b0280", + "check_exit": 0, + "check_stderr": "", + "run_exit": 3, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "d02372974777b5aff806c5eed15e7e8141e19c80c375af03dea1bc30762ecb44", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "d02372974777b5aff806c5eed15e7e8141e19c80c375af03dea1bc30762ecb44", + "same_elf": true + }, + { + "mutation": "second_branch", + "test": "address", + "expected_run_exit": 8, + "source_sha256": "eda13ce050dffeff4207f8d6b28be129477eb87eca348161baf492e1bbc296b5", + "check_exit": 0, + "check_stderr": "", + "run_exit": 8, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "3eea504012d839708f131d10e4aa4053d81356e12dff84f8072080e5cfe87216", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "3eea504012d839708f131d10e4aa4053d81356e12dff84f8072080e5cfe87216", + "same_elf": true + }, + { + "mutation": "noncanonical_guard", + "test": "guard", + "expected_run_exit": 1, + "source_sha256": "bdd6f3f505d4fe65717fe087ab5b66a346bc1601c05ae13d8ce5267a39df6164", + "check_exit": 0, + "check_stderr": "", + "run_exit": 1, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "043d2c1e7977ba94cdcd2ace87290c901206d1a1909293e6af0bd6a2fccdf79c", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "043d2c1e7977ba94cdcd2ace87290c901206d1a1909293e6af0bd6a2fccdf79c", + "same_elf": true + }, + { + "mutation": "body_refusal", + "test": "body", + "expected_run_exit": 1, + "source_sha256": "fe8847689136224eb62e9077b198ad4d26e9e1d0de1aed7251c953efe779d464", + "check_exit": 0, + "check_stderr": "", + "run_exit": 1, + "run_stderr": "", + "original_compile_exit": 0, + "original_compile_stderr": "", + "original_elf_sha256": "5f985e6dc8deea5fd9e70f3657d4b4c332d52b3c9ad9255c4845d1820e2e71eb", + "projected_compile_exit": 0, + "projected_compile_stderr": "", + "projected_elf_sha256": "5f985e6dc8deea5fd9e70f3657d4b4c332d52b3c9ad9255c4845d1820e2e71eb", + "same_elf": true + } + ], + "shell_controls": { + "command": "sh tests/device-trace/run-runner-controls.sh", + "exit": 0, + "stdout": "RUNNER ORCHESTRATION CONTROLS PASS (synthetic tools; no native or GPU execution)", + "scope": "Synthetic compiler programs and deliberately synthetic decode rows. Unit composition/failure propagation only, NOT native compilation or instruction decoding." + }, + "other_checks": { + "commands": [ + "sh -n tests/device-trace/run-emitter-checks.sh tests/device-trace/run-runner-controls.sh", + "git diff --check" + ], + "exit": 0, + "make_test": { + "baseline_exit": 2, + "final_exit": 2, + "failure": "x86 assembler rejects unchanged AArch64 ds instructions at src/omega_blackwell_engine.c:393 and :558; Makefile:40", + "suite_status": "NOT_RUN because build fails" + } + }, + "independent_review": { + "scope": "Read-only source review, independent projected-unit runs and original/projected compiles, source mutants and synthetic runner-failure matrix. No native ELF or GPU execution.", + "result": "No blocking behavioral defect found. Reviewer identified missing retained branch/offset controls; these were then added without changing branch assertion codes, and the author reran final units, compiles, source mutants and shell controls.", + "snapshot_note": "Final branch/offset-control extraction is an author-verified response to the review, not a second independent whole-diff approval." + }, + "limits": [ + "Native AArch64 execution, full real runner and its nvdisasm stage NOT_RUN in this repair session.", + "Full host suite NOT_RUN after the architecture-specific build failure. No GPU execution, scheduling, launch, clock, store or overhead qualification.", + "No claim that these bounded assertions replace every operand property of the historical whole-listing comparison.", + "No trusted crumb executable or repository crumb.lock is available. Targeted crumb compile/verify NOT_RUN. tests/device-trace/.crumb generated data is not refreshed and is expected stale; no generated fields hand-edited and root crumb untouched.", + "No public claim, comment, push, PR, merge, installation, settings or deployment." + ], + "wolfram_modeled": [ + { + "query": "Table[{o,Which[o==12,2,o>=16,10+(o-16)/4,True,6]},{o,0,28,4}]", + "result": "{{0,6},{4,6},{8,6},{12,2},{16,10},{20,11},{24,12},{28,13}}", + "units": "record byte offset to source register number" + }, + { + "query": "{16*21+2, Table[BitAnd[BitShiftRight[BitOr[2375,BitShiftLeft[18,18]],8 i],255],{i,0,3}]}", + "result": "{338,{71,9,72,0}}", + "units": "second branch mutation byte index; original little-endian opcode word bytes" + } + ], + "local_log_sha256": { + "baseline-make-test.log": "4d17078ded478a8537fa945eaccb6d744dd7fda6d11a054ab32b4521ecdc7433", + "final-make-test.log": "067fff5896ec353ecfa1a43f5d12c6484475bcbe3d7651f8bc9adb6d4e1fb6c8", + "red-runner.log": "6be68a50014962c89ea395d07e78ab0d7d124cf4346a86bc535e7260c493b77c", + "final-runner.log": "a74a78599c4e2bb4c1230a1b1f08c962e49644ce9d0cf431ad956b070fd57165", + "final-results.json": "aa2574d3f14589f030bf98175fa67de58f188fdb8d3f99b4475b47ec732fe4c6", + "source-mutation-results.json": "ca856872247abc545b712200e539853431490c5b6fcb9ef85d72227f3caccf05" + } +} diff --git a/evidence/device-trace/checker-coverage-rebase-20261027/receipt.json b/evidence/device-trace/checker-coverage-rebase-20261027/receipt.json new file mode 100644 index 00000000..d181517f --- /dev/null +++ b/evidence/device-trace/checker-coverage-rebase-20261027/receipt.json @@ -0,0 +1,169 @@ +{ + "schema": "cudapp.device-trace.checker-coverage-rebase.v1", + "date_utc": "2026-10-27", + "status": "HOST_REFERENCE_AND_SYNTHETIC_ORCHESTRATION_PASS; NATIVE_AND_GPU_NOT_RUN", + "base_commit": "67f3135ef88d8f520dfc15a2b2bc3264f53f0d6a", + "source_commit": "679902827fa01b63fdb1288cf340f1e486437aa4", + "tested_tip_before_this_receipt": "96b92400bbc3c496da0ede8883d48333b88c0d84", + "platform": "Linux x86_64", + "prior_receipt": { + "path": "evidence/device-trace/checker-coverage-host-20261027/receipt.json", + "sha256": "e08d62d2f9f64a03563682327f6656037fb6df8e40014f6b343559a62d442d60", + "disposition": "Preserved unchanged as local pre-rebase history. Its old local source pin81f74bb is superseded for publication identity by6799028; the four changed test-file blobs are identical." + }, + "scope_check": "git diff bba6da8 67f3135 -- AGENTS.md tests/device-trace native/blackwell/trace-emit.om native/blackwell/vector.om src/omega_blackwell_codegen.c is empty. No scoped implementation/test inputs changed across the rebase.", + "source_sha256": { + "tests/device-trace/address-test.om": "658d551fbe85a161a11b0971873930677ab5fd79fd985b761a8ba7ed43ec8370", + "tests/device-trace/run-emitter-checks.sh": "9713639a136b670ac09d1e7cb15b80292068554d7a5e2649c173285a156bb8f1", + "tests/device-trace/run-runner-controls.sh": "203bb36dcea10fed641e16d1cda361116e7c00b08c9d4d43dce7fed478febabe", + "tests/device-trace/README-safety.md": "dcd14ab49e847ffe52a974c225fa1d19f5e097773e5ae69ed128e09ea758e08c" + }, + "focused_commands": [ + "omega_ref check unit.projected.om", + "omega_ref run unit.projected.om", + "omega_ref run omc.om < unit.om > original.elf", + "omega_ref run omc.om < unit.projected.om > projected.elf", + "cmp original.elf projected.elf", + "sh tests/device-trace/run-runner-controls.sh", + "sh -n tests/device-trace/run-emitter-checks.sh tests/device-trace/run-runner-controls.sh", + "git diff --check 67f3135 HEAD" + ], + "oracle_and_projection": "Same frozen source, rebuilt referee binary, compiler source, independently expected self-output hash and literal-constant projection documented in the prior receipt. All generated ELFs remain unexecuted AArch64 outputs.", + "fresh_units": [ + { + "test": "emitter", + "check_exit": 0, + "run_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true, + "elf_sha256": "dc5773073ff4dbcd4895df0db0557470461af802526d1e5e5f4147e093d1304b", + "stderr_empty": true + }, + { + "test": "address", + "check_exit": 0, + "run_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true, + "elf_sha256": "8bc11f9ec2253cdc3d9959e67a6b032d98e1340f7fefb83031a0b2a4b3b4d7dc", + "stderr_empty": true + }, + { + "test": "guard", + "check_exit": 0, + "run_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true, + "elf_sha256": "68423524f52c03da9916749b4d78c24995983dbb818ddc56bd0a7c1c23a588d9", + "stderr_empty": true + }, + { + "test": "body", + "check_exit": 0, + "run_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true, + "elf_sha256": "a793ed62dc31e333682167bb0f2020062d84900479e0d9d883b7eaa8de499fe9", + "stderr_empty": true + } + ], + "fresh_source_mutants": [ + { + "name": "timer_source", + "test": "address", + "expected_run_exit": 3, + "run_exit": 3, + "check_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true + }, + { + "name": "timestamp_source", + "test": "address", + "expected_run_exit": 3, + "run_exit": 3, + "check_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true + }, + { + "name": "store_offset", + "test": "address", + "expected_run_exit": 3, + "run_exit": 3, + "check_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true + }, + { + "name": "second_branch", + "test": "address", + "expected_run_exit": 8, + "run_exit": 8, + "check_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true + }, + { + "name": "noncanonical_guard", + "test": "guard", + "expected_run_exit": 1, + "run_exit": 1, + "check_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true + }, + { + "name": "body_refusal", + "test": "body", + "expected_run_exit": 1, + "run_exit": 1, + "check_exit": 0, + "original_compile_exit": 0, + "projected_compile_exit": 0, + "identical_elf": true + } + ], + "runner_controls": { + "exit": 0, + "stdout": "RUNNER ORCHESTRATION CONTROLS PASS (synthetic tools; no native or GPU execution)", + "scope": "Synthetic compiler programs and deliberately synthetic decode rows, not native compilation or instruction decoding." + }, + "independent_final_review": { + "source_commit": "679902827fa01b63fdb1288cf340f1e486437aa4", + "result": "No blocking behavioral defect. The prior retained-control gap is closed.", + "reproduced": "All four projected units check/run0 with empty stderr; original/projected compiler outputs identical; shell syntax, whitespace and synthetic runner controls pass. Timer/timestamp/offset source mutants reject3; second branch rejects8.", + "extra_controls": "Replacing abranch by ret0 fails15; making the branch mutation a no-op fails15; making the offset mutation a no-op fails16.", + "boundary": "Read-only reviewer; native ELF, real decoder and GPU NOT_RUN." + }, + "full_suite": { + "command": "make test", + "exit": 2, + "failure": "Existing x86 assembler refusal of AArch64 ds instructions at src/omega_blackwell_engine.c:393/:558, Makefile:40. The full host suite did not run locally." + }, + "crumb": { + "status": "NOT_RUN", + "reason": "No trusted crumb executable is on PATH or in the inspected workspace, and CUDApp has no crumb.lock. No candidate-chosen replacement tool was built. The targeted generated block remains unchanged and unrefreshed; root crumbs untouched." + }, + "limits": [ + "Native AArch64 execution of the changed units and full real runner NOT_RUN locally.", + "New main has ARM64 make-test CI, but the device-trace Omega units are still outside HOST_TESTS. CI cannot substitute for their native run.", + "GB10 execution, scheduling, clock/store qualification, launch integration and overhead NOT_RUN.", + "No emitter, C, driver, Makefile, workflow, admission, licence or trust-policy changes. No whole-listing-equivalence claim." + ], + "local_log_sha256": { + "mutations.log": "5a0664c77d01cdb48d248bc85d5f203ba3b6f1d9496b58b1825b8c6c78aa6806", + "units.log": "52dc316d0c572e5ce0a480dc27607fbe6d55db392cff08a3606a894dfe7ee0dc", + "runner.log": "a74a78599c4e2bb4c1230a1b1f08c962e49644ce9d0cf431ad956b070fd57165", + "make-test.log": "067fff5896ec353ecfa1a43f5d12c6484475bcbe3d7651f8bc9adb6d4e1fb6c8" + } +} diff --git a/tests/device-trace/README-safety.md b/tests/device-trace/README-safety.md index 50011766..3103be80 100644 --- a/tests/device-trace/README-safety.md +++ b/tests/device-trace/README-safety.md @@ -23,7 +23,10 @@ and instruction-alignment checks. Disabled capacity zero is still refused. - `address-test.om` decodes the address pair and models each store's effective address inside a guarded capture extent. It checks ordinary and low-half-carry cases, untouched header/reserved bytes/canaries, signed 24-bit store offsets, - and the branch predicate and complete relative displacement. It does not use + the branch predicate and complete relative displacement, the GLOBALTIMERLO + source and R2 destination, and each record field's store-source register. + Its in-test timer and register mutations must be refused after each field is + changed, and the original bytes are restored. It does not use the nvdisasm decode or the emitter's address helpers as its oracle. This limited arithmetic model does not validate GPU instruction scheduling or scoreboards. - `guard-test.om` exercises enable/check values 0, 1, 2 and maximum unsigned @@ -57,15 +60,27 @@ done All four units must exit zero. The original emitter test prints its individual checks. The three new tests are silent on success and return a named assertion -status in their source on failure. These tests are not yet integrated into -`make test` or the historical disassembler runner. +status in their source on failure. `run-emitter-checks.sh` now compiles and runs +all four units before its external decode check. A failed compile, nonempty +compiler stderr or failing unit stops the runner before any later stage. +These units are still not integrated into `make test`. + +The runner's shell control flow can be checked without a compiler or GPU: + +```sh +sh tests/device-trace/run-runner-controls.sh +``` + +That check uses synthetic compiler programs and decode rows. It checks unit +composition and failure propagation only; it is not native Omega execution, +an instruction decoder or evidence that the emitter's instruction words work. ## Disassembler check (replaces the historical golden) The historical `expected.sass` described the original PR84 head `60d6c57fc6821accce0027d65dd239355beeb543`, including the erroneous -multiply-based address formation, and was itself an NVIDIA-tool listing, which -`AGENTS.md` forbids in the repository. It is removed. `run-emitter-checks.sh` +multiply-based address formation, and was itself an NVIDIA-tool listing. +PR #93 removed it. `run-emitter-checks.sh` now keeps the nvdisasm listing in its temporary directory and checks it against hand-written expectations: the opcode counts of the two 20-instruction marker blocks and the address-formation lines (`MOV R6, 0x40` / `0x80`, then diff --git a/tests/device-trace/address-test.om b/tests/device-trace/address-test.om index 82cd433d..7c9569d4 100644 --- a/tests/device-trace/address-test.om +++ b/tests/device-trace/address-test.om @@ -3,6 +3,11 @@ note Host-only semantic regression, not a GPU emulator or hardware receipt. note Compose after trace-emit.om. Decode the two address instructions independently of note the emitter helpers/golden, then model each STG effective address in a guarded extent. note Restoring the original base-low multiplication must fail, even if a golden is updated. +note Field formats: src/omega_blackwell_codegen.c BW_IR_S2R/BW_IR_STG_E at +note bba6da8045ba5baaf0a81f7152af44d52e24f563, the existing frozen reference. +note Selector 82 is class B: nvdisasm 13.0 decoded our own PR84 words as GLOBALTIMERLO. +note Historical tool receipt: evidence/device-trace/emitter-host-20261026/receipt.json. +note These field checks are host models; chip qualification remains NOT_RUN. global Aregs ulong 256 global Amem uchar 256 @@ -53,6 +58,22 @@ off = and shr off 8 16777215 if ge off 8388608 ret false end +note Contract v1 fields at offsets 0/4/8 use R6; stamp uses R2; IDs use R10:R13. +note Decode the low byte of word 1 independently of gtstg (frozen C encoder BW_IR_STG_E). +if or gt off 28 ne rem off 4 0 +ret false +end +want = ulong 6 +if eq off 12 +want = ulong 2 +end +if ge off 16 +want = add ulong 10 div sub off 16 4 +end +val = and aword add p 4 255 +if ne val want +ret false +end dst = get Aregs breg dst = or dst shl get Aregs add breg 1 32 dst = add dst off @@ -70,6 +91,19 @@ ret true end fn amark start ulong base ulong want ulong to bool +note S2R fields from frozen C encoder BW_IR_S2R; no producer constants or helpers used. +note Register 82 is GLOBALTIMERLO, as independently decoded in the historical host receipt. +clock = aword add start 48 +if ne and clock 65535 31001 +ret false +end +if ne and shr clock 16 255 2 +ret false +end +clock = aword add start 56 +if ne and shr clock 8 255 82 +ret false +end for i ulong 256 put Aregs i 0 end @@ -128,6 +162,42 @@ end ret true end +fn abranch p ulong to int +note Predicate-insensitive branch opcode, @P0, rel18: index1 +1 +18 =20. +w = aword p +if ne and w 4095 2375 +ret 6 +end +if ne and shr w 12 15 0 +ret 7 +end +if ne shr w 18 18 +ret 8 +end +if ne aword add p 4 0 +ret 9 +end +if ne aword add p 8 58720256 +ret 10 +end +ret 0 +end + +fn aneg pos ulong value uchar to bool +note Test the model itself: a changed field must be refused, then restore the stream. +old = get gbout pos +put gbout pos value +ok = aextent 4096 4160 4224 +for i ulong 2 +rc = abranch add mul i 320 16 +if ne rc 0 +ok = false +end +end +put gbout pos old +ret not ok +end + fn main to int put gbinlen 0 0 put gtchecks 0 1 @@ -151,25 +221,50 @@ ok = aextent 4096 4160 4224 if not ok ret 5 end -note Predicate-insensitive branch opcode, @P0, rel18: index1 +1 +18 =20. for i ulong 2 p = add mul i 320 16 -w = aword p -if ne and w 4095 2375 -ret 6 +rc = abranch p +if ne rc 0 +ret rc end -if ne and shr w 12 15 0 -ret 7 end -if ne shr w 18 18 -ret 8 +note Each marker must sample GLOBALTIMERLO into R2, not thread identity or another register. +for i ulong 2 +start = mul i 320 +note Byte 18 changes the branch displacement; byte 309 is the last store offset. +ok = aneg add start 18 0 +if not ok +ret 15 end -if ne aword add p 4 0 -ret 9 +ok = aneg add start 309 60 +if not ok +ret 16 +end +ok = aneg add start 57 33 +if not ok +ret 11 +end +ok = aneg add start 50 0 +if not ok +ret 12 +end +note Every record field has a named source register, not just an in-bounds destination. +for j ulong 20 +p = add start mul j 16 +w = aword p +if eq and w 65535 31110 +old = get gbout add p 4 +ok = aneg add p 4 uchar xor old 1 +if not ok +ret 13 end -if ne aword add p 8 58720256 -ret 10 end end +end +note Negative controls restored all bytes and the positive stream remains valid. +ok = aextent 4096 4160 4224 +if not ok +ret 14 +end ret 0 end diff --git a/tests/device-trace/run-emitter-checks.sh b/tests/device-trace/run-emitter-checks.sh index 03effb62..9abad05a 100755 --- a/tests/device-trace/run-emitter-checks.sh +++ b/tests/device-trace/run-emitter-checks.sh @@ -2,7 +2,7 @@ # Offline checks for the device-side trace emitter (CUDApp #82 first slice). # # Two layers, deliberately separate: -# 1. tests/device-trace/emitter-test.om -- host checks compiled by the pinned seed compiler. +# 1. emitter/address/guard/body-test.om -- host checks compiled by the pinned seed compiler. # 2. nvdisasm 13.0 on the emitted words -- an outside oracle. It is not part of the # delivered closure and no GPU is touched; it only confirms that the emitted words # decode to the intended instructions. Its listing stays in the temporary work @@ -24,15 +24,44 @@ trap 'rm -rf -- "$work"' EXIT HUP INT TERM echo "compiler $(sha256sum "$compiler" | cut -d' ' -f1)" -# 1. host checks -cat "$root/native/blackwell/trace-emit.om" "$root/tests/device-trace/emitter-test.om" > "$work/test.om" -"$compiler" < "$work/test.om" > "$work/test.elf" -chmod +x "$work/test.elf" -"$work/test.elf" > "$work/test.out" -fails=$(awk '$2 == 1 { n++ } END { print n + 0 }' "$work/test.out") -checks=$(wc -l < "$work/test.out") -echo "host checks: $checks, failures: $fails" -[ "$fails" = 0 ] || { cat "$work/test.out" >&2; exit 1; } +compile_unit() { + src=$1 + out=$2 + if "$compiler" < "$src" > "$out.elf" 2> "$out.compile.stderr"; then + : + else + rc=$? + cat "$out.compile.stderr" >&2 + return "$rc" + fi + [ ! -s "$out.compile.stderr" ] || { cat "$out.compile.stderr" >&2; return 1; } + chmod +x "$out.elf" +} + +# 1. All semantic units must pass before any external decode is attempted. +for name in emitter address guard body; do + : > "$work/$name.om" + if [ "$name" = body ]; then + cat "$root/native/blackwell/vector.om" >> "$work/$name.om" + fi + cat "$root/native/blackwell/trace-emit.om" "$root/tests/device-trace/$name-test.om" >> "$work/$name.om" + compile_unit "$work/$name.om" "$work/$name" + if "$work/$name.elf" > "$work/$name.out"; then + : + else + rc=$? + cat "$work/$name.out" >&2 + echo "host unit $name failed: exit $rc" >&2 + exit "$rc" + fi + if [ "$name" = emitter ]; then + fails=$(awk '$2 == 1 { n++ } END { print n + 0 }' "$work/$name.out") + checks=$(wc -l < "$work/$name.out") + echo "host checks: $checks, failures: $fails" + [ "$fails" = 0 ] || { cat "$work/$name.out" >&2; exit 1; } + fi + echo "host unit $name: PASS" +done # 2. instruction decode of the two marker blocks (no kernel words between them) cat > "$work/dump.om" <<'EOF' @@ -55,8 +84,7 @@ ret 0 end EOF cat "$root/native/blackwell/trace-emit.om" "$work/dump.om" > "$work/dump_full.om" -"$compiler" < "$work/dump_full.om" > "$work/dump.elf" -chmod +x "$work/dump.elf" +compile_unit "$work/dump_full.om" "$work/dump" "$work/dump.elf" > "$work/words.bin" echo "words: $(wc -c < "$work/words.bin") bytes, $(( $(wc -c < "$work/words.bin") / 16 )) instructions" [ "$(wc -c < "$work/words.bin")" = 640 ] || { echo 'expected 40 instructions (640 bytes)' >&2; exit 1; } diff --git a/tests/device-trace/run-runner-controls.sh b/tests/device-trace/run-runner-controls.sh new file mode 100644 index 00000000..c3a8de05 --- /dev/null +++ b/tests/device-trace/run-runner-controls.sh @@ -0,0 +1,99 @@ +#!/bin/sh +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# Shell orchestration only: fake compiler programs and deliberately synthetic decode rows. +# This does not compile Omega, decode GPU bytes, open a GPU or establish native execution. +set -eu +root=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd) +work=$(mktemp -d "${TMPDIR:-/tmp}/cudapp-runner-controls.XXXXXX") +trap 'rm -rf -- "$work"' EXIT HUP INT TERM +mkdir "$work/bin" +export RUNNER_CONTROL_LOG="$work/calls" + +cat > "$work/bin/omc" <<'EOF' +#!/bin/sh +set -eu +src=$(cat) +case "$src" in + *'global Aregs ulong'*) unit=address ;; + *'fn gprepare to void'*) unit=guard ;; + *'fn ballflags to bool'*) + unit=body + case "$src" in *'fn gbvec to void'*) : ;; *) exit 32 ;; esac ;; + *'global Fails ulong'*) unit=emitter ;; + *) unit=dump ;; +esac +printf 'compile %s\n' "$unit" >> "$RUNNER_CONTROL_LOG" +if [ "${CONTROL_STDERR:-}" = "$unit" ]; then echo 'synthetic compiler diagnostic' >&2; fi +# Emit executable bytes even when the compiler later fails. They must not run. +printf '#!/bin/sh\nprintf "run %s\\n" >> "$RUNNER_CONTROL_LOG"\n' "$unit" +printf '[ "${CONTROL_FAIL:-}" != "%s" ] || exit 23\n' "$unit" +if [ "$unit" = dump ]; then + printf 'dd if=/dev/zero bs=640 count=1 2>/dev/null\n' +elif [ "$unit" = emitter ]; then + printf 'printf "1 0\\n"\n' +fi +if [ "${CONTROL_COMPILE_FAIL:-}" = "$unit" ]; then exit 24; fi +EOF +cat > "$work/bin/nvdisasm" <<'EOF' +#!/bin/sh +set -eu +echo decode >> "$RUNNER_CONTROL_LOG" +[ "${CONTROL_DECODE_FAIL:-0}" = 0 ] || exit 25 +# Only the runner's handwritten addressed expectations are meaningful here. +# Repeated ffff rows below are intentionally not a real instruction stream. +printf '%s\n' '/*0010*/ @P0 BRA 0x140 ;' '/*0070*/ MOV R6, 0x40 ;' \ + '/*0080*/ IMAD.WIDE.U32 R8, R6, 0x1, R4 ;' '/*01b0*/ MOV R6, 0x80 ;' \ + '/*01c0*/ IMAD.WIDE.U32 R8, R6, 0x1, R4 ;' +for pair in 'BRA 1' 'ISETP.GE.AND 2' 'LDC.64 6' 'LDCU.64 2' 'MOV 6' 'S2R 2' 'STG.E 16'; do + set -- $pair + n=$2 + while [ "$n" -gt 0 ]; do printf '/*ffff*/ %s ;\n' "$1"; n=$((n - 1)); done +done +EOF +chmod +x "$work/bin/omc" "$work/bin/nvdisasm" + +run_case() { + : > "$RUNNER_CONTROL_LOG" + rc=0 + OMEGA_COMPILER="$work/bin/omc" PATH="$work/bin:$PATH" \ + sh "$root/tests/device-trace/run-emitter-checks.sh" > "$work/out" 2> "$work/err" || rc=$? +} +fail() { echo "runner control FAIL: $*" >&2; cat "$work/out" "$work/err" >&2; exit 1; } + +run_case +[ "$rc" = 0 ] || fail 'positive shell orchestration' +for unit in emitter address guard body dump; do + grep -qx "compile $unit" "$RUNNER_CONTROL_LOG" || fail "missing compile $unit" + grep -qx "run $unit" "$RUNNER_CONTROL_LOG" || fail "missing run $unit" +done +grep -qx decode "$RUNNER_CONTROL_LOG" || fail 'missing decode' + +for unit in emitter address guard body; do + export CONTROL_FAIL="$unit" + run_case + [ "$rc" = 23 ] || fail "$unit failure was not propagated" + if grep -qx decode "$RUNNER_CONTROL_LOG"; then fail "decode ran after $unit failed"; fi +done +unset CONTROL_FAIL + +for unit in emitter address guard body dump; do + export CONTROL_COMPILE_FAIL="$unit" + run_case + [ "$rc" != 0 ] || fail "$unit compiler failure was accepted" + if grep -qx "run $unit" "$RUNNER_CONTROL_LOG"; then fail "$unit ran rejected compiler output"; fi +done +unset CONTROL_COMPILE_FAIL + +for unit in emitter address guard body dump; do + export CONTROL_STDERR="$unit" + run_case + [ "$rc" != 0 ] || fail "$unit compiler diagnostic was accepted" + if grep -qx "run $unit" "$RUNNER_CONTROL_LOG"; then fail "$unit ran with compiler diagnostics"; fi +done +unset CONTROL_STDERR + +export CONTROL_DECODE_FAIL=1 +run_case +[ "$rc" = 25 ] || fail 'decoder failure was not propagated' +unset CONTROL_DECODE_FAIL +echo 'RUNNER ORCHESTRATION CONTROLS PASS (synthetic tools; no native or GPU execution)' ```