7 ms·
$20K Bounty Offered for Optimizing Rust Code in Rav1d AV1 Decoder
- degurechaff 2y agojust curious, why asian people not eligible?
- qalmakka 2y agoIt's not that simple to do a bounty program, my uninformed guess is that they are almost definitely targeting a number of jurisdictions whose laws are familiar with and/or they have some kind of representive in
- jaas 2y agoThis is the correct answer (we run this bounty). Contests can be legally complex, there are only so many place we feel comfortable running it from a legal POV.
- irf1 2y agoyou can use Algora.io (it’s open source) to cover 120+ countries for the bounty payout - it would be a fantastic showcase on our website (founder here) we can create a page for you like we did for the $25k Rust Prettier Bounty https://prettier.algora.io https://prettier.algora.io lmk if interested ioannis@algora.io good luck!
- rationably 2y agoIt says nothing about "asian people". Verbatim quote, in full: > The contest is open to individuals or teams of individuals who are legal residents or citizens of the United States, United Kingdom, European Union, Canada, New Zealand, or Australia.
- washadjeffmad 2y agoNationality, not ethnicity. Turks are Asian. Russians are Asian. Indians are Asian. Etc. They were probably just wondering why it's limited to Five Eyes + EU.
- bArray 2y agoIt'll likely be to do with financial responsibility due to where the funding comes from. They have an obligation to check that they are not sending funds to a terrorist group to solve code bounties, etc.
- karn97 1y agoThen it should def be banned in america as the biggest terrorist nation on the planet
- greggsy 2y agoInterestingly if you follow through to the full T&C's [1], they add exclusions: > ...not located in the following jurisdictions: Cuba, Iran, North Korea, Russia, Syria, and the following areas of Ukraine: Donetsk, Luhansk, and Crimea. Showing that the only explicit exclusions are aimed at the usual gang of comprehensively sanctioned states. [1] https://www.memorysafety.org/rav1d-bounty-official-rules/ https://www.memorysafety.org/rav1d-bounty-official-rules/ Still doesn't explain why the rest of the world isn't in the inclusions list. Maybe they don't want to deal with a language barrier by sticking to the Anglosphere... plus EU?
- bpicolo 2y agoMaybe because the laws for giving away money are complicated? There’s tax and reporting burden
- cess11 2y agoProbably legal and possibly political reasons that comes with the source of money.
- GolDDranks 2y agoAs a resident of Japan, I thought the exact same thing. (I'm also a citizen of an EU country, which would permit me to participate, but most of my colleagues couldn't.)
- zinekeller 2y agoActually, I'm more shocked that somehow Québec residents are eligible. Knowing how contest rules work, Québec is usually excluded because of its onerous rules. For one, the rules are not (also) written in French - which is a requirement for contests.
- hluska 2y agoThose laws were repealed in late 2023.
- zinekeller 2y agoHuh, thanks and noted. For those who are interested: https://www.canadianlawyermag.com/news/general/quebec-scraps-its-unique-regulatory-system-for-promotional-contests/381227 https://www.canadianlawyermag.com/news/general/quebec-scraps...
- pizza234 2y agoThe related post on performance optimization is extremely interesting, in particular, the considerations drawn while moving from the unsafe ported code to safe¹: > The first performance issue we hit was dynamic dispatch to assembly, as these calls are very hot. We then began adding inner mutability when necessary but had to carefully avoid contention. We found as we removed pointers and transitioned to safe Rust types that bounds checks increasingly became a larger factor. Buffer and structure initialization was also an issue as we migrated to safe, owned Rust types. Based on their conclusions², each of those issues amounts to a few percentage points (total: 11%). Based on the article, it seems that with highly complex logic, safety does come at the cost of raw performance, and it can be very hard to compensate (withing the safety requirements). [¹]: https://www.memorysafety.org/blog/rav1d-performance-optimization/#optimization-process https://www.memorysafety.org/blog/rav1d-performance-optimiza... [²]: https://www.memorysafety.org/blog/rav1d-performance-optimization/#current-state https://www.memorysafety.org/blog/rav1d-performance-optimiza...
- deleted 2y ago[deleted]
- StopDisinfo910 2y ago> Based on the article, it seems that with highly complex logic, safety does come at the cost of raw performance, and it can be very hard to compensate (withing the safety requirements). In Rust. These are Rust issues, not issues with safety in general. The issue with bound checks for exemple is entirely avoidable if you prove that all your calls are within bounds before compiling, same thing for partial initialization. The core issue is that the strategies Rust adopts to ensure memory safety are neither a panacea nor necessarily the right solution in every case. That being said, I think it's a very nice idea to try to write a decoder in Rust and have a bounty for optimization. Rust is popular so work on producing fast and safe Rust is good.
- pizza234 2y ago> The issue with bound checks for exemple is entirely avoidable if you prove that all your calls are within bounds before compiling, same thing for partial initialization. The situation is more nuanced. The article dedicates a section to it: > The general idea in eliding unnecessary bounds checks was that we needed to expose as much information about indices and slice bounds to the compiler as possible. We found many cases where we knew, from global context, that indices were guaranteed to be in range, but the compiler could not infer this only from local information (even with inlining). Most of our effort to elide bounds checks went into exposing additional context to buffer accesses. (extensive information given in that section)
- dhruv3006 2y ago[flagged]
- jebarker 2y agoI'd love it if someone started Kaggle for software optimization
- 0x000xca0xfe 2y agoThis would be utterly fantastic.
- rvz 2y agoThe sort of bounty + interview question I would ask when I'm really looking for those who will actually use such optimal algorithms in practice where it directly applies. Which is exactly this for video decoders. In fact, a bounty will show us who really is serious or not and even some interviewers don't have a clue why they ask for 'optimal algorithms' in the first place. Maybe just to show off that they Googled or used ChatGPT for the answer before the interview. Well, you can't do it for this one. The one who improves this and can explain their changes will have a impressive show of expertise which puts lots of so-called 'SWEs' to shame.
- irf1 2y agoyou can do exactly that with Algora.io
- hluska 2y agoSoftware is a huge field. There’s no reason any developer should feel shame because they can’t do something. The field is far too big.
- nomel 1y ago> The one who improves this and can explain their changes will have a impressive show of expertise which puts lots of so-called 'SWEs' to shame. Software is a means of automation that's used in every industry of man. Someone not knowing a particular, very specific, problem space isn't something to be ashamed of.
- gblanco9 1y agohttps://highload.fun/ https://highload.fun/
- bluGill 2y agoThis pays for at most a week of work. I doubt it is worth anyones time to do unless they would do it for free anyway. Between the risk that someone else does it first and gets the reward and that if you are trying to make a living you need to spend time finding the next thing it just isn't much. if you can fund someone for at least 6 months of work it becomes reasonable to work for these. Edit: Looks like many people are not understanding how overhead works. Your take home pay over a year is just over $100,000 since you end up so much unpaid time looking for the next gig.
- Mashimo 2y ago> This pays for at most a week of work. Does that mean that rust devs earn 60k monthly minimum?
- demarq 2y agoI hear Steve Klabnik doesn’t go to the gas station, he just drives into the Mercedes dealership.
- steveklabnik 2y agoHilariously, due to Oxide, my salary is public knowledge: I make $207,264. https://news.ycombinator.com/item?id=43862487 https://news.ycombinator.com/item?id=43862487 (also, to take your joke way too seriously: I lived in NYC so long my drivers' license expired, so I'm not driving my non-existent Mercedes anywhere!)
- marcusb 1y agoNo, you're thinking of the other Steve. https://abcnews.go.com/Technology/steve-jobs-car-apple-ceo-license-plates/story?id=14834608 https://abcnews.go.com/Technology/steve-jobs-car-apple-ceo-l...
- Hamuko 2y agoIs this yet another "every developer on the globe makes around the same as I do" post?
- IshKebab 2y ago> Our Rust-based rav1d decoder is currently about 5% slower than the C-based dav1d decoder (the exact amount differs a bit depending on the benchmark, input, and platform). This is enough of a difference to be a problem for potential adopters I'm really surprised that a 5% performance degradation would lead people to choose C over Rust, especially for something like a video codec. I wonder if they really care or if this is one of those "we don't want to use Rust because of silly reasons and here's are reasonable-sounding but actually irrelevant technical justification"...
- VWWHFSfQ 2y agoI think latency sensitive applications will usually prefer better performance and deal with safety issues, as opposed to better safety and deal with performance issues. So I doubt it's any religious thing between c and Rust.
- viraptor 2y agoIt's also a big difference in your environment. A desktop with spare power, decoding a video from an untrusted source? You probably want the safe version. A farm of isolated machines doing batch transcoding jobs? Give me every single % improvement you can. They can get completely owned and still won't be able to access anything useful or even reach out to the network. A crash/violation will be registered and a new batch will get a clean slate anyway.
- gafferongames 2y agoI think you're taking the term "safety" in rust a bit too literally. It's got bounds checking in it man. That's all. You can also write totally safe programs in C, or if you really want to be serious about it, write the program in F and use formal verification like this crypto library does: https://github.com/hacl-star/hacl-star https://github.com/hacl-star/hacl-star
- viraptor 2y ago
- Ragnarork 2y ago$20K sounds very low for the effort and expertise that are demanded here in my opinion. It would be quite a steal to bring this to the same level as the state of the art (which, correct me if I'm wrong, but I believe is dav1d?) for only that sum.
- jebarker 2y agoI assume they're hoping to nerd snipe someone
- _ache_ 2y agoAbsolutely. If you don't know dav1d, it's easy to overlook the complexity here. There is a reason for this sentence: > « The dav1d and rav1d decoders share the exact same low-level assembly code optimizations—you cannot modify this assembly ». So, it, kind of, makes the work easier, but it stills very complex I think.
- Zenbit_UX 1y agoThe reason for that disclaimer should be obvious, any improvements to the assembly code would also benefit dav1d in c, therefore the rust code still remains worse off by comparison. I’m sure both the dav1d and dav1d communities would appreciate improvements to the assembly code, but the goal of this contest is to improve the rust implementation only.
- rvz 2y agoThis time you cannot phone a chatbot (ChatGPT, Claude, Gemini) to help you on this one. It has to be, you know correct?
- minraws 2y agoWelp, > The contest is open to individuals or teams of individuals who are legal residents or citizens of the United States, United Kingdom, European Union, Canada, New Zealand, or Australia. So most countries where putting in the effort would actually be worth the bounty offered is a no go... I understand.
- jaoane 2y agoCan’t talk about the other countries but $20K is a shitload of money in many countries of the EU.
- Suppafly 2y ago>Can’t talk about the other countries but $20K is a shitload of money in many countries of the EU. It's a decent bonus in large parts of the US too. Not everyone on HN works for a FAANG company.
- minraws 1y agoIs it enough for this project though? I have worked on optimization projects, and have been hired as the Performance person, making well over 5K US a month in a startup working on optimization stuff, in a 3rd world(read: one of the two largest asian) country... Largely because optimizing the last 10% in such projects is extremely labour intensive and niche work. Either way this feels like atleast 4-5 months of full time work minimum... Creating a bounty which is essentially a zero sum competition and not including folks from countries where 20k can be living annual wage... Means you are essentially excluding most folks who are working full time. And honestly if someone can wrap this up in a couple months as a side hustle. And if they feel like 20K was more than worth their time.. Then not to argue but they are significantly under paid. And if I had a company, I would definitely like to hire them. Even at 15-20K a month...
- bArray 2y agoFor the purpose of an experiment, I would love to see $20k also offered to eek out more performance on the dav1d decoder, otherwise this is just a measure of how much money people are willing to pour into optimisations.
- Zenbit_UX 1y agoYour comment reads like the school room dilemma of if your mom gives you cookies to share with your friends at lunch she better bring enough for everyone. This is being done to prove a point, that rust is just as efficient as c while being memory safe. Your idea is misaligned with the goals of the contest and more a moral complaint on “fairness”. Where do you get this notion that any entity offering their own funds in a contest needs to distribute it evenly?
- bArray 1y agoYour reply reads as if you have skin in this game and are for some unknown reason offended by the idea of a fair test. > This is being done to prove a point, that rust is just as efficient as c while being memory safe. I understand that, but it could just end up being a measure of how much money we are willing to pour into libraries. If you start putting money in to any language, you should see efficiency increase and bugs decrease. A nice result would be them being about the same speed, but Rust offering greater protections. > Your idea is misaligned with the goals of the contest and more a moral complaint on “fairness”. Where do you get this notion that any entity offering their own funds in a contest needs to distribute it evenly? It was an intrigue, not a demand.
- degamad 1y agoThere is already significant investment from AOM, Videolan, and FFMPEG funding the development of dav1d. Is there a reason that that investment is not relevant? From what I can tell, way more than $20k has been invested into dav1d, and that investment has generated many performance optimisations already. Ostensibly, that's what this rav1d bounty is competing with.
- 1y ago
- feverzsj 2y ago$2mil would be the minimum.
- irf1 2y agoAnyone who wants to offer a bounty on GitHub can try https://algora.io https://algora.io It’s an open source platform (built in Elixir) for sharing bounties, contract work and full-time jobs with open source engineers I’m one of the founders, feel free to reach out ioannis@algora.io
- klaussilveira 1y agoI maintain an open-source project that could use some new contributors. We have bounties ranging from $50 to $100. Would that be attractive in this platform?
- irf1 1y agoSure give it a try! If your project is cool I bet people will be eager to contribute regardless.
- dblohm7 2y agoI had always kind of hoped that somebody would try to build production decoders using something like Halide. [1] [1] https://dl.acm.org/doi/10.1145/3150211 https://dl.acm.org/doi/10.1145/3150211
- 4ad 2y agoCode bounties are unethical. I will absolutely die on this hill. You benefit from everyone's work, yet only one (or a select few) maybe get paid (in this case a pitiful amount, considering the required expertise). Almost universally, people attempting a bounty are in a dire financial situation. You’re just taking advantage of them.
- Zenbit_UX 1y agoThat’s a pretty strong stance. I’m sitting at my desk doing 133t code challenges for free right now. The idea of optimizing something that both matters and could result in a payout of any amount sounds appealing given my context. I think you underestimate the amount of people willing to do things for free or for the sake of knowledge itself. And before you suggest that must mean I’m in a dire financial situation, I’m not.
- fwip 1y agoThe official rules include this interesting bit: > Solutions must be in either rav1d itself, the Rust compiler (inclusive of llvm), or the Rust standard library.
- pabs3 1y agoMore resources for getting paid to do open source: https://github.com/fossjobs/fossjobs/wiki/resources https://github.com/fossjobs/fossjobs/wiki/resources
- canucker2016 1y agofrom https://www.memorysafety.org/blog/rav1d-performance-optimization/ https://www.memorysafety.org/blog/rav1d-performance-optimiza... rav1d is transpiled c-to-rust version of dav1d, compiled using Clang18 for dav1d and relevant Clang18-LLVM backend code for rustc. Measurements showed rav1d was 3.8% slower than dav1d. Hacking up a rustc to turn off bounds checking showed rav1d-no-bounds-check was 3% slower than dav1d. So rustc bounds checking resulted in <1% total slowdown from dav1d. Another theory about slowdown was due to overflow checking with signed arithmetic. Further tests showed only isolated incidents of slowdown due to overflow arithmetic checking. According to perf counters, rav1d executed 7% more instructions than dav1d. Approximately 2% of 7% is due to bounds checking. More info about subtle interactions with changing transpiled code to idiomatic Rust in the article. "After applying the optimization techniques discussed here (and more), we have reduced performance overhead from a peak of about 11% when we started optimizing the safe Rust implementation in earnest to under 6% now on x86_64. We believe there is still room for further improvement, both in how the compiler optimizes Rust and in our implementation details. This will necessarily be a process of small, incremental improvements, as our profiling now indicates that the remaining overhead is spread roughly evenly across the largest, most complex functions in rav1d."
- burjui 1y ago> rav1d is transpiled c-to-rust version of dav1d Sounds like a bad way to port. Completely different languages. It took me some time to learn that one cannot simply write C code in Rust and expect the result to be any good. Should've started from scratch.
- typedef_struct 1y agoConfirms Rust is about where I thought it was. In a strange niche where you don’t need 100% the performance of C, but the 90% you get from a managed language isn’t enough. And you can’t run on the GPU.