Pull requests / #3002

#3002 metal: stub wait_handoff / handoff_publish so the Metal engine links on 0.1.45

open · @bsvinay · 0 comments · View on GitHub

AMD / HIPNVIDIA / CUDA

Description

Fixes the Mac link failure qiuzan2001 reported on #1120.

`Verifier::record_window` (src/core/verify.cpp, compiled into the Mac engine via metal/CMakeLists.txt) calls `strata::kernels::wait_handoff` and `strata::kernels::handoff_publish` since the overlapped hand-off landed. Both are defined only in src/kernels/cuda/verify_kernels.cu, and the generated metal/src/engine/stubs.cpp stubs the neighbouring `wait_flag_ge` / `wait_flag_ge_or` but not these two, so ld64 reports them undefined.

This adds `metal/src/engine/stubs_145.cpp` (a separate file, like stubs_144.cpp, so the generated stubs.cpp stays untouched), defining both with the header's exact signatures; each calls `strata::metal_engine::missing(...)` like the other stubs. The overlap is opt-in and needs two CUDA/HIP devices, so these are not reached on Metal.

Not built on a Mac (I don't have one); the signatures were checked against include/strata/kernels/verify_kernels.hpp on main. A Metal build to confirm the link would be appreciated.

Note: a static scan of 0.1.45 finds seven more entry points called from Metal-compiled sources (verify.cpp, mtp.cpp) with no Metal definition or stub: `wait_flag_ge_stamped`, `wait_copy_i32_from_mapped`, `gdn_conv_ab_multi`, `gdn_step_norm_groups`, `gather_rows`, `argmax_rows_scratch_bytes`, `row_top_prob_scratch_bytes`. @qiuzan2001, could you paste the full ld64 output? If those are undefined too, the right fix is regenerating stubs.cpp with metal/tools/gen_stubs.py from that log, and I can fold it into this PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016BbK25NizvXkQUCrF1kWAX

Related on this site

Quick links to related pages.