961 upstream commits since 7bb6c900. Resolutions:
- Test-only conflicts: upstream tests from before the base that our side
cut stay cut; tests new upstream are kept (audio aac/config, layout,
encode_format; cms lutfile; media mux; print windows_native, ticket;
update self_update; xml hostile).
- Code our side moved, with upstream's change carried to the new place:
craft-media mux roll sample groups (mux/boxes.rs) and writer-start
offsets with overflow checks (mux/progressive.rs); craft-print's
shrink-to-fit scale guard (sheets/plan.rs); craft-update's nextest
archive detection (self_update/detect.rs); craft-vectorcraft-format's
Tail::write_to_with (container.rs); craft-i18n's pedantic fixes
(bidi.rs, negotiation.rs).
- craft-ui: the old crate's modules stay removed; gpu_test_lock guarded
their per-test wgpu renderers, which the snapshot kit does not have.
- New upstream tests in crates that build their integration tests into
the library's test executable are modules of tests/main.rs (audio
flac_decode and qoa_oracle, cms, docpath, pcraft-format,
vectorcraft-format).
- The 22 new crates are optional members of the craft facade.
- framework-01-w13: written from its sheet
- framework-01-w13: review fixes (review-1)
- framework-01-w13: review fixes (review-1, files the rulings name)
- Integration: ButtonGrid is an unregistered container (panels-w11 a16470ef9)
* ci: cancel superseded Workspace pull-request runs
The Workspace workflow (the native, MSRV and WASM legs) had no concurrency
group, so every push to a lockfile or dependency pull request started a second
full set of runs while the first set kept going, up to three runners each.
Give pull requests one group per pull request, so a newer push cancels the
older run, and give every other run a group of its own, so a main push, a
release tag or a manual run is neither cancelled nor replaced while queued.
github.ref is refs/pull/<n>/merge for a pull request, so two forks with the
same branch name stay separate. The pattern is the one merged in #772 for the
23 crate workflows, which left this reusable-workflow caller out.
The gate commands, jobs, inputs, matrices, timeouts, triggers and permissions
are untouched.
scripts/test-workspace-concurrency.py checks the policy itself: the two fields
and their documented expression shapes, one group per pull request and one per
other run, cancellation on a pull request only, and no job-level concurrency.
It reads the workflow without wiring anything into CI.
* test(workspace-concurrency): reject a scalar concurrency value
`read_concurrency` matched any line starting with `concurrency:` and read the
indented lines under it as fields. Under `concurrency: |` — a block scalar, not
a mapping — the workflow would have passed every policy check with the reader
alone, while the `PyYAML` cross-check that catches it is skipped when PyYAML is
absent. `concurrency: some-string` was rejected only by accident, through the
empty field set.
Require the header itself to be `concurrency:` (an inline comment allowed), and
test both scalar shapes. CodeRabbit found this on the pull request.
* sonar: analyse the Workspace concurrency guard as a test
scripts/test-workspace-concurrency.py is a unittest module: each case reads a
workflow and asserts on the policy. Listing it in sonar.test.inclusions keeps it
analysed as test code — linted, indexed and reported — instead of counting it as
production code that needs coverage, which is what failed the quality gate at
0.0% Coverage on New Code.
The exact path is appended to the three existing Rust patterns, so no other
script, and nothing else in the repository, is reclassified. No coverage
exclusion, quality threshold, workflow or build change.
* ci: run the Workspace concurrency guard in the gate
scripts/test-workspace-concurrency.py guarded the policy only when someone remembered to
run it, so a reworded concurrency block could land with 16 green checks. The gate's
`command` step now runs it before the cargo steps; `command` covers the Linux and macOS
legs, and it is one python3 call that needs nothing installed and fails in a second, ahead
of an hour of building.
The Windows leg keeps its existing `windows-command`: the script passes on a CRLF copy of
the workflow, but this change does not put an untested step on Windows.
Merging main in brought cms.yml, menu.yml and the wasm job back, and their
action refs had no lockfile entries, so `gh actions-lock --verify` failed.
Regenerated with `gh actions-lock`; the four refs it normalized resolve to
the commits already in use.
EffectCraft's `effectcraft-opusenc` as `opus::encoder` (and
`opus::Encoder`) behind `opus-encode`: SILK, hybrid and CELT, 48 kHz,
20 ms frames, mono or stereo. The constructors and `encode_float`
return `Result` instead of panicking. `Bandwidth` is one type for the
decoder and the encoder, and the two `Mode` enums convert into each
other. `encode` now turns on `opus-encode`.
The encoder tests (modes, ffmpeg's two Opus decoders as oracles) and
`TrackDecoder` on Opus without an `OpusHead` come with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
202 upstream commits since 6cb00467a. Resolutions:
- craft-window, craft-platform: ours. Upstream's frame policy v2, restore
store and GNOME light/wait_first are the versions carried on 28 Oct;
ours moved place() to craft-behavior and kept LayoutWatch and the
appearance/portal.rs split.
- craft-timeline: ours. craft-time (crates/time) lands as upstream wrote
it and is not yet used by craft-timeline.
- Old crates/ui modules stay removed. Upstream's frosted backdrops, shape
gallery, dialog tabs and the iconic flyout top-edge rendering are not
carried. The #1094 model half is in craft-behavior's dock:
Group::flyout_offset and Action::MoveFlyoutTop.
- craft-update: #586 Save and Update, the install probe on the check
thread and quiet per-user MSI self-updates, carried into updater.rs,
stack_dialogs.rs, install/windows.rs and self_update/helper.rs.
- craft-jpeg: progressive Huffman decoding, carried into huffman.rs,
parse.rs and scan.rs.
- craft-print: the driver settings dialog's new tests and the bounded
XML parse's tests, as trials.
- Test-only conflicts: upstream tests from before the base that our side
cut stay cut; tests new upstream are kept.
* craft-cms: run the CMS suite in CI; say when system-profile checks are skipped
* craft-cms: satisfy clippy's chunks_exact_to_as_chunks lint in the total-ink test
---------
Co-authored-by: aiongg <aiongtaigi@gmail.com>
* ci: run craft-menu's fmt, clippy (Linux, macOS and wasm targets) and tests when menu, keymap or quit change
---------
Co-authored-by: aiongg <aiongtaigi@gmail.com>
craft-prepress depends on linesweeper, and #633 adds a copy of it in
vendor/linesweeper and runs its tests from scripts/test-pdf-backends.sh.
Without this path, a pull request that changes only that folder runs
SonarCloud and none of these tests.
---------
Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
Fails the build when .github/workflows/actions.lock stops matching the
workflows, or when a locked pin no longer verifies upstream, so a stale or
tampered lockfile cannot go unnoticed between dependency updates.
Mutable action tags are a supply-chain risk: a moved tag runs different code
without a diff. Every workflow action is now pinned through
.github/workflows/actions.lock, and CI verifies the lockfile so an out-of-sync
or tampered one fails instead of running.
Twelve format crates had no workflow of their own: xml, mime, cfb, mesh,
metafile, dxf, gcode, svg-paths, silhouette-studio, tiff, heif and cms
(cms ran only under the PDF workflow's paths). formats.yml runs fmt,
clippy (default, each feature alone, all features), the tests and a
wasm32 check for each.
The coverage build compiled none of the codec code that sits behind
features that are off by default, so new code in craft-video, craft-audio
and craft-media read as untested and failed the quality gate. The
SonarCloud job now passes those features to the shared workflow.
video.yml's per-feature clippy also covers vp9-decode and vp9-encode.
Each third-party action that StepSecurity publishes a secure drop-in
replacement for now uses that replacement, pinned to a commit with its
version as a comment. Versions follow what we used: the newest
StepSecurity release in the same major, or the closest major they
publish. dtolnay/rust-toolchain refs that named a toolchain (stable,
nightly, 1.76) become the replacement's `toolchain` input.
Adds step-security/harden-runner (audit, pinned to v2.22.4 like
craft-common-actions) as the first step of each job that did not have it,
so every workflow in the org's public repos reports its egress to
StepSecurity. Audit, not block: block-mode allow lists come from each
job's observed traffic.
The eight-part craft-video series landed as one commit, because each part's branch contains the parts before it.
- #702 dnx: DNxHD/DNxHR decoder and encoder
- #703 vp8: VP8 decoder
- #704 prores: ProRes decoder and encoder
- #705 h264: H.264 encoder
- #706 hevc: HEVC encoder
- #707 vp9: VP9 encoder
- #708 av1: AV1 encoder
FilmCraft's MPEG audio Layer I/II decoder as `craft_audio::mpa` behind
`mpa-decode`, kept over symphonia's: the same quality where both
decode, and it also decodes the MP2 files ffmpeg writes by default
(mono at 384 kbit/s), which symphonia rejects. `TrackDecoder` and the
native read path take MP1/MP2 in MP4, Matroska and raw streams;
symphonia keeps MP3 only, so its `mp1` and `mp2` features are dropped.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
* craft-audio: AC-3 and E-AC-3 decoder
FilmCraft's AC-3 decoder as `craft_audio::ac3` behind `ac3-decode`:
every AC-3 channel mode and frame size, and E-AC-3 independent
substream 0 with spectral extension, in WAV order without downmix.
`TrackDecoder` and the native read path take AC-3 and E-AC-3 in MP4,
Matroska and raw streams.
Not bit-exact: zero-bit mantissas are filled with decoder-specific
dither (A/52 §7.3.4), so tests compare at 65-94 dB SNR on tones and
27-48 dB on white noise. 7.1 E-AC-3 decodes as its 5.1 core.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 1 (#447)
An AC-3 / E-AC-3 packet is as long as all the primary syncframes in it.
Before the first decode, TrackDecoder::frames_per_packet gave 1536 for any
AC-3 track, and conceal used the first syncframe's header only. An E-AC-3
stream of one-, two- or three-block syncframes then got the wrong MP4 length
and seek positions and the wrong Matroska positions. A packet that groups
several such syncframes concealed at a fraction of its length.
Seeks in AC-3 and E-AC-3 now have to match the whole-file decode bit for bit,
as every other codec's do. The dither is seeded from each syncframe, so the
old 25 dB bound was looser than the decoder needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 2 (#447)
- AC-3 / E-AC-3 packets that decode to different lengths (in the packets
read ahead, or any decoded since) have no frames_per_packet, so a
Matroska seek finds its packet by timestamp rather than by index times
the first packet's length.
- E-AC-3 syncframes of fewer than six blocks may reuse exponents from any
syncframe before them: once one is seen, a seek decodes from the start
of the stream instead of 1536 frames before the target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 3 (#447)
- Matroska E-AC-3: the first seek reads every packet's syncframe headers (only the headers,
header stripping undone) and places packets by the frames their primary syncframes hold.
Packets that started to differ in length after the eight read ahead were placed as the first
packet's length times their index.
- A packet whose later syncframe fails no longer sets the length lost packets are concealed at,
nor marks the packets' lengths as differing: it decoded only in part.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Merge main; E-AC-3 in Matroska: read packet headers only up to the seek target, and count a packet of dependent syncframes as zero frames
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
* craft-audio: Opus decoder
FilmCraft's `filmcraft-opus` decoder as `craft_audio::opus` behind
`opus-decode`: SILK, hybrid and CELT, every frame size, PLC and FEC,
multistream (`Decoder`) and single stream (`StreamDecoder`), 8-48 kHz
output.
- `TrackDecoder` decodes Opus; mono and stereo without an `OpusHead`
(RTP, MPEG-TS) get a default one. Lost packets use Opus's own
concealment.
- The native read path takes Ogg Opus (pre-skip and end trimming per
RFC 7845), and Opus in Matroska/WebM and MP4, where packet starts
after a seek come from the packets' own lengths.
The RFC 8251 conformance test runs all 36 vectors.
`scripts/fetch-opus-vectors.sh` downloads them (SHA-256 checked) and
the CI test job caches them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 1 (#445)
- CELT concealment keeps its pitch in its own field. It reused postfilter_period_old, which the
next good frame's post-filter cross-fades from.
- Matroska Opus seeks: a failed packet read no longer caches a wrong start; a one-byte packet
is read as one byte.
- A malformed OpusHead in Ogg is reported as malformed instead of falling back.
- The libopus oracle tests skip through the testkit, so CRAFT_MEDIA_REQUIRE_ORACLES fails them.
- Decoder::reset documents that it re-arms pre-skip trimming.
- fetch-opus-vectors.sh retries its size probe.
- CI: the vectors are fetched after ffmpeg is installed, and apt's timeout runs as root so a
stalled apt-get is killed and frees the dpkg lock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 2 (#445)
- CELT: the noise-based concealment sets skip_plc, as libopus does, so
pitch-based concealment waits for two good frames in a row instead of
extending history that holds noise.
- SILK: decode_only_middle is per call, as in libopus. A lost or mono
frame no longer reuses the mid-only flag from an earlier frame.
- A damaged Opus packet is concealed at its own length (from its TOC and
framing) rather than the previous packet's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
* craft-audio: AAC decoder
FilmCraft's `filmcraft-aac` decoder as `craft_audio::aac` behind
`aac-decode`, kept over symphonia's: the same quality (about 135 dB
SNR against ffmpeg), and it decodes 5.1, which symphonia refuses.
HE-AAC decodes as its AAC-LC core, upsampled 2x to the stream's rate.
- `TrackDecoder` decodes AAC, including ADTS-framed packets without
extradata (MPEG-TS, raw `.aac`).
- The native read path takes AAC in MP4 and Matroska and raw ADTS
streams (frame sync over the file, with resync after damage).
- AAC errors convert into `AudioError`.
The AAC module's shared parts (Huffman, MDCT, TNS, ICS) arrive whole
as ported; their encoder half is unused until the encoder PR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 1 (#443)
Raw ADTS and TrackDecoder:
- Channel configuration 0 (a PCE in the stream, as ffmpeg's -aac_pce and
AudioToolbox's 7.x write) decodes; it was refused.
- Frames with several raw data blocks are refused; only their first block
was decoded, silently losing the rest.
- A frame that changes the sample rate, profile or channel configuration is
concealed; it played at the wrong speed.
- A source that fails during the frame scan is AudioError::Io; it looked
like the end of the file.
- A stream after an ID3 tag longer than the file head is found.
- conceal counts all the ADTS frames of a packet, and a packet of more than
1024 frames is refused before it is decoded into memory.
AAC decoder:
- Indexed channel configurations place elements by arrival order, not tag,
as ffmpeg does; tagged differently, channels were swapped.
- A PCE in an access unit that fails no longer changes the layout, which
left every later packet failing.
- Non-finite samples are zeroed before the output and the overlap.
MP4: probe and decode agree: the samples' durations end the track when no
single edit does, and an edit cannot outlast the media.
The routing oracle fails on a fixture ffmpeg cannot write when oracles are
required. The README's Limits names HE-AAC v2 as mono, multi-block ADTS,
iTunSMPB, Matroska's tick precision and AAC in CAF.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 2 (#443)
Corrects round 1:
- A multi-block ADTS frame after the stream has started is concealed at its
whole length; round 1's filter skipped it, shifting the audio after it.
- Sample durations only trim an MP4's last packet: wrong ones (some count a
HE-AAC packet's core frames) were cutting audio. Durations of 0 with an edit
use the edit.
Raw ADTS packets now keep their headers, so TrackDecoder alone handles format
changes, multi-block frames and concealment, for apps as for files, and nested
ADTS payloads are not split again. Headers come from the frame scan's reads,
not one read per frame. The stream's format is the one most of its first frames
share, so one damaged header does not silence the file. The ID3 walk and a
packet's ADTS split are bounded.
AAC:
- HE-AAC is delayed by the SBR filterbanks' 481 core samples; it played 19.5 ms
early against ffmpeg in every container.
- A failed access unit leaves the decoder's state as it was, so the next packet
decodes as if it had not been there.
- reset restarts the noise generator, so a seek into PNS repeats.
- A signalled rate that is not twice the core's plays the core; it reported the
signalled rate with the core's samples.
The decoder oracle's tolerance tightens from 1e-3 to 1e-5. Tests cover HE-AAC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 3 (#443)
Corrects round 2:
- ADTS headers are compared with the stream's format only when the first header
gave it. With extradata the format comes from there, so ADTS in MP4 whose
headers say something else decodes again; every packet had been concealed.
- A stream's only program config element is found in its first frames even when
that frame's header is damaged.
- The test of wrong sample durations patched the second run's count, not the
delta, so "durations of one" changed nothing. It now patches the delta, and
checks a file was changed and that seeks land on the same audio.
MP4 seeks place a packet by its index when every packet decodes to the same
length, as decoding does; they used the durations round 2 had stopped trusting
for the length, and returned the wrong audio. A last delta of 0 is overridden too.
Docs: what TrackInfo says for raw ADTS, that opening one reads the whole file, and
which codecs symphonia reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 4 (#443)
- TrackDecoder takes an ADTS stream's format from the one most of the lookahead
shares, as the file path did, so one damaged first header does not fail every
packet of an MPEG-TS stream. open_adts now just asks it.
- MP4 samples of several ADTS frames keep the sample table's timing; a packet
count of one frame each truncated them silently.
- Sample durations past what the packets decode to no longer over-report the
length.
- split_adts_upto is not behind aac-decode, as split_adts is not: an aac-encode
build in the next PR did not compile.
Removes an unreachable ID_END check and open_adts's unused core rate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 5 (#443)
No change in decoding. An aac-encode build in the next PR needs the
split_adts_upto re-export behind aac-decode, and ID_END only in tests.
Docs say the lookahead's headers give an ADTS stream's configuration, that AAC in
CAF still goes through symphonia, and that ProgramConfig is not #[non_exhaustive].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 6 (#443)
Two tests from round 1 failed on ffmpeg before 9, including CI's 8.0. Neither was
a decoding fault:
- ffmpeg 9 ends an MP4 with no edit list at its sample durations and earlier
versions present the whole last packet, so the length is checked against the
file's known duration, not ffmpeg's decode.
- The order ffmpeg gives channels with -aac_pce differs by version, so each decoded
channel must match a different one of ffmpeg's, whatever the order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 7 (#443)
Reading:
- an element of another type or a tag a program config does not list is
refused, not written to another channel; only an LFE coded as an SCE
is still allowed, as ffmpeg allows it
- an explicit sampling rate of 0 is refused
- a packet's later ADTS frames are searched for SBR
- a multi-frame ADTS packet that fails leaves the decoder as it was, and
one whose frames change the channel count is an error
- the whole ADTS frames before a damaged end of a packet decode
- a failed read of a raw stream's first frames is an I/O error
- an MP4 sample of several ADTS frames past the lookahead keeps its length
- an Ogg file with leading bytes keeps its track order and mask comments
Writing:
- ProgramConfig::write, AudioSpecificConfig::to_bytes and
AdtsHeader::write refuse what their fields cannot hold
Tests:
- the routing test checks one alignment for the ffmpeg version under test
- a default decode past an Ogg stream symphonia has no track for
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 8 (#443)
From wanikhawar's review:
- AudioSpecificConfig::parse reads backward-compatible SBR and PS signalling
(a 0x2b7 sync extension after the config), which craft-media's Matroska
demuxer writes for legacy HE-AAC IDs. Without lookahead those streams decoded
as their core.
- An MP4 media edit after one empty edit is applied: its priming skip and its
end. The empty edit's delay is not added as silence.
- A packet lost whole is concealed as long as the last one decoded, so a stream
of multi-frame ADTS packets keeps its timing.
- ADTS-framed MP4 samples keep their sample table's timing, instead of every
sample being read at open to look for several frames in one.
- AdtsHeader::write refuses an object type, sampling frequency index or channel
configuration its fields cannot hold; it masked them into other values.
- AudioSpecificConfig::lc no longer panics for a sampling frequency index with no
rate, and the decoder refuses such a config.
- AudioSpecificConfig::to_bytes refuses channel configuration 0 without a program
config element, which would not parse back.
- Upsample2x starts each channel's history afresh when the channel count
changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 9 (#443)
From CodeRabbit's review of round 8:
- AudioSpecificConfig::parse consumes extensionFlag3 after the config when
extensionFlag is set, so the 0x2b7 sync extension after it is found.
- AudioSpecificConfig::to_bytes refuses a sampling rate of 0, which would not
parse back.
- ADTS-framed HE-AAC in MP4 whose sample durations count core frames is not cut
to the durations' half length: durations short of one frame per sample no
longer end an ADTS-framed track, and its length is unknown until decoded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 10 (#443)
ADTS-framed AAC in MP4: durations short of the frames in the samples read
ahead no longer end the track. With HE-AAC samples of two ADTS frames each,
timed as two core frames, the durations matched one output frame per sample,
so the undercount check passed and the track stopped at half its length,
which probe reported as known. The frames each read-ahead sample holds are
now counted, and durations short of them leave the length unknown until
decoded, as durations short of one frame per sample already did. Correctly
timed AAC-LC samples of several frames keep their end trim.
Reported by FredApps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 11 (#443)
Corrects round 10. A short ADTS-framed MP4 track, whose last sample is in
the read-ahead, lost that sample's trim when it cut more than one frame:
the trim counted as durations falling short, so the length was left to
decoding and its padding was presented. The track's last sample is now left
out of the read-ahead comparison.
Reported by CodeRabbit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: document the ADTS-in-MP4 seek and edit limits (#443)
AAC in MP4 stored as ADTS frames, with sample durations that count fewer
frames than the samples hold, decodes in full from the start, but seeks
place samples by those durations and land later than asked, and an edit
list measured in them can end the track early. The README's Limits section
now says so, and the seek example points to it.
Reported by FredApps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: say why the ADTS-in-MP4 seek limit is kept (#443)
The Limits entry from 79f5839 said what goes wrong but not why it is left.
It now says that such a file is outside the MP4 specification: an MP4 AAC
sample is one raw access unit with the configuration in the sample
description (ISO/IEC 14496-14, 14496-3), so ADTS headers do not belong in
it, and a sample's duration is the time it decodes to (ISO/IEC 14496-12).
It says why files within the specification are not affected, what still
works, and why seeks and edits in such files are not corrected: finding
where each sample's audio starts means counting the ADTS frames in every
sample before it, one read per sample, which would slow every ADTS-framed
MP4 at open to work around files outside the specification.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: AAC encoder
FilmCraft's AAC-LC encoder behind `aac-encode`: psychoacoustic model,
window switching, M/S, TNS, bit reservoir, CBR and VBR, 1-8 channels,
optional ADTS framing. `rayon` encodes channels in parallel.
`aac::aac_order` maps WAV order to the encoder's input order. Settings
the encoder cannot use are `aac::Error::InvalidSettings`, which
converts to `AudioError::Encode`. `encode` now turns on `aac-encode`.
Tests that need AAC streams written by our own encoder come with it:
the encoder oracle and robustness tests, packet concealment, and
`TrackDecoder` on ADTS without extradata.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 1 (#444)
From CodeRabbit's first review of the AAC encoder:
- CBR bitrate limits use the exact bits per frame (bitrate * 1024
against channels * sample_rate) instead of the truncated quotient, so
288001 b/s at 48 kHz mono is rejected.
- Rates below 48 bits per channel per frame are rejected. That is the
largest silent frame per channel measured across 1-8 channels; below
it the encoder overshot the requested rate (96 kHz mono at 1000 b/s
came out near 4500 b/s).
- Fill elements are capped so the byte-aligned access unit stays within
6144 bits per channel. write_fill can write 8 bits over its request,
which gave 769-byte mono units at the maximum rate and when the
reservoir was flushed on the last frame.
- encode() buffers one frame of input at a time. Appending the whole
slice and draining 1024 samples per frame copied the rest of the
input once per frame, quadratic in the slice length. Output is
byte-identical to feeding the input in chunks.
- README: 8 channels are taken in channel configuration 7's element
order; a WAV 7.1 buffer has no equivalent there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 2 (#444)
From CodeRabbit's review of round 1:
- The CBR minimum adds the program config's bits when ADTS is on. The
7-channel layout repeats it in every ADTS frame, and at full
bandwidth a silent frame took 344 bits against the 336 bits that
31,500 b/s gives at 96 kHz. Bandwidth alone stays within 48 bits
per channel.
- write_fill never writes more than it is asked for: each element's
size comes from the bits left, so the total ends 0-6 bits short.
The old version could pass the request by 8 bits and could also
stop early (asked for 14, it wrote 7).
- The encoder fills to the unit's target end, capped at
max_frame_bits, instead of keeping round 1's 8-bit margin. Frames at
the maximum rate were 767 bytes when there was little to code; they
are now exactly 768 bytes per channel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 3 (#444)
Encoder::new rejects a NaN VBR quality, the known issue ported from
FilmCraft and listed in the PR description.
NaN passes f32::clamp, so the rate-distortion multiplier became NaN.
The frame-size loop compares it with `<` and never ran, and no band
was skipped, so every frame was coded at full precision: mono units
reached 2465 bytes against the 768-byte limit, and 8-channel units of
up to 17024 bytes did not fit the ADTS length field, so they went out
without headers. Infinities and other out-of-range values are clamped
and stay within the limit; the test checks both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-audio: review fixes, round 4 (#444)
From CodeRabbit's review of round 3:
- The CBR fill target is rounded down to a whole byte. Round 2 filled
to an unaligned target, so after byte alignment a unit could end up
to 7 bits past the bits it had: in a sweep of silent CBR encodes,
1188 of 13200 frames overspent, all of them frames with fill, hidden
by the level clamp at 0. The unit now ends exactly at the rounded
target. The 0-7 bits rounded off stay in the reservoir and are left
unspent after the last frame; the comment says so instead of
claiming an exact total.
- The NaN-quality test checks that infinities and out-of-range values
encode exactly as the nearest end of the 0.5-6.0 range.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* ci: save the dependency cache from main only, and cancel superseded PR runs
* ci: give runs outside pull requests their own concurrency group
---------
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
The deny-list paragraph and the chrono calendar exception now live in the Rust rules. CLAUDE.md imports AGENTS.md, and the workspace-lints requirement stays with the new-crate notes.
* craft-font-catalog: run the Unix font-folder tests only on Unix
Five tests build an Os::Unix FontEnv from Unix paths (/home/me, <dir>/sys/fonts</dir>).
Windows doesn't treat those paths as absolute, so the tests failed there. Production code
is unaffected: on Windows FontEnv::from_process picks Os::Windows, whose folders never go
through the Unix path logic. FontEnv's docs now say its paths follow the host's path rules.
The font-store workflow, which already triggers on crates/font-catalog, now also runs
craft-font-catalog's clippy and tests on Linux and Windows.
Refs #619
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-font-catalog: keep the store override and no-store tests on Windows
These assertions don't depend on Unix path rules, so they now sit in their own
ungated test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* craft-font-catalog: verify store override precedence
Exercise the override with platform defaults present on every OS variant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Keep both craft-web-api and craft-web-host in the workspace list, the
README and the lockfile. Point the host README at the command API that
landed in #413, and the command API README at these host messages.
Co-authored-by: Cursor <cursoragent@cursor.com>
CI: the package repair between ffmpeg install tries gets a time limit
too, so a blocked configure script cannot use up the job's time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>