Skip to content

Instantly share code, notes, and snippets.

@Noerr
Noerr / chipstar_rtc_cache_repro.cpp
Created April 29, 2026 18:00
ChipStar issue #1246 reproducer: hipRTC cache returns empty mangled name on cache hit
// Single-file reproducer for the ChipStar hipRTC cache bug.
//
// Bug summary: when CHIP_MODULE_CACHE_DIR is enabled and a previously-cached
// SPIR-V is loaded, hiprtcCompileProgram() returns HIPRTC_SUCCESS without
// running the LLVM HipEmitLoweredNames pass, so the program's
// name-expression -> lowered-name map stays empty. hiprtcGetLoweredName()
// then returns a pointer to an empty string, and the caller's downstream
// hipModuleGetFunction("") fails with hipErrorLaunchFailure.
//
// Run twice with a fresh CHIP_MODULE_CACHE_DIR: