From 61c7150dd608a2662a4992bfc395c3ed310a6c96 Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sat, 14 Nov 2026 02:08:37 -0400 Subject: [PATCH] tests: hrx-loom-jit-test reads launch geometry from the executable, where this line's materialize() returns it (engine#2404) AMD's materialize(context, ref, kernel, constants, launch) fills an out-parameter. This line's materialize(context, ref, constants) returns the geometry on KernelExecutable::launch. The test was adapted to the shorter call, but four sites kept asserting on local ggml_hrx_loom_jit_launch_config structs that nothing writes, so `workgroup_count[0] > 0` could not hold whatever the kernel did. They now read executable->launch, and the dead locals are gone. On the device, materialize's first sub-case now passes. The case still fails, next at :454: this line's KernelExecutableCache does not share a Dynamic-workload executable (AMD's does); that is tracked on engine#2404 and is not a test change. Co-Authored-By: Claude Opus 5.5 --- tests/hrx-loom-jit-test.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tests/hrx-loom-jit-test.cpp b/tests/hrx-loom-jit-test.cpp index fcbb81ae56d1..c0ebf3af3e89 100644 --- a/tests/hrx-loom-jit-test.cpp +++ b/tests/hrx-loom-jit-test.cpp @@ -401,7 +401,6 @@ static void run_cache_materialize_case(HrxTestDevice & devic ggml::hrx::Dispatch dispatch = make_binary_add_dispatch(binary, 64); std::vector constants; - ggml_hrx_loom_jit_launch_config launch; ggml::hrx::KernelExecutableCache cache(mode); ggml::hrx::KernelExecutableRef ref = cache.get_or_compile(context, binary, dispatch, constants); @@ -413,15 +412,15 @@ static void run_cache_materialize_case(HrxTestDevice & devic REQUIRE(executable->executable != nullptr); REQUIRE(executable->export_info.binding_count == dispatch.bindings.size()); REQUIRE(executable->export_info.constant_byte_length == constants.size()); - REQUIRE(launch.workgroup_count[0] > 0); - REQUIRE(launch.workgroup_size[0] > 0); + // engine#2404: this line's materialize() returns the launch geometry on the executable, not in an out-parameter + REQUIRE(executable->launch.workgroup_count[0] > 0); + REQUIRE(executable->launch.workgroup_size[0] > 0); std::shared_ptr loaded_hit = cache.materialize(context, ref, constants); REQUIRE(loaded_hit == executable); std::vector constants_for_prepare; - ggml_hrx_loom_jit_launch_config launch_for_prepare; std::shared_ptr prepared = cache.prepare(context, binary, dispatch, constants_for_prepare); REQUIRE(prepared == executable); @@ -448,8 +447,6 @@ static void run_dynamic_cache_materialize_case(HrxTestDevice & ggml::hrx::KernelExecutableCache cache(mode); std::vector first_constants; std::vector second_constants; - ggml_hrx_loom_jit_launch_config first_launch; - ggml_hrx_loom_jit_launch_config second_launch; ggml::hrx::KernelExecutableRef first_ref = cache.get_or_compile(context, binary, first, first_constants); ggml::hrx::KernelExecutableRef second_ref = cache.get_or_compile(context, binary, second, second_constants); REQUIRE(first_ref.valid()); @@ -462,8 +459,8 @@ static void run_dynamic_cache_materialize_case(HrxTestDevice & cache.materialize(context, second_ref, second_constants); REQUIRE(first_executable != nullptr); REQUIRE(second_executable == first_executable); - REQUIRE(first_launch.workgroup_count[0] == 1); - REQUIRE(second_launch.workgroup_count[0] == 2); + REQUIRE(first_executable->launch.workgroup_count[0] == 1); + REQUIRE(second_executable->launch.workgroup_count[0] == 2); REQUIRE(first_constants.size() == second_constants.size()); REQUIRE(first_constants != second_constants); @@ -507,16 +504,14 @@ static void run_dynamic_export_reuse_case( REQUIRE(second_ref.valid()); REQUIRE(first_ref.entry == second_ref.entry); - ggml_hrx_loom_jit_launch_config first_launch; - ggml_hrx_loom_jit_launch_config second_launch; std::shared_ptr first_executable = cache.materialize(context, first_ref, first_constants); std::shared_ptr second_executable = cache.materialize(context, second_ref, second_constants); REQUIRE(first_executable != nullptr); REQUIRE(second_executable == first_executable); - REQUIRE(first_launch.workgroup_count[0] > 0); - REQUIRE(second_launch.workgroup_count[0] > 0); + REQUIRE(first_executable->launch.workgroup_count[0] > 0); + REQUIRE(second_executable->launch.workgroup_count[0] > 0); REQUIRE(first_constants.size() == second_constants.size()); REQUIRE(first_constants != second_constants); std::printf("dynamic executable reuse materialized %s for two workloads\n", kernel_name); @@ -544,12 +539,11 @@ static void run_targeted_export_materialize_case(HrxTestDevice & device) { ggml::hrx::KernelExecutableCache cache(ggml::hrx::LoomJitMode::Sync); std::vector constants; - ggml_hrx_loom_jit_launch_config launch; std::shared_ptr executable = cache.prepare(context, *definition, dispatch, constants); REQUIRE(executable != nullptr); REQUIRE(executable->executable != nullptr); - REQUIRE(launch.workgroup_count[0] == 151936); + REQUIRE(executable->launch.workgroup_count[0] == 151936); std::printf("KernelExecutableCache materialized targeted %s as export %s for %s\n", definition->symbol, definition->name, device.architecture.c_str()); }