forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to crates/engine/src/export.rsClear filter

2026-08-19

🐛 fix(app): the export card tells the truth about a ranged exportAhmet Kaan Gümüş · 906e7de
🐛 fix(app): the export card tells the truth about a ranged export

The size estimate and the audio-codec label both ignored the marked
range (a ranged export re-encodes; the card said copy and quoted the
whole timeline's size). The RANGE duration is computed from the frame
count instead of float seconds, and the speed card's row joins it —
same truncation class. The range band gets 2px boundary ticks so it
reads over the played fill. bench.rs learns export::start's fifth
argument, closing the arity sweep over examples.
✨ feat(engine): per-clip audio fades and adjacency crossfade (edith 18)Ahmet Kaan Gümüş · 4e4ec16
✨ feat(engine): per-clip audio fades and adjacency crossfade (edith 18)

# Conflicts:
#	crates/engine/src/export.rs
✨ feat(engine): per-clip audio fades, adjacency crossfade, and edith 18Ahmet Kaan Gümüş · 6d0747c
✨ feat(engine): per-clip audio fades, adjacency crossfade, and edith 18

Clip carries fade_in/fade_out, an equal-power gain envelope mixed into
playback and export, a crossfade() op that sets both edges of two
adjacent audio clips, and split's rule that only the kept edge keeps its
fade. The project file format bumps to edith 18 to carry the two new
fields; a v17 (or older) file loads with every clip's fades at zero.

Fixes a stray fade_in/fade_out struct-literal fragment left outside any
Clip literal in Player::trimmed (crates/app/src/player/timeline_edit.rs),
which was a syntax error breaking the whole app crate's build.

Adds unit coverage for Fade::gain_at's boundary/midpoint curve, the
split edge rule, crossfade's adjacency refusal, the Clip size-lock
test (40 -> 48 bytes), and a v17-loads-zero-fades / v18-round-trips
edith.rs test.
✨ feat(export): mark an in/out range and export just thatAhmet Kaan Gümüş · a5c0bc7
✨ feat(export): mark an in/out range and export just that

i marks the in point and o the out, on the playhead; ctrl+u clears the
mark. The ruler shows the marked stretch as a translucent band and the
export card states it above the button. Session state only, never
saved to a .edith.

The engine side finishes what a capped predecessor started: run_audio
(the WAV/FLAC/MP3/OGG path) now offsets its segments and clips its
frame count to the range the same way encode_audio already did.
✨ feat(engine): a project can name its own sample rateAhmet Kaan Gümüş · 31981de
✨ feat(engine): a project can name its own sample rate

.edith goes to v17 with an optional samplerate line; the session carries
it, save/load round-trip it, and the one audio-open seam every consumer
shares (open_multi_streams_speed_at) conforms all segments to the named
rate — playback rebuild and both export encoders inherit it for free.
Proxies keep their film's own rate. A v16 file loads with the rate
unset, meaning derived-from-source as before.

2026-08-14

🐛 fix(engine): a bar that has been filled is not taken back when the GPU diesAhmet Kaan Gümüş · 197d1e2
🐛 fix(engine): a bar that has been filled is not taken back when the GPU dies

The hardware encoder's process dying puts the whole export through the
software encoder again, and the bar was put back to zero to do it: a
person watching 93% of a film written suddenly saw 5%, at the one moment
they most needed to believe the editor was still working. The mark holds
instead, and the re-run moves it on once it passes it -- which needed the
copied-picture path to publish with `fetch_max` like everything else.

With it, the rest of that same seam:

* the audio pass is joined however `run` leaves, not detached. The mp4
  path runs the sound beside the picture, and a picture that failed left
  that thread running: the re-run then started a second pass, so a
  machine that had just lost its GPU mixed the same film's sound twice
  at once.
* a dead child is a *type* (`hwproc::Lost`) and not a phrase. `is_lost`
  commits an export to being written again from the first frame, and a
  substring match handed that decision to any future error whose wording
  happened to mention the child.
* a wedged child is waited out by its own measure. The 15 s ceiling is
  what an encoder opening on a 4K frame may need, and it is also fifteen
  seconds an export spends on a child that will never answer again,
  before the software encoder it is owed can begin. Once a child has
  answered its first frames it has said what its frames cost, and eight
  times the slowest of them (never under two seconds) contains a wedge
  in two or three rather than fifteen -- while a slow open still gets
  the whole ceiling and is never killed for being slow. The editor is
  live throughout either way: the wait is on the export's own thread.
* the countdown cannot be handed a rate below zero or a division by
  nothing: a bar that went backwards read as "~0:00 left" over six
  minutes of encoding, and the estimate is a guess, never a lie.
🐛 fix(engine): the seat a test cycles is one no other test is sitting inAhmet Kaan Gümüş · 88ce23e
🐛 fix(engine): the seat a test cycles is one no other test is sitting in

The stand-in encoder seat was armed by a process-wide variable and read by
`hw_seat`, so a software test that had already opened its own export picked
it up mid-flight, met the hang injection, and stalled: `cargo test -p engine
--test export` was green or five-failed depending on the interleaving. The
progress reset the fallback does made it worse -- one cancel test hot-spins
on progress reaching 1.0 and a regression there never ends.

The seat is process state, so it is borrowed rather than assumed: the whole
software suite shares a read guard, exactly as parallel as it always was, and
the encoder-death family takes it exclusively, lifting the software encode
pin only for its own exports and putting it back before it lets go. Which
lets `hw_seat` go back to being production policy with no test flag in it.

Also: a child that does not answer `vh_enc_dma_geometry` is now reaped there
instead of costing the next picture a second whole timeout; the plugin's own
note no longer claims the editor never loads the encode half, when what it
never does is *call* it -- the availability check is a dlopen and opens no
VA-API display; and the guard that refuses to write an export again in
software when a person picked the GPU by name now has the test it was
shipped without.
🐛 fix(engine): the export stops with the last picture, caption or no captionAhmet Kaan Gümüş · 64e09f9
🐛 fix(engine): the export stops with the last picture, caption or no caption

A caption hanging past the media held the timeline open and the picture loop
walked it: 312 encoded frames under a 240-frame delivery, 72 of them black,
the copied sound padded to match, and the plan card saying cues were "cut off
there" of a file three seconds longer than it said.

`export_spans` is now the one place that end is decided -- the composite walk
cut to `media_frames` -- and both the encoding loop and the copy plan take it;
`copy_audio` drops the trailing gap the same walk leaves on its play list.
Playback still walks `timeline_frames`, so the transport parks on the tail.
✨ feat(engine): the driver that aborts kills a process nobody was editing inAhmet Kaan Gümüş · c0a1847
✨ feat(engine): the driver that aborts kills a process nobody was editing in

Mesa's radeonsi calls libc abort() from its own C worker thread when the
video ring resets under it -- amdgpu_ctx_set_sw_reset_status, mesa 26.1.6,
vcn_unified_0 hung during an AV1 encode submission on 2026-08-13. A foreign
thread's abort is not an unwind, so every catch_unwind in the plugin was
structurally unable to see it: the editor died with the driver and took the
session's work with it.

So the encoder is not in the editor's address space any more. HwEncoder is a
handle on a `hw-encode-child` process that dlopens the plugin, and its death
-- by abort, by any signal, or by going quiet past VE_HW_TIMEOUT_MS -- comes
back as an error the export answers by writing the file again in software.
A person who picked the GPU by name still gets the refusal in words rather
than an encoder nobody chose.

Isolation that cost the speed would not be worth having, so pictures do not
travel down a pipe: in-memory ones go through a memfd mapped in both
processes, and pictures still on the GPU never move at all -- their
DRM-PRIME descriptors cross as file descriptors over SCM_RIGHTS, so the
zero-copy export path stays zero-copy across the boundary. Measured on this
box at 1080p: 430 fps in-process, 384 isolated, 89% of it, worst case
(every export of an untouched clip takes the descriptor path instead).

The proof does not need a wedged ring, which is the one thing a wedged
machine cannot supply: VE_HW_TEST_FAKE opens a stand-in seat in the child and
VE_HW_TEST_ABORT / VE_HW_TEST_HANG say where it dies or stops, so the
containment paths are exercised on any machine, GPU or no GPU.

Decode is still in the editor's process, where the same abort would still be
fatal; the seam to move it is now the one this built.
✨ feat(engine): the words a timeline places are the tracks its file carriesAhmet Kaan Gümüş · 0f135a8
✨ feat(engine): the words a timeline places are the tracks its file carries

An export of a project with subtitle placements writes one track per subtitle
lane, in lane order, from the lane's own cues (`Project::sub_lane_cues`) --
language and title from the palette row its first placement plays. The pick
list stays in charge of a project with nothing placed anywhere, which is every
project the app can make today; the card's line goes lane by lane the same way.

A caption hanging past the last picture holds the timeline open but has nothing
under it to write, so an export now ends with the last picture or sound
(`Project::media_frames`): a cue straddling the end keeps the half inside, a
lane wholly past it writes no track, and the plan line says so before the button
is pressed -- and the sound is no longer padded with silence out to the caption.

A lane of pictures is refused in words and written nowhere: both muxers write
text and neither has a bitmap path. Past `MAX_SUB_TRACKS` lanes the card refuses
by name, and the muxer refuses again.
✨ feat(app): the seat that writes the picture is picked on the card, not by an env pinAhmet Kaan Gümüş · 50af5b5
✨ feat(app): the seat that writes the picture is picked on the card, not by an env pin

The export card gains an Encoder row: Auto, Hardware or Software, three rows in a
list like every other setting with more than two values -- `e` steps it, a click
opens the list, and the planned line under the rows re-probes and says which seat
it measured.

Auto is what every export did before (the GPU where there is one). Hardware is
the GPU or a refusal in words -- `Enc::open` refuses before the muxer exists, so
nothing is written -- and it is now the only door to the plugin's AV1 seat, which
`VE_HW_AV1=1` used to guard: an env pin nobody exporting a film would ever find.
A person who picks it for AV1 gets a plain row naming what happened on this box's
driver, and the pick still stands.

Software forces the CPU encoder, which also takes the zero-copy path off the
table by construction (`Enc::dma_want` answers only for the two hardware seats).

Kept with the project: `.edith` gains an `encoder` line at v14, written only when
it is not Auto, and a v13 file loads as Auto.

- engine: `ExportSettings::force_sw` -> `seat: EncoderSeat`; `hw_seat` returns the
  refusal instead of falling back; `planned_video` says `NO_HW_SEAT` where it would
- app: `Pick::Encoder`/`Choice::Encoder`, card row, `e` in the card's own keyboard
  and in the keys menu (`FIXED`)
- tests: the backends sweep runs all three seats (the AV1 hardware seat excepted,
  as before), and asserts the refusal is only what a missing seat produces
🐛 fix(engine): the seat line finishes the sentence about the soundAhmet Kaan Gümüş · aa6d699
🐛 fix(engine): the seat line finishes the sentence about the sound

An mp4 mixes its sound on a thread beside the picture, so the encoders
line is published half-written -- "HW encode (VA-API) · working out the
sound…" -- and completed once the pass is collected. The frame loop does
that where the sound lands under the picture; where the *picture*
finishes first the pass is collected under the muxer instead, and that
path never published again: a card left saying it was still working out
a track it had already written.

The tests read the line the same way now. They took the first one
published, which since hardware encode got fast enough to beat the mix
was the half-line, and `a_mixed_timeline_says_it_re_encodes_and_then_does`
and `the_planned_encoders_are_the_ones_the_job_opens` failed on it every
run; `published_encoders` waits for the line a card settles on instead,
and the mixed timeline runs to the end to read that settled line twice.
🐛 fix(engine-hw): the hardware HEVC seat says what its samples meanAhmet Kaan Gümüş · 9fdee6f
🐛 fix(engine-hw): the hardware HEVC seat says what its samples mean

The plugin's HEVC encoder wrote no VUI at all, so libavcodec read the
stream's colour as "unspecified" and rendered a 709 export through the
601 matrix -- the HEVC decoder takes the bitstream's answer and
overwrites the container's with it, which is why the mp4's `colr` box
and the Matroska's Colour element could not cover for it
(`export_color::every_format_signals_its_space_in_the_bitstream`, both
HEVC containers, whenever the plugin is on the path).

The three H.273 code points and the range flag now go in at the open,
from the same `ColorDescription::output` rule the software intra seat's
VUI and both muxers' tags come from, through the vendored `SpsBuilder`'s
own `video_signal_type`/`colour_description`. A symbol of its own,
`vh_enc_hevc_open_colour`, rather than four more arguments under the old
name: a plugin that predates it is then simply missing the seat and the
export falls back to the software encoder, which has always written the
VUI, instead of being called with a signature it does not have.

2026-08-13

🔀 merge(engine): the stand-in decides one path, and the intra file keeps its marksAhmet Kaan Gümüş · eff035e
🔀 merge(engine): the stand-in decides one path, and the intra file keeps its marks

Lane P's proxy workflow meets a main that had taken S's persistent decode
workers, E's pipelined export and E4's zero-copy encode.

* `start_span` keeps S's reuse door and P's single substitution point at
  once: `picture_path(source)` is resolved *before* the door and handed to
  both halves of it. A worker holding the film is then asked for a span of
  the stand-in, declines on the path it already has (`Worker::reseek`),
  and `set_proxies`' seek becomes a respawn on the other file -- while a
  span that did not change files still costs no thread and no VA-API init.
  Asking the project for the path at the door, as main did, would have
  left every proxied span opening a worker from scratch.
* `Enc::encode_dma` takes P's `intra` flag, which is not symmetry: a proxy
  of a file already small enough is coded at that file's own size
  (`proxy::size_for` -- `wanted` is true for HEVC and AV1 at any size), so
  an intraframe export's decoder and encoder can agree on a surface and
  the buffer goes straight across. Marked `false` there, an all-intra
  stand-in would have carried no sync point at all, which is the exact
  bug `gop_limit` was written against, reached by the other door.
* The five other conflicts were both sides adding a field: `drop_late`
  and `proxies` next to each other, in the struct and in all three opens.
* `enc_depth` is keyed by codec, so the intra seat takes H.264's two. Said
  in its doc rather than left to be re-derived: that seat is the same
  entrypoint with every inter dependency removed, so a picture there is
  finished no later than one on the seat the two was measured on.

`nm -D libengine_hw.so` lists sixteen: P's `vh_enc_open_intra` beside
E4's `vh_next_frame_dma`, `vh_enc_dma_geometry`, `vh_enc_frame_dma` and
main's `vh_seek`. `picture_path` still has exactly one call site outside
the tests, and it is in `playback` -- an export reads the film.

The intra seat and the zero-copy path are read, not run: every test that
would reach either is hardware-gated and the GPU is wedged.
🔀 merge(engine-hw): the encoder that skips the CPU keeps the two it holdsAhmet Kaan Gümüş · 9717151
🔀 merge(engine-hw): the encoder that skips the CPU keeps the two it holds

Lane E4's zero-copy encode path meets lane E's two-picture encoder. Both
touched the same file at the same place and neither knew of the other.

* `vh_seek` and `vh_next_frame_dma` were the textual conflict and nothing
  more: two different symbols added at one spot. Both kept.
* `EncSession::encode_dma` submits a picture like `encode` does, so it
  counts one in `in_flight` -- one session takes both kinds of picture
  (an untouched clip hands buffers over while a graded one or a gap goes
  through the pixel path), and a submission missing from that count is an
  input buffer the pixel path would believe free one picture too early.
* No deferred poll on the dma path, said in a comment where it would go:
  the depth exists to overlap the *next* picture's CPU interleave with
  this one's encode, and a picture arriving on the GPU has no interleave
  to overlap. Draining every call is also what keeps the decoder's own
  hold on the buffer short.
* Per-codec `enc_depth` therefore governs both kinds: the pixel gate is
  the only one there is, and the dma path leaves `in_flight` at its floor.

`nm -D libengine_hw.so` lists both lanes' optional symbols: vh_seek,
vh_next_frame_dma, vh_enc_dma_geometry, vh_enc_frame_dma. The refusal
fallback is untouched -- a buffer the plugin cannot hand over comes back
as pixels, never as a failure.

The dma path itself is read, not run: every test that would exercise it
is hardware-gated and the GPU is wedged.
🐛 fix(export): one bar, two threads, and it may only ever go forwardsAhmet Kaan Gümüş · e5b7da5
🐛 fix(export): one bar, two threads, and it may only ever go forwards

Moving the audio pass onto a thread of its own put two stages on one progress
number, and `encode_audio` still wrote its share of the band with `store`:
every chunk of the mix pulled the bar back to the sound's small figure while
the picture was publishing a large one. Measured on the film's AC-3 track,
12,000 frames: 4,489 backward steps, the worst of them from 5% to 0%.
`fetch_max`, and 0 backward steps over the same run.

The rule is written on `Shared::progress` rather than only at the call site,
because it is the class and not the instance: any stage that can run beside
another writes that field with `fetch_max`, never `store`. A `store` is left
only where nothing else can be publishing at all -- the terminal
`PROGRESS_SCALE`, and the audio-only export that has no second thread.

`encode_audio` also had no cancellation checkpoint anywhere in it, which
nobody could see while it ran in front of the picture: cancelling an export
then left a detached thread mixing the whole timeline behind a job whose
outcome was already settled, still writing into its `Shared`. Measured before
the fix, cancelling a 12,000-frame export one second in: the mixer went on to
finish all 500 s of sound and the process was still busy 1.45 s after the
export reported itself finished -- minutes, on a feature film. With the poll
in the mix loop, and two more before the encoders that have no checkpoint of
their own, the same cancel leaves no thread behind at all (quiet in 0.00 s,
and the "mixed ... s of sound" line the mixer prints on completion never
appears).

And the mp4 muxer's fps on a capped bench run is derived from the highest
progress the poll loop saw rather than from one read at the end, which is the
same fragility one layer up.
🐛 fix(engine): the GPU's stand-in was one starting point long, not every frameAhmet Kaan Gümüş · 60ae56c
🐛 fix(engine): the GPU's stand-in was one starting point long, not every frame

A proxy asked the ordinary hardware seat for a key frame on every
picture, which is not the same thing as an intra-only file and does not
make one: cros-codecs' low-delay predictor takes the keyframe branch
with `idr` false for a forced key frame, writes no SPS or PPS with it,
and `fix_slice_nal_headers` -- which reads the parameter sets to know
what a slice is -- then marks it a plain I slice. A 60-picture hardware
proxy came back with **one** frame a decoder could start on, so its
seeks were the film's own seeks and the whole point of it was gone.
Software was right all along (150 of 150), which is what hid it.

The thing that decides this is the predictor's group limit, and a group
of one picture is what an intra seat is: the counter is then pinned at
zero, every picture takes the keyframe branch as an IDR, and every
access unit carries its own parameter sets. That is the HEVC seat's own
mechanism, now the H.264 one's as well.

Its own plugin symbol (`vh_enc_open_intra`) rather than a flag on the
existing one, matching the AV1 and HEVC seats: a plugin built before it
exists has no intra seat, and the caller then takes the software encoder
-- which codes one frame a GOP and writes what was asked for -- instead
of being handed a long-GOP file under a name that promises otherwise.
`intra_only` on anything but the mp4 pair is now refused by name.

Checked without a GPU: the group limit and the IDR-marking rule are both
unit tests in the plugin. The hardware end-to-end twin (`sync_points`
== frame count) is written and `#[ignore]`d, for a machine whose GPU is
not wedged.
⚡ perf(export): the sound is worked out under the picture, not in front of itAhmet Kaan Gümüş · cd31ad1
⚡ perf(export): the sound is worked out under the picture, not in front of it

An export mixed, encoded and held its whole audio track before a single frame
was decoded, because the muxer was handed the track when it was created. On a
feature film that is minutes of nothing visible happening, and it was pure
waiting: an mp4 writes its audio samples after the last picture anyway.

So the mp4 muxer declares its audio track where it writes it. `mp4 0.14`
builds the movie box at the end from the tracks in the order they were added,
and the samples go into `mdat` in the order the caller writes them, so a track
added before the first picture and a track added after the last one produce
the same file -- which is checked and not argued: a ten-second span of the
film exported before and after this is byte-identical, md5
73f1a9ca9b2eb1c4a7a8f8d467e7635e either way.

With that gone, the audio pass runs on a thread from the top of `run` and the
picture starts immediately. Where it is *waited* for is the whole design: a
Matroska file interleaves audio into its clusters from the header on, so that
path still collects the pass before the first coded picture (nothing there to
overlap, and the copied-picture path is the same muxer); an mp4 collects it at
the frame where the thread happens to have finished, and failing that after
the last one. Collecting inside the loop is not tidiness -- a mix this engine
cannot decode used to refuse in seconds, and an overlapped pass that reported
only at the end would spend the whole encode first.

Measured on the film, 600 s span, AC-3 5.1 re-encoded to AAC: the audio pass
now completes 4.5 s and 7.0 s into the picture on two runs (`export audio:
done N s into the picture`), where before it stood in front of it. The wall
clock says 214-229 fps against 199-268 for the serial build -- this box was
running four other agents' benchmarks and its noise (±30%) is wider than the
10% this is worth on that path, so the stage lines are the evidence and the
fps numbers are not.

Two smaller things fall out. The progress bar advances with `fetch_max`, so
the audio's share of the band cannot pull it backwards while the picture
pushes it forwards. And the encoder line says "working out the sound…" until
the pass is collected -- the half-line the copied-picture path already used --
so what it publishes is still never a codec that did not run.
⚡ perf(export): the picture the GPU decoded is the picture it encodesAhmet Kaan Gümüş · 366171b
⚡ perf(export): the picture the GPU decoded is the picture it encodes

An untouched clip's frames never leave the card: the decode session hands
its DRM-PRIME buffer over and the encoder imports it, so an export of a
clip with no grade, no tone map, no matrix remap and no canvas to place
on costs neither the `vaGetImage` read-back nor the NV12 interleave back
up -- both of which used to run once per frame, per side.

Three optional plugin symbols carry it (`vh_next_frame_dma`,
`vh_enc_dma_geometry`, `vh_enc_frame_dma`), so an older `libengine_hw.so`
reads back exactly as it did, and any refusal at all -- another coded
size, another fourcc, a driver whose export the plugin will not take, a
software decoder on the other end -- hands the pixels over instead of
failing. The decode session keeps six pictures out of its pool while
they are outstanding, and reserves six extra buffers the moment a caller
asks, so a decoder is never robbed of its own.

Measured on the film, 60s span, hardware H.264 both ways: 94.58 -> 276.46
fps median, 46.9s -> 15.6s wall, and 37.6s -> 0.5s of user CPU. SSIM
against the source frames is 0.964490 where the read-back path scores
0.964506 -- the same picture, coded by the same encoder.
✨ feat(engine): the picture may come off the stand-in, the delivery never doesAhmet Kaan Gümüş · 79c69dd
✨ feat(engine): the picture may come off the stand-in, the delivery never does

One switch for the project, saved with it as the v12 `proxy` line, and
one place that reads it: the span open asks `picture_path`, which hands
back the stand-in where the cache has one and the film itself
everywhere else. The sound is opened elsewhere and is always the film's;
`export` reads the project's own sources and knows nothing of proxies,
so a delivery cannot come off one -- and both sides now say out loud
which file they read (`export source:` / `picture: proxy`), so that is a
grep rather than a belief.

*Which* films have a stand-in is deliberately not saved: a proxy is
found by the film's own path, length and modification time, so the cache
is the single answer and a project file cannot go stale about it. A v11
project loads unchanged and is cut on its films, which is all it could
ever do.
✨ feat(engine): a big film gets a small stand-in to cut withAhmet Kaan Gümüş · 83e561d
✨ feat(engine): a big film gets a small stand-in to cut with

A proxy is the film at 1280 on its long edge, every frame an IDR, no
sound in it at all: a seek lands on the frame asked for instead of on
the nearest one a decoder can start from, and the mix stays the
original's.

Generation is the export walk given a one-clip project and a smaller
canvas, so the hardware seat, the progress and the cancel are the ones
a file export already had. Two switches were wanted for it: `intra_only`
(one frame a GOP on the H.264 pair) and `keep_source_colour`, which
carries the film's own space into the stand-in instead of converting it
-- that conversion ran on the source's full 4K, cost 48 ms a frame and
was the whole of a proxy's price, and leaving it to the screen means the
tone-map preset can still be changed after the stand-in was made.

The cache is keyed on the source's path, length and modification time,
so a re-encoded original misses rather than reading a stale stand-in.

A 4K HDR film: 2.35x realtime on the VA-API seat, against 0.59x before
the colour switch; a cancel leaves neither the file nor its .part.
✨ feat(export): the GPU takes the HEVC export againAhmet Kaan Gümüş · e6624f3
✨ feat(export): the GPU takes the HEVC export again

The seat goes back to being the default, with the reason it was safe to make
one restored rather than assumed: both HEVC seats code intra-only, so
preferring the GPU changes how long an export takes and not what comes out of
it -- and there is now a test that says so about the *pixels*
(`a_1080p_hardware_export_leaves_a_decoder_with_nothing_to_say`) rather than
about the frame count.

Measured on this box's radeonsi/VCN before the flip, every export decoded by
ffmpeg with an empty error channel: a 60 s span of a 1080p source at SSIM
0.976/0.965/0.983/0.971 over four spread frames, a 3840x1600 HDR film at 0.947
against the H.264 hardware export of the same span, a 2560x1440 capture --
whose height is not a coding tree multiple -- at 0.873/0.880/0.881, and the
sub-384 picture still falling to `oxideav-h265`.
🔧 chore(export): the GPU's HEVC seat waits behind a flagAhmet Kaan Gümüş · c67649f
🔧 chore(export): the GPU's HEVC seat waits behind a flag

Its pictures are wrong on real material -- a garbled band over flat green,
one `CABAC_MAX_BIN` notice per frame -- while the frame count decodes clean,
so nothing that only counts frames ever saw it. The software intra encoder
takes HEVC again until that is found and proven gone; `VE_HW_HEVC=1` asks
for the GPU, exactly as `VE_HW_AV1=1` does for the other opt-in seat.
✨ feat(export): the GPU takes the HEVC export, and it is the same fileAhmet Kaan Gümüş · bacbe9f
✨ feat(export): the GPU takes the HEVC export, and it is the same file

`HwEncoder::open_hevc` on the plugin's new symbol, and `hw_seat`'s HEVC
arm goes from a flat `None` -- "the plugin has no HEVC encoder" was true
and is not any more -- to a real probe. Unlike the AV1 seat it is **not**
behind an opt-in, and what makes that safe is that both HEVC seats code
intra-only: preferring the GPU changes how long an export takes and not
what comes out of it, which is the whole reason AV1's `VE_HW_AV1` exists
and does not apply here.

`Enc::HevcHw` beside `Enc::Hevc`, and every unit it hands back is marked
a sync point, because that is this encoder's configuration rather than a
driver's choice. Falling back is silent and covers all of it: no
entrypoint, a plugin too old to carry the symbol, a picture under the
driver's 384x384 floor, `VE_SW_ENC=1`, or the export card's own "software
only" -- `hw_seat` answers `None` before it probes for the last two, as
it always has.

The caps line stops saying HEVC is decode-only on this GPU.

Measured on this box, both against the software seat's 4.30 fps at 1080p:
1440p at 74 fps, 1080p at 117 fps, output decoding frame for frame.
chore: rename ponytail: comment marker to corner-cut:Ahmet Kaan Gümüş · 9ba8e0a
chore: rename ponytail: comment marker to corner-cut:

Marker convention renamed after uninstalling the ponytail plugin;
semantics unchanged (deliberate corner-cut, known ceiling + upgrade path).
Token-only rename, 81 comment lines, no code change.
✨ feat(export): the custom bitrate reaches fifty, and the wheel takes it thereAhmet Kaan Gümüş · dadd2f4
✨ feat(export): the custom bitrate reaches fifty, and the wheel takes it there

The ceiling was twenty, which was never an encoder's limit: it was the top
of the range the exporter *derives* an automatic bitrate in, borrowed as the
cap on a number a person typed. An asked-for rate has its own ceiling now
(MAX_EXPLICIT_BITRATE), and the card offers all of it.

And a range fifty wide is not a range a stepper walks: the wheel over the
custom row moves it, one step a notch, up for more -- the gesture the
timeline already zooms and scrolls with. It moves the field while one is
open, exactly as the arrows do, so the two ways in never disagree about
which number is being changed. Hold-to-run stays the keyboard's, as it is
on every other card here.
🐛 fix(export): the decode thread says how it ended, and is waited forAhmet Kaan Gümüş · ba88e8f
🐛 fix(export): the decode thread says how it ended, and is waited for

Two hazards the thread brought in, neither of which the serial decoder had.

A panicked decode thread dropped its sender saying nothing, and a shut channel
read as end of stream: the span ended "because the source ran out", the export
wrote what it had and reported success. A truncated file that says it finished
is the one outcome an export must never have, and before the decode moved onto
a thread the same panic took the whole export down. So the thread now states
every ending down the channel -- a picture, an error, or the `Ok(None)` that is
end of stream -- and a channel that shuts without one of them is the failure it
is. A source genuinely shorter than the clip that names it still ends its span
gracefully, and asking again after that stays end of stream rather than turning
into a disconnect.

And the thread was never joined. `decode::Worker` states why it must be: one
abandoned inside `vaInitialize` outlives the process, and Mesa's `atexit`
handlers free the state it is still reading -- a SIGSEGV at exit, long after
the export succeeded. The handle is kept and joined on drop, after the receiver
beside it, which is the field order `decode::FrameStream` is written in: the
disconnect is the only thing that wakes a decoder parked in a full send, so
joining first would wait for a consumer that is never coming.

Throughput is where it was (93.3 fps on a 1080p minute, hardware encode) and
the round-trips hold on both seats.
⚡ perf(export): the decoder stops waiting for the encoderAhmet Kaan Gümüş · b728a45
⚡ perf(export): the decoder stops waiting for the encoder

An export decoded a picture, encoded it, decoded the next: two engines taking
turns, each idle while the other worked. The decode now runs on a thread of its
own and hands pictures over a channel two deep, so the encode of picture n
overlaps the decode of picture n + 1 -- and the bound is what keeps it honest,
since a decoder that ran ahead without one would hold a film's worth of 3 MB
pictures.

The thread is also where the plugin is opened: a VA-API session is not ours to
pass between threads, so the open happens there and its failure comes back down
the channel, which is why a vanished source and a codec with no decoder still
fail the export rather than looking like a clip that ran out.

A 1080p h264 minute exports at 93.3 fps against 73.4 (hardware encode) and
18.3 against 17.5 (software, where the encoder is the wall). The written file
is the same one: 1438 frames for the 60 s span, 59.977 s at 24000/1001, zero
errors decoding it back, and the round-trip tests hold on both seats.

2026-08-12

🐛 fix(export): the sound gate judges the middle of what it hears, and says which codec it wroteAhmet Kaan Gümüş · 6b7076f
🐛 fix(export): the sound gate judges the middle of what it hears, and says which codec it wrote

Two defects the sampled gate's own first run on a real film exposed.

**The statistic was wrong.** A worst-of-windows rule at 0.95 refused a film this
encoder handles perfectly well: forty five-second windows of one mix, encoded at
128 kbps and decoded back, read

    0.803  0.835  0.938  0.940  0.960  0.987  ... median 0.998 ... 0.999

so five of the thirty-nine that carry sound sit under the threshold on a *good*
track -- the same thing OPUS_MAX_KBPS's own table shows, where a span scoring
0.937 at 128 kbps is inside the usable band. What the gate exists to catch is
the opposite shape: a rate the encoder cannot hold ruins the track wherever that
rate is used (0.452/0.697/0.951 at 136 kbps, 0.06 at 256). Half a track cannot
go without the middle of the list moving, so the median separates the two by a
margin no single window can, and a track under a minute is still one window --
median and whole-track correlation are the same number there.

Measured, this film: worst-window 0.8467 (refused, sound written as AAC),
median 0.9982 (taken, written as Opus).

**And the fallback was invisible.** The line the export publishes named "Opus ·
SW encode (opus-rs)" for *every* Matroska encode, because the label it borrowed
predicts from the format and cannot know what the gate decided -- so a track the
gate had just sent to AAC was announced as Opus, on the one path where the
difference is audible. `measured_audio_label` fills in the half a prediction
cannot know.

    cargo test -p engine --release --test video_copy -- --include-ignored
      7 passed in 133.2 s; the film exported in 98.5 s, 27944 MB, Opus
⚡ fix(export): the sound of a feature film is measured in a minute, not in half an hourAhmet Kaan Gümüş · 3fc6753
⚡ fix(export): the sound of a feature film is measured in a minute, not in half an hour

An mkv export of a two-and-a-half-hour film wrote zero bytes for twenty-one
minutes and then failed its own test's ten-minute cap. All of it was the Opus
fidelity gate: `ruopus` is built here without its `spectrograms` feature, so its
inverse MDCT is an O(n²) DFT with a `sin_cos` per term and decodes at 0.2x real
time. Measured on a two-minute window of a real 4K film (the new
`export_audio_cost` example, and the three `export audio:` lines it reads):

    mix (E-AC-3 5.1 -> stereo)   0.7 s
    Opus encode (opus-rs)        0.3 s
    fidelity decode-back        24.2 s   <- 98.6% of the pass

So the gate now samples: twelve five-second windows spread across the track, a
warm-up per window because CELT predicts across frames, and the *worst* window
is the answer -- which is harsher than the old whole-track sum, where a ruined
minute averaged away against two good hours. What it looks for survives
sampling: OPUS_MAX_KBPS's cliff is a rate the encoder falls off, not a defect of
one bar of music. A window with no sound in it is skipped rather than scored
0.0, which is what a silent timeline used to score before falling back to AAC.

...and the export no longer decides what it is *after* paying for the sound:
CopyPlan is consulted first, so the line on screen says "copy" from the first
second, and the audio pass owns the head of the progress bar instead of leaving
it at zero for as long as it runs.

Beside them, for the card that has been predicting the wrong export in both
directions: `planned_seats` asks the export's own gates what it would open, and
`sync_points` hands a front-end the frames a cut may be placed on.

    cargo test -p engine --release --test video_copy -- --include-ignored
      7 passed in 157.6 s (was: failing the 600 s cap)
🔀 fix(export): a copied picture names the sound it was really written withAhmet Kaan Gümüş · 64cb44f
🔀 fix(export): a copied picture names the sound it was really written with

The copy path and the Opus seat landed in the same function from two lanes and
published two different sentences. The encoder path already names the codec the
mix was *measured* to have taken; the copy path was still handing the card the
same prediction the card shows before an export starts -- so an mkv whose mix
fell back to AAC would have run under a line saying Opus, on precisely the
exports that are over in a few seconds.

Both branches now read the one flag `copy_audio` came back with. The check is
the seam itself: an untouched HEVC timeline (copied block for block) with a 5.1
Opus source folded onto its audio lane (encoded), asserting the published line
is "copy · Opus · SW encode (opus-rs)" and that the file carries A_OPUS and no
A_AAC.
✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusingAhmet Kaan Gümüş · c94ba8b
✨ feat(audio): convert wide layouts and off-rate sources at import instead of refusing

An 8-channel Opus track came back "IMPORT FAILED: unsupported channel
layout: 8 channels (max stereo)" and took the picture with it, and a
48 kHz file "audio 48000 Hz 2 ch does not match the timeline's 44100 Hz
2 ch". Both strings are gone: an import converts.

Width: `fold_5_1` becomes `downmix`, a coefficient table per layout from
2.1 to 7.1 (ITU-R BS.775 — front channels keep their side, centre and
surrounds join at -3 dB, LFE dropped, both sides normalised by their own
coefficient sum so a full-scale source cannot clip). 5.1 comes out of the
table bit-identical to what it was. `vorbis_to_film_order` gains the RFC
7845 permutations for 3, 5, 7 and 8 channels beside the 6 it had, so
surround Opus at any width reaches the fold in the order the fold reads.
The AC-3 decoder's own 2.1 passthrough, which it leaves at 3, folds here
too, and a multichannel AAC track in an *mp4* now takes the `rusty_aac`
route the Matroska side already had (`aac_decoder`, one call for both).

Rate: the segment resampler a speeded clip already goes through takes the
source rate over the timeline's into its step, so the two compose into one
interpolation and 48 kHz onto a 44.1 kHz timeline keeps its pitch. All of
it is convert-on-read — per packet in the decoder, per buffer in `emit`,
after the window trim — so there is no upfront pass to show progress for
and nothing to cancel.

What is still refused is the layout alone: a mono track cannot join a
stereo timeline, in the words "audio 1 ch does not match the timeline's
2 ch". The picker's grey-out rule follows the gate rather than leading it.

Measured on a 12.9 GB 2160p AV1 remux with a real-library 7.1 Opus
track: imports, opens as a timeline, and a ten-second WAV export comes
back at RMS 0.0091 left / 0.0085 right.
🔊 feat(export): an edited Opus source leaves an mkv as OpusAhmet Kaan Gümüş · 76ede8e
🔊 feat(export): an edited Opus source leaves an mkv as Opus

Opus could be read here since `ruopus` landed and could not be written at
all, so every cut of an Opus film came out as AAC in a Matroska file: a
codec downgrade nobody asked for, paid on every edit. `opus-rs 0.1.26` is
the encoder half -- a pure-Rust port of libopus 1.6, BSD-3, no `build.rs`,
not one `.c` in the crate and no dependencies at all (checked, not read off
the README) -- and a Matroska export now writes `A_OPUS` with an `OpusHead`
in its `CodecPrivate`, `CodecDelay` and the codec's fixed 80 ms
`SeekPreRoll` beside it. An mp4 still says AAC and the mp4 writer now
refuses an Opus track by name rather than declaring `mp4a` over it.

Only where an *encode* was going to happen anyway. An untouched timeline
still copies its packets, bit for bit, into the same container: Opus is what
an edit costs, never what a passthrough costs.

The envelope is measured and it is narrow, which is the whole story of this
crate. On three one-second spans of a 5.1 Opus film, encoded here and
decoded with `ruopus` -- not the suspect, it reads ffmpeg's libopus at 256
kbps back at correlation 1.00000 -- the encoder is usable to 128 kbps
(0.937/0.989/0.994) and ruined by 136 (0.452/0.697/0.951), against libopus
at 0.997/0.998 on the same material. Pure-tone fixtures put that cliff at
165 kbps, so its edge moves with the content and no constant is safe on its
own: the cap is 128 kbps *and* every track is decoded again and correlated
with the mix before it is written. Below 0.95 the export writes AAC instead,
and the encoder line the export publishes says AAC, so the fallback is
visible rather than silent. Mono keeps AAC outright -- this encoder mis-codes
it at every rate asked for here -- and so does any timeline that is not
48 kHz, since Opus has one rate and resampling a whole timeline to reach it
is a bigger change to the sound than the codec is.

Two delays, both measured rather than hoped for. The pre-skip is 1080
samples: the encoder's 2.5 ms lookahead plus one warm-up frame, because a
cold first frame comes out ramped and out of phase (the head of the fixture
went 0.9788 -> 0.988 correlated once it was fed its own first 20 ms first),
and one silent frame is pushed in at the end so the last 2.5 ms leave the
encoder instead of ending the track short under a picture that is not.
ffmpeg's decode of the file agrees with this project's own reader sample for
sample, which is what says the header describes the stream.

`tests/opus_export.rs` exports a cut and reads it back through symphonia's
mkv reader and `ruopus` -- 0.9948 left and 0.9825 right against the source,
0.997/0.993 past the first frame -- proves the AAC copy still wins where it
applies and that a mono mix takes the AAC path, and, with `EDITH_OPUS_FILM`
pointing at a real-library Opus mkv, cuts a span out of the film itself:
correlation 0.9914 at a lag of one sample. The unit test in `export.rs` pins
the 256 kbps failure, so the day the crate fixes it this suite fails and the
cap can be raised.
✨ feat(export): an untouched Matroska timeline leaves as its own packetsAhmet Kaan Gümüş · ada6ac5
✨ feat(export): an untouched Matroska timeline leaves as its own packets

The picture's half of what `copy_audio` already did for the sound: where a
copy says exactly what the timeline says, the coded blocks of the source are
written straight into the file and no decoder or encoder is opened at all.

The gate is the audio one's doctrine, not a looser one -- Matroska in and
Matroska out, the source's codec is the one this format carries (HEVC for
`Format::Hevc`, AV1 for `Format::Av1`), and nothing has touched a sample: no
grade, no speed, no rate conversion, no gap to fill with black, no source of
another size, no `ContentEncodings` packing to undo. Every span must begin on
a sync point and end where the next begins, which is what placing a cut on a
keyframe gives it.

All or nothing per export, and that is the interesting constraint: a copied
span and an encoded one cannot share one track, because this project's
encoders write 8-bit SDR streams with parameter sets of their own and a
container states its configuration record once -- splicing them into a Main 10
HDR source would change bit depth and colour mid-track. So the head and tail
fragments of a cut that lands mid-GOP are not re-encoded into the copy; they
are what makes the whole export fall back to the encoder it always used.

A copy keeps its source's `Colour` as well as its `CodecPrivate`: an HDR film
copied is still the HDR film, because not one of its samples was touched. The
blocks are timed by their source's own timestamps (`MkvMuxer::write_block`)
rather than by a frame counter, without which a stream with B-frames -- stored
in decode order, timestamped in display order -- would play its groups of
pictures in the order they were coded in.

An open-GOP source writes leading pictures after a sync point that are shown
before it and reference the group before it; at the start of a copied region
those references are not in the file, so they are dropped rather than written
as pictures no decoder can put back together. The region still starts at the
timeline frame it owns, so the sound never drifts.

Measured on a real-library 4K x265 HDR Matroska of 2h30m (167671 pictures),
five minutes cut out of the middle on two sync points: the export takes 162 s
and writes 10.8 GB, against a re-encode of the same timeline measured at
0.94-1.75 pictures a second -- 25 to 47 hours for the same file. Every block
sampled either side of the join is its source's own bytes, the shown order is
one unbroken frame grid, and the pictures two seconds either side of the join
decode through this project's own decoder without an error.
✨ feat(subtitles): as many tracks as you want, embedded in the exportAhmet Kaan Gümüş · 28e2853
✨ feat(subtitles): as many tracks as you want, embedded in the export

Subtitle tracks now work the way audio and video tracks do: add as many
as you like, remove any of them, and every track with cues on the
timeline is written into the exported file.

Add and remove
- "+ S" beside "+ V"/"+ A" imports every subtitle track in a picked
  file; each row carries its own "x". Pointer and keyboard doors share
  one implementation and refuse identically, before any chooser opens.
- Project::remove_subtitles / PlaybackSession::remove_subtitles, with
  the index fixup in one place so a removal cannot repoint the overlay.

Embedded in the output
- ExportSettings.subtitles is a list; the Matroska muxer writes N tracks
  from number 3 up, ceiling derived from the encoding (0x7F -
  SUB_TRACK_FIRST) because track 127 is the all-ones VINT our own reader
  maps to "unknown" and would silently lose.
- mp4 carries them too, as real tx3g timed text. The old "an mp4 carries
  none" was a false refusal: mp4 0.14 has MediaConfig::TtxtConfig all
  along. Samples are built from cue boundaries, so gaps are empty
  samples and the track spans the film.
- of_mp4 reads them back, so edith re-imports its own output. Verified
  against a file ffmpeg muxed, which writes mdhd in microseconds where
  we write milliseconds.
- The export set is derived from timeline_cues per call, so it cannot
  desync; the card names a track it leaves off, and counts past the
  width budget rather than eating the card.

Language and title
- SubtitleTrack carries language and name apart; the guess-them-back
  heuristic is gone. LanguageBCP47 is read and mapped to a 3-letter code
  (ffmpeg reads no BCP-47 at all, so writing it would have made the
  language invisible). A 17-track subtitle library file and a
  dual-language one no longer read "und".

Media bitrate in properties
- engine::probe_bitrate opens no decoder; all three numbers share the
  container's duration, so total >= video + audio holds by construction.
  Within 0.004% of ffprobe across the library.
- Both properties cards show it; a dual-audio file says which of how
  many. The line picks one unit off its smallest stated component, so a
  real value never renders as 0.00.

Off the render thread
- The subtitle walk moved to the background executor at every door:
  1324ms -> 0.1ms on a 3.1GB film, 234ms -> 5.0ms on a 25.4GB/35-track
  one. (The media walk is still on the render thread; separate slice.)

False refusals removed
- .mks and .mka were refused while the compiled-in Matroska reader
  parses them; is_matroska now takes the standard's closed set.
- The audio-only "sound alone" sentence was unreachable when every pick
  was a bitmap track.

Subtitle-free exports stay byte-identical: 294a8b0c (hevc mkv),
8c16b8b1 (default mp4).

2026-08-11

✨ feat(tonemap): the reference rendition converts a film at the peak the film declaresAhmet Kaan Gümüş · 27097e2
✨ feat(tonemap): the reference rendition converts a film at the peak the film declares

`Demuxer::light().peak()` -- a stream's MaxCLL, or its mastering display's
maximum -- has been read at every open and dropped on the floor. It now reaches
`ToneMapper::new` as `declared_peak`, and `Preset::master_nits_for` is the whole
composition rule: `Reference` takes the film's number (1000 stays the fallback
for a file that declared nothing), `Standard` and `Vivid` keep their fixed 400
and 250, because a picked exposure that moved per file would not be a pick.

One HDR film declares 1759 cd/m^2, so its 1000-nit highlights
land at SDR 215 instead of clipping at white, and BT.2408 diffuse white at 145
instead of 166.

Both sites that build a table have the demuxer in hand already, so nothing is
promoted through `VideoMeta`: the decode funnel reads it before the worker takes
the demuxer, and `source_rate` returns it off the header parse export already
did -- which is what keeps preview and export on one number.

A declared peak is a stranger's number and is checked before it becomes a
divisor: outside 100..=10000, or a NaN, is treated as not declared.

test_hdr_bright.mkv joins the fixtures for it -- the older HDR metadata ones all
say 1000, which no picture can tell apart from the fallback.
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for youAhmet Kaan Gümüş · 09671f7
✨ feat(tonemap): the HDR rendition is a row you pick, not a constant someone chose for you

BT.2446 Method A's assumed mastering peak was a constant in the module: 400
cd/m^2, one exposure decided for everybody. It is a matter of taste, not of
correctness -- a reference rendition and a vivid one are both honest pictures of
the same film -- so it becomes a project setting with three renditions through
the very same curve, which is what keeps the hues right whichever is picked:

  Reference  1000 nits, chroma 1.0   the published conversion (diffuse white 166)
  Standard    400 nits, chroma 1.0   display-referred, as bright as a player
  Vivid       250 nits, chroma 1.10  brightest, and a tenth more colour

The chroma gain is a scale about 128 in the SDR codes, after the map and clamped
to the legal range: a grey stays exactly grey at any gain, and at 1.0 it is a
clamp the maths cannot reach, so the other two presets are byte for byte what
Method A produced. HLG's OOTF gain is guarded at black -- below a 1000 cd/m^2
peak the system gamma is under 1, and the 0 * inf that follows byte-cast to 0
and put a hole where black belongs.

The preset lives on the Project beside the limiter (a setting, not an undo step),
reaches the decode workers and the export through the same value, and is saved as
a `tonemap` line in edith 11 -- left out when it is the default, so a project
holding no HDR media is the bytes it was, and a v10 file loads as the reference
rendition, which is the only one it ever had. Picking one rebuilds the picture
under the playhead the way a resize does; an SDR project is unmoved.

The panel names it beside the resolution and the rate -- the third thing that is
the project's rather than the media's -- and a click opens the three renditions
with the one in force marked. No stroke: this is a list to look at.
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the gradeAhmet Kaan Gümüş · f390c37
✨ feat(export): an HDR source is tone-mapped into the file's SDR, once, before the grade

The export path read a PQ or HLG source's tags, wrote an SDR file and left the
pixels on their HDR curve: a washed-out, flat picture in a file that says
BT.709. `engine::tonemap` existed and nothing called it.

One `ToneMapper` per source stream -- the 9 537-node table is built beside the
per-source rate and colour, not per span -- and one call per frame, into the
grade scratch the path already owns, ahead of `apply_yuv`. That order is
playback's: the grade is a decision made against the SDR picture on the canvas,
so applying it to HDR codes would export a picture nobody saw.

The matrix remap that used to be the whole of the answer now asks `remap_into`,
which knows the tone map hands back BT.709 whatever the source was coded as: an
HDR clip is never *also* given the 2020 matrix treatment, and one on a canvas
below 720 lines still takes its 709 -> 601 step.

An SDR project is byte-identical: no table is built, no branch is taken.
🐛 fix(color): the bitstream says which matrix it is, and a grade happens where the preview grades itAhmet Kaan Gümüş · 86c11d8
🐛 fix(color): the bitstream says which matrix it is, and a grade happens where the preview grades it

Two faults the container-level tests could not see.

An HEVC export carried its colour in the file's tags and nowhere in the
stream, and a decoder reads the stream first: libavcodec inferred
"unspecified", which is BT.601, and rendered a 709 export from the wrong
matrix (9.78 mean codes off the right render against 2.27 off the wrong
one). The vendored encoder now writes a §E.2.1 VUI carrying the colour
description, from the same `ColorDescription::output` rule the muxers
tag with, so the two halves of a file cannot drift apart. rav1e gets the
same signalling for the same reason; `rusty_h264` has no VUI knob at all
(`vui_parameters_present_flag` is hardcoded 0), and H.264 only ever
ships here inside an mp4 whose `colr` box rescues it.

...and an export remapped a clip into the file's space before grading
it, while playback grades in the source's own space and converts for the
screen -- so a graded 601 clip on a 709 canvas came out 21.04 mean codes
away from the picture the canvas had shown. The grade goes first now,
which is the order `Decoded::frame` renders in.

Measured, on the frame-0 rig: preview vs export 21.04 -> 0.15, and
`ffprobe -show_frames` on the raw HEVC and AV1 elementary streams reads
bt709 where it read unknown. An ungraded same-space export is
byte-identical to before.
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that oneAhmet Kaan Gümüş · 907dfc5
✨ feat(export): a file says which matrix its numbers are in, and its clips are all in that one

Exports carried no colour tags at all: the numbers went out as they came off
the decoder and every reader downstream had to guess. A 601 clip beside a 709
one went out as two spaces in one file, and nothing said so.

Now every export declares a space -- BT.709 at 720 lines and up, BT.601 below,
the same rule a reader with no tags applies -- in the Matroska `Colour` element
and the mp4 `colr` box, and a clip coded against the other matrix is rewritten
into it before it is graded. Same-space clips take the path they always did and
not a byte is touched.
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads itAhmet Kaan Gümüş · 070ffe6
✨ feat(colorspace): a file says which matrix and curve its numbers are in, and edith reads it

Three tiers, per field: the container's own tags (Matroska `Colour`, mp4
`colr`), then the bitstream's (H.264/HEVC SPS VUI, AV1 `color_config`),
then the ffmpeg/mpv resolution rule -- 720 lines or taller is BT.709,
below it BT.601, limited either way. A code that says nothing, or says
something with no implementation here, falls to the next tier rather than
answering wrongly.

`VideoMeta` carries the answer; nothing consumes it yet. Everything still
renders through the hardcoded BT.601 it always did, which is the bug this
is the foundation for fixing.

The bit-level walks are where this can quietly go wrong: an SPS whose
scaling lists are counted wrongly lands the VUI read in the middle of a
coefficient. Both are measured -- H.264 and HEVC against hand-built
parameter sets (no encoder here writes SPS scaling lists), the rest
against fixtures tagged in the container, tagged only in the bitstream,
and tagged nowhere, plus the two real films: a 4K HDR remux that reads
BT.2020/PQ and a fully untagged 720p one that reads BT.709.
🩹 fix(subtitles): the grafts off the losing PGS laneAhmet Kaan Gümüş · bf65371
🩹 fix(subtitles): the grafts off the losing PGS lane

- The overlay is a flex box with the canvas as its one growing item,
  fitted (Contain) the way the picture under it is: size_full inside an
  absolutely placed box has nothing to be a percentage of, and Fill put
  every cue somewhere the disc did not.
- One way out of subtitle_overlay, and it lets the drawn picture go on
  the way: the toggle going off leaked an 8 MB atlas tile per press.
- A track is pictures because of its codec id, not because its first cue
  happens to be one: an all-erase or empty PGS track passed for text and
  an export promised words it has none of.
- The sup handed to the decoder stops at the end of the first display
  set that composes something, so a muxer packing the erase into the
  same block no longer blanks the cue.
- The film-gated session test: the row a click picks, the map a repaint
  asks for twice (under 16 ms warm), the picture it draws.
✨ feat(subtitles): a PGS cue is a picture the timeline carries, not a row that says noAhmet Kaan Gümüş · c45b18e
✨ feat(subtitles): a PGS cue is a picture the timeline carries, not a row that says no

The four S_HDMV/PGS tracks of a BluRay remux were listed and greyed: pictures,
and nothing here could draw one. Now the cue IR carries a picture beside its
text -- `Cue::image`, a `CueImage` holding the display set the Matroska block
held -- and the rows are rows a click can pick.

The decoding is `oxideav-sub-image`: the run-length walk, the palette, the
YCbCr and the object fragmentation are not this project's to re-derive. What is
written here is the framing between the two -- a Matroska block is a `.sup`'s
segments with the `PG` magic and the timestamps taken off, so they go back on --
and the pairing PGS needs and text does not: half the blocks compose nothing,
which is the disc clearing the screen, and that is where the cue before them
ends. `BlockDuration` is zero on every one of them, so `end_of` now reads a zero
the way it reads a missing one.

Kept encoded, decoded when something is about to draw it: this film's canvas is
8 MB of RGBA and its four tracks carry eleven thousand display sets, so the IR
holds the thirty megabytes the file already spends and the front-end keeps one
decoded picture for as long as its cue is up.

An export still writes a text track, so a track of pictures writes none and the
card says "drawn, not written" before the button. A `.edith` is unchanged: it
held a file and a track number and never a cue, which is why a bitmap track
round-trips without the format knowing it exists.
✨ feat(export): OGG Vorbis is a row you can pick, not a note about missing encodersAhmet Kaan Gümüş · 17d7d99
✨ feat(export): OGG Vorbis is a row you can pick, not a note about missing encoders

The export card said "no pure-Rust Vorbis or Opus encoder" and that had stopped
being true. `rusty_vorbis` 0.1.1 (Apache-2.0, zero dependencies, same family as
the h264/aac/mp3 encoders already here) is the first permissively-licensed
pure-Rust Vorbis *encoder*; `oxideav-ogg` 0.1.8 pages it, and its only dependency
is the `oxideav-core` the AC-3 decoder already pulls in. No C, no FFI, no new
runtime system dependency -- `ldd` on the binary is unchanged, name for name.

The row is live, keyed `o`, and names its encoder like every other live row does.
VP9 stays refused with the reason it always had: AV1 replaces it.

What the bench found, and what the code does about it. Every number below was
measured by encoding this suite's own fixtures and decoding them back with
symphonia -- an independent decoder, and the one this engine reopens exports
with:

* The encoder numbers its granules a full block ahead of the samples it codes,
  so written straight through, every sample lands ~1024 early: a marker signal
  came back with its head at 36% amplitude and a full-scale burst 1500 samples
  before the real one, in silence. One hop of silent pre-roll puts it back --
  head 0.86 against an input peak of 0.80, the phantom burst down to 0.04.
* Its block grid overshoots the last sample, so the stream is padded and the
  last page's granule declares the timeline's own frame count. An `.ogg` is now
  exactly as long as the WAV of the same timeline, which is the promise every
  other audio row here keeps.
* Below quality 0.50 the encoder is *quiet*, not merely coarse (1-1.6 dB of
  level error, near-silence at 0.10), and the whole usable band tops out around
  200 kbps. So the file is written at one measured quality, 0.85, and the Sound
  row is refused by name rather than mapping 128/192/256/320 onto quality steps:
  the top two are rates this encoder cannot reach, and a card that printed them
  would be lying.
* The embedded setup header is a stereo profile -- a mono push is refused
  outright -- so a mono mix is written as dual mono, both channels bit-identical.

And one defect the round trip turned up on the way in: `SymTrack` subtracted
`Track::delay` on top of symphonia, which already drops those frames itself.
Every `.mp3` import was losing its first 1105 samples (25 ms) and reading 25 ms
short, every `.ogg` its first 128. Measured against `test_tone.flac` -- lossless,
and the only one of the three declaring no delay -- which the mp3 and the ogg of
the same tone now align with. WAV, FLAC and AAC-in-mp4 read hash-identical
across the change; only those two formats move, and both move to the length
their own container declares.
🐛 fix(subs+eos): the plate reads the map the file is written from, and a knob past the end leaves the end aloneAhmet Kaan Gümüş · 2bee9c3
🐛 fix(subs+eos): the plate reads the map the file is written from, and a knob past the end leaves the end alone

The overlay and the timeline strip drew every subtitle track on the raw
timeline clock while the export carried an embedded track through the cuts
(export::timeline_cues), so a rippled timeline previewed one thing and wrote
another. Both now ask that one map through PlaybackSession::timeline_cues --
preview and file agree by construction, and a standalone .srt keeps the
timeline clock it always had.

And the end of stream: is_eos promised that "any edit after the end revives
the session", which a sound-only edit never did. The transport's own model
says it should not -- eos means the picture worker ran out, reseek_audio
starts no picture worker, and reviving on an EQ tweak would spend the Ended
state that makes the next press restart from the top. The doc now states that
rule and a test pins it.
✨ feat(export): the subtitles leave with the fileAhmet Kaan Gümüş · df92458
✨ feat(export): the subtitles leave with the file

A Matroska export now carries the picked subtitle track as S_TEXT/UTF8:
a TrackEntry beside the picture and the sound, and one BlockGroup per cue
— Block plus BlockDuration, because a SimpleBlock has nowhere to say when
a line goes away. Interleaved into the clusters as the AAC packets are,
so a player has the cue by the time it needs it.

The cues are put on the exported timeline first. A track that came out of
a media file is timed against that file, so it is carried through the
spans that still play it: a cue over a stretch that was cut out is gone,
one straddling the cut keeps the half that is still there, and everything
after a rippled delete moves back with the picture it belongs to. A
standalone .srt has no clip to hang on and no offset to shift by, so it
stays on the timeline's own clock — the one the overlay drew it at —
clipped to the exported length. A cue nothing clipped keeps its own
microseconds, so an untouched timeline exports the times the source
states, to the millisecond the file is written in.

An mp4 says so instead of pretending: tx3g is a different beast and
nothing here writes one, so the export card carries a Subtitles row that
reads "test_subs.srt → embedded", "mkv only — an mp4 carries none" or
"none" before the button is pressed.

Exports without a picked track are the files they always were: the track
entry and the blocks are written only when there is one.
✨ feat(export): the sound has a bitrate you pick, in every file that codes oneAhmet Kaan Gümüş · 2169fb8
✨ feat(export): the sound has a bitrate you pick, in every file that codes one

The rate was 256 kbps in two places nobody could reach: the AAC a video
export re-encodes and the MP3 the audio row writes. Both now take
`ExportSettings::audio_kbps` -- 128, 192, 256 or 320 -- and `None` is
still 256, so an export nobody touched writes the bytes it always did.

The card grows a Sound row on `b`, cycling like the container row. It
dims with the reason where there is no rate to pick: no sound on the
timeline, a lossless format (WAV, FLAC code samples and not a rate), or
an AAC track that is copied packet for packet and carries its source's.
The MP3 quality refusal stopped claiming a fixed 256 kbps, since the
Sound row can now change it under the summary.

Probed rather than promised: an mp3's frame headers declare 128/256/320
as asked, and an mp4's AAC track measures within a fifth of the request.