Repository navigation
Releases
v0.6.0
v0.5.5
v0.5.4
v0.5.3
v0.5.2
Fixes for pysacd-extract writing into a folder that already holds files, byte-compatibility with
sacd_extract for blank ISRC fields, hardening that followed the review of 0.5.0, and the build
chain. DSF, DSDIFF, cue, XML and -P output is unchanged for a disc with ordinary titles and ISRCs
written into an empty folder (release checks, below). FLAC files from the Linux wheels are now
encoded by libFLAC 1.5.0: the audio is the same, the bytes are not.
Release checks for 0.5.2 (docs/development.md, "To release"), on the commit before the version
bump: tools/extract_compare.py --require-sacd-extract against sacd_extract built from CI's
pinned commit, 0.5.1 against this release, on four real discs (stereo and 5.1, both DST; plain
stereo with 5.1 DST; plain stereo; plain stereo with no disc text) in all 35 modes (140 runs, 872
files): no difference between 0.5.1 and this release in any run, and -P matches sacd_extract on
all four. Of sacd_extract's 450 files, 270 are identical and 177 differ only where
docs/sacd_extract.md says they do. Three differ otherwise, in 0.5.1 exactly as in this release: the
multichannel edit master of the disc with a 5.1 DST area (60 bytes in length and about 3,300 bytes,
from the header on), which is not explained and is tracked as #179; and two DSF files of the
no-text disc in the -z -b mode, a mode the comparison reports without failing because
sacd_extract repeats frames at some boundaries. The full suite passes on a Fedora 44 machine (358
passed, the 21 expected skips). The changes since 0.5.1 had a security review before the release;
its three points are fixed in this release.
Fixed
pysacd-extractwarns when a file already in the album folder can't be read for its tags: it is
matched by name only, and replaced if the run writes that file. docs/sacd_extract.md says how
files without tags are matched.pysacd-extracton Windows: a disc titled with a device name such asCONno longer fails the
run; its folder and files get a leading_(_CON), aspysacd convertnames them. Other
systems keepsacd_extract's names (#156).pysacd-extractno longer writes one track over another when theirsacd_extractnames would be
the same file: titles that differ only in case on a case-insensitive filesystem (Windows, macOS
by default), or equal titles of tracks past 99. The later track is written as<name> (2)
(#156). See the differences from sacd_extract. The
filesystem is asked once per name, so a disc with many such titles doesn't slow the run.pysacd-extractwrites into an album folder that holds this disc's own files from an earlier run in
another mode, assacd_extractdoes. An edit master (-e) or cue sheet (-C) run after the DSF or
DSDIFF tracks, tracks after an edit master, a second-e, another-tselection or a-k
concatenation went to<album> [<catalogue no.>]instead, as if the folder held another disc.
Another disc's files still keep a disc out of the folder (#165).pysacd-extractkeeps two editions of an album apart when one has ISRCs and the other doesn't
but their titles and numbering are the same. Withsacd_extract's naming, the second replaced
the first's files, with only a warning that their sizes differed. An ISRC on one side only now
counts as a difference wherever the file would carry the track's ISRC:sacd_extract's ID3
modes 1, 3 and 4 (the default) and pysacd's own tags. The minimal ID3 modes (2 and 5) carry no
ISRC, so their files are compared without it (#171;
the rule).pysacd-extractwrites a track's ISRC field assacd_extractdoes when the disc leaves it blank
or fills it only in part: as stored up to its first NUL, spaces kept. A field of spaces was
written as an empty TSRC frame, left out of the cue sheet, XML and-P, and padded ones were
trimmed, so the DSF, DSDIFF, edit master, cue, XML and-Poutput differed from
sacd_extract's.pysacd convertand pysacd's own tags still carry the ISRC itself, and a
blank ISRC still counts as none when telling discs apart (#175). In-P, control characters in
the field are shown as escapes, and a disc with such a field is still recognised as itself on a
second run.
Security hardening
- Cover downloads follow redirects only to
coverartarchive.organdarchive.orghosts. A
redirect anywhere else is refused and reported as a cover-art warning; the run continues
without a cover (#155). The redirect must name its host plainly (no user part, escapes or other
port), and a redirect that can't be parsed is reported as an error instead of ending the run
with a traceback (#172). - Reading a MusicBrainz or cover response stops with an error on anything that isn't bytes.
The test suite can run under a memory limit (PYSACD_TEST_MEMORY_MB), and CI'stestsjob does.
Tests
- The engine's fuzz harness also covers ranges that don't start at frame 0 in every format, DSF
chains with a head frame, the ISO copy, cancellation, 176.4 kHz PCM, FLAC output, other thread
counts andallow_filler: an input can carry a run configuration before the image, and the seed
corpus has a configured run for each. CI replays the seeds under TSan as well as ASan and UBSan
(#157).
Build and release
- The macOS wheels' support is stated as it was tested: built for macOS 11 (arm64) and 10.13
(x86-64), run on macOS 15 on both; older versions are untested (#142). - The release-tag check runs in a Fedora container like the other release jobs, and on pull
requests it also checks its clone, so its set-up is tested before a tag depends on it (#167). licenses/names the GCC runtime library (libgcc_s) that the musllinux wheel carries, with its
licence texts (#167).- The release workflow refuses a
v*tag that isn'tvplus the package version, or whose commit
isn't onmasteror arelease/*branch, before anything is built or published (#154). - The Linux wheels link libFLAC 1.5.0, built in the job from its release source with the SHA-256
checked, as the macOS wheels do, instead of bundling the build image's libFLAC and libogg (1.3.2
in the manylinux wheels, 1.4.3 in the musllinux wheel). FLAC encoding in them is now multithreaded,
as on macOS and Windows. The audio is the same; the encoder's vendor string in each FLAC file
names the new version (#153).
v0.5.1
A security release. A private review of 0.5.0, asked for by the maintainer, found three problems
that a crafted disc image can trigger, and a number of smaller ones; all are fixed here. Upgrade
if you convert images you did not rip yourself. Two defaults change with the fixes:
- a run now stops when it would write mostly silence or filler for audio the image lacks (more than
10 seconds beyond the audio it found).--allow-silencegives the old behaviour for a run, to
rescue what a damaged rip still holds; pysacd-extract --templateskeeps files that already exist;--overwritereplaces them.
Output for ordinary discs is unchanged, byte for byte (release checks, below).
Security
- Disc text could place
pysacd-extract's output outside the output folder
(advisory GHSA-gx45-h8q4-vwmc).
For some titles made only of dots, spaces and control characters, the folder or file name derived
from the title was empty,.or... Such names are no longer produced, a relative-ostarting
with../is used as given, and every output path is checked against the output folder before
anything is created. Names of ordinary discs don't change
(what differs from sacd_extract). Upgrade to 0.5.1.
Fixed with it: apysacd convertname could start with-after an empty[]or()was
removed, andpysacd toc --jsonwrote non-ASCII control characters from disc text to the terminal
as they were (it now writes ASCII, with\uescapes). - A disc could replace another disc's files without a warning
(advisory GHSA-whv9-98xg-4xw9).
pysacd convertwrites a disc to<folder> [<catalogue number>]when the folder holds a different
disc; with a very long album title the catalogue number was cut off and the disc went into the
first folder after all. The number is now always kept, and the run stops if no separate folder can
be named.pysacd-extract --templatesreplaced existing files; it now keeps them and reports them
as skipped, and the new--overwritereplaces them. Withsacd_extract's naming nothing changes:
a re-run replaces its files, and the documentation now
says what tells two discs apart there. Upgrade to 0.5.1. - A crafted image could make one run write far more than the image could hold
(advisory GHSA-q45f-7qmf-37x3).
The bound added for #17 held each output to what the image's sectors could hold, but not the whole
run, and frames missing from the image were written as silence without limit, so a small image
could fill a disk. Affects 0.5.0 and earlier; 0.5.1 fixes
it. The outputs of one format in a run may now cover the area at most twice (an edit master and its
tracks), checked before anything is written and again in the engine, and a run stops once it has
written more than 10 seconds of silence beyond the audio it found. Ordinary discs, and truncated
rips whose run still has more audio than silence, extract as before, byte for byte
(security, sacd_extract differences). - Network and credential hardening, found in the same review (low severity, no advisory):
- MusicBrainz ids (release, release group, track, recording, artist) are kept only when they are
MBIDs, and the ISRC plan escapes the release id it prints. A--mb-releasevalue (or
mb_releasein the config) that isn't an MBID is now an error before any request. - MusicBrainz, Cover Art Archive and OAuth requests have a deadline for the whole request (60 s,
300 s for covers), and network errors while reading a reply are retried and reported as
MusicBrainz errors instead of escaping as other exceptions. A malformed ISRC lookup reply no
longer raisesAttributeError, and a token reply'sexpires_inmust be a sane number. - Requests use https only and follow at most 5 redirects, each to https; the token exchange and
the ISRC submission follow none, so credentials only go where they were meant to
(security). - The MusicBrainz token is written through a new file with an unpredictable name, mode 0600 from
creation, and is not saved in a folder that other users can write. - The log no longer records the value of
mb-login --client-secret. - An empty or relative
XDG_CONFIG_HOMEis ignored (as the XDG spec says), instead of making
pysacd readpysacd/config.tomlfrom the current directory. - A copy from a PS3 must average at least 256 KiB/s after a 300 s allowance, so a server can't
stretch it out indefinitely; real PS3s read 2-4 MB/s.
- MusicBrainz ids (release, release group, track, recording, artist) are kept only when they are
- Output hardening, found in the same review (low severity, no advisory):
- frames that don't decode now count with the silence in the limit above, and the new
--allow-silence(pysacd-extractandpysacd convert) lifts that limit for a run, to rescue
what a damaged rip still holds; - a failed or cancelled
-Ino longer leaves a partial.isounder its final name; - a WAV track over 4 GiB is refused before the run starts, instead of failing at the end and
taking the run's finished tracks with it; pysacd convertchecks every output path against the output folder, aspysacd-extractdoes;pysacd-extractwarns when a re-run replaces files of a different size, and with--templates
when a folder already holds another disc's tracks; a run that skipped every file exits with 1;- before reopening a temporary file by name, pysacd checks it is still its own regular file;
- an engine call that returns no result is a failure, not a success.
- frames that don't decode now count with the silence in the limit above, and the new
Release checks for 0.5.1 (docs/development.md, "To release"): tools/extract_compare.py --require-sacd-extract against sacd_extract built from CI's pinned commit, 0.5.0 against the
fixes, on three real discs (stereo and 6-channel DST; plain stereo with 6-channel DST; plain stereo)
in all 35 modes (105 runs, 597 files): no difference between 0.5.0 and the fixes in any run. Against
sacd_extract, of its 319 files 191 are identical and 128 differ only where docs/sacd_extract.md
says they do; none differs otherwise, and -P matches on all three. That run was made before the
one-worker default below (#137) was merged in; with it, the seven plain-DSD and mixed modes were run
again on the two discs with plain areas (14 runs): no difference. The fixes were developed
privately, where CI doesn't run, so these were run by hand on the release tree before it was
published: the full suite (312 passed, the 16 expected skips), the whole suite under ASan and UBSan
(clang), the sacd_extract comparison tests, the engine leak check (memcheck), ruff and mypy. The
beets-pysacd test suite passes against this release's code. Not run by hand: macOS and Windows,
CodeQL, semgrep and TSan, which the release pull request's CI ran. That CI found one defect the
private checks could not: on Windows, a title that sanitises to a name ending in a dot or space
made the run fail (Windows drops them from folder names); such names lose them on Windows now. It
also found three tests that assumed POSIX or Python 3.11.
Other changes
-
CI builds and tests in Red Hat-derived containers. The test suite on Python 3.10 to 3.15, the
ASan/UBSan, leak, fuzz,sacd_extractcomparison and benchmark jobs, the live MusicBrainz lookup
and the release's sdist run in a Fedora 44 container; semgrep, zizmor and the private-names check
in UBI 10, with semgrep and zizmor installed from PyPI by hash instead of their vendors' images.
CI only; the wheels and the package are unchanged (development). -
Plain DSD to DSF or DSDIFF uses one worker thread by default (#137). Nothing is decoded or
filtered there, so a pool the size of the CPU only cost wake-ups. On a 32-thread machine, a
40-minute stereo disc from the page cache to local NVMe (-2 -s, 15 alternating runs, power
profileperformance): engine time 0.17–0.21 s with one worker against 0.20–0.23 s with 32
(medians of three series), the same bytes out.--threadsand-jstill set the count. Not
measured: multichannel plain DSD. -
Python 3.10 is supported again (#140), so pysacd installs with Ubuntu 22.04's own Python. On 3.10 the
config file is read withtomli(installed only there), and CI runs the suite on 3.10 too. The
wheels are unchanged (one per platform serves every Python). -
The engine builds with GCC 11 (Ubuntu 22.04's). GCC before 12 stopped with "no dispatcher found
for the versioning attributes" on the PCM filters' load-time choice of AVX-512 or AVX2; such a
compiler now builds them for the baseline only. Wheels are built with a newer GCC and keep the choice.
Run on Python 3.10.12 and GCC 11.4 in an Ubuntu 22.04 container, as an ordinary user: ruff, mypy, the
engine with-Werror, and the whole suite (267 tests, the expected 16 skipped) pass. -
docs/quickstart.mdnow gives the minimums: Python 3.10, and for wheels glibc 2.28, musl 1.2,
macOS 11 (arm64) or macOS 10.13 (x86-64). -
The macOS wheels run on macOS 11 and later (Apple silicon) and 10.13 and later (Intel) (#142),
instead of macOS 15 only. They link libFLAC 1.5.0, the release Homebrew ships, built in CI from its
release source with the SHA-256 checked, statically, for those versions. -
The engine links scarletbook-rs 0.5.9 (digests checked against the release's
.sha256files
and attestations; the CET shadow-stack mark is kept). Output is byte-identical to the 0.5.8 build in
every mode on the five real test discs; speed is in docs/performance.md. 0.5.9 has nothing new for
pysacd to adopt: its additions are Rust-only (TrackAudioCursor::with_dst_lanes) or documentation
of how to write per-track DSF files, whose writer is planned for scarletbook 0.6.0 (scarletbook-rs#202),
so pysacd's per-track writer stays until then. -
**A stale engine is refus...
v0.5.0
v0.5.0rc1
pysacd v0.5.0rc1
v0.4.3
v0.4.3rc1
pysacd v0.4.3rc1