diff --git a/Cargo.lock b/Cargo.lock index 0bd2bd2..944a3f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1597,7 +1597,7 @@ name = "ec-dsp" version = "0.1.0" dependencies = [ "ec-core", - "wide 1.7.0", + "wide", ] [[package]] @@ -1606,7 +1606,7 @@ version = "0.1.0" dependencies = [ "ec-core", "ec-h264-syntax", - "wide 1.7.0", + "wide", ] [[package]] @@ -1622,7 +1622,7 @@ version = "0.1.0" dependencies = [ "ec-core", "ec-dsp", - "wide 1.7.0", + "wide", ] [[package]] @@ -1692,7 +1692,6 @@ dependencies = [ "oxideav-subtitle", "rav1e", "rusty_aac", - "rusty_h264", "rusty_mp3", "rusty_vorbis", "symphonia", @@ -5043,43 +5042,6 @@ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" name = "rusty_aac" version = "0.5.0" -[[package]] -name = "rusty_h264" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "690044fc22dedcc09367177bd50cc7f6b46b72f3227d35a9311e69c64c2a73d4" -dependencies = [ - "rusty_h264-common", - "rusty_h264-decoder", - "rusty_h264-encoder", -] - -[[package]] -name = "rusty_h264-common" -version = "0.9.1" -dependencies = [ - "bytemuck", - "wide 0.7.33", -] - -[[package]] -name = "rusty_h264-decoder" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd475fe0f7480930bf735275111922733a323cb9ef7d83d825a0222ccde9fb4" -dependencies = [ - "rusty_h264-common", -] - -[[package]] -name = "rusty_h264-encoder" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8100c6b118fa62ff4f021b47cf2d6feb423dad78e3dec5d8dfc2d0ff3a6729bb" -dependencies = [ - "rusty_h264-common", -] - [[package]] name = "rusty_mp3" version = "0.6.1" @@ -5133,15 +5095,6 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" -[[package]] -name = "safe_arch" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" -dependencies = [ - "bytemuck", -] - [[package]] name = "safe_arch" version = "1.2.0" @@ -6955,16 +6908,6 @@ dependencies = [ "winsafe", ] -[[package]] -name = "wide" -version = "0.7.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" -dependencies = [ - "bytemuck", - "safe_arch 0.7.4", -] - [[package]] name = "wide" version = "1.7.0" @@ -6972,7 +6915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cf05ca94c9fba0c51316899caa1d1e74a064fc310a5efa7375e614343d415be" dependencies = [ "bytemuck", - "safe_arch 1.2.0", + "safe_arch", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ddee086..1892e10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ exclude = [ "vendor/cros-codecs", "vendor/rusty_aac", "vendor/oxideav-h265", - "vendor/rusty_h264-common", "vendor/mp4", ] @@ -17,7 +16,7 @@ edition = "2024" # Five upstream crates vendored verbatim except for one clearly marked fix each, # all blockers on this machine and all still unfixed upstream as of -# 0.0.6/0.0.13/0.5.0/0.0.9/0.9.1: +# 0.0.6/0.0.13/0.5.0/0.0.9/0.14: # cros-libva - fails to build against libva >= 1.23 headers # cros-codecs - probes VA-API with a 16x16 context that Mesa radeonsi refuses; # and creates every decode context as 8-bit 4:2:0, which no HEVC @@ -66,21 +65,6 @@ edition = "2024" # 69bde5a6e, and it is a plain path dependency (no # `[patch.crates-io]` line) because nothing else in the tree # asks for it. -# rusty_h264-common - declares `rusty_alloc` (its authors' own mimalloc -# remake) as the `#[global_allocator]` of whatever application -# links it, under a feature that `rusty_h264-{decoder,encoder}` -# turn on from *their* defaults, so no downstream feature choice -# can decline it. It crashed us: under sustained ruler scrubbing -# edith churns decode-worker threads, and that allocator -# segfaulted inside `span_from_segments` on a new thread's first -# allocation (two cores, 2026-08-13). The patch is the feature -# default and the six-line declaration in `src/lib.rs`; every -# line of codec code is byte-identical to 0.9.1, so decode stays -# bit-exact and the process gets glibc's malloc back. -# (Since 2026-09-12 only the software H.264 *encode* seat -# still links this crate -- decode is `ec-h264`, which carries -# no allocator of its own; the patch stays until the encode -# seat moves too.) # mp4 - reads the `mp4a` sample entry as ISO only: the 8 bytes # QuickTime uses for version/revision/vendor are skipped as # reserved, so a version-1 SoundDescription's 16-byte tail @@ -89,12 +73,16 @@ edition = "2024" # AAC track "with no esds", every Resolve / Final Cut / `ffmpeg # -f mov` file silent. The patch is `Mp4aBox::read_box` and a # `WaveBox` fourcc; writing is untouched. -# Drop `vendor/` entirely once released versions handle all six. +# A sixth, `rusty_h264-common`, left the tree on 2026-09-12 with the last +# `rusty_h264` seat: it was vendored only to declaw `rusty_alloc` -- its +# authors' allocator installed itself as the process `#[global_allocator]` and +# segfaulted the editor on a new thread's first allocation -- and once +# `ec-h264` carried both H.264 seats there was nothing left to patch. +# Drop `vendor/` entirely once released versions handle all five. [patch.crates-io] cros-libva = { path = "vendor/cros-libva" } cros-codecs = { path = "vendor/cros-codecs" } rusty_aac = { path = "vendor/rusty_aac" } -rusty_h264-common = { path = "vendor/rusty_h264-common" } # Drops the `pub use proc_macro;` re-export (E0365 future-incompat, rustc # warns on every workspace build); nothing in the crate or its users names it. proc-macro-error2 = { path = "vendor/proc-macro-error2" } diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index 288abc2..3d5069a 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -34,46 +34,30 @@ mp4 = "0.14" # pulls this exact version in through `png`, and it is the pure-Rust inflate the # rest of the ecosystem is built on. miniz_oxide = "0.8" -# The software H.264 *encoder* -- since the decode seat moved to `ec-h264` -# above, the only seat still on this crate. Pinned exactly, like -# `oxideav-ac3` below, because a codec is a reproducibility dependency; the -# 0.9.1 pin is the one the decode half set on 2026-08-12, when 750 pictures of -# a 1080p High and a 720p Main clip decoded byte-for-byte against ffmpeg where -# 0.8 had drifted (software *encode* was unchanged within noise across that -# bump, so the pin costs the encoder nothing). `default-features = false` is -# what keeps `asm` off: those are vendored openh264 SIMD kernels that want -# `nasm` at build time, which this project's no-install rule forbids, and the -# crate enables them by default. +# The software H.264 seats, both of them the project's own: `ec-h264` (I/P/B +# encode, CAVLC and CABAC, full DPB decode, weighted prediction, in-loop +# deblocking), bit-exact against the JVT conformance suite. The decode seat +# moved on 2026-09-12; the encode seat followed the same day, which retired the +# last of `rusty_h264` -- whose `rusty_h264-common` installed its authors' +# `rusty_alloc`, a pure-Rust mimalloc remake, as the process-wide +# `#[global_allocator]` of whatever application linked it, no downstream +# feature choice being able to decline it, and that allocator segfaulted the +# editor on a new decode-worker thread's first allocation (2026-08-13). It had +# been survivable only through a vendored patch, which is gone with the crate. # -# What that line does not turn off, and cannot: the facade asks for its three -# sub-crates with *their* defaults, and `rusty_h264-common`'s default installs -# `rusty_alloc` -- a pure-Rust mimalloc remake, MIT -- as the process-wide -# `#[global_allocator]`, for the whole application rather than the codec. It was -# faster on a synthetic 2M-allocation churn (0.104 s against glibc's 0.142 s) -# and it crashed the editor: sustained scrubbing churns decode-worker threads, -# and it segfaulted on a new thread's *first* allocation. `common` is therefore -# vendored with that declaration removed (workspace root `[patch.crates-io]`), -# which is the only way to decline it -- the codec itself is untouched. When -# the export encode seat moves to `ec_h264::Encoder`, this line, the patch and -# the vendored crate go with it. -# The software H.264 *decoder*, which is the project's own: `ec-h264` -# (I/P/B, CAVLC and CABAC, full DPB, weighted prediction, in-loop deblocking), -# bit-exact against the JVT conformance suite. It took this seat from -# `rusty_h264` on 2026-09-12. Raw decode throughput (demux+decode, no render, -# best of three warm passes, otherwise idle machine): 1.5x `rusty_h264` on a -# 1080p Main export and a 4K Main render, 1.0x on a 1440p High screen -# recording, 1.17x on a CAVLC Baseline fixture; 0.80x on the two B-picture -# CABAC streams measured (a 720p High fixture and a 720p Blu-ray episode) -- -# the price of the full DPB the old seat skipped with its decode-order -# corner-cut, which scrambled exactly those streams. It hands pictures back in -# display order, which is what every reader of `frame.index` already assumed -# (the hardware backend always did; see `tests/sw_backends.rs` for the -# byte-exactness witness against `rusty_h264`, kept as the independent oracle). +# Decode throughput, measured at the decode swap (demux+decode, no render, best +# of three warm passes, otherwise idle machine): 1.5x `rusty_h264` on a 1080p +# Main export and a 4K Main render, 1.0x on a 1440p High screen recording, +# 1.17x on a CAVLC Baseline fixture; 0.80x on the two B-picture CABAC streams +# measured (a 720p High fixture and a 720p Blu-ray episode) -- the price of the +# full DPB the old seat skipped with its decode-order corner-cut, which +# scrambled exactly those streams. It hands pictures back in display order, +# which is what every reader of `frame.index` already assumed (the hardware +# backend always did). ec-h264 = { path = "../../../edith_codecs/crates/ec-h264" } # Its shared IR (packets, frames, the registry decoder contract the seat is # written against), direct because decode.rs names those types itself. ec-core = { path = "../../../edith_codecs/crates/ec-core" } -rusty_h264 = { version = "=0.9.1", default-features = false } # Both halves of AAC, and the only crate here that is asked for both. The # *encoder*, so an mp4's sound can be a mix rather than a copy: an equalized (or # otherwise processed) lane has to be decoded, and what is decoded has to be @@ -81,8 +65,9 @@ rusty_h264 = { version = "=0.9.1", default-features = false } # than stereo outright (`aac/mod.rs:93`, "aac: aac too complex") and a 5.1 film # soundtrack in an mkv is exactly that -- this one hands 5.1 back already # reordered into FL, FR, FC, LFE, BL, BR, which is the order the downmix in -# `audio` folds. Pure Rust with no C or FFI, Apache-2.0, same family as -# `rusty_h264` above. Nothing else in the ecosystem encodes AAC without linking +# `audio` folds. Pure Rust with no C or FFI, Apache-2.0, the same Mata Network +# family the retired `rusty_h264` came from. Nothing else in the ecosystem +# encodes AAC without linking # Fraunhofer's C library, which this project's no-install rule forbids. Built # from `vendor/rusty_aac` -- see the patch table in the workspace manifest. rusty_aac = "0.5"