Summary

Patch release focused on Compose/applied-config overhead, uint8 posterize fast paths, corner illumination gradient generation, and salt-and-pepper sparsity routing. No new transforms and no intended output changes for existing pipelines beyond numerical parity with prior implementations where noted.

Microbenchmarks during development (local timeit, macOS arm64, Python 3.10; best-of repeated runs) showed roughly:

  • ~ faster scalar Posterize (uint8, 1024×1024 RGB) vs the prior sz_lut scalar path; ~ for per-channel bits=[…] on RGB (#250).

  • ~1.6–3.2× faster corner illumination gradient build vs cv2.distanceTransform (DIST_L2 / DIST_MASK_PRECISE), depending on spatial size (1024² vs 512²) (#250).

  • ~1.6× faster SaltAndPepper apply for a fixed ~12% pixel-noise mask on 1024×1024 RGB when the sparse threshold moves from 0.080.16 (same masks; measures path selection, not RNG) (#250).

  • ~19× lower overhead for hot get_transform_init_args_names() after the per-class cache vs forcing a full MRO/inspect.signature walk each call (5000× loop on HorizontalFlip; real Compose wins are smaller but scale with pipeline size) (#250).

  • Compose / transform metadata: cache get_transform_init_args_names() per transform class to avoid repeated inspect.signature() work during applied-config construction (#250).

  • Posterize (uint8): scalar and per-channel paths use bitwise masking instead of LUT/sz_lut for the hot paths (#250).

  • Illumination (mode="corner"): corner multiplier map uses Euclidean distance math (+ cv2.sqrt) instead of cv2.distanceTransform; aligned with the previous field via regression tests (#250).

  • SaltAndPepper: raised the internal sparse-noise threshold so the copy-assign path wins on a wider range of realistic multi-channel densities (microbench-driven) (#250).

  • Docs / tests: benchmark and maintenance guidance updates; added/extended tests for init-args caching, posterize (uint8 / float32 paths), corner-gradient parity, and zero-intensity corner gradient (#250).

  • Housekeeping: telemetry unit test hardening (#249); packaging version → 2.2.5 (#251).


Breaking changes

None.


New features

None.


Bug fixes

None shipped as user-visible correctness fixes in this patchline (changes are performance-path refactors with parity coverage where the implementation swapped).


Performance

Methodology: local timeit microbenchmarks (macOS arm64, Python 3.10, OpenCV as shipped in the dev env). Ratios are best-of repeated runs; absolute ms varies by CPU/OS/build — treat numbers as order-of-magnitude guidance, not a SLA.

  • get_transform_init_args_names() cache: ~19× faster for 5000 repeated calls on a warm per-class cache vs clearing _transform_init_args_names_cache and paying the full MRO/inspect.signature walk each time (HorizontalFlip). End-to-end Compose(...) construction benefits are usually smaller but add up with many transforms (#250).
  • Posterize (uint8, 1024×1024 RGB): ~4.2× vs prior scalar sz_lut path; per-channel bits=[3,4,5] ~2.0× vs the prior per-channel LUT loop (#250).
  • Illumination corner gradient (intensity=0.1, corner 2): ~1.62× at 1024×1024, ~3.18× at 512×512 vs cv2.distanceTransform (DIST_L2, DIST_MASK_PRECISE) (#250).
  • SaltAndPepper apply_salt_and_pepper (1024×1024 RGB, fixed masks with ~12% noisy pixels): ~1.60× faster with sparse threshold 0.16 vs 0.08 (same masks; isolates the multi-channel sparse fast-path eligibility) (#250).

Misc

  • Developer docs: performance decision notes updated in maintainer-facing guidance (bitwise vs LUT, OpenCV bitwise usage, distanceTransform avoidance, dispatch overhead) (#250).
  • Functional API: create_corner_illumination_gradient remains a low-level helper (now documented); Illumination corner mode is the primary user-facing entry (#250).
  • Packaging: pyproject.toml / uv.lock version → 2.2.5 (#251).

Commits

CommitPRDescription
2ee8884#249test(telemetry): force settings telemetry on for send assertions; version metadata housekeeping (pyproject.toml, uv.lock)
eb72777#250perf: cache transform init-arg names; Posterize bitwise paths; Illumination corner Euclidean gradient; SaltAndPepper sparse threshold; tests; perf docs
c1902d5#251chore: bump version to 2.2.5 (pyproject.toml, uv.lock)