Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ matches `Directory.Build.props`.
6. **Tag and push**:

```bash
git tag -a v1.7.0 -m "CHDSharp v1.7.0"
git push origin main v1.7.0
git tag -a v1.7.1 -m "CHDSharp v1.7.1"
git push origin main v1.7.1
```

`release.yml` verifies the tag against `Directory.Build.props`, rebuilds the six bundles on
Expand All @@ -172,7 +172,7 @@ matches `Directory.Build.props`.
7. **Verify the release**:

```bash
gh release view v1.7.0
gh release view v1.7.1
gh run list --workflow=release.yml --limit 1
(Invoke-RestMethod https://api.nuget.org/v3-flatcontainer/chdsharp/index.json).versions
```
Expand Down
2 changes: 1 addition & 1 deletion CHDSharpCli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

The binary is named `CHDSharp` (e.g. `CHDSharp.exe` on Windows). It accepts the same subcommands and options as MAME's `chdman`, plus additional convenience commands.

> **v1.7.0** - the CLI now runs on .NET 11 and ships native platform bundles: `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on macOS. Release bundles are framework-dependent single-file binaries and require the .NET 11 runtime; the library targets `net8.0` / `net9.0` / `net10.0` / `net11.0`. No command-line behavior changed in this release.
> **v1.7.1** - bug-fix release: an explicitly empty `--input`/`--output` path now prints the normal usage error instead of crashing in `Directory.CreateDirectory("")`, and CD FLAC encoding reserves 512 bytes of frame metadata (was 64) so one-frame-per-hunk audio no longer fails with `FLAC frame too large`. Bundles remain `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on macOS, and require the .NET 11 runtime; the library targets `net8.0` / `net9.0` / `net10.0` / `net11.0`.

---

Expand Down
2 changes: 1 addition & 1 deletion CHDSharpLib/CHDSharpLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<RepositoryType>git</RepositoryType>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageReleaseNotes>v1.7.0: .NET 11 and C# 15 release. All projects now multi-target net8.0/net9.0/net10.0/net11.0 and build with LangVersion 15, and the package includes net11.0 assemblies for CHDSharpLib and every vendored codec. CLI release bundles now use each platform's native format: .zip on Windows, .tar.gz on Linux and .dmg on macOS. No public API or encoder output changes: 4,220 library tests + 455 encoder tests on each target framework, jb inspectcode 0 findings, quick battle harness 905/905 checks. Pure C# - zero native dependencies. Targets net8.0/net9.0/net10.0/net11.0.</PackageReleaseNotes>
<PackageReleaseNotes>v1.7.1: Bug-fix release. Empty CLI paths report usage errors instead of crashing, and CdflCodec/AVHuff reserve 512 bytes of FLAC frame metadata per frame (was 64), so one-frame-per-hunk CD audio with large Fixed subframes no longer fails with "FLAC frame too large". No public API or encoder output changes: 4,221 library tests + 456 encoder tests on each target framework, jb inspectcode 0 findings, CI chdman parity smoke passed. Pure C# - zero native dependencies. Targets net8.0/net9.0/net10.0/net11.0.</PackageReleaseNotes>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarningsAsErrors>$(WarningsAsErrors);CS1591</WarningsAsErrors>
</PropertyGroup>
Expand Down
5 changes: 5 additions & 0 deletions CHDSharpLib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

---

## What's New in v1.7.1

- **FLAC frame headroom** - `CdflCodec` and the AVHuff encoder now reserve 512 bytes of per-frame metadata instead of 64. Valid CD audio with large Fixed subframes no longer fails with `FLAC frame too large`; encoded bytes are unchanged for every hunk that already compressed.
- **No public API changes** - 4,221 library tests + 456 encoder tests on each of the four target frameworks, `jb inspectcode` 0 findings, CI `chdman` parity smoke passed.

## What's New in v1.7.0

- **.NET 11 and C# 15** - the package now multi-targets `net8.0`/`net9.0`/`net10.0`/`net11.0` and ships `lib/net11.0` assemblies for `CHDSharpLib` plus every vendored codec. All projects compile with `LangVersion 15`.
Expand Down
2 changes: 1 addition & 1 deletion CHDSharpTest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

**xUnit unit and corpus test suite for CHDSharp — tests header parsing, CRC checksums, and full decompression against a deterministic 30-file CHD corpus (V1–V5, all codecs).**

> **v1.7.0** - targets `net8.0` / `net9.0` / `net10.0` / `net11.0`. 4,220 tests per target framework (18,700 across all four TFMs); encoder suite 455 tests per TFM; quick battle harness 905/905 checks vs `chdman` 0.289; solution clean under `jb inspectcode`.
> **v1.7.1** - targets `net8.0` / `net9.0` / `net10.0` / `net11.0`. 4,221 tests per target framework (18,708 across all four TFMs); encoder suite 456 tests per TFM; CI quick battle harness passed vs `chdman` 0.289; solution clean under `jb inspectcode`.

---

Expand Down
2 changes: 1 addition & 1 deletion CHDSharpTestDataGeneration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

**Deterministic CHD test corpus generator for the CHDSharp xUnit test suite.**

> **v1.7.0** - targets `net8.0` / `net9.0` / `net10.0` / `net11.0`. Generates the 30-file corpus for V1-V5 via MAME 0.289 `chdman`; version-aligned with the v1.7.0 release.
> **v1.7.1** - targets `net8.0` / `net9.0` / `net10.0` / `net11.0`. Generates the 30-file corpus for V1-V5 via MAME 0.289 `chdman`; version-aligned with the v1.7.1 release.

Generates the 30-file CHD corpus in `CHDSharpTest/TestData/`, covering every format version (V1–V5), all compression codecs (zlib, lzma, huffman, flac, zstd, avhu + CD variants), every map type, and parent/child chains. All source images are built deterministically (seeded PRNG) so regenerating the corpus produces byte-identical output.

Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<Version>1.7.0</Version>
<AssemblyVersion>1.7.0</AssemblyVersion>
<FileVersion>1.7.0</FileVersion>
<Version>1.7.1</Version>
<AssemblyVersion>1.7.1</AssemblyVersion>
<FileVersion>1.7.1</FileVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DebugType>embedded</DebugType>
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ Supports every CHD format version (V1–V5), all 10 compression codecs, parent/c

---

## What's New in v1.7.1

- **Empty CLI paths no longer crash** - `extractcd -o ""` (and every other command using the shared `--input`/`--output` parser) now prints the normal `... requires --input <file> --output <file>` usage error instead of reaching `Directory.CreateDirectory("")` and throwing an unhandled `ArgumentException`.
- **Large FLAC frames fit again** - `CdflCodec` and the AVHuff encoder reserve 512 bytes of FLAC metadata per frame (was 64), so one-frame-per-hunk CD audio with large Fixed subframes no longer fails with `FLAC frame too large`. Encoded output bytes are unchanged for every hunk that already compressed.
- **Tooling** - `Meziantou.Analyzer 3.0.341`, `coverlet.collector 10.1.1` and `Serilog.Extensions.Logging 11.0.0`.
- **Verification** - 4,221 library tests + 456 encoder tests on each of the four target frameworks (18,708 total), `jb inspectcode` 0 findings, CI `chdman` parity smoke passed. No public API changes.

## What's New in v1.7.0

- **.NET 11 and C# 15** - every project now multi-targets `net8.0`/`net9.0`/`net10.0`/`net11.0` (`net11.0-windows` for the WPF tester) and builds with `LangVersion 15`. The NuGet package includes `net11.0` assemblies for the library and all vendored codecs. Runtime packages (`Microsoft.Extensions.Logging.Abstractions`, `System.IO.Hashing`) are 11.0.0; their `netstandard2.0` assets keep the `net8.0`/`net9.0` targets working.
Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ Out of scope:
## Verifying a release

```bash
gh attestation verify CHDSharp_win-x64_v1.7.0.zip --repo purelogiccode/CHDSharp
gh attestation verify CHDSharp_linux-x64_v1.7.0.tar.gz --repo purelogiccode/CHDSharp
gh attestation verify CHDSharp_osx-arm64_v1.7.0.dmg --repo purelogiccode/CHDSharp
gh attestation verify CHDSharp_win-x64_v1.7.1.zip --repo purelogiccode/CHDSharp
gh attestation verify CHDSharp_linux-x64_v1.7.1.tar.gz --repo purelogiccode/CHDSharp
gh attestation verify CHDSharp_osx-arm64_v1.7.1.dmg --repo purelogiccode/CHDSharp
```

NuGet packages are published from the tag workflow; compare the package version,
Expand Down
83 changes: 42 additions & 41 deletions WhatsNew.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# CHDSharp v1.7.0 - What's New
# CHDSharp v1.7.1 - What's New

**Released:** 2026-11-13 - [Full changelog](docs/ReleaseNotes.md) - [NuGet](https://www.nuget.org/packages/CHDSharp/1.7.0)
**Released:** 2026-11-18 - [Full changelog](docs/ReleaseNotes.md) - [NuGet](https://www.nuget.org/packages/CHDSharp/1.7.1)

CHDSharp v1.7.0 moves the complete solution to **.NET 11** and **C# 15**, keeps the
`net8.0`/`net9.0` targets for current consumers, and switches the CLI bundles to each
platform's native archive format. No library API or encoder output changed.
CHDSharp v1.7.1 is a bug-fix release. It stops empty CLI paths from crashing and restores
FLAC encoding for CD audio whose frames need more than 64 bytes of header metadata. No public
API or `chdman`-visible encoder output changed.

---

## Download (CLI)

| Platform | Bundle |
|----------|--------|
| Windows x64 | [`CHDSharp_win-x64_v1.7.0.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_win-x64_v1.7.0.zip) |
| Windows ARM64 | [`CHDSharp_win-arm64_v1.7.0.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_win-arm64_v1.7.0.zip) |
| Linux x64 | [`CHDSharp_linux-x64_v1.7.0.tar.gz`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_linux-x64_v1.7.0.tar.gz) |
| Linux ARM64 | [`CHDSharp_linux-arm64_v1.7.0.tar.gz`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_linux-arm64_v1.7.0.tar.gz) |
| macOS Intel | [`CHDSharp_osx-x64_v1.7.0.dmg`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_osx-x64_v1.7.0.dmg) |
| macOS Apple Silicon | [`CHDSharp_osx-arm64_v1.7.0.dmg`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_osx-arm64_v1.7.0.dmg) |
| Windows x64 | [`CHDSharp_win-x64_v1.7.1.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.1/CHDSharp_win-x64_v1.7.1.zip) |
| Windows ARM64 | [`CHDSharp_win-arm64_v1.7.1.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.1/CHDSharp_win-arm64_v1.7.1.zip) |
| Linux x64 | [`CHDSharp_linux-x64_v1.7.1.tar.gz`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.1/CHDSharp_linux-x64_v1.7.1.tar.gz) |
| Linux ARM64 | [`CHDSharp_linux-arm64_v1.7.1.tar.gz`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.1/CHDSharp_linux-arm64_v1.7.1.tar.gz) |
| macOS Intel | [`CHDSharp_osx-x64_v1.7.1.dmg`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.1/CHDSharp_osx-x64_v1.7.1.dmg) |
| macOS Apple Silicon | [`CHDSharp_osx-arm64_v1.7.1.dmg`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.1/CHDSharp_osx-arm64_v1.7.1.dmg) |

Every bundle contains a **framework-dependent single-file** `CHDSharp` / `CHDSharp.exe`
build (the .NET runtime is **not** embedded) plus `LICENSE.txt`, `README.md`, `README.txt`
Expand All @@ -26,50 +26,51 @@ is required.

---

## .NET 11 and C# 15
## Empty CLI paths report the usage error

- All 12 projects now multi-target `net8.0;net9.0;net10.0;net11.0`
(`net11.0-windows` for the WPF tester) and compile with `LangVersion 15`.
- The NuGet package ships `lib/net11.0` assemblies for `CHDSharpLib` and all four vendored
codec assemblies.
- CI, CodeQL, DocFX, the release pipeline and the documentation site all run on the .NET 11 SDK.
- The runtime packages (`Microsoft.Extensions.Logging.Abstractions`, `System.IO.Hashing`) and
SourceLink are at 11.0.0/11.0.100 for every target. The packages ship `netstandard2.0` assets,
so the `net8.0`/`net9.0` targets remain functional; their advisory TFM-support warnings are
suppressed centrally.
`extractcd -o ""` passed the old null check, reached
`Path.GetDirectoryName("")` / `Directory.CreateDirectory("")` and crashed with an unhandled
`ArgumentException`. An explicitly empty `--input` or `--output` is now treated as a missing
path for every command that uses the shared create/extract argument parser, so the CLI prints
the normal `... requires --input <file> --output <file>` usage text and exits with code 1.

## Native CLI bundles
Regression test: `Extractcd_reports_usage_error_for_an_empty_output_path`.

- **Windows** stays `.zip`.
- **Linux** is now `.tar.gz`.
- **macOS** is now `.dmg` (built on a macOS runner; the disk image contains the binary and
the documentation files).
- `VersionCheckService` looks up the correct asset extension for the running platform, and
the release workflow builds each platform's bundles on its native runner before
publishing them together.
## FLAC frames have enough header room

`CdflCodec` reserved only 64 bytes per FLAC frame for the frame header, subframe headers,
Rice partition parameters and footer. Real CD audio using Fixed subframes can need 67 bytes,
which made a valid one-frame-per-hunk source fail with
`FLAC frame too large: 2419 bytes (buffer 2416)`.

- `CdflCodec` now reserves 512 bytes of metadata per frame.
- `AvHuffEncoder` does the same for each laserdisc audio channel's mono FLAC frame.
- The allowance is only headroom: the encoded bytes are unchanged for every hunk that already
compressed, and the existing `total >= hunk size` check still decides whether a hunk is
stored compressed.

Regression test: `CdflCodec_OneFrameHunk_EncodesWithoutOverflowingTheFrameBuffer`.

## Tooling and dependencies

- Dependabot updates: GitHub Actions (`setup-dotnet 6.1.0`, `github/codeql-action 4.39.3`,
`ruby/setup-ruby 1.338.0`), `Meziantou.Analyzer 3.0.339` and `xunit.v3 4.0.3`.
- The Pages workflow now uses the .NET 11 SDK, so the DocFX API reference keeps building
against the `net11.0` target.
- Documentation, `WhatsNew.md`, the per-project READMEs and `AGENTS.md` describe the
four target frameworks and the new bundle formats.
- `Meziantou.Analyzer` 3.0.339 -> 3.0.341.
- `coverlet.collector` 10.1.0 -> 10.1.1.
- `Serilog.Extensions.Logging` 10.0.0 -> 11.0.0.

## Verification

- `dotnet build -c Release -warnaserror`: 0 warnings, 0 errors.
- `jb inspectcode --severity=WARNING --exclude="Vendored*/**"`: **0 findings**.
- Library tests: **4,220 passed** and encoder tests: **455 passed** on each of `net8.0`,
`net9.0`, `net10.0` and `net11.0` (**18,700 tests total**).
- Quick `chdman` parity battle on `net11.0`: **905/905 checks passed**, byte-identical output.
- `jb inspectcode CSharp_CHDSharp.sln --severity=WARNING`: **0 findings**.
- Library tests: **4,221 passed** and encoder tests: **456 passed** on each of `net8.0`,
`net9.0`, `net10.0` and `net11.0` (**18,708 tests total**).
- CI quick `chdman` parity smoke: passed, byte-identical output.
- No public API changes and no encoder output changes.

## Upgrade notes

- Use the bundle matching your platform: `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on
macOS. On Linux run `chmod +x CHDSharp` after extracting if needed; on macOS drag `CHDSharp`
out of the mounted disk image.
- The CLI's update check now expects the new asset names. Older releases remain downloadable
from the [releases page](https://github.com/purelogiccode/CHDSharp/releases).
- The CLI update check expects the same asset names as v1.7.0, with the version bumped to
v1.7.1. Older releases remain downloadable from the
[releases page](https://github.com/purelogiccode/CHDSharp/releases).
53 changes: 53 additions & 0 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
# CHDSharp Release Notes

## CHDSharp v1.7.1

Bug-fix release on top of v1.7.0. No public API or encoder-output changes.

**Released:** 2026-11-18 - [NuGet](https://www.nuget.org/packages/CHDSharp/1.7.1) -
[CLI bundles](https://github.com/purelogiccode/CHDSharp/releases/tag/v1.7.1)

### Empty CLI paths report the usage error

`extractcd -o ""` passed the old null check, reached
`Path.GetDirectoryName("")` / `Directory.CreateDirectory("")` and crashed with an unhandled
`ArgumentException`. `ParseCreateArgs` now treats an explicitly empty `--input` or `--output`
as a missing path for every command that shares the parser, so the CLI prints the normal
`... requires --input <file> --output <file>` usage text and exits with code 1.

Regression test: `Extractcd_reports_usage_error_for_an_empty_output_path`.

### FLAC frames have enough header room

`CdflCodec` reserved only 64 bytes per FLAC frame for the frame header, subframe headers,
Rice partition parameters and footer. Real CD audio using Fixed subframes can need 67 bytes,
so a valid one-frame-per-hunk source failed with
`FLAC frame too large: 2419 bytes (buffer 2416)`.

- `CdflCodec` now reserves 512 bytes of metadata per frame.
- `AvHuffEncoder` does the same for each laserdisc audio channel's mono FLAC frame.
- The allowance is only headroom: encoded bytes are unchanged for every hunk that already
compressed, and the existing `total >= hunk size` check still decides whether a hunk is
stored compressed.

Regression test: `CdflCodec_OneFrameHunk_EncodesWithoutOverflowingTheFrameBuffer`.

### Tooling

- `Meziantou.Analyzer` 3.0.339 -> 3.0.341.
- `coverlet.collector` 10.1.0 -> 10.1.1.
- `Serilog.Extensions.Logging` 10.0.0 -> 11.0.0.

### Verification

- `dotnet build -c Release -warnaserror`: 0 warnings, 0 errors.
- `jb inspectcode CSharp_CHDSharp.sln --severity=WARNING`: 0 findings.
- Library tests: 4,221 passed and encoder tests: 456 passed on each of `net8.0`, `net9.0`,
`net10.0` and `net11.0` (18,708 total).
- CI quick battle harness: passed, byte-identical `chdman` output.

### Upgrade notes

Use the bundle matching your platform: `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on
macOS. Linux users may need `chmod +x CHDSharp` after extracting; macOS users should copy
`CHDSharp` out of the mounted disk image. The CLI update check expects the same asset names as
v1.7.0, with the version bumped to v1.7.1.

## CHDSharp v1.7.0

Platform and packaging release on top of v1.6.3. No public API or encoder-output changes.
Expand Down
6 changes: 3 additions & 3 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CSharp_CHDSharp.sln
├── VendoredLZMA/ LZMA SDK C# port
├── VendoredFlac/ Pure C# FLAC encoder/decoder
├── VendoredZSTD/ Pure C# zstd 1.5.5 encoder/decoder (MAME parity)
└── Directory.Build.props Centralized versioning (1.7.0) and analyzer setup
└── Directory.Build.props Centralized versioning (1.7.1) and analyzer setup
```

---
Expand All @@ -52,7 +52,7 @@ dotnet build CHDSharpLib/CHDSharpLib.csproj -c Release

### Centralized versioning

`Directory.Build.props` defines a single `<Version>` (currently `1.7.0`) that all projects inherit, so `AssemblyVersion`, `FileVersion`, and the NuGet package version stay in sync automatically.
`Directory.Build.props` defines a single `<Version>` (currently `1.7.1`) that all projects inherit, so `AssemblyVersion`, `FileVersion`, and the NuGet package version stay in sync automatically.

### Code style & analyzers

Expand Down Expand Up @@ -193,7 +193,7 @@ single-file** binary (`--self-contained false -p:PublishSingleFile=true` — the
runtime is *not* embedded), appends `LICENSE.txt`, `README.md`, `README.txt` and
`WhatsNew.md`, and writes the platform-native bundle: `CHDSharp_<rid>_v<version>.zip` on
Windows, `.tar.gz` on Linux and `.dmg` on macOS (the exact asset names the CLI's built-in
update check looks up on GitHub releases, e.g. `CHDSharp_linux-x64_v1.7.0.tar.gz`).
update check looks up on GitHub releases, e.g. `CHDSharp_linux-x64_v1.7.1.tar.gz`).
Existing files in the output path are never deleted. macOS `.dmg` bundles must be built on
macOS. The binary is named `CHDSharp` (`CHDSharp.exe` on Windows); bundles require the
.NET 11 runtime.
Expand Down
2 changes: 1 addition & 1 deletion scripts/package-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
for each platform - CHDSharp_<rid>_v<version>.zip on Windows,
CHDSharp_<rid>_v<version>.tar.gz on Linux and CHDSharp_<rid>_v<version>.dmg on macOS -
the exact asset names VersionCheckService looks up on GitHub releases for the built-in
update check (e.g. CHDSharp_linux-x64_v1.7.0.tar.gz). Existing files in the output
update check (e.g. CHDSharp_linux-x64_v1.7.1.tar.gz). Existing files in the output
path are never deleted. macOS .dmg bundles require macOS; use -Rids on other hosts to
select only the formats you can build.

Expand Down
Loading