Skip to content

DM-57102: Merge mask planes in bulk in Mask.update - #116

Merged
timj merged 1 commit into
mainfrom
tickets/DM-57102
Nov 24, 2026
Merged

timj merged 1 commit into
mainfrom
tickets/DM-57102

Conversation

@timj

@timj timj commented Nov 23, 2026

Copy link
Copy Markdown
Member

Mask.update copied each shared plane with a boolean read and a fancy-indexed write, about 70 ms per plane on a 4k x 4k mask. Planes that move by the same bit shift between the same pair of array elements are now copied with a single shift-and-OR. Reading a LSSTCam visit image, whose mask is stored as one int32 plane, drops from 1.84 s to 0.75 s.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.31%. Comparing base (e539b69) to head (5d343d5).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #116      +/-   ##
==========================================
+ Coverage   66.22%   66.31%   +0.09%     
==========================================
  Files         159      159              
  Lines       24201    24248      +47     
==========================================
+ Hits        16028    16081      +53     
+ Misses       8173     8167       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@timj
timj requested a review from TallJimbo November 24, 2026 04:34
@timj

timj commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

@TallJimbo the real question is if you want to trade the 1 second saving in read time for code complexity. From the end-user point of view this is a big saving when looking at notebooks, but I also imagine that these seconds add up during DRP and even Prompt Processing once we are using native lsst.images.

@TallJimbo TallJimbo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we definitely make the trade for speed here, and I expect that to happen in other places, too. I think the right policy here is something along the lines of "use the simple boolean operators unless profiling says it matters for big-picture performance", and here it clearly does.

Mask.update copied each shared plane with a boolean read and a
fancy-indexed write, about 70 ms per plane on a 4k x 4k mask. Planes
that move by the same bit shift between the same pair of array
elements are now copied with a single shift-and-OR. Reading a
LSSTCam visit image, whose mask is stored as one int32 plane, drops
from 1.84 s to 0.75 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@timj
timj merged commit e65f4f4 into main Nov 24, 2026
20 checks passed
@timj
timj deleted the tickets/DM-57102 branch November 24, 2026 22:44
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.

2 participants