Release v0.8.0#116
Merged
Merged
Conversation
Three defects surfaced when running the full suite on Apple Silicon via `swift test` (CI only runs on Linux, where Metal and the ARM64 accelerator are compiled out, so these never failed there): - MetalAccelerator: `makeDefaultLibrary(bundle:)` failed with "no default library was found" because SwiftPM's `.process` only copies the `.metal` source into the resource bundle without compiling a `default.metallib` (only Xcode's build system does). Add a runtime fallback that compiles the bundled shader source via `makeLibrary(source:)`, so the GPU path works under both `swift build`/`swift test` and Xcode. (~47 test failures) - ARM64Accelerator.computeGolombRiceParameter: returned an unclamped `k` (up to ~60) for pathological a/n ratios because the CLZ-based estimate can start above 31, skipping the `while k < 31` loop. Clamp to the documented [0, 31] range, matching X86_64Accelerator. (1 test failure) - MetalAccelerator.computeGradientsBatch CPU fallback used trapping subtraction while the GPU shader wraps in 32-bit int, so identical inputs made the CPU path trap (SIGTRAP on `0 - Int32.min`) while the GPU wrapped. Use wrapping subtraction (`&-`) so the paths are bit-identical and the public API no longer crashes on extreme Int32 inputs. Update the boundary test's expectations to match. Full suite now passes: 1388 tests in 105 suites, green debug + release builds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When a round-trip fails, bench-dicom now writes an actionable line to stderr: for a lossless mismatch it reports the first differing sample (row, col, decoded vs original), and for a thrown error it reports the file path and the error. Previously failures were only tallied as a count, with no way to tell which file or pixel diverged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Promote the [Unreleased] / "0.8.0 - In Progress" sections to a dated 0.8.0 release, folding in the DICOM-independence (Milestone 20) work. - Document changes made since the milestones were last recorded: bench-dicom harness + diagnostics, docs/man reorg, jpegls->jpeglscli target rename, and the build/SIMD/Metal/Golomb-Rice/gradient fixes. - Add CHANGELOG comparison links for v0.8.0. - Bump the README SPM install example to `from: "0.8.0"`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR prepares the v0.8.0 release while fixing Apple-platform issues in Metal shader loading, ARM64 Golomb-Rice bounds, and CPU/GPU gradient overflow semantics.
Changes:
- Adds runtime Metal shader source compilation fallback for SwiftPM builds.
- Aligns ARM64 Golomb-Rice and Metal CPU fallback behavior with documented/platform semantics.
- Updates release documentation and bench-DICOM failure diagnostics.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
Sources/JPEGLS/Platform/Metal/MetalAccelerator.swift |
Adds shader library fallback loading and wrapping CPU gradient subtraction. |
Sources/JPEGLS/Platform/ARM64/ARM64Accelerator.swift |
Clamps Golomb-Rice parameter to the documented upper bound. |
Sources/jpeglscli/BenchDICOMCommand.swift |
Emits detailed stderr diagnostics for round-trip failures/errors. |
Tests/JPEGLSTests/MetalAcceleratorTests.swift |
Updates gradient expectations to use wrapping subtraction. |
README.md |
Bumps SwiftPM dependency example to v0.8.0. |
CHANGELOG.md |
Promotes v0.8.0 release notes and comparison links. |
Comment on lines
+48
to
+50
| #### DICOM Independence & Final Integration (Milestone 20) | ||
| - Non-DICOM usage examples in USAGE_EXAMPLES.md (general-purpose compression, web assets, archival storage) | ||
| - DICOM-aware/DICOM-independent architecture documented in README.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cuts the first tagged release, v0.8.0 (Validation & Conformance milestone, plus the DICOM-independence work). Also fixes three platform-specific defects that surfaced when running the full test suite on Apple Silicon via
swift test— CI only runs on Linux, where Metal and the ARM64 accelerator are compiled out, so these were never exercised there.Fixes
.processonly copiesJPEGLSShaders.metalinto the resource bundle; it doesn't compile adefault.metallib(only Xcode does).makeDefaultLibrary(bundle:)therefore failed with "no default library was found" (~47 test failures). Added a runtime fallback that compiles the bundled shader source viamakeLibrary(source:), so the GPU path works under both SPM and Xcode.computeGolombRiceParametercould return an unclampedk(~60) for pathologicala/nratios because the CLZ-based estimate starts above 31, skipping the bounding loop. Now clamps to the documented[0, 31], matchingX86_64Accelerator(1 test failure).int, so0 - Int32.mincrashed the CPU path (SIGTRAP) while the GPU wrapped. Now uses wrapping subtraction (&-) so both paths are bit-identical and the public API no longer traps on extremeInt32inputs.Release prep
bench-dicom: first-mismatch diagnostics on failures (row/col + decoded vs original, or the thrown error) instead of a bare failure count.jpegls→jpeglsclirename, and all the build/SIMD/Metal/Golomb-Rice/gradient fixes.from: "0.8.0".Verification
swift test→ 1388 tests in 105 suites passed (was 48 failing) on Apple Silicon.swift build -c release→ Build complete.🤖 Generated with Claude Code