Repository navigation
Fix PackedBinaryMatrix::submatrix() at tile edges, and make the BinaryMatrix test a real test - #1681
Merged
Merged
Conversation
If the submatrix width is a multiple of 64, or its height a multiple of the tile height, submatrix() called clear_padding() with 0 bits and cleared the whole last column or row of tiles. The tile height depends on the CPU (4 to 64), so results were different on each machine. SparseBinaryMatrix::submatrix() got this fix in ecdc7fc. This makes the packed version the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The old BinaryMatrix test was debug code: it was not registered, ran timing loops, and only checked the matrix type the CPU dispatch picks. Now each matrix type that the build has and the CPU supports gets a test on 4 CommandLineTests images. It checks compress_rgb32_to_binary_range(), the bitwise operations and submatrix() against the image pixels, and that the padding bits stay 0. The tile checks now also run on the Default tile. Co-Authored-By: Claude Opus 5.5 <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.
Fix a bug in
PackedBinaryMatrix::submatrix(), and make the BinaryMatrix kernel test a real test. The new test found the bug.Split from #1669, as Mysticial asked. The other part is #1682 (
filter_rgb32_range()).The bug: if the submatrix width is a multiple of 64, or its height is a multiple of the tile height,
submatrix()cleared the whole last column or row of tiles. The tile height depends on the CPU (4 to 64 rows), so the result was different on each machine.SparseBinaryMatrix::submatrix()got the same fix in ecdc7fc. In production, this changesSubObjectTemplateMatcher::rmsd_with_background_replace().The test now checks each binary matrix type that the CPU supports, on real images:
compress_rgb32_to_binary_range(), the bitwise operations,submatrix(), and that the padding bits stay 0. Before, the test was debug code. It was not registered, so CI did not run it, and it tested only the matrix type that the dispatch picks.Other changes:
PartialWordAccesscheck now also checks that a store keeps the bytes around the data.The images are from the CommandLineTests repo. No width or height is a multiple of 8, so the tiles at the right and bottom edges are only partly used. #1554 also changes this test file, so it will need a small merge fix.
0 test files added, 1 test file changed:
Test results: added when the CI of this PR finishes.
🤖 Generated with Claude Code