Skip to content

Release v0.8.0#116

Merged
SureshKViswanathan merged 3 commits into
mainfrom
release/v0.8.0
May 30, 2026
Merged

Release v0.8.0#116
SureshKViswanathan merged 3 commits into
mainfrom
release/v0.8.0

Conversation

@SureshKViswanathan

Copy link
Copy Markdown
Contributor

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

  • Metal shader library loading — SwiftPM's .process only copies JPEGLSShaders.metal into the resource bundle; it doesn't compile a default.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 via makeLibrary(source:), so the GPU path works under both SPM and Xcode.
  • ARM64 Golomb-Rice clampcomputeGolombRiceParameter could return an unclamped k (~60) for pathological a/n ratios because the CLZ-based estimate starts above 31, skipping the bounding loop. Now clamps to the documented [0, 31], matching X86_64Accelerator (1 test failure).
  • Gradient CPU/GPU overflow — the CPU fallback used trapping subtraction while the GPU shader wraps in 32-bit int, so 0 - Int32.min crashed 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 extreme Int32 inputs.

Release prep

  • bench-dicom: first-mismatch diagnostics on failures (row/col + decoded vs original, or the thrown error) instead of a bare failure count.
  • CHANGELOG promoted to a dated 0.8.0 release; documents the bench-dicom harness, docs/man reorg, jpeglsjpeglscli rename, and all the build/SIMD/Metal/Golomb-Rice/gradient fixes.
  • README SPM install example bumped to from: "0.8.0".

Verification

  • swift test1388 tests in 105 suites passed (was 48 failing) on Apple Silicon.
  • swift build -c release → Build complete.

🤖 Generated with Claude Code

raster and others added 3 commits May 30, 2026 16:33
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>
Copilot AI review requested due to automatic review settings May 30, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread CHANGELOG.md
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
@SureshKViswanathan SureshKViswanathan merged commit bcf00eb into main May 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants