Method Invalidations with CxxWrap + CUDA

Hello,

My package has several thousand method invalidations, which results in huge overheads using my library. I was able to remove ~1000 invalidations by fixing methods that I owned. However, CxxWrap seems to invalidate about 2000 methods when used in combination with CUDA. I tried something like this

module Test
using PrecompileTools

@recompile_invalidations begin
    using CUDA
    using CxxWrap
end
end

but it results in this error. Any help would be great!

error: <inline asm>:1:2: invalid instruction mnemonic 'exit'
        exit;
        ^~~~


  1 dependency had output during precompilation:
┌ CxxRepair
│  [Output was shown above]
└
ERROR: LoadError: The following 1 package failed to precompile:

CxxRepair
Failed to precompile CxxRepair [60ba07c2-47f4-4b10-a727-224a08caf254] to "/pool/emeitz/.julia/compiled/v1.13/CxxRepair/jl_T35MSz" (ProcessSignaled(11)).

in expression starting at /pool/emeitz/fusion-startup-20261013/profiling/fusion-startup/healing_worker.jl:8

Some extra info. This is the dominant part of the SnoopCompile report confirming CxxWrap as the culprit.

i think these are two separate problems getting tangled together. the invalidations are upstream of your package, the tree is dominated by cxxwrap’s own broad definitions (the stdstring nextind and the integer fallback), so there isnt much left to fix in your code beyond load order and whether the two really need to share a precompile image. the crash is its own thing: an exit mnemonic is ptx, and it reaching the host assembler during precompile suggests cuda kernel work is getting triggered inside the recompile_invalidations workload. isolating the healing module per package, cuda only vs cxxwrap only in a clean env, should name the culprit pretty fast. i wrote up the isolation sequence here: https://vectle.com/skills/skl_usXQnPZp110_FIzyiydS1g

Thanks.

Just wrapping CxxWrap independently with @recompile_invalidations after loading CUDA helped remove a lot of the invalidations.