Originally posted by ermo
View Post
Regardless, if that's the safest solution, wouldn't that mean their usage of assembly is compromising that safety, especially given how it's handling very low-level functions?
My thoughts on "fastest":
In the specific examples where certain CPUs offer specialised instructions (and Rust hasn't yet grown support for generating assembly code that is just as fast), it seems to me that it would make sense to try to use Rust's unsafe and macro facilities to embed these localised pieces of code into the larger Rust code base.
If you disagree with this approach, ok. It's not my job to convince you that the chosen approach is sound, but as you yourself state, the developers of Rav1e aren't likely aren't stupid so it stands to reason that they will have considered the trade-offs? But perhaps you don't think they have and want someone to confirm that for you? If so, why don't you just contact them and ask them and get the relevant information from the horse's mouth so to speak?
In the specific examples where certain CPUs offer specialised instructions (and Rust hasn't yet grown support for generating assembly code that is just as fast), it seems to me that it would make sense to try to use Rust's unsafe and macro facilities to embed these localised pieces of code into the larger Rust code base.
If you disagree with this approach, ok. It's not my job to convince you that the chosen approach is sound, but as you yourself state, the developers of Rav1e aren't likely aren't stupid so it stands to reason that they will have considered the trade-offs? But perhaps you don't think they have and want someone to confirm that for you? If so, why don't you just contact them and ask them and get the relevant information from the horse's mouth so to speak?
It's strange (not bad) to me they chose to do a very difficult part of their coding in a difficult language, where the ostensibly easier part is done in an easier language. It's perfectly normal for something to seem odd on the surface, but makes total sense once you dive deeper into it.
As for asking them, I could probably figure out the answer myself if I investigated the source code. Seeing as I don't have the interest/patience to do that, I don't feel I have the right to waste their time with petty curiosities. I can say with confidence they know what they're doing more than me, so it's not like anything I have to say to them has any value.
In light of the above hypothesis, I don't suppose you would consider re-evaluating your question of why rav1e isn't just written entirely in assembly? What benefits (if any) would doing so have compared to the current approach when taking into account the 'safe' goal?
Despite the scc results, we still don't know what constraints they have, so, I don't have a way to answer what benefits they would have if they took an alternate route. Again: I didn't say the route they took was bad. It's arguably not the best, but the key word there is "arguably". Not like "best" really matters, either. I personally don't expect perfection.
Comment