Releases: Raster-Lab/JLSwift
Release list
v0.9.0 — Hot-path performance rewrite
Highlights
0.9.0 is a performance release: the codec hot path was rewritten end to end, guided by CPU profiling against real radiology DICOM data, with every change gated on byte-identical encoded output versus 0.8.0.
| Benchmark (Apple Silicon) | v0.8.0 | v0.9.0 | Speedup |
|---|---|---|---|
| Real DICOM encode (lossless, 6 modalities) | 27.3 MB/s | 79.4 MB/s | 2.9x |
| Real DICOM decode | 41.3 MB/s | 82.3 MB/s | 2.0x |
| Synthetic 16-bit 2048² encode / decode | 36.6 / 57.2 MB/s | 99.7 / 101.7 MB/s | 2.7x / 1.8x |
| 4096² frame with restart intervals (wall) | 0.84 s / 0.69 s | 0.31 s / 0.24 s | ~2.8x, all cores |
New: restart-interval parallelism (DRI/RSTm)
let config = try JPEGLSEncoder.Configuration(restartInterval: 256) // lines per interval
let encoded = try JPEGLSEncoder().encode(imageData, configuration: config)
// Decoding splits at the RST markers automatically and decodes intervals concurrently.Standards-compliant intra-image parallelism for large frames (e.g. 17 MP mammography) at ~0.03 % size cost — jpegls encode --restart-interval N from the CLI. This work also fixed a decoder bug where conformant streams containing restart markers failed to decode.
Also in this release
jpegls batch encode/batch decodeare now implemented (parallel worker pool, byte-identical to serial encodes)- The never-invoked GPU/SIMD
Platform/layer (Metal, Vulkan, Accelerate, ARM64/x86-64) was removed (~9,400 lines); documentation now describes only what ships - Robustness hardening from an adversarial review:
Data-slice decoding, hostile/malformed stream handling (crafted LSE segments, stray or out-of-sequence restart markers, oversized MAXVAL), per-scan DRI semantics, and encoder rejection of sub-sampled planes — all with regression tests
Breaking changes (0.x minor)
- Removed public types: the
Platform/accelerators,PlatformAcceleratorprotocol,JPEGLSBufferPool,JPEGLSCacheFriendlyBuffer,JPEGLSTileProcessor(none were used by the codec; restart intervals are the supported parallelism mechanism) jpegls batchno longer accepts the never-functional raw-input options
Full details in the CHANGELOG and the analysis behind the rewrite in docs/OPTIMIZATION_PLAN.md.
🤖 Generated with Claude Code
JLSwift v0.8.0
JLSwift v0.8.0
Release Date: 2026-05-30
Type: Minor Release (first tagged release)
Overview
The first tagged release of JLSwift — a pure-Swift JPEG-LS (ITU-T.87) codec with Apple-Silicon (ARM64/NEON), Accelerate, and Metal GPU acceleration paths. This release consolidates the Validation & Conformance milestone (CharLS conformance, benchmarks, edge cases) together with the DICOM-independence work, and fixes several platform-specific defects that only manifest on Apple Silicon.
Highlights
- 🎉 CharLS conformance — reference fixtures and a 589-test conformance suite; the parser handles CharLS extension markers (0xFF60–0xFF7F).
- ⚡ Hardware acceleration — ARM64/NEON, Accelerate (vDSP), and Metal GPU paths for gradient/MED/quantisation and HP1/HP2/HP3 colour transforms.
- 🩺 DICOM tooling —
jpegls bench-dicomround-trips a DICOM corpus and reports per-modality throughput and lossless verification, now with first-mismatch diagnostics on failures. - 🐛 Platform fixes — Metal GPU path now works under
swift build/swift test, plus correctness/robustness fixes in the ARM64 Golomb-Rice and gradient routines. - 📚 Documentation — Getting Started, Usage Examples, Performance Tuning, Troubleshooting, SwiftUI/AppKit integration guides, and a man page.
What's New
Added
jpegls bench-dicomcommand — JPEG-LS round-trip benchmark over a DICOM corpus (per-modality encode/decode throughput + lossless verification), with first-mismatch diagnostics (row/col, decoded vs original) on failures.- CharLS conformance — 12 JPEG-LS reference files, 7 reference images, a 589-test conformance suite, and extension-marker (0xFF60–0xFF7F) parsing.
- Benchmark + edge-case suites — 18 performance benchmarks across sizes/bit-depths/components/NEAR/interleave modes, and a 38-test edge-case suite.
- Documentation — DocC for all public APIs; GETTING_STARTED, USAGE_EXAMPLES (25+), PERFORMANCE_TUNING, TROUBLESHOOTING, SWIFTUI/APPKIT examples; man page (
man/jpegls.1). - DICOM independence — non-DICOM usage examples and DICOM-aware/independent architecture documented.
Changed
- Reorganised repository layout: docs into
docs/, man page intoman/. - Renamed the executable target
jpegls→jpeglsclito avoid a case-insensitive-filesystem collision with theJPEGLSlibrary target (the built product is still namedjpegls).
Fixed
- Metal GPU path under SwiftPM —
MetalAcceleratornow compiles the bundled.metalshader source at runtime when no precompileddefault.metallibis present (SwiftPM copies the source rather than compiling it), instead of failing with "no default library was found". - ARM64 Golomb-Rice clamp —
ARM64Accelerator.computeGolombRiceParameternow clampskto the documented[0, 31]range for pathologicala/nratios, matchingX86_64Accelerator. - Gradient CPU/GPU consistency —
MetalAccelerator.computeGradientsBatchCPU fallback uses wrapping subtraction to match the GPU shader's two's-complement semantics, keeping the paths bit-identical and preventing a trap on extremeInt32inputs. - Build & test compilation on case-insensitive (Apple) filesystems;
SIMDMask.any()build error on ARM64. - CharLS-encoded files with extension markers now parse; conformance test-expectation corrections per ITU-T.87.
Installation
Swift Package Manager
dependencies: [
.package(url: "https://github.com/Raster-Lab/JLSwift.git", from: "0.8.0")
]Command-Line Tool
git clone https://github.com/Raster-Lab/JLSwift.git
cd JLSwift
git checkout v0.8.0
swift build -c release
# binary at .build/release/jpeglsRequirements
- Swift: 6.2 or later
- Platforms: macOS 12+, iOS 15+, Linux
- Primary: Apple Silicon with ARM64/NEON + Metal optimisations
- Secondary: x86-64 (Intel/Linux) with SSE/AVX
Notes
- This is a pre-1.0 release: the public API is not yet considered stable (see VERSIONING.md).
- CI validates the Linux build/test/coverage; Metal and ARM64 acceleration paths are platform-gated and were validated locally on Apple Silicon.
Full Changelog
See CHANGELOG.md for the complete list of changes.
🤖 Generated with Claude Code