Commit 7c9cfa3
Merge #150573
150573: vecindex: fix and enhance vecindex testing r=drewkimball a=andy-kimball
#### vecindex: add datadriven tests for vecindex
Refactor the C-SPANN datadriven tests so they can be shared by other
Store implementations. Add new datadriven test for vecindex that
tests recall for several interesting datasets.
#### cspann: fix bug in CalculateTruth
Fix bug in CalculateTruth, which was calling vecpb.MeasureDistance with
un-normalized vectors for Cosine distance. This returns incorrect results.
#### vecindex: fix determinism violations
Fix a couple cases where the vector index is not behaving
deterministically even when configured to do so. In one case, partition
keys were not generated deterministically. In the other case, the seed
used in crdb_test builds was different than the seed used otherwise.
#### builtins: add process_vector_index_fixups builtin
Add a new builtin function that waits until all pending fixups have
been processed for a given index. This is used for testing.
Previously, we were processing fixups in deterministic tests by calling
ProcessFixups just before inserting vectors or searching for them.
However, that was causing deadlocks, because fixups were being processed
in the same transaction that was updating the index.
The vector_index test is now updated to call the new builtin when it
needs to force fixup processing.
#### cspann: use brackets to format vectors
Postgres uses brackets to format vectors, e.g. [1, 2]. However, our test
code currently uses parentheses, e.g. (1, 2). Update our tests to use
brackets instead, so that we're more consistent.
Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com>File tree
44 files changed
+3860
-3093
lines changed- pkg
- cmd/vecbench
- sql
- faketreeeval
- logictest/testdata/logic_test
- sem
- builtins
- eval
- vecindex
- cspann
- commontest
- memstore
- quantize/testdata
- testdata
- testutils
- utils
- testdata
- vecstore
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+3860
-3093
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| |||
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
199 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
580 | 587 | | |
581 | 588 | | |
582 | 589 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
542 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
543 | 546 | | |
544 | 547 | | |
545 | 548 | | |
546 | 549 | | |
547 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
548 | 573 | | |
549 | 574 | | |
550 | 575 | | |
| |||
765 | 790 | | |
766 | 791 | | |
767 | 792 | | |
768 | | - | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
769 | 797 | | |
770 | 798 | | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
771 | 809 | | |
772 | 810 | | |
773 | 811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9357 | 9357 | | |
9358 | 9358 | | |
9359 | 9359 | | |
| 9360 | + | |
| 9361 | + | |
| 9362 | + | |
| 9363 | + | |
| 9364 | + | |
| 9365 | + | |
| 9366 | + | |
| 9367 | + | |
| 9368 | + | |
| 9369 | + | |
| 9370 | + | |
| 9371 | + | |
| 9372 | + | |
| 9373 | + | |
| 9374 | + | |
| 9375 | + | |
| 9376 | + | |
| 9377 | + | |
| 9378 | + | |
| 9379 | + | |
| 9380 | + | |
| 9381 | + | |
| 9382 | + | |
| 9383 | + | |
9360 | 9384 | | |
9361 | 9385 | | |
9362 | 9386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2795 | 2795 | | |
2796 | 2796 | | |
2797 | 2797 | | |
| 2798 | + | |
2798 | 2799 | | |
2799 | 2800 | | |
2800 | 2801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
458 | 462 | | |
459 | 463 | | |
460 | 464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| |||
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
0 commit comments