Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`show` errors on buffers and `Managed`, because `sizeof` returns a `UInt64`

Open Beginner friendly
#1,124 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
julia
Domain
backend

Research direction

Start with src/runtime/memory/hip.jl at the sizeof methods around lines 73 and 168, then search their callers for assumptions about UInt64. Confirm that returning an Int fixes display of HIP buffers and Managed values, including the failing @test scenario, without breaking callers that consume the size.

Written by the indexing model from the issue text.

Description

Base.sizeof is supposed to return an Int. For HIP buffers it returns a UInt64, and Managed passes that on:

https://github.com/JuliaGPU/AMDGPU.jl/blob/f0d05021/src/runtime/memory/hip.jl#L73
https://github.com/JuliaGPU/AMDGPU.jl/blob/f0d05021/src/runtime/memory/hip.jl#L168

Base's default show asserts sizeof(x)::Int, so any object that holds one of these can't be printed:

julia> a = ROCArray([1]);

julia> a.buf[]
Error showing value of type AMDGPU.Managed{AMDGPU.Runtime.Mem.HIPBuffer}:
ERROR: TypeError: in typeassert, expected Int64, got a value of type UInt64

This also hits @test when it prints a failing expression that has a Managed argument, e.g. @test isnothing(a.buf[]). The failure is then reported as an error from show, not as the actual failure. Returning Int(b.bytesize) from both sizeof methods should fix it, but callers that rely on getting a UInt64 would need checking.

Dominant language
Julia
Stars
346
Forks
81
Avg merge
2d 10h
Merged PRs (30d)
49

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaGPU/AMDGPU.jl

All issues in JuliaGPU/AMDGPU.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.