forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to Cargo.tomlClear filter

2026-11-06

2026-10-23

🚚 edith moves to git.tahinli.comAhmet Kaan Gümüş · b02f499
🚚 edith moves to git.tahinli.com

The working tree as of 2026-10-23, as one commit on top of the last one
here. It carries the work up to that date plus the test-slimming work:
integration tests merged into one binary per crate, nextest config,
doctest = false, debug line tables only, perf tests behind --ignored,
and faster generators, reverse, undo, subtitle-export, hevc, stabilise
and hear tests.

2026-09-13

Merge branch 'lane-h265enc-swap' (4808c4a): the HEVC encode seat is ec-h265 and oxideav-h265 leaves the tree (47+ vendor files, conformance-window patch with them -- ec-h265 self-pads and writes the crop) -- reviewer-executed validity: +1.22 dB PSNR-Y at -25.6% bytes vs the old seat at qp40 (+1.02 dB at -11.1% qp27), export wall 1.07-1.10x, mkv+mp4 decode back through the VA-API plugin seat, frame-parallel batching preserved byte-identicallyAhmet Kaan Gümüş · 49b300a
Merge branch 'lane-h265enc-swap' (4808c4a): the HEVC encode seat is ec-h265 and oxideav-h265 leaves the tree (47+ vendor files, conformance-window patch with them -- ec-h265 self-pads and writes the crop) -- reviewer-executed validity: +1.22 dB PSNR-Y at -25.6% bytes vs the old seat at qp40 (+1.02 dB at -11.1% qp27), export wall 1.07-1.10x, mkv+mp4 decode back through the VA-API plugin seat, frame-parallel batching preserved byte-identically

# Conflicts:
#	Cargo.toml
#	crates/engine/src/caps.rs
🔁 feat(video): the HEVC encode seat is the native ec-h265 — oxideav-h265 leaves the treeAhmet Kaan Gümüş · 4808c4a
🔁 feat(video): the HEVC encode seat is the native ec-h265 — oxideav-h265 leaves the tree

The vendored OxideAV intra encoder is replaced by the project's own ec-h265,
intra-only by construction: every picture an IDR carrying its own
VPS/SPS/PPS, so the seat's contract — an intraframe master, every frame a
cut point, even dimensions, a bitrate row mapped to a constant QP through the
same 0.6 bpp anchor — is unchanged. Named headroom deliberately not taken:
the encoder's per-picture target-bits correction pass, 64x64 CTBs and the
chroma rate-distortion mode search.

The seat keeps the frame-parallel shape of the one it replaces: a batch of
display-size planes codes on one lane encoder each, and each encoder's WPP
wavefront splits the cores the lanes leave over. Coding one picture at a
time on every core was measured at 0.63x the old export wall — the batching
is what keeps decode and render fed while a batch codes.

Quality, identical 300-frame 1920x792 film window, matched constant QP,
ffmpeg-decoded, ffmpeg PSNR/SSIM against the source:

  QP 40: 38.05 dB PSNR-Y / 0.9434 SSIM-Y at 2.14 MB
         (was 36.83 dB / 0.9286 at 2.88 MB — +1.22 dB for 25.6% fewer bytes)
  QP 27: 45.10 dB / 0.9811 at 8.35 MB
         (was 44.08 dB / 0.9773 at 9.40 MB — +1.02 dB for 11.1% fewer bytes)
  libx265 intra control at the same QPs: 39.87 dB / 46.37 dB

Perf: export wall over a 300-frame 1080p30 window, 5-sample bench, quiet
box: 12.6-13.0 fps against the old seat's 11.8 (1.07-1.10x).

Bitstream validity: the exports reopen through this project's demuxer in
both containers and decode back to pictures through the VA-API plugin's
HEVC seat (mkv and hvc1); ffmpeg decodes every witness without a complaint
and the 1080p conformance-window export still states 1920x1080 through the
SPS. Suites green: hevc, hevc_export (incl. the hardware and software
roundtrip witnesses), hevc_mkv, hevc_hvc1, export, export_color, backends,
opus_export, lib (373); cargo check -p engine --all-targets with zero
warnings.

2026-09-12

🔥 chore(engine): rusty_aac leaves the tree -- the encode seat was its last job and ec-aac took it in the previous commit; vendor/rusty_aac git-rm'd, the [patch.crates-io] line and the workspace exclude row go with it, Cargo.lock carries zero rusty_aac entries (its lock stanza was dependency-free, so nothing else moves), and the manifest keeps the record in the rusty_h264-common style: a seventh vendor whose whole entry left with its last seat, its decoder IMDCT patch (N/4-point FFT through dsp::dct4, 40x the matrix version) having served the decode seat ec-aac replaced first. Seat comments read past tense. Post-removal: -p engine --all-targets 0 warnings, lib suite 375/375, export 8/8Ahmet Kaan Gümüş · cbad1fe
🔥 chore(engine): rusty_aac leaves the tree -- the encode seat was its last job and ec-aac took it in the previous commit; vendor/rusty_aac git-rm'd, the [patch.crates-io] line and the workspace exclude row go with it, Cargo.lock carries zero rusty_aac entries (its lock stanza was dependency-free, so nothing else moves), and the manifest keeps the record in the rusty_h264-common style: a seventh vendor whose whole entry left with its last seat, its decoder IMDCT patch (N/4-point FFT through dsp::dct4, 40x the matrix version) having served the decode seat ec-aac replaced first. Seat comments read past tense. Post-removal: -p engine --all-targets 0 warnings, lib suite 375/375, export 8/8
🔥 chore(engine): rusty_h264 leaves the treeAhmet Kaan Gümüş · 17b5566
🔥 chore(engine): rusty_h264 leaves the tree

The encode seat was the last linker; the facade, its -common subcrate and
the vendored patch that declawed rusty_alloc all go with it. The SEGFAULT
history (rusty_alloc installing itself as the process global allocator and
dying on a decode worker's first allocation, 2026-08-13) stays written
down, past tense, in both manifests. Cargo.lock carries no rusty_h264,
rusty_h264-common or rusty_alloc entry.
♻️ refactor(engine): the software H.264 seat decodes with ec-h264Ahmet Kaan Gümüş · e24fe61
♻️ refactor(engine): the software H.264 seat decodes with ec-h264

decode::run leaves `rusty_h264` for `ec_h264::H264Decoder` (path dep on
../../edith_codecs, `ec_core` beside it for the registry contract):
packets in over the demuxer's Annex-B access units, frames out through
send_packet/receive_frame with a flush at end of stream so the reorder
delay releases its tail.

Semantics: the old loop emitted pictures in decode order and counted
access units -- a corner-cut that only held for Baseline, and scrambled
exactly the B-picture streams it could not reorder. ec-h264 bumps the
DPB (clause C.4.5.3) and hands pictures back in display order, so the
landing index the demuxer's seek reports and the label each frame ships
with now count the same thing: timeline positions, which the transport,
skip_for_speed and the hardware backend already assumed. Witnessed on
test_high.mp4 (B pictures): the seat delivers 0..150 in order where the
old seat delivered the same frames reshuffled and mislabelled.

Tests: tests/sw_backends.rs is the byte-exactness witness -- ec-h264
against rusty_h264 (kept as the independent oracle) on CAVLC Baseline
and CABAC High fixtures, decode order per position and display order as
a multiset, with the reorder engaged only where the stream reorders;
hw_decode's software halves (seek_matches_linear, range_stops_at_end,
hardware_matches_software_on_frame_30) pass against the VA-API backend.

Throughput (raw demux+decode, idle machine, best of three): 1.52x
rusty_h264 on a 1080p Main export and 1.57x on a 4K Main render, 1.02x
on a 1440p High screen recording, 1.17x on CAVLC Baseline; 0.80-0.81x
on the two B-picture CABAC streams measured -- the measured price of
the full DPB the old seat skipped. cargo check -p engine: 0 warnings.

rusty_h264 stays linked for the export encode seat (Encoder,
EncoderConfig, Preset, YuvFrame) and export's own SwDecoder, so the
dep, the rusty_h264-common vendored patch (the rusty_alloc
global_allocator landmine) and their Cargo.lock entries are load-bearing
until that seat moves to ec_h264::Encoder; caps names the split honestly
('ec-h264 / rusty_h264').

2026-09-06

🐛 fix(engine): a QuickTime .mov keeps its AAC — read v1/v2 sound descriptionsAhmet Kaan Gümüş · 7fbbd0f
🐛 fix(engine): a QuickTime .mov keeps its AAC — read v1/v2 sound descriptions

A Resolve export (qt brand) opened with no sound: mp4 0.14
reads the mp4a sample entry as ISO only, skipping the 8 bytes QuickTime
uses for version/revision/vendor, so a version-1 SoundDescription's
16-byte tail was taken for the first child box and the wave-wrapped esds
behind it never seen -- "trak[2].stbl.esds not found", and with it every
Resolve / Final Cut / `ffmpeg -f mov` file. Vendored mp4 0.14 under
vendor/mp4 (patch table entry, workspace exclude): Mp4aBox::read_box now
reads the version, skips the v1 tail or takes rate/channels from the v2
block, and finds the esds directly or inside `wave`; the crate's ten
lint warnings cleaned with it. New fixture assets/test_qt.mov (ffmpeg -f
mov, same 440/880 tone) and a test in audio_decode that fails on stock
0.14 and passes here.

Verified in the harness on a Resolve export: opens with picture and waveform,
plays (sink RMS -26.9 dBFS), seeks to 00:10 and plays the right audio
(captured peak -11.109 dBFS = source's own). Workspace suite 981/987;
the six failures are five load flakes that pass serially and one
pre-existing failure on clean main (audio_multi layout refusal), logged.

2026-08-22

🐛 fix(engine): H.264 level_idc from Table A-1 on the software seat tooAhmet Kaan Gümüş · 4a00a35
🐛 fix(engine): H.264 level_idc from Table A-1 on the software seat too

rusty_h264 left level_idc at its default 3.0, out of spec above 720p30.
The Table A-1 lookup moves from the plugin into engine::export so both
seats write the same byte; the plugin maps it onto the vendored enum.
Verified: a 2560x1440@30 software export now carries level 5.0.

Also vendors proc-macro-error2 2.0.1 with its `pub use proc_macro;`
re-export dropped (E0365 future-incompat, the one warning left on a
workspace build; nothing names that re-export).

2026-08-13

⚡ perf(cros-codecs): a cache line is flushed once, not sixty-four timesAhmet Kaan Gümüş · 522e89f
⚡ perf(cros-codecs): a cache line is flushed once, not sixty-four times

Unmapping a DMA buffer flushed the CPU's caches back to it a *byte* at a
time -- one CLFLUSH per byte, where a CLFLUSH covers a whole 64-byte line.
That is 3.1 million instructions per 1080p picture, and it was 6.2 ms of the
8.4 ms a hardware export was spending per frame: the encoder maps its input
buffer to write the picture into, and every unmap paid it. The stride is the
cache line now. Upstream's own TODO on those lines asks for this and reports
a race when it was tried; what orders the flushes is the mfence either side,
which is still there, and the sixty-three redundant flushes per line never
were.

The same `drop` also wrote its munmap as `let _ = zip(..).map(..)` -- a lazy
iterator nobody consumes, so no mapping was ever released. An encode session
leaked its 3 MB input mapping every frame, 2.2 GB of address space over a
719-frame export. It unmaps in a `for` loop now, and it unmaps what `mmap`
actually returned: the plane addresses it used to pass are those bases plus
an offset that is not required to be page aligned, which munmap refuses.

Export throughput on the 1080p film, hardware H.264 seat, same 30 s span:
89.9 fps before, 239.6 fps after -- 10x realtime, and the file is the same
file (a ten-second span exported through both builds is byte-identical,
6,379,699 bytes, ffmpeg -v error empty). tests/hw_decode.rs (10),
tests/hw_encode.rs (3) and tests/decode_baseline.rs pass, the pixel oracle
`hardware_matches_software_on_frame_30` among them.
🔧 chore(vendor): cros-codecs learns to write HEVC, from its own branchAhmet Kaan Gümüş · 75da480
🔧 chore(vendor): cros-codecs learns to write HEVC, from its own branch

The vendored 0.0.6 decodes HEVC and encodes H.264 and AV1; the seven
commits behind cros-codecs' `hevc-vaapi-encoder` branch are what give it
the third encoder, and they are carried here verbatim rather than
rewritten:

  * `codec/h264/nalu_writer` - emulation prevention after an escaped byte
    (the same >=5-zero-run bug the vendored H.264 writer had)
  * `codec/h265/nalu_writer` - the H.265 writer that fix belongs to
  * `codec/h265/parser` - VPS, SPS and PPS builders, the SPS deriving its
    own conformance window from the resolution it is given
  * `codec/h265/synthesizer` - the parameter sets written back out as
    NALUs, which is what a driver emitting no packed headers needs
  * `encoder/h265` + `encoder.rs` - initial tunings on the config
  * `encoder/stateless/h265` - the codec and its low-delay predictor
  * `encoder/stateless/h265/vaapi` - the VA-API backend

Applied with `git apply -3`; every hunk landed clean against the local
patches already here, the only file with drift being `parser.rs`, whose
entry-point-offset and sub-layer fixes sit far from the new builders.
The c2_wrapper commit is left out (nothing here uses it) and so is the
Cargo uprev (this tree is path-patched).

Upstream's own tests for the new code pass in the source checkout: 22 in
`codec::h265`, 4 in `codec::h264::nalu_writer`. They cannot run in
`vendor/` because the published crate ships no `src/**/test_data`.
🐛 fix(decode): a seek into an open GOP is hardware's to finishAhmet Kaan Gümüş · 7652ada
🐛 fix(decode): a seek into an open GOP is hardware's to finish

A Blu-ray remux codes its GOPs open: the I picture that opens one is stored
ahead of the leading pictures that are *shown* before it, and those reference
the GOP before. Restart decoding at that random access point -- which is what
every seek, scrub and clip boundary does -- and the leading pictures have
references nobody decoded, so the plugin failed its first frame, playback fell
back to `rusty_h264`, and that decoder died on the file's I_PCM macroblocks.
Seventeen of twenty scrub steps on a 5.27 GB AVC remux ended with no picture
at all, and the three that survived cost 482 ms each in software.

The pictures are not ours to show, so they are dropped and the decode walks on
(bounded by `LEADING_LIMIT`, and only for a session that was positioned
somewhere other than the file's own start). The refusal that the tolerance
would otherwise swallow is kept at both ends: a stream read from frame 0 is
still refused the moment its first picture will not decode, and the plugin
probe now counts an immediate end of stream as a refusal rather than a pass --
a session that hands back no picture is the black-frame-and-instant-eof the
probe exists to catch.

The vendored H.264 decoder's own refusal goes with it: it failed a `frame_num`
gap outright unless the stream declared gaps allowed, which is exactly the
wrong reading here -- the gap is the editor's, made by starting in the middle
of a film, and §8.2.5.2's non-existing frames are what stands in for it. The
loop that builds them was already there, behind that flag.

Twenty of twenty scrub steps on the remux now decode in hardware, 77 ms
median against 482 ms; `seek_matches_linear_every_container` holds for every
container, and `dump_frame <file> <n> <out> seek` is what a picture reached by
a seek can be compared with the same picture reached by decoding from the
start.

2026-08-12

🐛 fix(engine): the codec stops replacing the whole program's allocatorAhmet Kaan Gümüş · c8f62cb
🐛 fix(engine): the codec stops replacing the whole program's allocator

`rusty_h264-common` declares `rusty_alloc` as the `#[global_allocator]` of
whatever links it, and its sibling decoder and encoder turn that feature on
from their own defaults -- so no downstream feature choice could decline it.
Sustained scrubbing churns decode-worker threads, and that allocator faulted
on both ends of a thread's life: on a new one's very first allocation, and
in `Heap::collect_inner` from the `thread_done` TSD destructor. Three cores.

`common` is vendored (the fifth, same idiom as the other four): the feature
stays declared so the sibling manifests still resolve, but it is empty and
the six-line declaration is gone. Not one line of codec code differs from
0.9.1 -- 360 decoded pictures across three fixtures still match ffmpeg's
`framemd5` exactly -- and the process gets glibc's malloc back.

2026-08-11

✨ fix(waveform): a film in an mkv paints its wave, and a failure says soAhmet Kaan Gümüş · ffb3105
✨ fix(waveform): a film in an mkv paints its wave, and a failure says so

A 5.1 AAC track decodes through rusty_aac, whose IMDCT ran as an 8 MB
cosine matrix -- 88% of decode time and 2x realtime, so a two-hour film
needed an hour of background decode before its lane had anything to
draw. The same file has an N/4-point FFT already, for the encoder: the
IMDCT is a DCT-IV read at an offset, so both directions now share
dsp::dct4. 40x on the fixture, 141 s for the film.

And a decode that fails is no longer a silent file: peaks() errors reach
the lane as Wave::Failed with a band that says "audio unreadable", the
reason goes to the log, and the Matroska opener logs what it swallows.
✨ feat(export): HEVC leaves the way it came in — intra, in either boxAhmet Kaan Gümüş · 12f8cb7
✨ feat(export): HEVC leaves the way it came in — intra, in either box

The one codec edith could read and never write. OxideAV's pure-Rust H.265,
vendored from git master (its released 0.0.9 is pre-encoder) with one marked
patch: the intra SPS writer had no conformance window and refused any dimension
off the 16-sample CTB grid, so 1920x1080 could not be written at all. It is now
coded padded to 1088 with the edge replicated and cropped back by the SPS, which
is what ffprobe reads out of the bitstream.

Intra-only, and every row says so: the inter modes code 1080p at 0.81 fps across
twelve cores and the intra path does 4.30 on the same picture, so the export is
an intraframe master — ProRes-shaped, large files, every frame a cut point —
rather than a delivery file nobody would wait for. The AU is a stateless
function of one frame, so frames fan out across twelve lanes and are collected
back in display order.

Two rows, `h` and `x`, because a codec and a container are two choices: the
`hvcC` record built from the encoder's own VPS/SPS/PPS goes into a Matroska
`CodecPrivate` and into an mp4 `hvc1` sample entry unchanged, so the two files
are one stream written twice. Both re-open in edith through the plugin, sound
and all.

2026-08-10

✨ feat(import): a Matroska film opens, its 10-bit picture and its 5.1 sound alikeAhmet Kaan Gümüş · b083a3b
✨ feat(import): a Matroska film opens, its 10-bit picture and its 5.1 sound alike

mkv HEVC demux (Main/Main10), a P010 pool in the hardware path read back to
I420, mkv audio through symphonia's Matroska reader with rusty_aac decoding
what symphonia's own AAC refuses (anything wider than stereo), and a BS.775
fold of 5.1 down to the stereo the output device takes.

vendor/rusty_aac is 0.5.0 with one local patch: its decoder's IMDCT caches the
cosine matrix instead of calling cos() per term, 11x faster and the difference
between playable and not.

2026-08-09

✨ feat(engine): audio decode, PipeWire output plugin, playback clockAhmet Kaan Gümüş · 229a569
✨ feat(engine): audio decode, PipeWire output plugin, playback clock

Wave 1 of the audio slice — three independent modules, app wiring
comes next:

- audio.rs: AAC-LC via standalone symphonia AacDecoder over the
  existing mp4 demuxer; priming trim read from the container elst
  (verified against ffprobe); channel identity pinned by
  zero-crossing tests on the 440/880 Hz fixture
- engine-audio: dlopen'd PipeWire cdylib (ao_* C ABI). App binary
  keeps zero libpipewire linkage; daemon absent fails open() in ~1ms.
  Fill capped at 1024 frames/callback: uncapped, PipeWire hands the
  sink-sized buffer and the position clock steps 256ms at a time.
  Stream time rate is 1/48000 regardless of stream rate — position
  is rescaled or the clock runs 8.8% fast on 44.1k content
- clock.rs: PlaybackClock, audio-driven with wall fallback; audio
  positions relative to last re-anchor so restarted streams re-sync;
  paused == frozen exactly, all re-anchoring through one path
🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui previewAhmet Kaan Gümüş · 0acbf8d
🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui preview

- engine: mp4 demux → Annex-B, rusty_h264 software decode, BT.601
  I420→BGRA; decode on worker thread behind a bounded channel
- engine-hw: optional VA-API decode plugin (cros-codecs) behind a
  C ABI, dlopen'd at runtime with silent software fallback; the app
  binary keeps zero libva/gbm/drm linkage so it runs on any distro
- app: gpui window, per-frame RenderImage swap + drop_image
- vendor/: cros-libva + cros-codecs with 3 LOCAL PATCH fixes (libva
  1.23 struct init, radeonsi 64x64 min context, pub surface()) —
  upstream is dormant, so vendor/ is adopted code, not a temp fork
- fixtures are gitignored; scripts/gen_fixtures.sh regenerates them