Skip to content

release: v10.11.0 — JP3D batched GPU iDWT#447

Merged
SureshKViswanathan merged 1 commit into
mainfrom
v10.11.0-release-candidate
May 24, 2026
Merged

release: v10.11.0 — JP3D batched GPU iDWT#447
SureshKViswanathan merged 1 commit into
mainfrom
v10.11.0-release-candidate

Conversation

@SureshKViswanathan

Copy link
Copy Markdown
Contributor

Summary

  • JP3D batched GPU iDWTJP3DSliceStackCodec runs parallel _jp3dDecodeToCoefficients across the z-range + ONE batched iDWT dispatch across all slices instead of N per-slice dispatches.
  • JP3D full decode wins (M2 release, in-process, 7 runs / 2 warmups): −5 ms on small CT to −115 ms on 16M-voxel CT (1.07–1.17× faster, 5/6 fixtures clear the 3 ms threshold).
  • Decoder-only, codestream byte-identical to v10.10.0.

Correctness gate (release mode)

Suite Tests Result
V10_20_BatchedBridgeParityTests 5/5 PASS
V10_20_BatchedInverseInt32ParityTests 12/12 PASS
V10_20_JP3DBridgeParityTests 5/5 PASS
swift test --filter JP3D regression 519/519 PASS
J2KMedicalCorpusEncodePerformanceTests 2/2 PASS
J2KMedicalCorpusPerformanceTests 2/2 PASS
J2KStrictCrossCodecValidationTests 3/3 PASS

Test plan

  • Mandatory pre-release gate (encode-perf + decode-perf + cross-codec parity)
  • V10_20 bridge SPI parity (per-slice vs batched bridge bit-exact)
  • V10_20 batched kernel parity (batched vs serial GPU bit-exact)
  • JP3D regression sweep (519 tests covering v10.10.0 partial-resolution + ROI + Z-narrow + round-trip)
  • JP3D A/B bench measurement (J2K_JP3D_BATCHED_BRIDGE=0 opt-out vs default-batched)
  • Codestream byte-equality vs v10.10.0 (no encoder change)

Companion documents

🤖 Generated with Claude Code

JP3D decoder gets a single-dispatch Metal kernel that amortises
per-slice GPU overhead across the whole volume. `JP3DSliceStackCodec`
now runs parallel `_jp3dDecodeToCoefficients` across the z-range
via a TaskGroup, then ONE batched iDWT call across all slices, then
the existing sequential Z-delta residual chain.

JP3D full-decode wins (M2 release, --jp3d bench, in-process, 7 runs
/ 2 warmups, median):

  Fixture (WxHxD)            voxels    serial  batched   Δ ms   ratio
  -------------------------------------------------------------------
  mr_3d_small  128×128×16    262K      13.81   14.05    +0.24  0.98×
  ct_3d_small  256×256×16    1.05M     44.11   38.99    −5.12  1.13×
  us_3d_small  320×240×24    1.84M     60.44   56.29    −4.15  1.07×
  mr_3d_mid    256×256×32    2.10M     87.21   77.71    −9.50  1.12×
  ct_3d_mid    512×512×32    8.39M    369.81  316.56   −53.25  1.17×
  ct_3d_large  512×512×64    16.78M   789.15  674.59  −114.57  1.17×

5/6 fixtures clear the 3 ms acceptance threshold; the wash is the
smallest fixture (13 ms wall) where per-slice overhead dominates.

Kernel-level: 5.93 ms serial → 2.06 ms batched (16 slices × 256² ×
3 levels) = **2.4× faster GPU dispatch**.

Architectural surface — opaque JP3D bridge SPI on `J2KDecoder`:
  • `_jp3dDecodeToCoefficients(_:Data) -> JP3DSliceCoefficients`
  • `_jp3dIDWTAndFinalize(_:JP3DSliceCoefficients) -> J2KImage`
  • `_jp3dIDWTAndFinalizeBatched(_:[JP3DSliceCoefficients]) -> [J2KImage]`

Two new Metal kernels extend v10.3 tiled threadgroup kernels with a
Z-dim grid axis (`j2k_dwt_inverse_53_horizontal_int_tiled_batched`,
`..._vertical_..._batched`), processing N slices in one dispatch.

Decoder-only release; codestream bytes byte-identical to v10.10.0.
Encoder unchanged. Eligibility gate: only `K=0 + no ROI` routes
through the batched path; `K>0` keeps the per-slice
`decodeResolution` loop, ROI keeps `decodeRegion` (those bridges
are future work). Opt-out via env `J2K_JP3D_BATCHED_BRIDGE=0`.

Validation:
  - V10_20_BatchedBridgeParityTests          5/5  PASS
  - V10_20_BatchedInverseInt32ParityTests   12/12 PASS
  - V10_20_JP3DBridgeParityTests             5/5  PASS
  - `swift test --filter JP3D` regression  519/519 PASS
  - Mandatory commit gate (release mode)     7/7  PASS

The multi-week research arc lives at
`Documentation/research/V10_20_BATCHED_JP3D_IDWT.md` on the
`v10.19-research` branch; this release is the production landing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SureshKViswanathan SureshKViswanathan merged commit 02a1a00 into main May 24, 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