diff --git a/Makefile b/Makefile index e3b39121..30e883d9 100644 --- a/Makefile +++ b/Makefile @@ -184,6 +184,7 @@ GPU_FP8_TEST = $(OUT_DIR)/gpu_fp8_api_test $(GPU_FP8_TEST): tests/gpu_fp8_api_test.c tests/bw_warp_sim.h src/omega_gpu_fp8_api.h src/omega_blackwell_codegen_moe.h $(OUT_DIR)/libomega_gpu.a $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_fp8_api_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm test-gpu-fp8: $(GPU_FP8_TEST) + sh tests/grid_ab_exit_test.sh ./$(GPU_FP8_TEST) ./$(GPU_FP8_TEST) --host-only ./$(GPU_FP8_TEST) --sim diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index b3575901..788f16e5 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -98,7 +98,7 @@ moves. All of it is seeded Omega except one migration-pending C launcher. |---|---|---| | Target table, one row per GPU family; `make doctor OMC=…` prints it | `backend/targets.om` (`targets doctor`) | IMPLEMENTED. GB10 (sm_121) SUPPORTED; every other GPU row PLANNED, hardware NOT_RUN; PoCL and lavapipe rows are HOST-ONLY (not a GPU) | | Code-object loader checks for `ob_code_load` | `backend/targets.om` (`targets load FORMAT FILE [ENTRY or gfx]`) | IMPLEMENTED: SPIR-V header, instruction stream, capability/addressing/memory model per environment, entry point; HSACO ELF64, HSA OSABI with code object v4/v5, EM_AMDGPU, e_flags mach, PT_NOTE NT_AMDGPU_METADATA msgpack (`amdhsa.target`, `amdhsa.version`, `amdhsa.kernels`); SM121_RAW shape. MSL_SOURCE and AARCH64 refused (PLANNED), CUBIN refused (reserved) | -| SPIR-V builder: FP32 vadd and FP32 16-term sum (`fsum16`), OpenCL and Vulkan forms, plus planted-wrong mutants | `backend/spirv/emit.om` | IMPLEMENTED; every module passes `spirv-val`. Hand-built words because omc IR mode has no floats yet (E3, omega-mv#883) | +| SPIR-V builder: FP32 vadd and FP32 16-term sum (`fsum16`), OpenCL and Vulkan forms, plus planted-wrong mutants | `backend/spirv/emit.om` | IMPLEMENTED; every module passes `spirv-val`. Hand-built words because the pinned seed omc IR mode lacks the needed floating-point operations. E3 (omega-mv#883) tracks OSC IRv7, a separate compiler path; it does not by itself enable this seed SPIR-V path | | Host reference and bit compare | `backend/spirv/conform.om` | IMPLEMENTED; vadd reference digest equals `hello_gpu --sim` output digest | | Launcher that hands a module to PoCL (CPU) or Mesa lavapipe (CPU) | `tools/multitarget/spirv-host.c` | migration-pending C, `CUDAPP_MIGRATION_PENDING_SPIRV_HOST` default OFF; reason: no checked shared-library call (E2, omega-mv#888); successors `backend/opencl/host.om`, `backend/vulkan/host.om` | | gfx1151 vadd code object | `backend/amd/vadd-gfx1151.s` | ORACLE fixture assembled by `llvm-mc` + `ld.lld` to test the loader (see §6); not a first-party encoder | diff --git a/evidence/GRID-AB-EXIT-20261027/README.md b/evidence/GRID-AB-EXIT-20261027/README.md new file mode 100644 index 00000000..c08a2870 --- /dev/null +++ b/evidence/GRID-AB-EXIT-20261027/README.md @@ -0,0 +1,30 @@ +# Grid A/B exit status repair + +Base: `5b91c6a66595a0d876831107d6a7c8a4872f7d54`. + +The caller discarded `grid_ab`'s return value. Invalid lists returned 2 +before any CHECK, but main printed PASS and exited 0. Main now closes the +session and preserves that nonzero status, without printing PASS. + +`sh tests/grid_ab_exit_test.sh ./build/gpu_fp8_api_test` checks empty, +malformed, single-arm and malformed-later-arm lists. These inputs return +before command-list creation. This regression runs in `make test` through +`test-gpu-fp8`. It never intentionally opens a device. + +Local x86_64 validation: + +- An isolated probe compiled the unchanged main dispatcher and grid parser + from the source, with nondelegating stubs for dependencies. Baseline + empty-list output was `0 checks, 0 failed: PASS`, exit 0. The regression + failed as expected. With the patched dispatcher all invalid-list cases + passed. This is dispatcher coverage, not execution of the full binary. +- `sh -n tests/grid_ab_exit_test.sh` and `git diff --check`: PASS. +- `make test`: exit 2. The unchanged AArch64 instructions in + `src/omega_blackwell_engine.c:393,558` fail on this x86_64 assembler + (`number of operands mismatch for ds`). Full local suite NOT_RUN past + that compile failure. ARM64 CI is required for the real binary. +- GPU execution, benchmark reruns, deployment and qualification: NOT_RUN. + +No kernel, runtime API or historical measurement changed. The separate +documentation correction distinguishes seed omc IR from OSC IRv7 as +specified in omega-mv issue 883; it does not upgrade either capability. diff --git a/tests/gpu_fp8_api_test.c b/tests/gpu_fp8_api_test.c index 21eb1adf..301437b3 100644 --- a/tests/gpu_fp8_api_test.c +++ b/tests/gpu_fp8_api_test.c @@ -1292,8 +1292,10 @@ int main(int argc, char **argv) { if (budget) omega_gpu_fp8_set_cta_budget(budget); if (depth_set) { omega_gpu_fp8_set_depth(1, depth); g_depth_forced = 1; } (void)omega_gpu_session_set_spin_us(spin); - if (grid_arms) grid_ab(grid_arms, reps ? reps : 1, seed); else chip_run(out_path, reps ? reps : 1); + int grid_rc = 0; + if (grid_arms) grid_rc = grid_ab(grid_arms, reps ? reps : 1, seed); else chip_run(out_path, reps ? reps : 1); omega_gpu_session_close(); + if (grid_rc) return grid_rc; } printf("gpu_fp8_api_test: %d checks, %d failed: %s\n", g_checks, g_failed, g_failed ? "FAIL" : "PASS"); return g_failed ? 1 : 0; diff --git a/tests/grid_ab_exit_test.sh b/tests/grid_ab_exit_test.sh new file mode 100644 index 00000000..9fd07f8b --- /dev/null +++ b/tests/grid_ab_exit_test.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# Invalid lists stop before command-list creation. No device is opened. +set -eu +binary=${1:?usage: grid_ab_exit_test.sh BINARY} +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT HUP INT TERM +for arms in '' 'bad' '0:0' '0:0,bad' '0:0x,0:0'; do + rc=0 + "$binary" --grid-ab "$arms" >"$tmp/output" 2>&1 || rc=$? + if [ "$rc" -ne 2 ]; then + cat "$tmp/output" + echo "FAIL: invalid grid list '$arms' returned $rc, expected 2" >&2 + exit 1 + fi + if grep -q ': PASS' "$tmp/output"; then + cat "$tmp/output" + echo 'FAIL: rejected grid list printed PASS' >&2 + exit 1 + fi +done +echo 'grid-ab invalid-list exit checks: PASS'