forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on ef5832fea151ca30db92b142c8de131c5f43fc49Filtered to crates/engine/examples/bench.rsClear filter

2026-08-20

2026-08-19

✨ feat(engine): clips can name a dissolve into their neighbor (edith 19, storage+format)Ahmet Kaan Gümüş · 8369d8e
✨ feat(engine): clips can name a dissolve into their neighbor (edith 19, storage+format)

transition_out frames on a video clip dissolve it into the adjacent
next clip; split keeps the tail's transition clamped and zeroes the
head; v18 files load with hard cuts, v19 round-trips bit-exactly.
Blending (playback and export) lands separately.
🐛 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, 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.

2026-08-15

🐛 fix(bench): the cutloop timeline is the keeps aloneAhmet Kaan Gümüş · 4bd886f
🐛 fix(bench): the cutloop timeline is the keeps alone

The freeze metric's harness, corrected on its first live runs: the
holes are the odd clips of the cut list and the tail past the last
keep is the last one, deleted from the far end down so no delete
moves an index still to be named (repeatedly deleting index 1
alternated hole, keep, hole, keep); V1 names each hole and the group
takes the A1 half of the take with it; the end of the last keep is
cut so the run plays the keeps and not the rest of the film; and a
shape guard refuses a timeline that is not the keeps it asked for.
The spans before and after the deletes go to the log as provenance.
🐛 fix(playback): a silence cut's boundary decodes forward, not flushAhmet Kaan Gümüş · e045b5e
🐛 fix(playback): a silence cut's boundary decodes forward, not flush

Cutting silences leaves a timeline of same-file micro-clips, and every
boundary reseeked the worker the expensive way: decoder FLUSH, demuxer
seek to the RAP, skip-decode RAP->clip-start (up to a GOP of VCN work,
the GPU spikes), then a re-prime whose ~178ms ttff at 4K outlasts the
0.15-0.65s clips -- so the picture starved while the continuous audio
feeder played on (the freeze), and LATE_RESYNC answered the starved
picture with another flush storm every RESYNC_GAP.

- engine-hw: seek_to reaches a target ahead of the decoder, within
  FORWARD_SECS (0.5s) of it, by decoding forward and dropping through
  the existing skip path -- no flush, no RAP seek, no re-prime; behind,
  past the reach, and past EOF keep the flush. Decision extracted as
  the pure reposition() + tests; position tracked per popped handle.
- playback: the session reports picture_priming() -- owed from span
  start until its first frame -- and the player's resync waits out a
  prime instead of restarting into it (resync_due, constants kept).
- bench cutloop: the freeze metric -- an N-region cut timeline played
  end to end, displayed/dropped per second, restarts and resyncs.

2026-08-14

✨ 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

2026-08-13

Merge branch 'worktree-agent-a1dbd9ef7cdaec697'Ahmet Kaan Gümüş · 1cb74a4
Merge branch 'worktree-agent-a1dbd9ef7cdaec697'

# Conflicts:
#	scripts/bench.sh
🐛 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.
🔧 chore(bench): an export measurement may carry the sound it is judged byAhmet Kaan Gümüş · 56e406a
🔧 chore(bench): an export measurement may carry the sound it is judged by

The export metric covered picture only, and a floor phrased as "twice real
time end to end" cannot be read off it: the audio pass is inside that wall
clock. BENCH_EXPORT_AUDIO puts the same clip on an audio lane and names the
row `_av`, so the two numbers can never be mistaken for each other;
BENCH_EXPORT_ASTREAM picks which of the file's tracks it is, a film's second
one being the one no sample table can copy (this film's AC-3 5.1 re-encodes
at 43x real time, its AAC stereo copies) and therefore the one that measures
the re-encode; BENCH_EXPORT_SPAN sets how much timeline a measurement covers,
since sixty seconds of a two-hour film says nothing about the pass that runs
once per export.

And scripts/bench.sh built the plugin it depends on with a target filter that
excluded it: `--example bench` selects no target in engine-hw, so a fresh
target directory produced no libengine_hw.so and every "hardware" row was
software with nothing on it saying so -- the exact silent fallback the
LD_LIBRARY_PATH comment three lines below it warns about (11.55 fps against
94.58 for the same span, measured 2026-08-13). Two builds now, and the script
refuses to run at all if the plugin is not where the loader will look.
✨ feat(bench): a seek storm and a play loop, and the underruns they costAhmet Kaan Gümüş · 8271b5d
✨ feat(bench): a seek storm and a play loop, and the underruns they cost

The complaint is a long film jumped around in: the sound runs dry and the
picture jumps. Neither was measurable. The audio plugin counted its starved
callbacks and only whispered them on the way out, so a session could be asked
nothing while it ran; `ao_underruns` reads the same counter -- two relaxed
atomic loads, nothing added to the RT path but one store on the starved branch
-- and `PlaybackSession::audio_underruns` hands it over in device seconds. The
picture's half is `restarts`, counted where a worker is replaced, so a seek, a
clip boundary and a late-picture resync all land in one number.

Two metrics use them. `seekstorm` plays the file and seeks fifty seeded random
places, cold then warm, and reports first-frame p50/p95/max beside the
underruns each pass cost -- playing, because a paused device runs no callbacks
and can never starve. `playloop` runs the app's own pump for N seconds with a
jump every five, and reports the gap between frames (p50/p99), the underruns
and the restarts, with its own count of late-picture resyncs beside them.

Both name the decode backend in the note, as seek and scrub already do: a row
that does not say `backend HW` was measured in software.

And it would have been. `cargo build -p engine-hw --example bench` selects
example targets in every package it is given, and a cdylib is not one, so the
line that exists to build the plugin built nothing and the LD_LIBRARY_PATH
below it pointed at an empty directory. The plugins are their own build now.
🔧 chore(bench): a seat for hardware HEVC, and a run that may keep its fileAhmet Kaan Gümüş · 57f6721
🔧 chore(bench): a seat for hardware HEVC, and a run that may keep its file

`bench export <file> hevchw` measures the GPU seat; plain `hevc` still
means the software one so a row keeps comparing with the baselines
already recorded against it, and `scripts/bench.sh` sweeps both.

`BENCH_KEEP=1` leaves the exported file where a run would have deleted
it, which is how a seat is checked for decodability -- `ffprobe
-count_frames` on what it actually wrote -- rather than for speed.
⚡ perf(waveform): a film's envelope is read by several handsAhmet Kaan Gümüş · 50e3988
⚡ perf(waveform): a film's envelope is read by several hands

Importing a source decodes its whole audio track for the lane's waveform, and
on a film that is the longest thing an import waits for: 22.7 s of one core for
a 2 h 39 m 5.1 E-AC-3 mkv, 3.8 s for a 2 h stereo AAC mp4. It is linear in
length and nothing about it was parallel, though `open_multi_streams` has
always taken a window per call and seeked to it.

So a source long enough to pay for the extra opens is cut into windows -- one
per minute, capped at the machine's cores and at eight -- decoded side by side
and stitched. The first window is the session that was opened to learn the
length, so a split costs `jobs - 1` opens and not `jobs`. Joining is safe
because the fold is min/max into absolutely-numbered buckets: the chunk that
straddles a joint is folded into both windows and cannot be double-counted.

The 2 h 39 m mkv's 22.7 s becomes 4.6 s and the 2 h mp4's 3.8 s becomes 1.2 s,
bucket count identical either way. A clip under two minutes is read exactly as
it was, on the calling thread. `bench waveform <file>` is the metric.

2026-08-12

📊 feat(bench): the decode/encode baseline, measured on real 4K filmsAhmet Kaan Gümüş · cb2833f
📊 feat(bench): the decode/encode baseline, measured on real 4K films

Nothing in this tree said how long an open, a seek, a scrub or an export
actually take on the files this editor is used on -- 5 to 30 GB HDR mkvs,
where a fixture's five seconds says nothing. Every later codec change is
supposed to be an improvement over *something*, and this is that something.

`examples/bench` measures one metric per process, on purpose: a decoder
that panics on its own thread must cost one row and not the run. It
reports medians of five with the min and max beside them, because on a
file this size the spread is the finding as often as the middle is.

  * `open`   -- `Demuxer::open`, cold and warm. Cold is the file's pages
                dropped with posix_fadvise(DONTNEED) on a fd of our own:
                no root, no drop_caches, nothing else evicted, and
                advisory -- so a cold number is the optimistic end of
                cold, and the header says so.
  * `seek`   -- first-frame latency at t=30/600/5400 s down the deferred
                opener, which is what every seek and clip boundary uses.
  * `scrub`  -- twenty steps waited for one by one, then twenty with no
                wait at all: the first is latency, the second is what a
                drag storm does to the thread count, which is the number
                the abandoned-worker problem is actually about.
  * `export` -- throughput over a fixed 60 s span, one encoder seat per
                run, video only so a sound track that refuses cannot take
                the picture's measurement with it. A run that outlasts its
                cap is cancelled and still reports a rate, marked CAPPED,
                rather than reporting nothing.

`scripts/bench.sh` drives the list and writes the TSV. Its one trap is
worth the line it costs: the plugin is looked for beside the running
executable and an example binary lives a directory below it, so without
LD_LIBRARY_PATH every seat silently reads "SW" -- measured on the small
control file as 23 ms versus 1359 ms for the same seek. The file list is
read from $BENCH_LIST outside the repo: what is measured is a personal
library, and its names are not this project's to record.