Repository navigation
Commit 5b6da88
authored
Clear descriptor-index results for empty queries (colmap#4960)
`FeatureDescriptorIndex::Search` returns early for an empty descriptor
matrix without updating its output matrices. A C++ caller that reuses
those matrices after a nonempty query receives the previous query's
indices and distances for an empty input.
Clear both matrices in the existing empty-query branch, matching the
existing empty-index result convention. Type and descriptor-width
validation and nonempty FAISS searches stay unchanged. The current SIFT
pipeline already filters empty images before this call; this fix covers
direct use of the public index utility.
I extended the existing parameterized native test to search an empty
matrix after filling both outputs. All four combinations fail the new
assertions on pristine production and pass with the fix, covering
SIFT/ALIKED and flat/IVF indexes. All five module tests pass. A separate
native check covers 72 empty queries and 312 ordinary, repeated and
rebuild controls; ordinary results match pristine output exactly.
Clang-format, scoped Clang-Tidy and whitespace checks pass.
I validated the actual C++ owner with MSVC Release and generic CPU FAISS
1.15.1. I did not run a full application build, reconstruction datasets,
GPU builds, dynamic-dispatch builds or other operating systems.
AI assistance disclosure: AI-assisted development tools were used during
investigation and implementation. The reported tests were run against
the final diff.1 parent e6644e7 commit 5b6da88
2 files changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
0 commit comments