From be4e24d421a62a0df1bbf0ea7b41db2486c098fd Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Wed, 21 Oct 2026 02:57:22 +0200 Subject: [PATCH] Fix the gfx906 query-swizzle host guard test: the dispatch expression now spans two lines and reads kernel --- bench/test_gfx906_qsa_query_swizzle_guard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/test_gfx906_qsa_query_swizzle_guard.py b/bench/test_gfx906_qsa_query_swizzle_guard.py index 813ce7843..58be3deb8 100644 --- a/bench/test_gfx906_qsa_query_swizzle_guard.py +++ b/bench/test_gfx906_qsa_query_swizzle_guard.py @@ -18,7 +18,7 @@ source = (ROOT / "src/kernels/cuda/qsa_decode_attn.cu").read_text() start = source.index("bool query_swizzle_gfx906_device() {") end = source.index("\n}\n", start) + 3 guard = source[start:end] -dispatch = re.search(r"^ const bool use_query_swizzle = .*;", source, re.MULTILINE) +dispatch = re.search(r"^ const bool use_query_swizzle = [^;]*;", source, re.MULTILINE) if dispatch is None or "if (use_query_swizzle) {" not in source: raise RuntimeError("production query-swizzle dispatch changed; update the test") @@ -118,7 +118,7 @@ int main() { ''' program = prefix + guard + "\nbool active(bool query_swizzle, bool lane_cell, int kv_mode) {\n" -program += dispatch.group(0) + "\n return use_query_swizzle;\n}\n" + tests +program += " const int kernel = -1; // the environment's choice (launch_chunks_batch)\n" + dispatch.group(0) + "\n return use_query_swizzle;\n}\n" + tests with tempfile.TemporaryDirectory(prefix="qsa-swizzle-guard-") as directory: cpp = Path(directory) / "guard_test.cpp" binary = Path(directory) / "guard_test"