forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to crates/engine/tests/rotation.rsClear filter

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-24

🐛 demux: close the block walk's unchecked add, and one mkv conventionAhmet Kaan Gümüş · 7a52aa1
🐛 demux: close the block walk's unchecked add, and one mkv convention

Four things the re-verification left behind, each either the same class as what
this lane already fixed or a promise its new text made.

The video block walk's own timestamp -- the one a copy reads -- was still
accumulated unchecked (`cluster_ts + i64::from(block.rel)`), one step before the
scale the subtitle walk widened: a crafted cluster near the top of what an `i64`
holds overflows the add before anything could refuse the product, and the block
is taken at a time that wrapped negative. Both walks now call one `block_ticks`,
and the unit test covers the add as well as both scales.

`VideoMeta::rotation`'s doc listed a spherical projection among the turns refused
at the door, but `projection_rotation` deliberately does not refuse those -- the
pose of a spherical projection is the sphere's orientation, not the picture's --
so the sentence says that instead of claiming a refusal no code makes.

The mkv door fed the *coded* height to the 720-line rule an untagged stream's
matrix is guessed from, where the mp4 door feeds the displayed one. That was
harmless until this lane made the two differ, and then an untagged turned `.mkv`
and its `.mp4` twin landed on different matrices: 1280x640 as stored, 640x1280 as
shown, so bt601 against bt709. Both doors now feed the height the picture is
*shown* at, and `test_rotation90tall.{mp4,mkv}` (generated, untagged in both
containers) pins it -- the assertion fails with the coded height, which was
verified by putting `video.height` back and watching it fail.

And the export test runs on the mkv twin too, because a turn reaches the export
through exactly one number (the source's `Rotation` in the export's rate table),
and only a both-doors test shows a door that reads its own spelling into that
number differently.

cargo check -p engine --all-targets: 0 warnings. cargo test -p engine --test
rotation: 5 passed. subtitles: 22 passed. cargo test -p engine --lib: 392 passed,
0 failed. rustfmt --edition 2024 reports the same nine pre-existing hunks on
demux.rs as base, none in the added code, and none on the test file.
⏪ demux: keep the turn, drop the display size; widen the block walk's ticksAhmet Kaan Gümüş · 9b42f9f
⏪ demux: keep the turn, drop the display size; widen the block walk's ticks

The display-size adoption is reverted: `VideoMeta.width/height` mean exactly
what they meant at base again -- the coded size with the turn applied -- and
nothing reads `pasp`, `DisplayWidth`, `DisplayHeight` or `DisplayUnit` any more.
Reading them without applying the pixel aspect anywhere in the pixel pipeline
made an anamorphic source *worse* rather than better: the canvas of a freshly
opened file is built from `meta.width/height`, while `Render::frame` only rotates
and placement is an aspect-preserving `Fit` of the coded frame, so a 1440x1080
source became a 1440-wide pillarboxed picture inside a 1920x1080 canvas with the
bars baked into the preview and the export; and `CopyPlan::of` hands those two
numbers to `CopyParams`, so an exact Matroska copy declared PixelWidth 1920 while
copying 1440x1080 blocks and dropped the source's display elements -- a file that
plays right nowhere. Anamorphic support is a feature slice (the stretch stage in
`export::place_picture` and in the decode funnel), not a container-reader fix, so
it leaves together with its fixtures and the test that asserted it.

Kept, because they are the defect this lane was chartered for: the Matroska
`Projection` roll is read as the turn it is (`rotation_of_roll`,
`projection_rotation`, with the same refusal by name for anything that is not a
quarter turn) -- now asserted for the mkv twin too, which was generated but read
by nothing before.

And the multiply the subtitle walk had is widened for the block walk a copy
reads: `coded_block`'s `ts_ns` was `block.ts * timestamp_scale` in `i64`, where a
crafted cluster timestamp overflows -- a panic in debug and a negative block time
in release, silently. One `ticks_scaled` now serves both walks, and the unit test
covers both (microseconds at `per_tick` 1_000, nanoseconds at 1).

cargo check -p engine --all-targets: 0 warnings. cargo test -p engine --test
rotation --test subtitles: 4 passed + 22 passed. cargo test -p engine --lib: 392
passed, 0 failed.
🐛 demux: read the turn and the shown size a file states for its pictureAhmet Kaan Gümüş · 30b435d
🐛 demux: read the turn and the shown size a file states for its picture

A Matroska `Projection` roll, the `DisplayWidth`/`DisplayHeight` pair and an
mp4's `pasp` box were read by neither door, so a rotated `.mkv` played and
exported sideways, and an anamorphic source -- HDV's 1440x1080, a DVD's 720x576
with a display width -- probed, previewed and exported squashed. Neither had a
message: both were silent wrong output.

The engine could already turn a picture (`scale::rotate_i420_90s`) and already
collapsed a file's coded size into its displayed one off an mp4 `tkhd` matrix.
Both doors now do the same two steps in the same order: the size the file says
the picture is shown at, then the turn. The roll is *negated* to get the quarter
count -- it counts counter-clockwise degrees where the matrix counts clockwise
turns -- and that direction is measured, not derived: the new
`test_rotation{90,180,270}.mkv` fixtures are the same quadrant source as their
`.mp4` twins (one `ProjectionPoseRoll` of +90, +180, -90, byte-verified by
walking the header), ffmpeg reads each back as the same display matrix, and both
autorotate to the same four corners -- which is what `tests/rotation.rs` asserts
corner by corner, through the preview funnel as well as the probe.

A rectangular projection mirrored or tilted out of its own plane is refused by
name like the mp4 door refuses a 45-degree matrix: mkvmerge v95 states a mirror
with a yaw, and a picture out of plane has no rendition here. A spherical
projection's pose is left alone -- on those the same elements describe the
sphere, and a flat player shows a 360 file rather than refusing it.

The subtitle walk's tick arithmetic is widened to `i128` and made fallible: the
multiply is where a corrupt cluster timestamp overflows, a panic in debug and a
negative cue time in release, silently.

Fixtures live in `assets/`, which is gitignored and symlinked to the shared pool,
so they are generated rather than committed: `scripts/gen_fixtures.sh` writes
both the mkv turns and the anamorphic pair.

Still open, and not made worse here: the anamorphic *placement*. `Composer`
letterboxes, so a 1440x1080 picture in the 1920x1080 canvas the file states gets
bars rather than its samples stretched to the shown shape -- the stretch belongs
in `export::place_picture` after its turn, and in the decode funnel for the
preview.

2026-09-18

🐛 fix(media): audio routing, session audio re-arm, hw trailing-zero NALs, display-matrix rotationAhmet Kaan Gümüş · bc8b82e
🐛 fix(media): audio routing, session audio re-arm, hw trailing-zero NALs, display-matrix rotation

- is_audio admits .mpeg/.mpg so mp3-with-cover files import (was fed to Mp4Demuxer)
- session audio walks past trackless leading sources and re-arms when a
  sounding file joins a silent timeline (fixes add/remove/add silence)
- engine-hw pump clears trailing cabac_zero_word bytes instead of dying
  with code -2; export falls back to software decode before first frame
- tkhd display matrix read for mp4; 90/180/270 turns baked into preview
  and export pixels; other angles refused by name (UnsupportedRotation)