Skip to content

refactor: vectorize k×s segment-id construction#365

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/kxs-refactor
Jul 9, 2026
Merged

refactor: vectorize k×s segment-id construction#365
Jammy2211 merged 1 commit into
mainfrom
feature/kxs-refactor

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

The k×s refactor exercise's library leg (#362, sequenced after phase 3 — merged this morning as autolens_workspace_test#154): the per-pixel loop in convolve_bin_segment_ids_from becomes pure numpy. Cold construction 62→9.7 ms on a 3000-pixel adaptive mask; ids bit-identical to the loop; suite 867 unchanged, zero test edits. Call-site review found the operate/image seam clean as-is (no PyAutoGalaxy changes needed, so no claim contention).

🤖 Generated with Claude Code

…cise)

The per-pixel python loop becomes pure numpy (repeat/cumsum/divmod on the
flat sample index): cold construction 62 ms -> 9.7 ms on a 3000-pixel
adaptive mask (cached repeat calls unchanged at ~80 us). Exact same ids as
the loop on adaptive references; suite unchanged.

Behaviour-preserving; closes the library leg of the k x s refactor
exercise. The operate/image call-site pattern was reviewed and left as-is
(clean two-step seam); no PyAutoGalaxy edits needed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 9, 2026
@Jammy2211 Jammy2211 merged commit 27fe67c into main Jul 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant