Skip to content

Conversation

Firestar99
Copy link
Member

@Firestar99 Firestar99 commented Sep 17, 2025

I'm deliberately skipping mod raytracing since the safely specification on those intrinsics is a little more involved, with both ray pipeline and ray query having a quite complex state and UB rules around it.

closes #382

@Firestar99 Firestar99 added this pull request to the merge queue Sep 17, 2025
Merged via the queue into main with commit de03e8d Sep 17, 2025
13 checks passed
@Firestar99 Firestar99 deleted the safe-intrinsics branch September 17, 2025 16:13
@nazar-pc
Copy link
Contributor

This is very helpful!

Looks like atomic operations like atomic_i_add() are still unsafe, would appreciate similar updates there.

@Firestar99
Copy link
Member Author

Atomics are really difficult to make safe. You can misuse scope to get the value to an undefined state. And I'm unsure how Vulkan, let alone other APIs, handle atomic and non-atomic read/write aliasing.

@nazar-pc
Copy link
Contributor

All the more reasons to add "Safety" section to them. If it is difficult to rust-gpu maintainers, there is no hope for casual GPU developers like myself to use them correctly 😂

On CPU at least atomic operations on integers are perfectly safe, there is no memory unsafety that can be caused by them. I recently opened #399, maybe atomics need to start working with standard library types like AtomicU32 instead of u32 to reduce the confusion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Barries are unsafe, but not clear why
3 participants