RCRAG Converter

Image Ingest for RAG: What Today's rusty_jpeg 0.5 Build Changes

A glass lightbox on a dark table holding two blank sheets of photo paper, one corner slightly curled, lit from below with a faint red rim light

Image ingest for RAG has to decode the picture before OCR or a caption can do any work. Tonight the converter moved onto rusty_jpeg 0.5.2, and it now patches flate2 through rusty_zlib v0.1.4. Against zune-jpeg 0.5.15, that decoder is still ahead on every layout the README measured, from 1.19x to 1.64x. Against its own 0.4.15 line it is a little slower on most of those layouts, because the SIMD kernels were made bit-exact with the scalar path. A Flate measurement from FFAI, on the pdf.js corpus, showed 11.2% fewer instructions and about 2% less wall time, with output identical to zlib-rs. None of those figures is a RAG Converter product benchmark.

What did today's Remade-With-Rust builds change in RAG Converter?

The vendored parser and the server now decode JPEGs with that 0.5.2 crate, and flate2 in the workspace inflates through rusty_zlib v0.1.4. The speed numbers come from those crates' own races, not from a new converter-wide ingest test. The public releases are on GitHub.

Today's builds, now in the converter

Late this afternoon the Remade-With-Rust org published rusty_jpeg 0.5.2. This evening RAG Converter took that crate in two places: the vendored rusty_RAG parser, which is what actually reads images, and a dev-dependency on the server used to encode the image formats the API accepts. The decoder API did not change. The workspace tests still pass, including the image-format and HEIF conformance suites.

The same commit patches flate2's zlib-rs backend to rusty_zlib v0.1.4. Any flate2 user in the graph now inflates through the house zlib. The lockfile also moved a few FFAI crates - ffai-core 0.9.2, ffai-carmenta 0.14.1, ffai-argus 0.10.2, ffai-mercury 1.2.2, and ffai-models 0.7.1. Those tags landed yesterday. Their release notes are mostly licence files, and the existing version ranges already allowed them, so I am not treating that lockfile move as a performance story.

This morning's PDF ingest note said flate2 was still pulling upstream zlib-rs. That sentence is now stale for RAG Converter's own build. It does not mean the new rusty_pdf_core reader is the converter's PDF parser. That work is still moving through FFAI.

What the 0.5 release actually measured

rusty_jpeg is the house JPEG decoder and encoder. The MATA repo page has the install line. Version 0.5 is the release that makes the x86 SIMD kernels produce the same pixels as the scalar code, so a laptop and a chip decode a file the same way.

That correctness has a cost. The README re-measured the exact kernels against 0.4.15 and against zune-jpeg 0.5.15, on 3840x2400 photographs written by libjpeg-turbo, one pinned core, 12 rotated rounds. Against 0.4.15 the ratios sit between 0.92x and 1.00x on those layouts, so most of them are a little slower. Instruction counts tell the same story without the clock's noise: 4.4% more for greyscale, 7.7% more for 4:2:0, 10.4% more for 4:4:4. Against zune-jpeg the decoder is still ahead on every layout in that table, from 1.19x on a couple of baseline cases up to 1.64x on progressive 4:4:4.

FFAI recorded a related check when it took 0.5.2 this evening: after the bit-exact change, about 2% of samples move by one to three levels, and the libjpeg twin check on its diana-coco corpus stayed at a worst difference of 3 in 255, under a limit of 8.

The other thing 0.5 carries is a much more forgiving damaged-file path. The README compares this release with 0.4.9 on a libjpeg-turbo djpeg corpus. Of 5,368 damaged variants that djpeg itself decodes, 4,875 now match it (90.8%), up from 1,454 (27.1%). On a cut-short set of 179 files, this release opens 170. Version 0.4.9 opened none of them. That is crate work, not a converter ingest eval, and a picture of text still needs OCR before it helps retrieval.

I am not claiming a win against FFmpeg. The crate already corrected an older encode figure. At 0.3.0, encode sat at 0.96x of FFmpeg 8.1.2 at matched size, a little slower, and decode was 1.02x, inside the noise. Those races have not been re-run for 0.5.

House zlib under flate2, and a number we already had

rusty_zlib is the house zlib, tagged tonight at v0.1.4. The MATA page has the current version. The useful measurement for ingest is not the 1.19x level-1 compression figure from this morning. Pulling text out of a compressed stream is inflate.

FFAI measured the same patch this afternoon, at an earlier tag, on Flate streams in the pdf.js corpus: 11.2% fewer instructions, about 2% less wall time, and bytes identical to zlib-rs. The later 0.1.3 tag kept that output unchanged. RAG Converter took 0.1.4, which the FFAI commit called the final zlib tag for now. We did not re-run that corpus inside the converter, so treat the 11.2% as FFAI's number for the patch, not as a new product result.

What's on GitHub, and what this does not claim

The new files are the public source releases, not installers. You can get rusty_jpeg v0.5.2 and rusty_zlib v0.1.4 from GitHub tonight. FFAI also published ffai-media 0.7.4, which picks up the same JPEG crate and rusty_pdf_core 0.2.1. RAG Converter did not move its FFAI media crate in this bump, so I am not claiming that media release is already inside the converter.

This is not a new file-format announcement either. The 0.5 release can accept packed YUYV from a camera, and it can build without std, which matters on a chip. The browser converter still reads the same image types it did this morning. Images and scans are still their own job: a JPEG decodes to pixels, and a scan still needs OCR.

What changed for image ingest for RAG is the floor under that first decode, plus the inflate path that already sits under compressed streams. If you convert locally so the file never leaves the machine, that floor is the part you want to be boring and correct. MATA is the house stack for keeping the rest of that work on hardware you hold, and the engineering write-up for the JPEG crate also lives on Remade with Rust.

FAQ

Q: Did RAG Converter get faster at converting files end to end?

A: We did not measure that. The 1.19x to 1.64x figures are the 0.5 decoder against zune-jpeg 0.5.15, and the 11.2% instruction drop is FFAI's Flate run on the pdf.js corpus. Use them as crate results, not as a product ingest score.

Q: Is rusty_jpeg 0.5 faster than the 0.4 line?

A: Not on most of the layouts in the README's exact-kernel table. Against 0.4.15 the ratios are 0.92x to 1.00x, with 4.4% to 10.4% more instructions, because the SIMD path was made bit-exact with scalar. It is still ahead of zune-jpeg 0.5.15 on every layout in that table.

Q: Where are the new files on GitHub?

A: rusty_jpeg v0.5.2 and rusty_zlib v0.1.4 are public tags on Remade-With-Rust. FFAI also tagged ffai-media 0.7.4 this evening. Those releases are source archives, not installers.

Q: Does this mean the converter now uses the new PDF reader?

A: No. This bump put house zlib under flate2 and moved the JPEG decoder to 0.5.2. The rusty_pdf_core adoption is still happening in FFAI, which already does OCR for the server tier.

Q: Do I need to change how I upload images?

A: No. The decoder API is unchanged, and the accepted image types are unchanged. A JPEG still has to decode before OCR can read any text in it.

More on converting for RAG