release: v10.11.0 — JP3D batched GPU iDWT#447
Merged
Conversation
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>
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
JP3DSliceStackCodecruns parallel_jp3dDecodeToCoefficientsacross the z-range + ONE batched iDWT dispatch across all slices instead of N per-slice dispatches.Correctness gate (release mode)
V10_20_BatchedBridgeParityTestsV10_20_BatchedInverseInt32ParityTestsV10_20_JP3DBridgeParityTestsswift test --filter JP3DregressionJ2KMedicalCorpusEncodePerformanceTestsJ2KMedicalCorpusPerformanceTestsJ2KStrictCrossCodecValidationTestsTest plan
J2K_JP3D_BATCHED_BRIDGE=0opt-out vs default-batched)Companion documents
RELEASE_NOTES_v10.11.0.md— full release notesDocumentation/Benchmarks/data/jp3d-bench-arm64-v10_20-batched-20260524.json— A/B raw (batched)Documentation/Benchmarks/data/jp3d-bench-arm64-v10_20-serial-20260524.json— A/B raw (serial baseline)Documentation/research/V10_20_BATCHED_JP3D_IDWT.md) stays on thev10.19-researchbranch perfeedback_research_no_main_merge.md.🤖 Generated with Claude Code