From 25aa74a0b6cf963b6087390bd9eacc32f10f41b1 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Wed, 28 Oct 2026 21:07:51 -0500 Subject: [PATCH] fix: create the standalone QMD test output directory Add the existing output-directory rule as an order-only prerequisite. Keep a host-only clean-directory regression in HOST_TESTS, with failure propagation, temporary cleanup and recursive make dry-run semantics. No QMD implementation, C test assertion, API or hardware change. Host-only source-bounded receipt and independent review are included. --- Makefile | 12 ++- evidence/QMD-CLEAN-OUTPUT-20261029/README.md | 74 +++++++++++++++++++ .../QMD-CLEAN-OUTPUT-20261029/host-checks.log | 71 ++++++++++++++++++ 3 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 evidence/QMD-CLEAN-OUTPUT-20261029/README.md create mode 100644 evidence/QMD-CLEAN-OUTPUT-20261029/host-checks.log diff --git a/Makefile b/Makefile index 6605d6a5..609a004a 100644 --- a/Makefile +++ b/Makefile @@ -328,13 +328,19 @@ $(GPU_L2_REUSE_TEST): tests/gpu_l2_reuse_test.c src/omega_gpu_fp8_api.h src/omeg # The Blackwell QMD shared-memory field (word 36): the encoding of every size, the fixed SM-config # fields beside it, and the refusal one byte over OMEGA_BW_QMD_MAX_SHARED_BYTES (a host check, no GPU). -.PHONY: test-gpu-qmd-shared +.PHONY: test-gpu-qmd-shared test-gpu-qmd-shared-clean-build QMD_SHARED_TEST = $(OUT_DIR)/test_omega_bw_qmd_shared -$(QMD_SHARED_TEST): tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.h src/omega_blackwell_qmd.c +$(QMD_SHARED_TEST): tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.h src/omega_blackwell_qmd.c | $(OUT_DIR) $(CC) $(CFLAGS) -o $@ tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.c test-gpu-qmd-shared: $(QMD_SHARED_TEST) $(QMD_SHARED_TEST) +# Build the same host-only test with an output directory that does not exist yet. +# The normal test target does not recurse through this regression target. +test-gpu-qmd-shared-clean-build: + +@set -eu; out=$$(mktemp -d); trap 'rm -rf "$$out"' EXIT; \ + $(MAKE) --no-print-directory OUT_DIR="$$out/new" test-gpu-qmd-shared + # Every host-only check: no GPU, no device opened. The chip gates are listed in README.md. HOST_TESTS = test-drift test-gpu-matmul-api test-gpu-elementwise test-gpu-reconv test-gpu-attention test-gpu-moe-window \ test-gpu-fp8 test-gpu-decode-attn test-gpu-router test-gpu-bf16-gemv test-gpu-fp8gemm test-gpu-tern-sched test-gpu-gpr-boundary \ @@ -344,7 +350,7 @@ HOST_TESTS = test-drift test-gpu-matmul-api test-gpu-elementwise test-gpu-reconv test-codegen-freestanding test-gpu-session-platform test-gpu-native-runtime test-gpu-wait test-gpu-wait-mutants host-tests-m16 \ test-runtime-api test-runtime-portability test-doctor test-hello-sim test-native-artifact-manifest test-gemm-selectors \ test-native-artifact zero-cuda-gate verify-vendored test-swap-cli test-om-encoder test-om-spec-encoder test-om-cubin \ - test-portable-receipts test-gpu-qmd-shared $(CARRIED_HOST_TESTS) + test-portable-receipts test-gpu-qmd-shared test-gpu-qmd-shared-clean-build $(CARRIED_HOST_TESTS) test: $(HOST_TESTS) @echo "CUDA++ HOST TESTS PASS ($(words $(HOST_TESTS)) targets)" diff --git a/evidence/QMD-CLEAN-OUTPUT-20261029/README.md b/evidence/QMD-CLEAN-OUTPUT-20261029/README.md new file mode 100644 index 00000000..f7fef2a5 --- /dev/null +++ b/evidence/QMD-CLEAN-OUTPUT-20261029/README.md @@ -0,0 +1,74 @@ +# QMD standalone clean-output build repair + +## Scope and identity + +This is a host-only build-rule follow-up to CUDApp #178. +The production QMD builder, its shared-memory cap, existing C test assertions, +public APIs and historical receipts are unchanged. + +Base: `b348277e4383ab1f37f45bb702ea7d4fb4363782`. +The tested replacement Makefile has Git blob +`609a004ab095dec51a7d5ef1d319d07a30425976` and SHA-256 +`105e81766f32584be8d8730d3b7e54a0132bdad1828248d64519736383ef7203`. + +Local validation used a source-bounded fixture, not a full repository checkout: +the exact Makefile, all mk/ include files, and these unchanged source blobs +were fetched from the base and their Git blob identities checked. + +- `src/omega_blackwell_qmd.c`: `dd13ec5a2c0d712627240afa8b1151e45643cd06` +- `src/omega_blackwell_qmd.h`: `1d56f1a9198ee0e7f8d18f2712207b7a6c37b21a` +- `tests/test_omega_bw_qmd_shared.c`: `ea877dbe92010691daed3ea4ffa2dd31e9700ffb` + +Machine: Linux x86_64. Measured tool versions: GNU Make 4.4.1, +GCC 14.2.0, Python 3.12.14. + +## Defect and repair + +The standalone test target did not depend on its output directory. +With an absent OUT_DIR, compilation failed while opening the dependency file. +Other host targets could create the directory first and hide this defect. + +The repair adds the existing OUT_DIR rule as an order-only prerequisite. +The retained `test-gpu-qmd-shared-clean-build` regression creates a temporary +parent, leaves its child output directory absent, and invokes the ordinary +host-only QMD test target with that child as OUT_DIR. It is in HOST_TESTS. +The recipe propagates failures and removes its own temporary directory. + +## Measured host outcomes + +Commands and captured output are in `host-checks.log`. + +- Same regression with only the directory prerequisite removed in a separate + copied fixture: expected exit 2, missing output-directory error. +- `make test-gpu-qmd-shared-clean-build`: exit 0, + `qmd shared: 112 checks, 0 failed: PASS`. +- `make -j4 test-gpu-qmd-shared-clean-build`: the same PASS, no jobserver warning. +- Direct `make OUT_DIR= test-gpu-qmd-shared`: the same PASS. +- `CC=false`: expected exit 2. The temporary directory was removed. +- A missing TMPDIR: expected exit 2 before compilation. +- `make -n test-gpu-qmd-shared-clean-build`: exit 0, commands printed, + no QMD binary executed. The temporary directory was removed. +- `git diff --check`: exit 0. +- A separate reviewer independently reproduced the fresh-output, parallel, + removed-prerequisite, compiler-failure, cleanup and dry-run controls. + No remaining finding in the final Makefile blob above. + +The negative control must use a separate fixture's default Makefile: changing +only a `make -f` parent would leave the recursive make reading the original file. + +The initial review found that directly executing the binary outside recursive +make broke dry-run behavior. The final recipe invokes the ordinary test target, +so recursive make carries the dry-run flag through both build and execution. + +## Verification boundary + +Full `make test`, complete library build, native-artifact and zero-CUDA gates +were NOT_RUN locally in this source-bounded fixture. The draft PR's exact-head +ARM64 CI is the full-repository gate; its result is reported separately. +No simulator result or physical GPU result is claimed by this receipt. +No device, driver, live service, installation or deployment was touched. +No existing receipt was edited. + +The repository publication scanner's self-test passed: measured output +`SELFTEST PASS: planted 17 ... found 17; binary listed`. +The changed-file publication scan is recorded in the pull request. diff --git a/evidence/QMD-CLEAN-OUTPUT-20261029/host-checks.log b/evidence/QMD-CLEAN-OUTPUT-20261029/host-checks.log new file mode 100644 index 00000000..5dd6bd94 --- /dev/null +++ b/evidence/QMD-CLEAN-OUTPUT-20261029/host-checks.log @@ -0,0 +1,71 @@ +## Same regression, missing prerequisite: expected failure +$ make --no-print-directory test-gpu-qmd-shared-clean-build +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I./m16 -I./nvrm -I./third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I./third_party/nvidia-open-580.173.02/kernel-open/common/inc -I./third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I./third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -o /tmp/tmp.vlg5GHBeNs/new/test_omega_bw_qmd_shared tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.c +tests/test_omega_bw_qmd_shared.c:80:1: fatal error: opening dependency file /tmp/tmp.vlg5GHBeNs/new/test_omega_bw_qmd_shared.d: No such file or directory + 80 | } + | ^ +compilation terminated. +src/omega_blackwell_qmd.c:238:1: fatal error: opening dependency file /tmp/tmp.vlg5GHBeNs/new/test_omega_bw_qmd_shared.d: No such file or directory + 238 | } + | ^ +compilation terminated. +make[1]: *** [Makefile:334: /tmp/tmp.vlg5GHBeNs/new/test_omega_bw_qmd_shared] Error 1 +make: *** [Makefile:341: test-gpu-qmd-shared-clean-build] Error 2 +exit=2 + +## Serial regression +$ make --no-print-directory test-gpu-qmd-shared-clean-build +mkdir -p /tmp/cudapp-qmd-verify-6_c66ej5/tmp.IOaEFY16cI/new +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I./m16 -I./nvrm -I./third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I./third_party/nvidia-open-580.173.02/kernel-open/common/inc -I./third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I./third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -o /tmp/cudapp-qmd-verify-6_c66ej5/tmp.IOaEFY16cI/new/test_omega_bw_qmd_shared tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.c +/tmp/cudapp-qmd-verify-6_c66ej5/tmp.IOaEFY16cI/new/test_omega_bw_qmd_shared +word 36 default: shared7 8 min 9 max 26 target 9 +qmd shared: 112 checks, 0 failed: PASS +exit=0 + +## Parallel regression +$ make --no-print-directory -j4 test-gpu-qmd-shared-clean-build +mkdir -p /tmp/cudapp-qmd-verify-6_c66ej5/tmp.A9TZfZieIE/new +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I./m16 -I./nvrm -I./third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I./third_party/nvidia-open-580.173.02/kernel-open/common/inc -I./third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I./third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -o /tmp/cudapp-qmd-verify-6_c66ej5/tmp.A9TZfZieIE/new/test_omega_bw_qmd_shared tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.c +/tmp/cudapp-qmd-verify-6_c66ej5/tmp.A9TZfZieIE/new/test_omega_bw_qmd_shared +word 36 default: shared7 8 min 9 max 26 target 9 +qmd shared: 112 checks, 0 failed: PASS +exit=0 + +## Compiler failure propagates: expected failure +$ make --no-print-directory test-gpu-qmd-shared-clean-build CC=false +mkdir -p /tmp/cudapp-qmd-verify-6_c66ej5/tmp.HuuefpWIXC/new +false -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I./m16 -I./nvrm -I./third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I./third_party/nvidia-open-580.173.02/kernel-open/common/inc -I./third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I./third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -o /tmp/cudapp-qmd-verify-6_c66ej5/tmp.HuuefpWIXC/new/test_omega_bw_qmd_shared tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.c +make[1]: *** [Makefile:334: /tmp/cudapp-qmd-verify-6_c66ej5/tmp.HuuefpWIXC/new/test_omega_bw_qmd_shared] Error 1 +make: *** [Makefile:341: test-gpu-qmd-shared-clean-build] Error 2 +exit=2 + +## mktemp failure propagates: expected failure +$ make --no-print-directory test-gpu-qmd-shared-clean-build +make: TMPDIR value /tmp/cudapp-qmd-verify-6_c66ej5/missing: No such file or directory +make: using default temporary directory '/tmp' +mktemp: failed to create directory via template ‘/tmp/cudapp-qmd-verify-6_c66ej5/missing/tmp.XXXXXXXXXX’: No such file or directory +make: *** [Makefile:341: test-gpu-qmd-shared-clean-build] Error 1 +exit=2 + +## Dry-run without execution +$ make --no-print-directory -n test-gpu-qmd-shared-clean-build +set -eu; out=$(mktemp -d); trap 'rm -rf "$out"' EXIT; \ + make --no-print-directory OUT_DIR="$out/new" test-gpu-qmd-shared +mkdir -p /tmp/cudapp-qmd-verify-6_c66ej5/tmp.RqS6AOhSBq/new +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I./m16 -I./nvrm -I./third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I./third_party/nvidia-open-580.173.02/kernel-open/common/inc -I./third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I./third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -o /tmp/cudapp-qmd-verify-6_c66ej5/tmp.RqS6AOhSBq/new/test_omega_bw_qmd_shared tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.c +/tmp/cudapp-qmd-verify-6_c66ej5/tmp.RqS6AOhSBq/new/test_omega_bw_qmd_shared +exit=0 + +## Direct target with absent output directory +$ make --no-print-directory OUT_DIR=/tmp/cudapp-qmd-verify-6_c66ej5/direct test-gpu-qmd-shared +mkdir -p /tmp/cudapp-qmd-verify-6_c66ej5/direct +cc -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -I./m16 -I./nvrm -I./third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc -I./third_party/nvidia-open-580.173.02/kernel-open/common/inc -I./third_party/nvidia-open-580.173.02/kernel-open/nvidia-uvm -I./third_party/nvidia-open-580.173.02/src/nvidia/arch/nvalloc/unix/include -o /tmp/cudapp-qmd-verify-6_c66ej5/direct/test_omega_bw_qmd_shared tests/test_omega_bw_qmd_shared.c src/omega_blackwell_qmd.c +/tmp/cudapp-qmd-verify-6_c66ej5/direct/test_omega_bw_qmd_shared +word 36 default: shared7 8 min 9 max 26 target 9 +qmd shared: 112 checks, 0 failed: PASS +exit=0 + +## Diff whitespace +$ git diff --check +exit=0 +All expected outcomes and temporary cleanup controls verified.