Repository navigation
Description
What happens
The internal ROCm capture guard rejects a raw Ptr, but accepts Val(pointer) and a closure carrying that value. Julia permits a pointer as a type parameter. The guard walks value fields, while Val{pointer} has no fields, so the captured pointer is never checked.
A closure can recover the exact pointer from its type parameter. It then has unowned storage with no verified context or lifetime, despite passing capture admission.
Reproduction
Host-only run on macOS arm64 with Julia 1.13.3 and pinned AMDGPU 2.11.0, against ROCm foundation commit 1a4d8aea80c0dd87dfc09ba5d5a052a64e2ec3d8:
import AMDGPU, SolpropJulia
E = Base.get_extension(SolpropJulia, :SolpropJuliaAMDGPUExt)
address = Ptr{Float32}(UInt(0x1000))
token = Val(address)
decode(::Val{P}) where {P} = P
body = let captured = token
(row, column) -> decode(captured)
end
E._rocm_capture(address, nothing) # throws ArgumentError
E._rocm_capture(token, nothing) # returns nothing
E._rocm_capture(body, nothing) # returns nothing
body(1, 1) === address # trueThese admission outcomes were reproduced with the actual extension. No pointer was dereferenced, no kernel was launched, and no HIP runtime was available or called. The ROCm stride follow-up does not modify this guard.
The current CUDA and Metal helpers use the same field-only pattern: that is source-read evidence, not an executed cross-vendor reproduction.
Context
- ROCm capture guard
- Refuse unowned raw pointer captures in the Julia CUDA foundation #730 concerns direct/nested CUDA raw pointer fields; this is the separate type-parameter path.
- WIP: SEP 48 — Julia execution backend #611 implements SEP 48.
- Qualify the Julia ROCm foundation and resolve its unfiltered JET reports #750 retains unrelated ROCm device/JET qualification requirements.
To do
- Reject pointer values retained in captured type parameters, including nested tuples/parameter records.
- Apply the same ownership rule consistently to each vendor guard without rejecting ordinary integer, floating-point, symbol or type metadata solely because it is parametrized.
- Add actual-extension host admission regressions and preserve valid scalar-record/owned-array capture tests.
- Keep initialized device execution and hardware qualification separate; this host check does not certify them.
Done when
The reproduced raw and parameter-hidden pointer cases both refuse before launch, valid non-pointer metadata remains admissible, and each changed vendor has focused host evidence. Record device checks actually run rather than converting hardware absence into a pass.
Activity
jtravs commentedon Nov 11, 2026
Independent follow-up reproduced the same admission gap using the actual CUDA and Metal extensions on the host, with 14 assertions per vendor. Their execution source bytes match the currently integrated versions:
dfa8f65603f488d5ccf6ed01bf599ed7377ba7c1, SHA256ef5deaf29286892257964f9241730387228ad9b00749f67ba32c0a99cbb41fb6.035ee5ac9ca3e4be1f25d833c0227765acc0ab97, SHA25624ad747baa1b112cd9a08a04b86ca578ee151021e48feaa71965406b5bc42430.The guards accept all five forms below (with ordinary
Ptr{Float32}), although direct raw-pointer capture refuses:A closure retaining
Val(address)also passes and recovers the original pointer from its parameter. Address-free positive controls (Val(:stage),Val(2),Val(Float32),Val(Ptr{Float32}), tuple tags and a parameter containingTuple{Int,Float32}) pass. A pointer type alone carries no address and should not be rejected just because it is a type parameter.These were host admission tests only. No device allocation, kernel launch, pointer dereference, synchronization, or hardware arithmetic was performed. This strengthens the earlier source-read-only CUDA/Metal observation without claiming a device failure or device qualification.
jtravs commentedon Nov 12, 2026
Closing: the maintainer withdrew SEP 48 (the Julia backend) on 2026-11-11. C++/Kokkos stays the engine, and solprop has exactly two backends, native and numpy_ref (ADR-077, recorded in #763). This issue concerns only the Julia backend, its package, bridge or CI, so it no longer applies.