Skip to content

release: v10.10.0 — JP3D true partial-resolution + ROI footprint-skip + Z-narrow#446

Merged
SureshKViswanathan merged 1 commit into
mainfrom
v10.10.0-release-candidate
May 23, 2026
Merged

release: v10.10.0 — JP3D true partial-resolution + ROI footprint-skip + Z-narrow#446
SureshKViswanathan merged 1 commit into
mainfrom
v10.10.0-release-candidate

Conversation

@SureshKViswanathan

Copy link
Copy Markdown
Contributor

Summary

  • JP3DDecoderConfiguration.resolutionLevel becomes functional (was wired but ignored since v5.x). M2 release: 2.2–3.1× faster decode at resolutionLevel = 1.
  • JP3DROIDecoder replaces decode-then-crop with true ROI footprint-skip (per-tile in-tile XY decodeRegion(.direct) + Z-narrow non-residual scan). M2 release: ROI 1/4 is 3.4–4.1× faster than full decode.
  • Combined resolutionLevel + ROI throws loud (was silently ignored). Codestream bytes byte-identical to v10.9.3.

Correctness gate (release mode)

J2KMedicalCorpusEncodePerformanceTests  2/2 PASS
J2KMedicalCorpusPerformanceTests        2/2 PASS
J2KStrictCrossCodecValidationTests      3/3 PASS
Total: 7 tests, 0 failures, 0 unexpected (32.26 s release-mode)

Test plan

  • Mandatory pre-release gate (release mode, 0 failures)
  • V10_18_TrueSelectiveParityTests — new 9-test parity oracle (bit-exact assertions for resolutionLevel + ROI vs full-decode-then-crop)
  • JP3DDecoderTests — existing 61-test JP3D regression suite (no regression)
  • Codestream bytes byte-identical to v10.9.3 (encoder unchanged, decoder-only change)
  • README updated (Current Version + new Release Status paragraph + v10.9.3 catch-up)
  • RELEASE_NOTES_v10.10.0.md authored

Reproducing

swift test -c release \
  --filter 'V10_18_TrueSelectiveParityTests|JP3DDecoderTests'

Companion docs

  • RELEASE_NOTES_v10.10.0.md
  • Documentation/research/V10_18_JP3D_TRUE_SELECTIVE_DECODE.md

🤖 Generated with Claude Code

… + Z-narrow

Closes the long-standing JP3D follow-up: the resolution-level field
on JP3DDecoderConfiguration was wired but never consulted; the ROI
decoder was decode-then-crop. Both are now true-selective.

Decoder-only release; codestream bytes byte-identical to v10.9.3.
Encoder unchanged. MINOR bump for new functional behaviour on existing
public APIs (JP3DDecoderConfiguration.resolutionLevel and
JP3DROIDecoder.decode(_:region:)).

Three coordinated changes inside Sources/J2K3D/:

1. JP3DDecoderConfiguration.resolutionLevel becomes functional.
   The field has shipped since v5.x but the decoder ignored it.
   v10.10.0 routes each per-slice 2D codestream inside
   JP3DSliceStackCodec through the 2D codec's existing
   decodeResolution(_:options:) (v10.5.0); returned volume sized
   ⌈W / 2^K⌉ × ⌈H / 2^K⌉ × D as documented.
   M2 release: 2.2-3.1x faster decode at resolutionLevel = 1.

2. JP3DROIDecoder swaps decode-then-crop for true ROI footprint-skip.
   Per-tile in-tile sub-region passed into JP3DSliceStackCodec, which
   routes the per-slice 2D decode through decodeRegion(_:options:)
   .direct strategy (v10.6.0 footprint-skip). Returned buffers sized
   exactly for the region, no second intersection-crop pass needed.

3. Z-narrow ROI skip. JP3DSliceStackCodec.decode pre-scans slice
   headers (no decode), finds the latest non-residual slice ≤
   zRange.lowerBound, decodes from there. Slices in [z_start, zLower)
   keep the Z-delta residual chain intact; out-of-Z-range slices
   that precede the request are entirely skipped.

M2 release ROI 1/4 (XY footprint-skip + Z-narrow combined):
  mr_3d_small  18.78 → 5.57 ms (3.37x faster than full)
  ct_3d_small  64.45 → 15.55 ms (4.14x)
  mr_3d_mid    130.13 → 32.84 ms (3.96x)

Combined resolutionLevel + ROI throws loud (the 2D codec doesn't yet
implement footprint-skip at a downsampled resolution — separate arc).
Previously the combination silently ignored resolutionLevel.

Files (Sources/J2K3D + Tests/JP3DTests):
  - JP3DDecoder.swift           Phase 2 resolutionLevel
  - JP3DSliceStackCodec.swift   Phase 2 + Phase 3 + Phase 6 (zRange)
                                + 20-line inline COD-marker peek
                                (peekDecompositionLevels) for per-slice N
  - JP3DROIDecoder.swift        Phase 3 (true ROI) + Phase 5 guard
                                + Phase 6 (zRange plumbing)
  - V10_18_TrueSelectiveParityTests.swift (NEW)  9 tests:
      testFullDecodeLosslessRoundTripBaseline      (anchor)
      testROIDecodeMatchesFullDecodeCropped        (Phase 3 guard)
      testROIDecodeMatchesFullDecodeCroppedAtCorner
      testResolutionLevel0IsBitExactFullDecode     (Phase 2 backward-compat)
      testPartialResolutionShape                   (Phase 2 dim contract)
      testPartialResolutionDeterministic
      testPartialResolutionLevel2Shape             (Phase 2 K=2)
      testZNarrowROIBitExactWithFullCropped        (Phase 6 guard)
      testCombinedResolutionLevelAndROIIsPhase5Future (Phase 5 tripwire)

Tests (release mode):
  - V10_18_TrueSelectiveParityTests:           9/9 PASS
  - JP3DDecoderTests:                          61/61 PASS
  - Mandatory commit gate (release mode):
    * J2KMedicalCorpusEncodePerformanceTests:  2/2 PASS
    * J2KMedicalCorpusPerformanceTests:        2/2 PASS
    * J2KStrictCrossCodecValidationTests:      3/3 PASS
    Total: 7 tests, 0 failures, 0 unexpected (32.26 s)

README updated with v10.10.0 Current Version + Release Status paragraph
+ v10.9.3 catch-up paragraph (was missing in the v10.9.3 release).
Companion doc: Documentation/research/V10_18_JP3D_TRUE_SELECTIVE_DECODE.md.

The bench-app scaffolding from v10.18-research (J2KBenchApp Volumes
tab, 3-plane MPR viewer, 6 anatomical phantoms, J2KBenchMac --jp3d)
stays on the research branch per feedback_research_no_main_merge.md —
only the codec changes ship in this release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SureshKViswanathan SureshKViswanathan merged commit 4ef71c5 into main May 23, 2026
13 of 16 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.

1 participant