64 bit and 128 bit integers are not supported at all
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- rust
- Lĩnh vực
- compilers, computer-graphics
Hướng nghiên cứu
Bắt đầu với entry point kernel/src/lib.rs và tái hiện các chẩn đoán đã được báo cáo cho các kiểu storage-buffer u64 và i64. Theo dõi cách các kiểu số nguyên được dịch thành các capability của SPIR-V, và coi vấn đề là đã được giải quyết khi các độ rộng số nguyên được hỗ trợ biên dịch chính xác hoặc các giới hạn của chúng được báo cáo rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected Behaviour
I want to port some code using fixed::FixedI128 to the gpu, so I tried using rust-gpu to avoid needing to re-implement the wheel.
Well, this failed epically.
Figuring out how to use rust-gpu from the docs and examples is impossible, so I looked at rust-gpu-chimera, and I was able to figure out how to use it.
Of course, even though fixed is no-std and does not allocate, it does not compile, so I started to try to clone it locally and monkeypatch any issues until it would build.
But after the errors just never ended, I thought it more prudent to LITERALLY manually dig through the thousands of lines of macro-generated code for fixed and inline all the code I was using.
Of course, this failed because rust-gpu does not ACTUALLY support 128 bit integers.
Of course, the errors don't explicitly say this, instead they say "unsupported type for constant i128" or something else, and never explicitly admit to not supporting 128 bit integers.
Ok, that's really disappointing, but sure I'll rewrite all these functions to work on 64 bit limbs explicitly instead.
Well, actually, rust-gpu does not support 64 bit integers either, so that was a waste of time.
Now the error does sort of explicitly say this: "error: u64 type used without OpCapability Int64".
This is pretty surprising because on 32 bit CPU targets we can use 128 bit ints with reckless abandon and the compiler will just figure it out, but some part of this when translating from rust to llvm ir to spriv is not putting the square peg into the square hole.
Example & Steps To Reproduce
This kernel stub should have the same error, even with none of the implementation actually present:
#[cfg(target_arch = "spirv")]
#[spirv(compute(threads(1024)))]
pub fn bqa_kernel(
#[spirv(global_invocation_id)] gid: UVec3,
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] data: &mut [((u64, i64), i64, i64)],
#[spirv(push_constant)] param: &BqaParams,
) {
let thread_id = ThreadId::new(gid.x);
bqa_helper(thread_id, data, (param.r0, param.r1), param.b_min, param.b_max);
}
we don't even need to look into bqa_helper or any other implementation details, the error will be something like
Compiling kernel v0.1.0 (/home/hac/projects/rust-gpu-chimera/kernel)
error: `u64` type used without `OpCapability Int64`
|
= note: used by `core::option::Option<i64>`
= note: used by `((u64, i64), i64, i64)`
= note: used by unnamed type
= note: used by unnamed type
note: used from within GLCompute entry-point `bqa_kernel`
--> kernel/src/lib.rs:171:5
|
171 | #[spirv(storage_buffer, descriptor_set = 0, binding = 0)] data: &mut [((u64, i64), i64, i64)],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `i64` type used without `OpCapability Int64`
System Info
Rustc version is pinned to nightly-2025-06-23 by rust-gpu-chimera
SPIRV-Tools v2025.3 v2025.3.rc1-0-g33e025681
OS: linux 6.15.8-zen (arch linux)
GPU: Intel Arc B580
I'm using the webgpu backend following rust-gpu-chimera
- Ngôn ngữ chính
- Rust
- Star
- 3.4k
- Fork
- 126
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Rust-GPU/rust-gpu
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
enhancement
Rust-GPU/rust-gpu#643 · 2 bình luận · 1 reaction · 1 người được giao ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
async functions cause ICE Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của Rust-GPU/rust-gpu
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
Axis areas are always keyboard-focusable (Sense::drag), even with allow_axis_zoom_drag(false) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug team:backend track:services-maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cowprotocol/services#4950 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
gitbutlerapp/gitbutler#15998 · 1 bình luận ·