Firefox will consider a Rust implementation of JPEG-XL
github.com
github.com
There's already a JPEG-XL decoder written in Rust: https://crates.io/crates/jxl-oxide
It would be nice to hear why it's not good enough.
(In the case of AV1 I think they eventually gave up and started offering dav1d on Android, but not before shipping their in-house implementation that was much less efficient and no safer than state of the art, perplexing everyone in the process.)
[1] The main blocker for J40 was that I don't really want to keep it less safe than I hope to achieve, but I also want to keep it in C for practical reasons. This and my daily job prevented any significant improvements so far.
As good as Oxide might be it looks like a one developer project.
As for why jxl-oxide can't be used yet — it just isn't mature enough yet. They're still finding unimplemented or incompatible features, and have some unoptimized code.
JPEG XL is big and complex – it is designed to have every feature of every competing codec (from vector graphics to video), and beat them all on compression in every case, so it's a half a dozen of different codecs in a trench coat.
libjxl decoder is 3-5x smaller in binary and 10x smaller in specification text size than an avif decoder
Anything that has remotely something to do with user-supplied data should be done in Rust, especially for such a high profile piece of software.
Most things that are advanced correctness verification in C++ are regular compiler errors in Rust.
Another implementation is still unlikely to have the exact same bugs. Especially rewrite in Rust will force the code to be structured differently (Rust is very opinionated about that).
The spec is big enough that the team won't be able to just write the exact same implementation from memory.
current decoder is around 20 kloc
One way to think of Highway is that it is portable multi-platform SIMD intrinsics for C++. While we developed it originally as a part of JPEG XL, it has long ago graduated into a general-purpose library that has various uses, including the recent Gemma.cpp ML launch. Other modern highway uses include: Audio, Browsers, Computational biology, Computer graphics, Cryptography, Grok JPEG 2000, JPEGenc, Jpegli, OpenHTJ2K, Image processing, Image viewers, Information retrieval, Machine learning, Numpy, and Robotics... (copied from: https://github.com/google/highway)
I derived the name from the CityHash, FarmHash, and then HighwayHash series, and considered that Highway would link this library to its roots in the HighwayHash (of course much is also based on Jan's previous work with SIMD). Notably, I resisted using the -li naming here :-D
> of the reference decoder (currently behind a pref in Firefox Nightly), which weighs in at more than 100,000 lines of multithreaded C++
* Much better quality at high bpp (avif performs better at high compression levels, means shitty quality images can be much smaller, while high quality images either don't compress well or loose quality a lot)
* Best in class lossless compression, to replace png
* Progressive encoding
* Ability to losslessly reconvert existing jpegs for 20% free gains
For all we know, JXL might be super useful, and is actively being used, for some project at Google for X, Y, and Z reasons, but the Chrome team doesn't want to add it to the browser for A, B, and C reasons. Google does many thing.
Latency can cost monetization. Fewer bits at X b/s is fewer seconds.
At "Google scale" 1% or 2% savings can add up to hundreds of thousands or millions of dollars per year. 1% of 100,000 servers is 1,000 servers.
Users know that their time is valuable. If your website is fast, they will explore it, and came back soon.
So not only it is on by default, but it also requires a couple of config entries to disable.
I wonder which one was objected to - the implementation considered to be in Rust or that a rewrite might not actually make sense for the dying browser (2.75% share) at this stage?
I personally feel like softeare is dead once it is no longer useful, and there is no likelihood of that changing in the foreseeable future. That's obviously not the case woth Firefox.
On the other hand I've seen exaggerated reports of the demise of a project that hasn't had a git commit in the last week, or isn't commercially relevant for whatever the commenter is interested in. Even this doesn't seem to me to be true for Firefox, but I don't think the accusations will stop, or the signal-to-noise will increase.