Skip to content

v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Sep 08:09
· 10 commits to main since this release

BUILDINFO release metadata, Windows test harness command-line contract, error recovery on audio and plugin paths, RISC-V and PPC64 plugin relocations, and comprehensive verification gates.

Added

  • The release archive carries a generated BUILDINFO.txt recording the Zig
    version, target and optimize mode the shipped DLL was built with, read from
    build.zig.zon. deps/SHA256SUMS and SBOM.cdx.json already said which
    third-party code the DLL carries and what the vendored headers hash to, but
    nothing in the archive said what compiled it, so a rebuild had no toolchain to
    reach for. Every field comes from the tree or from SOURCE_DATE_EPOCH, never
    from the packaging host, so the archive stays byte-identical across hosts.

Changed

  • The Quick API's three entry points that allocate a sample share one
    newQuickSample helper, and AIL_quick_load's VFS-or-disk read is now
    loadQuickSample. Same handles, same last-error text, same log lines.
  • The four Windows harnesses in tests/ now answer their command line the same
    way: -h and --help print a usage on stdout and exit 0, a mistyped flag or
    a surplus positional print it on stderr and exit 2, and a missing required
    argument names itself on stderr. rib_test took no arguments and ignored
    any it was given, and full_suite accepted a fourth silently.
  • A diagnostic that stops a harness run now goes to stderr rather than stdout.
    The checks themselves still report on stdout, so a piped run reads as a
    report with no failure text mixed into it.

Fixed

  • A loop restart that miniaudio refuses no longer reports success. The
    end-of-sound bridge dropped the result of ma_sound_seek_to_pcm_frame and
    ma_sound_start and returned "loop again", so a sample whose loop start lies
    past the end of the decoded image (a block setLoopBlock accepts, since it
    only checks that the block spans a frame) stayed SMP_PLAYING forever, never
    fired its end callback, and, on an infinite loop count, spun the audio thread
    for the life of the process. A failed seek or start is now named in the log
    and reported as the end of the sound.
  • A truncated or foreign SMF is no longer measured as a complete image.
    smfImageSize answered data.len when its track walk ran out of data or met
    a chunk that was not MTrk, so findXmi handed the trailing DLS bank back as
    part of the music image and AIL_merge_DLS_with_XMI wrote the two out as one
    file. Those paths now report 0, matching what the sibling pointer-based walker
    already answered and what the module's contract says.
  • AIL_set_3D_sample_info bounds data_len against the 256 MiB image cap before
    slicing, as every other untrusted image in the library is bounded. channels
    and bits were already clamped, so a game with a bad AILSOUNDINFO asked for
    a 4 GiB slice over a pointer of unknown extent.
  • LoadLibraryW failures are no longer all reported as FileNotFound. A path
    that failed to convert to UTF-16, a plugin whose imports are missing, and a
    plugin whose DllMain refused now reach the caller as distinct errors, and
    the Win32 code is carried out to the load log beside the plugin name.
  • A soundbank's name index that fails to build says so. The bank still loads and
    still answers every lookup, on the linear-scan path, but nothing recorded that
    the index was abandoned.
  • AIL_allocate_bus names which of its three failures (allocation, miniaudio
    group init, list append) produced the null, and carries the ma_result
    description for the init failure. AIL_list_DLS records why it rejected an
    image instead of leaving AIL_last_error holding the previous failed call's
    message. AIL_redbook_open and AIL_redbook_open_drive log the error their
    catch was discarding.
  • Capture chunks dropped by Input.captureCallback (contended lock, or a ring
    with no room) are counted and readable through Input.droppedChunkCount.
    Losing audio silently left a busy device indistinguishable from a quiet one.
  • A case-insensitive path that resolves but still fails to open now logs both
    the first and the retry's error, instead of reporting only the retry's and
    losing a permission failure to a "File not found". createFile and
    createFileAbsolute get the retry the opens already had, so a name MSS
    resolves case-insensitively can be written as well as read.
  • The three blocking external calls with no timeout (LoadLibraryW,
    ma_device_init, FindFirstFileW) are recorded in docs/THREAT_MODEL.md
    with the reason a bound is not inlined and the value one would take.
  • MilesSetSoundLabelLimits and a set_limits step name every limit entry they
    could not parse or store, and record the count through AIL_last_error. The
    call still returns 1: the caps that parsed are applied, and a caller told
    "failed" for a partly applied string would not know which half is live.
  • scripts/check_all_versions.sh sorted its unswept-version report with
    sort -V, a GNU extension BSD sort rejects, so the parity sweep died before
    printing a row on a macOS or BSD host. The order is now built from awk,
    sort and cut, and the same sequence comes out.
  • The ELF plugin-image fixup applied no relocations on a 32-bit Linux target,
    and on a riscv64 or ppc64 one, because relative_reloc_type named only
    x86_64 and aarch64. The writable-segment repair still ran, so a plugin loaded
    on those targets kept link-time addresses in its data and crashed on the first
    dereference. riscv64 and ppc64 are now rebased as well; a 32-bit target still
    gets the segment repair without them, because std.elf names no R_386
    RELATIVE value to apply.
  • CONTRIBUTING.md claimed the library builds on any host Zig supports. It
    does not on aarch64, on any operating system, and the README already said so.
    The claim now names the exclusion, and it states that the two scripts/*.sh
    gates need bash rather than the sh their shebangs are read as.
  • The temporary ASI provider image is created with Permissions.fromMode(0o600)
    rather than a bare 0o600. std.Io.File.Permissions is a non-exhaustive enum,
    not a mode integer, so the tree did not compile at all: every zig build and
    make test on a non-Windows target failed with expected type 'Io.File.Permissions__enum_2901', found 'comptime_int'. The owner-only mode
    itself is unchanged.
  • The parity setup steps in CONTRIBUTING.md and scripts/requirements.txt
    now create the virtual environment uv pip install requires, instead of
    naming an install command that stops with No virtual environment found.
    .venv/ is gitignored, and make check-parity-tools names the same three
    steps.
  • 90 of the 197 file:line anchor references in docs/THREAT_MODEL.md were
    stale, so make lint and CI failed on a clean checkout. All 197 resolve again.

Added

  • scripts/package_release.sh writes <output.zip>.sha256 beside the archive,
    and the release attaches it. The SHA256SUMS a release already published
    names the files inside the zip, so a consumer who downloaded the archive
    and had not unpacked it had no record of the archive's own bytes to check
    them against.
  • scripts/check_workflow_shell.py, in make lint and therefore in CI: every
    run: block in .github is extracted and shellchecked as bash. The shell in
    a workflow installs the pinned tools, cross-checks build.zig.zon against the
    tag, and reads the shipped PE header; yamllint read those blocks as YAML, so
    a quoting mistake in one passed lint and failed on the runner. A finding names
    the workflow and the step it came from.
  • scripts/check_config_docs.py, in make lint and therefore in CI: the log
    cap, the log path limit, the TMPDIR limit, the default log file name, and
    the spellings OPENMILES_DEBUG accepts are constants in src/, and every
    one of them was also a number written out in the README and the threat model.
    Widening a limit in a source left both documents quoting the old one, so an
    operator setting a OPENMILES_LOG_PATH the library had stopped accepting read
    a document that said otherwise, with every gate green. The script reads the
    constants back and asserts the documents name them.
  • scripts/check_versions.py also reads the accepted -Dmss-version set from
    the header's side. A value added to src/mss.h and to check_header.py
    without a matching entry in build.zig compiled for every consumer and for
    every version probe the header gate runs, because each of those selects a
    value build.zig does know, and the two lists were only compared with each
    other. The gate now rejects a header value no build encodes, and compares the
    two defaults it never read: build.zig's orelse "9" and mss.h's
    OPENMILES_MSS_VERSION 90, which is what a consumer that defines nothing
    gets. It also compares the -Dmss-version=<...> list and the default beside
    it in the README, which is where a consumer picks a version from ahead of
    zig build --help, and which nothing had read until now.
  • scripts/check_toolchain_pins.py checks the Zig version in the README's build
    requirements against .minimum_zig_version. It was the one pin written in
    prose, and a bump that missed it left the front page asking for a compiler
    make build refuses, with every gate in the tree green.

Changed

  • scripts/check_vendored.py fails a README.md dependency table that
    disagrees with deps/README.md on a library's version, upstream, or license,
    and fails a vendored library the table does not list. The table is the first
    thing a reader of the repository, and of the release archive, sees, and it was
    the one copy of the version a scanner matches an advisory against that no gate
    checked: a header swap updated deps/README.md, deps/SHA256SUMS and
    SBOM.cdx.json, and left the front page naming the superseded version.
  • scripts/check_vendored.py fails a vendored entry whose Source is not an
    https URL on an approved host. Version, upstream commit and digest were all
    verified, so a header arriving from a lookalike host carrying the right bytes
    and a plausible commit id passed every check; the commit names a revision, not
    a repository. Both upstreams resolve to github.com, named in SOURCE_HOSTS.
  • ci.yml reads the UV_VERSION, RUFF_VERSION and YAMLLINT_VERSION pins out
    of the Makefile instead of repeating them, the way release.yml already
    did, and make check-pins now fails a workflow that types one of its own.
  • XMIDI conversion orders a same-tick control or program change before a
    same-tick note-on. Sorting by raw status byte put the note-on first, and an
    XMIDI sequence opens at delta 0 with its volume, pan and reset-controllers
    writes ahead of the first note, so every sequence's first note rendered at the
    soundfont's default volume and pan.
  • make check-parity-tools asks scripts/check_exports.py --check-deps whether
    pefile imported, instead of a python -c 'import pefile' one-liner in the
    makefile. The probe belongs to the script that owns the dependency, and a
    parity run launched without pefile now names the missing package instead of
    ending on an ImportError traceback.

Fixed

  • src/api_coverage_test.zig compiled again: the file/input coverage test built
    a const payload and @ptrCast it to AIL_file_write's void FAR *, which
    discards the const qualifier, so zig build test failed to build the test
    binary at all.
  • The Windows temporary directory is now reported for every reason it is
    refused. A %TEMP% longer than MAX_PATH, one that will not convert to a
    path this build can use, and an environment with no temporary directory were
    two of them the same "TMP, TEMP and the system profile directory are all
    unavailable", and the first two were silent: the image went to the game
    directory with nothing on stderr to say why. Each reports its own cause, and
    the too-long case names the variables to shorten.
  • The configuration a run starts from no longer inherits the previous run's
    OPENMILES_DEBUG echo. debug_from_env was set when an export was read and
    never cleared, so a process that loaded the library twice, with the export
    gone the second time, printed a configuration line about a build default that
    nothing had asked about. init() and deinit() both reset it beside the
    build defaults they own.
  • docs/THREAT_MODEL.md re-anchored at src/engine/midi.zig: the XMIDI loop
    stack, its depth check and the per-buffer jump budget had moved, so
    make lint failed check-threat-model on every run. The three mitigations
    the model cites were always in the file; only the line numbers were stale.
  • docs/THREAT_MODEL.md re-anchored across src/api/, src/engine/,
    src/root.zig and src/fuzz_native_test.zig, which had drifted the same
    way: make lint failed check-threat-model on 90 references.
    scripts/check_threat_model_refs.py --update re-aimed each one at the line
    its anchor is on now.
  • AIL_set_3D_sample_loop_block and AIL_set_stream_loop_block apply the SDK
    loop-block argument rules the 2D AIL_set_sample_loop_block already did:
    both offsets -2 is a no-op, a single -2 keeps that side's current
    offset, and a reversed pair is swapped. The 3D and stream entry points
    passed the pair straight through, so -2 cleared the loop block instead of
    leaving it alone, and a game that gave the block the SDK way round (a common
    habit, since the 2D call accepts it) got a sample that played through once.
    The normalization is now openmiles.resolveLoopBlock, shared by all three.
  • AIL_stop_sequence on a sequence that never reached a sound reports
    SEQ_STOPPED. Sequence.status returned SEQ_DONE for every sequence that
    was not initialized, which is checked before the stop flag, so a game that
    starts a sequence, falls back when the driver cannot play it, and then stops
    it could never observe SEQ_STOPPED.
  • AIL_set_sequence_ms_position applies the tempo events it passes over even
    when the driver has no soundfont loaded. The seek consumes every event before
    the target whether or not it applies it, so the tempo in force at the seek
    point was being skipped, and beat and measure were recalculated from the
    file's initial tempo.
  • AIL_load_sample_buffer leaves the ring's head cursor on the slot it names
    when the submission is refused. The cursor advanced before the feed, so a
    refusal left it one slot ahead, and the next MSS_BUFFER_HEAD call skipped
    the slot AIL_sample_buffer_ready had just reported as free.
  • AIL_enumerate_filter_attributes clears the name on the terminal call, as
    its own comment says it does. It wrote the first attribute's name instead, so
    a caller reading the name before the return value got "Cutoff" back from a
    call that reported no attribute.