Repository navigation
perf: avoid full-frame promotion during alignment - #3
Open
EricSpencer00 wants to merge 1 commit into
Open
EricSpencer00 wants to merge 1 commit into
EricSpencer00 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
What this changes
Fixes #2. Canonical alignment now promotes only the four sampled pixel neighborhoods to float64 instead of converting the entire source photograph before indexing. The existing interpolation, clamping, rounding, output dtype, and seeded measurement path are unchanged. An exact-output regression test compares the optimized sampler with the pre-change implementation at image edges and out-of-bounds coordinates.
Baseline and measured result
Baseline commit:
f0ebfe39d9b2ef82e98343b3b24bcb794e9e5041(the post-batching code before this change). On the same NUC runner, Python 3.12.3, NumPy 2.5.3, synthetic 1600x2000 RGB input, 512 crop, and 2048 samples, an alternating same-process A/B harness measured:Both paths returned 42 measured and 26 unavailable results with no failures.
Verification
86a7e5b:pytest -q -r s— 850 collected, 840 passed, 10 expected skips.python -m buildandtwine check dist/*: passed.gpt-5.6-luna/max, but the review transport was unavailable; no substitute model was used.Risk and rollback
The code path is limited to the canonical crop sampler. The regression oracle preserves the previous pixel output exactly for boundary cases. Revert commit
86a7e5bto roll back.