News for hackers. Stuff that matters.
Re:Unreal Rust by newpavlov on Sunday September 04, 2022 @06:07PM (#32718178)
>Nanite is a very clever data structure for meshes. It's brittle, and full of internal relative addresses within the data item, so it's very vulnerable to buffer overflows.

Using bounds checking is likely to kill performance on such data structures, while using `get_unchecked` or raw pointers will keep the issues.

But even then, I would love to see Nanite implemented in Rust.

Re:Unreal Rust by pjmlp on Monday September 05, 2022 @02:15AM (#32721107)
It is a matter of how much the compiler is able to ellide.
Re:Unreal Rust by cfcosta on Monday September 05, 2022 @06:58AM (#32722927)
Kinda late to the party, but just a heads up: in rust, bounds checks are only available on debug builds. I'm not familiar with the internals of Nanite though, so I can't comment on how safe (or unsafe) it should be to implement.
Re:Unreal Rust by wmanley on Monday September 05, 2022 @08:54AM (#32723755)
> in rust, bounds checks are only available on debug builds

This is not true - bounds checks are always enforced: https://play.rust-lang.org/?version=stable&mode=release&edit...

Maybe you're confusing it with signed overflow behaviour in Rust or bounds checks in Zig?

Re:Unreal Rust by steveklabnik on Monday September 05, 2022 @07:35AM (#32723175)
I’m not sure what you mean here, bounds checks have nothing to do with debug builds, other than that optimizations may remove more of them if they’re determined to never fire, and release builds tend to have higher optimization levels. Semantically they’re always on unless you use the get_unchecked method.