Odeinjul commited on
Commit
f0cf37f
·
verified ·
1 Parent(s): 8a5c7f9

fix(pq): align initial PQ rows with the initial index labels

Browse files
README.md CHANGED
@@ -45,6 +45,36 @@ Checkpoint ground truth is produced by filtering the static source ground truth
45
 
46
  Static PQ codebooks and metadata are reused. `initial/pq/pq_m<M>.pqcodes` contains only `80,000,000` rows and is ordered by the initial HNSW internal ID, so it can be used directly with `initial/index_80m_m32_efc500`.
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  ## Attribution
49
 
50
  The original Turing-ANNS-1B vectors are credited to Microsoft Turing and were obtained from the [Big ANN 2021 benchmark collection](https://big-ann-benchmarks.com/neurips21.html).
 
45
 
46
  Static PQ codebooks and metadata are reused. `initial/pq/pq_m<M>.pqcodes` contains only `80,000,000` rows and is ordered by the initial HNSW internal ID, so it can be used directly with `initial/index_80m_m32_efc500`.
47
 
48
+ ## PQ row-order compatibility
49
+
50
+ The initial PQ files `initial/pq/pq_m25.pqcodes`, `initial/pq/pq_m50.pqcodes`, `initial/pq/pq_m100.pqcodes` were corrected on 2026-11-10. For initial-index
51
+ internal row `j`, let `e` be the external label stored in `initial/index_80m_m32_efc500`
52
+ (also `initial/layout-sidecar/index_80m_m32_efc500.id_mapping.u32[j]`). Row `j` must
53
+ encode `base.fbin[e]`. With the corrected static PQ of `turing-100m-static-search-eval`
54
+ (internal-ID order), its source row is found through the inverse static index
55
+ mapping: `initial_PQ[j] = static_PQ[inverse_static_mapping[e]]`. Neither `j` nor
56
+ `e` can be used directly as a static PQ row in general.
57
+
58
+ The previous files were derived on 2026-07-21 from the static PQ rows, which
59
+ were in base-row order, while treating them as internal-ID order. They therefore
60
+ held `base_order_PQ[inverse_static_mapping[e]]`, which encodes the wrong vector
61
+ for the 555,038 of the 80,000,000 rows (0.69%) whose label is not a fixed
62
+ point of the static mapping, despite valid headers, checksums, and an
63
+ internal-order declaration.
64
+
65
+ The correction changes PQ row assignments only. Codebooks, PQ metadata, the HNSW
66
+ index, update order, insert vectors, traces, and checkpoint ground truth are
67
+ unchanged. Validation of the corrected files: every row equals the correctly
68
+ mapped static row, and re-encoding the vectors stored in the initial index with
69
+ each codebook agrees with the stored rows, with no misplaced row among the
70
+ sampled rows. `initial_pq_manifest.json` records the formula, the source static
71
+ revision, the checks, and the correction.
72
+
73
+ A stored manifest declaration, or sample rows chosen by the same mapping, is not
74
+ a correctness proof; re-encode sampled index vectors. Insert `vector_refs` remain
75
+ offsets in `base_permuted` (see `workload.json`), independent of HNSW internal IDs
76
+ and external labels.
77
+
78
  ## Attribution
79
 
80
  The original Turing-ANNS-1B vectors are credited to Microsoft Turing and were obtained from the [Big ANN 2021 benchmark collection](https://big-ann-benchmarks.com/neurips21.html).
checksums.sha256 CHANGED
@@ -1,4 +1,4 @@
1
- d6bcb6d59659351d2294a424b1eac2e271f514af815b5abc3c5d64dbca077720 README.md
2
  217408174fab532ce1254801764f5f483b7e652f06dc03160625bd24b792aac8 base_permuted.fbin
3
  7d5c2d5d7e937bcef37b530400faa1d86cfcc9676480b8291091af2baa7cdf99 groundtruth/active_80m.bin
4
  17bbe5e9e6bfb8a1d0ba6dc6c3138515c934418425bd3634fdd9352075ac78db groundtruth_manifest.json
@@ -8,15 +8,15 @@ d6bcb6d59659351d2294a424b1eac2e271f514af815b5abc3c5d64dbca077720 README.md
8
  9d4ae44d3dadbde06da56c3d8fd21d1d38561108a66ab4da446f084d15a22d87 initial/layout-sidecar/index_80m_m32_efc500.layout.json
9
  f91a49c182e980bfe787e57aac00bbcc96d0d65baec7859451288d1b1de589ed initial/layout-sidecar/index_80m_m32_efc500.levels.u16
10
  752346ff5cf07f3c75c6156ed773b22380c464e9f4025111766b0184af1717a8 initial/pq/pq_m100.pqcodebook
11
- d7f7fc0c1ea67b7c527ea49dc205eeaf0b6dee0fdee14ac6a1a5b621aa695fea initial/pq/pq_m100.pqcodes
12
  3c16fba37dc54fbe776b488adc8536c93fe891b4398757b1119c2943f1bce954 initial/pq/pq_m100.pqmeta
13
  e96082c1ffbb8271ac0849d398269e968eb6078540a6de7e4287e912d7d17413 initial/pq/pq_m25.pqcodebook
14
- b21ed0cf8946da2fcabddf4b921e38ae567608dea0d8a525640180bb4b7cb469 initial/pq/pq_m25.pqcodes
15
  7c675a66d175c2667ac643a18247439d2b4e767ea3fe92db90b7ca4e3c8e0b17 initial/pq/pq_m25.pqmeta
16
  2c8bdc1a40b34de5ceb6296fae7fc64a720304139e79f81550461647c8277b06 initial/pq/pq_m50.pqcodebook
17
- 4c02ffaeccf381a958594ae75e128e66a6a14227afcdeff9ab7492ccf3d9a747 initial/pq/pq_m50.pqcodes
18
  5019b7c448a37f19ed93b027aa45df20616e01121d688baa80e4c3d43d15dba2 initial/pq/pq_m50.pqmeta
19
- 3d2aceb68294c944af6308f71b3842c031fbe0403800b1e50b64165948cbbc63 initial_pq_manifest.json
20
  f2751fde12afaf0e72f51e2a47909bfb1a088ed1f4600f628ee7fcbb22be4129 reordered_insert_manifest.json
21
  6bbcc272b2a37ec2e06908f4d195304195889f317633d049a50bda2af245320b source_manifest.json
22
  027b583fb0bb972346b15569ce28a49f4871b2e2dc1d4bd625306fd85997113a static-workload-reference.json
 
1
+ d6ed46428881961a3ff918abb12a76a4e25f5ce38d98bc4d684d95a60ffa3606 README.md
2
  217408174fab532ce1254801764f5f483b7e652f06dc03160625bd24b792aac8 base_permuted.fbin
3
  7d5c2d5d7e937bcef37b530400faa1d86cfcc9676480b8291091af2baa7cdf99 groundtruth/active_80m.bin
4
  17bbe5e9e6bfb8a1d0ba6dc6c3138515c934418425bd3634fdd9352075ac78db groundtruth_manifest.json
 
8
  9d4ae44d3dadbde06da56c3d8fd21d1d38561108a66ab4da446f084d15a22d87 initial/layout-sidecar/index_80m_m32_efc500.layout.json
9
  f91a49c182e980bfe787e57aac00bbcc96d0d65baec7859451288d1b1de589ed initial/layout-sidecar/index_80m_m32_efc500.levels.u16
10
  752346ff5cf07f3c75c6156ed773b22380c464e9f4025111766b0184af1717a8 initial/pq/pq_m100.pqcodebook
11
+ 255c0bda969f9e9f3da31a9dc26f9dab048f3ac3eaec57a1a8993212ec7e620c initial/pq/pq_m100.pqcodes
12
  3c16fba37dc54fbe776b488adc8536c93fe891b4398757b1119c2943f1bce954 initial/pq/pq_m100.pqmeta
13
  e96082c1ffbb8271ac0849d398269e968eb6078540a6de7e4287e912d7d17413 initial/pq/pq_m25.pqcodebook
14
+ 46ed258c2fef334a27b86762087e3c9dc588d95b8344e2d7798198cfbd6208c7 initial/pq/pq_m25.pqcodes
15
  7c675a66d175c2667ac643a18247439d2b4e767ea3fe92db90b7ca4e3c8e0b17 initial/pq/pq_m25.pqmeta
16
  2c8bdc1a40b34de5ceb6296fae7fc64a720304139e79f81550461647c8277b06 initial/pq/pq_m50.pqcodebook
17
+ 25ac9738f30d8d6247f2c9170c665800e6d6c10b179ec58e167393ef2ccb8732 initial/pq/pq_m50.pqcodes
18
  5019b7c448a37f19ed93b027aa45df20616e01121d688baa80e4c3d43d15dba2 initial/pq/pq_m50.pqmeta
19
+ 25e57d63739fd1d1d27960067bd6883f3fab8cf16a61e2470bb092264edb32c1 initial_pq_manifest.json
20
  f2751fde12afaf0e72f51e2a47909bfb1a088ed1f4600f628ee7fcbb22be4129 reordered_insert_manifest.json
21
  6bbcc272b2a37ec2e06908f4d195304195889f317633d049a50bda2af245320b source_manifest.json
22
  027b583fb0bb972346b15569ce28a49f4871b2e2dc1d4bd625306fd85997113a static-workload-reference.json
initial/pq/pq_m100.pqcodes CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d7f7fc0c1ea67b7c527ea49dc205eeaf0b6dee0fdee14ac6a1a5b621aa695fea
3
  size 8000000029
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:255c0bda969f9e9f3da31a9dc26f9dab048f3ac3eaec57a1a8993212ec7e620c
3
  size 8000000029
initial/pq/pq_m25.pqcodes CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b21ed0cf8946da2fcabddf4b921e38ae567608dea0d8a525640180bb4b7cb469
3
  size 2000000029
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46ed258c2fef334a27b86762087e3c9dc588d95b8344e2d7798198cfbd6208c7
3
  size 2000000029
initial/pq/pq_m50.pqcodes CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4c02ffaeccf381a958594ae75e128e66a6a14227afcdeff9ab7492ccf3d9a747
3
  size 4000000029
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25ac9738f30d8d6247f2c9170c665800e6d6c10b179ec58e167393ef2ccb8732
3
  size 4000000029
initial_pq_manifest.json CHANGED
@@ -1,5 +1,61 @@
1
  {
2
  "code_order": "hnsw_internal_id",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  "created_at": "2026-07-21 19:15:08 UTC",
4
  "dataset": "turing",
5
  "elapsed_seconds": 323.194,
@@ -999,6 +1055,7 @@
999
  "schema": "batch-update-eval-initial-pq.v1",
1000
  "source_code_order": "hnsw_internal_id",
1001
  "source_id_mapping": "layout-sidecar/index_m_32_ef_500.id_mapping.u32",
 
1002
  "source_static_dataset": "turing-100m-static-search-eval",
1003
  "target_index": "initial/index_80m_m32_efc500"
1004
  }
 
1
  {
2
  "code_order": "hnsw_internal_id",
3
+ "correction": {
4
+ "corrected_at": "2026-11-10",
5
+ "corrected_formula": "initial_PQ[j] = base_order_static_PQ[label[j]] (equal to corrected static_PQ[inverse_static_mapping[label[j]]])",
6
+ "note": "sample_checks in files[] (initial row j, static row inverse_static_mapping[label_j]) hold for the corrected initial and corrected static PQ; they could not detect the defect because both sides used the same mapping",
7
+ "previous_codes_sha256": {
8
+ "pq_m100.pqcodes": "d7f7fc0c1ea67b7c527ea49dc205eeaf0b6dee0fdee14ac6a1a5b621aa695fea",
9
+ "pq_m25.pqcodes": "b21ed0cf8946da2fcabddf4b921e38ae567608dea0d8a525640180bb4b7cb469",
10
+ "pq_m50.pqcodes": "4c02ffaeccf381a958594ae75e128e66a6a14227afcdeff9ab7492ccf3d9a747"
11
+ },
12
+ "previous_formula": "initial_PQ[j] = base_order_static_PQ[inverse_static_mapping[label[j]]]",
13
+ "previous_package_revision": "8a5c7f9b0b2e90b98b28387a6cf36100de82645e",
14
+ "reason": "initial PQ rows were derived from base-row-order static codes treated as internal-ID order",
15
+ "row_order_checks": {
16
+ "pq_m100": {
17
+ "exact_rows": 0.986201103911687,
18
+ "misplaced_rows": 0,
19
+ "misplaced_rows_label_ne_internal": 0,
20
+ "row_min_agreement": 0.5,
21
+ "rows_checked": 25002,
22
+ "rows_label_ne_internal": 25002,
23
+ "subcode_agreement": 0.9998616110711142,
24
+ "subcode_agreement_if_label_order": 0.004250961586492832,
25
+ "subcode_agreement_label_ne_internal": 0.9998616110711142
26
+ },
27
+ "pq_m25": {
28
+ "exact_rows": 1.0,
29
+ "misplaced_rows": 0,
30
+ "misplaced_rows_label_ne_internal": 0,
31
+ "row_min_agreement": 0.5,
32
+ "rows_checked": 25002,
33
+ "rows_label_ne_internal": 25002,
34
+ "subcode_agreement": 1.0,
35
+ "subcode_agreement_if_label_order": 0.004409810679854138,
36
+ "subcode_agreement_label_ne_internal": 1.0
37
+ },
38
+ "pq_m50": {
39
+ "exact_rows": 0.9998800095992321,
40
+ "misplaced_rows": 0,
41
+ "misplaced_rows_label_ne_internal": 0,
42
+ "row_min_agreement": 0.5,
43
+ "rows_checked": 25002,
44
+ "rows_label_ne_internal": 25002,
45
+ "subcode_agreement": 0.9999976001919846,
46
+ "subcode_agreement_if_label_order": 0.00429991508067336,
47
+ "subcode_agreement_label_ne_internal": 0.9999976001919846
48
+ }
49
+ },
50
+ "rows_changed": {
51
+ "pq_m100": 555038,
52
+ "pq_m25": 555038,
53
+ "pq_m50": 555038
54
+ },
55
+ "rows_with_wrong_source_vector": 555038,
56
+ "source_static_revision": "4902d0310c2c3fc76fe969b27d305f84ea30f5d6",
57
+ "tool": "static-search-eval-prep/scripts/repair_pq_row_order.py"
58
+ },
59
  "created_at": "2026-07-21 19:15:08 UTC",
60
  "dataset": "turing",
61
  "elapsed_seconds": 323.194,
 
1055
  "schema": "batch-update-eval-initial-pq.v1",
1056
  "source_code_order": "hnsw_internal_id",
1057
  "source_id_mapping": "layout-sidecar/index_m_32_ef_500.id_mapping.u32",
1058
+ "source_row_formula": "initial_pq[j] = static_pq[inverse_static_id_mapping[initial_label[j]]] = base_order_pq[initial_label[j]]",
1059
  "source_static_dataset": "turing-100m-static-search-eval",
1060
  "target_index": "initial/index_80m_m32_efc500"
1061
  }