Confusing "cannot use `AtomicOrdering::SeqCst` on Vulkan memory model"
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
Hướng nghiên cứu
Bắt đầu với crates/farmer/ab-proof-of-space-gpu/src/shader/find_matches_in_buckets.rs tại lệnh gọi AtomicU32 fetch_add quanh dòng 109, sau đó kiểm tra chẩn đoán SeqCst được báo cáo và spirv_std::arch::atomic_i_add(). Xác định thứ tự nguyên tử của Vulkan được xử lý như thế nào và liệu có thể giải quyết việc hỗ trợ AtomicU32 hay không. Được xem là hoàn tất khi trường hợp sử dụng được báo cáo biên dịch được hoặc lỗi chỉ dẫn rõ ràng người dùng đến thao tác nguyên tử được hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I'm getting the following error when trying to use AtomicU32:
error: cannot use `AtomicOrdering::SeqCst` on Vulkan memory model (check if `AcqRel` fits your needs)
--> /home/nazar-pc/.rustup/toolchains/nightly-2025-06-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:3984:23
|
3984 | SeqCst => intrinsics::atomic_xadd::<T, { AO::SeqCst }>(dst, val),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: used from within `core::sync::atomic::atomic_add::<u32>`
--> /home/nazar-pc/.rustup/toolchains/nightly-2025-06-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:3984:23
|
3984 | SeqCst => intrinsics::atomic_xadd::<T, { AO::SeqCst }>(dst, val),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: called by `<core::sync::atomic::AtomicU32>::fetch_add`
--> /home/nazar-pc/.rustup/toolchains/nightly-2025-06-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:3748:1
|
3748 | / atomic_int! {
3749 | | cfg(target_has_atomic = "32"),
3750 | | cfg(target_has_atomic_equal_alignment = "32"),
3751 | | stable(feature = "integer_atomics_stable", since = "1.34.0"),
... |
3764 | | u32 AtomicU32
3765 | | }
| |_^
note: called by `ab_proof_of_space_gpu::shader::find_matches_in_buckets::log_message`
--> crates/farmer/ab-proof-of-space-gpu/src/shader/find_matches_in_buckets.rs:109:34
|
109 | let write_at = debug_counter.fetch_add(message_length, Ordering::Relaxed);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The confusing part is that I'm not using SeqCst. Looks like the code that references SeqCst is technically compiled in and causes issues even though it is practically unreachable.
Would have been nice for it to compile successfully.
After above failure I tried spirv_std::arch::atomic_i_add(), which did work, but it has a bit strange syntax due to the need to provide not just ordering semantics, but also scope and it doesn't work on AtomicU32, only on u32. It is also unsafe for some reason.
Ultimately I think the error should say to use spirv_std::arch::atomic_i_add() (because I don't think hiding/guessing scope is a great idea) and spirv_std::arch::atomic_i_add() should support Atomic32, which has the same memory layout as regular u32.
- 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
Chuẩn bị môi trường
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
-
glam v0.33.6 breaks `Vec3A`Có thể đã có người làm @Firestar99 đã nhận 4 ngày trước. Đang mởbug
-
Adhere to Rust floating-point semanticsCó thể đã có người làm @Firestar99 đã nhận 13 ngày trước. Đang mởenhancement
Rust-GPU/rust-gpu#643 · 3 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
Tất cả issue của Rust-GPU/rust-gpu
Issue tương tự
-
area:casework bug criticality:p3 triage:needs-implementation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
registrystack/registry-stack#1623 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
leptos-rs/leptos#4885 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
longbridge/gpui-kit#3276 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-Migration Guides D-Straightforward S-Ready-For-Implementation X-Uncontroversial
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
bevyengine/bevy-website#2607 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày