Odeinjul commited on
Commit
3a05d9e
·
verified ·
1 Parent(s): e366562

chore(dataset): retain only the current spatial workload release

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +0 -31
  2. README.md +7 -5
  3. checksums.sha256 +5 -175
  4. spatial-workloads/v1/README.md +0 -67
  5. spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin +0 -3
  6. spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json +0 -17
  7. spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin +0 -3
  8. spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json +0 -17
  9. spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin +0 -3
  10. spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json +0 -17
  11. spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin +0 -3
  12. spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json +0 -17
  13. spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin +0 -3
  14. spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json +0 -17
  15. spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin +0 -3
  16. spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json +0 -17
  17. spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin +0 -3
  18. spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json +0 -17
  19. spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin +0 -3
  20. spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json +0 -17
  21. spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin +0 -3
  22. spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json +0 -17
  23. spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin +0 -3
  24. spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json +0 -17
  25. spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin +0 -3
  26. spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json +0 -17
  27. spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin +0 -3
  28. spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json +0 -17
  29. spatial-workloads/v1/catalog.json +0 -151
  30. spatial-workloads/v1/checksums.sha256 +0 -169
  31. spatial-workloads/v1/code-provenance.json +0 -31
  32. spatial-workloads/v1/generation-spec.json +0 -143
  33. spatial-workloads/v1/partitions/k128-seed42/assignments.u32 +0 -3
  34. spatial-workloads/v1/partitions/k128-seed42/centroids.fbin +0 -0
  35. spatial-workloads/v1/partitions/k128-seed42/partition.json +0 -315
  36. spatial-workloads/v1/partitions/k128-seed42/query_assignments.u32 +0 -0
  37. spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 +0 -3
  38. spatial-workloads/v1/plan.json +0 -589
  39. spatial-workloads/v1/requirements.txt +0 -4
  40. spatial-workloads/v1/tools/cxl/derive_concurrent_manifest.py +0 -555
  41. spatial-workloads/v1/tools/cxl/materialize_concurrent_batch_update.py +0 -1392
  42. spatial-workloads/v1/tools/evaluation_runners/configs/deep100.json +0 -123
  43. spatial-workloads/v1/tools/evaluation_runners/e1.py +0 -4
  44. spatial-workloads/v1/tools/evaluation_runners/e2.py +0 -4
  45. spatial-workloads/v1/tools/evaluation_runners/e6.py +0 -4
  46. spatial-workloads/v1/tools/evaluation_runners/prepare_spatial_config.py +0 -230
  47. spatial-workloads/v1/tools/evaluation_runners/runner.py +0 -2556
  48. spatial-workloads/v1/tools/generator/spatial_common.py +0 -109
  49. spatial-workloads/v1/tools/generator/spatial_groundtruth.py +0 -263
  50. spatial-workloads/v1/tools/generator/spatial_partition.py +0 -131
.gitattributes CHANGED
@@ -66,37 +66,6 @@ base_permuted.fbin filter=lfs diff=lfs merge=lfs -text
66
  initial/pq/pq_m24.pqcodes filter=lfs diff=lfs merge=lfs -text
67
  initial/pq/pq_m48.pqcodes filter=lfs diff=lfs merge=lfs -text
68
  initial/pq/pq_m96.pqcodes filter=lfs diff=lfs merge=lfs -text
69
- spatial-workloads/v1/partitions/k128-seed42/assignments.u32 filter=lfs diff=lfs merge=lfs -text
70
- spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 filter=lfs diff=lfs merge=lfs -text
71
- spatial-workloads/v1/workloads/delete-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
72
- spatial-workloads/v1/workloads/delete-hot/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text
73
- spatial-workloads/v1/workloads/delete-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
74
- spatial-workloads/v1/workloads/delete-uniform/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text
75
- spatial-workloads/v1/workloads/insert-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
76
- spatial-workloads/v1/workloads/insert-hot/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text
77
- spatial-workloads/v1/workloads/insert-hot/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text
78
- spatial-workloads/v1/workloads/insert-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
79
- spatial-workloads/v1/workloads/insert-uniform/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text
80
- spatial-workloads/v1/workloads/insert-uniform/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text
81
- spatial-workloads/v1/workloads/mixed-shared-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
82
- spatial-workloads/v1/workloads/mixed-shared-hot/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text
83
- spatial-workloads/v1/workloads/mixed-shared-hot/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text
84
- spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text
85
- spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text
86
- spatial-workloads/v1/workloads/mixed-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
87
- spatial-workloads/v1/workloads/mixed-uniform/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text
88
- spatial-workloads/v1/workloads/mixed-uniform/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text
89
- spatial-workloads/v1/workloads/mixed-uniform/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text
90
- spatial-workloads/v1/workloads/mixed-uniform/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text
91
- spatial-workloads/v1/workloads/mixed-update-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
92
- spatial-workloads/v1/workloads/mixed-update-hot/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text
93
- spatial-workloads/v1/workloads/mixed-update-hot/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text
94
- spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text
95
- spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text
96
- spatial-workloads/v1/workloads/query-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
97
- spatial-workloads/v1/workloads/query-hot/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text
98
- spatial-workloads/v1/workloads/query-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text
99
- spatial-workloads/v1/workloads/query-uniform/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text
100
  spatial-workloads/v2/partitions/k128-seed42/assignments.u32 filter=lfs diff=lfs merge=lfs -text
101
  spatial-workloads/v2/partitions/k128-seed42/query_banks/uniform/query_assignments.u32 filter=lfs diff=lfs merge=lfs -text
102
  spatial-workloads/v2/partitions/k128-seed42/training_source_ids.u32 filter=lfs diff=lfs merge=lfs -text
 
66
  initial/pq/pq_m24.pqcodes filter=lfs diff=lfs merge=lfs -text
67
  initial/pq/pq_m48.pqcodes filter=lfs diff=lfs merge=lfs -text
68
  initial/pq/pq_m96.pqcodes filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  spatial-workloads/v2/partitions/k128-seed42/assignments.u32 filter=lfs diff=lfs merge=lfs -text
70
  spatial-workloads/v2/partitions/k128-seed42/query_banks/uniform/query_assignments.u32 filter=lfs diff=lfs merge=lfs -text
71
  spatial-workloads/v2/partitions/k128-seed42/training_source_ids.u32 filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -83,10 +83,12 @@ We generated the indexes ourselves.
83
 
84
  ## Fixed spatial hotspot workloads
85
 
86
- See [spatial-workloads/v1](spatial-workloads/v1/README.md) for 9 validated query/update profiles, including uniform controls and a fixed 5.39% hotspot. These workloads reuse the existing static and initial-80M indexes and vector/PQ assets. The original traces above remain available.
87
 
88
- ## Current fixed spatial hotspot release: v2
 
 
 
 
89
 
90
- See [spatial-workloads/v2](spatial-workloads/v2/README.md) for 11 validated query/update profiles, including uniform controls and a fixed 12.79% hotspot. These workloads reuse the existing static and initial-80M indexes and vector/PQ assets. The original traces and previous releases remain available. There is no hotspot batch switching.
91
-
92
- In v1, `query-uniform` / `query-hot` meant queries derived from the original 10K bank. In v2 these are `query-original` / `query-original-hot`; `query-uniform` / `query-uniform-hot` use the separate heldout DEEP1B random 500K bank. v1 artifacts are preserved.
 
83
 
84
  ## Fixed spatial hotspot workloads
85
 
86
+ The current spatial workload release is [spatial-workloads/v2](spatial-workloads/v2/README.md), with 11 query/update profiles and one fixed 12.79% hotspot.
87
 
88
+ - `query-original` / `query-original-hot`: official Original10K queries, repeated or resampled into 500K query rows.
89
+ - `query-uniform` / `query-uniform-hot`: the separate heldout DEEP1B random500K query bank.
90
+ - Standalone insert/delete: one batch of 1M operations.
91
+ - Mixed: three batches, each with 1M inserts and 1M deletes.
92
+ - Corresponding query and initial/post-batch GT, validation reports, scripts, and checksums are included.
93
 
94
+ The dataset keeps one current spatial workload release. It reuses the existing static and initial-80M indexes and vector/PQ assets. The original traces above remain available.
 
 
checksums.sha256 CHANGED
@@ -1,4 +1,4 @@
1
- e6302475693ade2d9c2cf69edb4d5b3986c3b901efce05bb9597607cb4178a61 README.md
2
  1c8bf71f320a52e763ba1fa1168d88dbd45f5b36ce74cf2fa71d7bdc399eba93 base_permuted.fbin
3
  0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 groundtruth/active_80m.bin
4
  5793ba574761e11c41087eb1e9e7b1e232350af3c6f17c5c18ed071b05e56031 groundtruth_manifest.json
@@ -19,177 +19,7 @@ a76f3833c7fa915910396c52975576953fb95c3269733b5c75f49f33004567a1 initial/pq/pq_
19
  cbdf00b2bb52fd734dd2fd9b72a0acfc3d5d3006a4f1d630596fa6aa84befbb5 initial_pq_manifest.json
20
  c33bcf46d80fbe91f66bb3f480769e39613fd3f490b528732c330e1253f79025 reordered_insert_manifest.json
21
  4a36d2c637cf2baaf733fff385f112f99af18f0f115708b5342d52eb6d08a4ec source_manifest.json
22
- 0262b930cd55a42336108545b8b2b17af79cee237a173b9f124da299d508adf9 spatial-workloads/v1/README.md
23
- 4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454 spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin
24
- ebd2f5852533b2f1c4bc90b4d7f2f87feca2649759461260ef06c72d7e4b4025 spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json
25
- df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5 spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin
26
- 174f25a58aad3d57c38db71a2684133cd6bf625a6fc6feb15678f5afaafe7ead spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json
27
- 0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin
28
- 363192ee85853529fa016c029dd51a5ccd5e58351c286806aea37ccebcd485c6 spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json
29
- b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin
30
- dba30c20f2ec43cc854d461b74c263e3858104acd7c6e0c3879eb53c3fa3e54a spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json
31
- 97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7 spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin
32
- 0123a0ad340f7db6967a5bd0edeabc954176db8bb9fca45d1c5cf9ef1987588d spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json
33
- f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin
34
- e236e49f6baf00bd5969fb21ce8ca3d4acfe27047a1034d9ceb2777c42235828 spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json
35
- b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0 spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin
36
- 881532cf320ae91ee066472418f1190c418a79dcd2e7524e7485d7dbfd5105ca spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json
37
- a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584 spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin
38
- 42b81b526e150aad4f6a15e5cc7ba7d277fba122988156c4e118f8faadd8785c spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json
39
- 6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin
40
- 5fdaea6e59fafd1bcecd2d72da6bdfb1645a6cb2804b6b3ff8a3aeb263983793 spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json
41
- bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43 spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin
42
- 19b43e37edac283c91906df67cdd18a49238aa2ac275790917bb8be9da4c5f4a spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json
43
- 0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin
44
- 133fb957197800a0ed821e9a4e0bdbac535b96d1a5cd792f8a2ee4bc7f49365d spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json
45
- 8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin
46
- 4fe180cdcc6d14f982266432e2b1b59df17b3991bb6f5a8b53c13dcf75166f3a spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json
47
- af3b7696e04c272f97c4bf13329e06da8acf3ef752779e1b990fc4b7e4165181 spatial-workloads/v1/catalog.json
48
- 71230865a86cc453ac9db74b18acf5309df211c98e47937d60bf27b8a8727f29 spatial-workloads/v1/checksums.sha256
49
- 29f3841ac2e651931ea64dc54667dce8ff416e58da8d234c4d3b88638b32bf9c spatial-workloads/v1/code-provenance.json
50
- 2585e060c231d981f165824896ed65389c5c04c36def65f02e20532141b5063b spatial-workloads/v1/generation-spec.json
51
- 3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 spatial-workloads/v1/partitions/k128-seed42/assignments.u32
52
- 8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877 spatial-workloads/v1/partitions/k128-seed42/centroids.fbin
53
- abe6ef6ba3119b480f45fde41a52eab8c5b1d13631b402dc63878fab40f20543 spatial-workloads/v1/partitions/k128-seed42/partition.json
54
- 49a52421492b803544f01575b7c9a96c76a7ed39271ab9353558b9b5028b606c spatial-workloads/v1/partitions/k128-seed42/query_assignments.u32
55
- 73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32
56
- 5352ee47e6e0bc687f79af633bf53b61f4bcd958644cc0ee567539d5748892d6 spatial-workloads/v1/plan.json
57
- f5adf71ee42604d49b0eaa261b64a575b5971b4271eaefefbb9918939efe790a spatial-workloads/v1/requirements.txt
58
- 81ef6ebf171e1148d6550b3d20f99b78952e65eceb327246051731cd6ee730b8 spatial-workloads/v1/tools/cxl/derive_concurrent_manifest.py
59
- 284572d32ec143b7f51e6716dfe4b01669a576d99c9198e030ef5efa8e51458e spatial-workloads/v1/tools/cxl/materialize_concurrent_batch_update.py
60
- 55c326ae4f71e63a402851fc744e2a287b5d031a87f246567286b4d956f2818b spatial-workloads/v1/tools/evaluation_runners/configs/deep100.json
61
- 9342db9244643ca971d84e405435117579e4b0204e6a9bd875cff393965bcdca spatial-workloads/v1/tools/evaluation_runners/e1.py
62
- 0b9b4e8143f608773bf687a09553a18377d11495168ae357ae62dddaf5ac7270 spatial-workloads/v1/tools/evaluation_runners/e2.py
63
- b12e15b00f867267b357de7db578656f1c2811fc6e81e66272c8fbce0c7d2e4f spatial-workloads/v1/tools/evaluation_runners/e6.py
64
- 349a77a32a74506c00cc43a4b4007706055330889395541a6dbc2c3084b8def6 spatial-workloads/v1/tools/evaluation_runners/prepare_spatial_config.py
65
- 03a69485ce73254352436ff51cada5c9a78880a35a52e240ccb4aba0b9206fcb spatial-workloads/v1/tools/evaluation_runners/runner.py
66
- cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749 spatial-workloads/v1/tools/generator/spatial_common.py
67
- 0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0 spatial-workloads/v1/tools/generator/spatial_groundtruth.py
68
- d4763d5918ed4b0630d9f013b4269de2746e237f53a4eedbdc65aca8ce7c8b02 spatial-workloads/v1/tools/generator/spatial_partition.py
69
- 86e39bd83b69ee8fa0fc10428dc48371b62e3538ec1d674686288f3ecb052f6c spatial-workloads/v1/tools/generator/spatial_workload.py
70
- 4cc0af40a2ce20eb2cd0a18954d647640800301ce220e3218b200295ba9a005e spatial-workloads/v1/tools/generator/stage_release.py
71
- 3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff spatial-workloads/v1/tools/generator/verify_spatial_consumers.py
72
- bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 spatial-workloads/v1/workloads/delete-hot/groundtruth/initial.bin
73
- 5aeedf5eafe810a3ea6006a74d511d4a985cdbe2e95684b6522940b55e648ec8 spatial-workloads/v1/workloads/delete-hot/plan.json
74
- 75bfc783f74e3322fb0d9053714566f0a9dba646a4b04a2b3f527af7970b7686 spatial-workloads/v1/workloads/delete-hot/profile.json
75
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/delete-hot/queries/queries.fbin
76
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/delete-hot/queries/query_refs.u32
77
- e336b2103179c7bb9ca271b7bb53ed9b49bfc81ecdde79159f0f0a95aad23f71 spatial-workloads/v1/workloads/delete-hot/spec.json
78
- d216f20eaffd03ca7811a30311d9b6ab379d6e128ca5f14803cce17af3c6e807 spatial-workloads/v1/workloads/delete-hot/streams/delete_ids.u32
79
- 169871c7f0628e75b643de65688c4977ae010299ff840821596e74671c458f91 spatial-workloads/v1/workloads/delete-hot/traces/delete-hot/batches/batch_0001.json
80
- a3dacd9b244e326e5dc8eb35296e849bea7dd2f36372ade5c58e5185b2aaa049 spatial-workloads/v1/workloads/delete-hot/traces/delete-hot/groundtruth/checkpoint_0001.bin
81
- afea38c57bc2c61a4119cc40132b8414618bc2aaf720cd7fac59e50d6df20c1b spatial-workloads/v1/workloads/delete-hot/traces/delete-hot/trace.json
82
- 754b577478eb5e75f55c5242a751fb1a8068897a1fce143bae07f4ce59781cf7 spatial-workloads/v1/workloads/delete-hot/validation.json
83
- b485a90d492885f7a3d5834593b38f2b91f1e661ca70f7234193a3fd6050f503 spatial-workloads/v1/workloads/delete-hot/workload.json
84
- bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 spatial-workloads/v1/workloads/delete-uniform/groundtruth/initial.bin
85
- 59e3d918fa91c607be57e74f083039eac2d37206ef283f1586803feb1f8ba51b spatial-workloads/v1/workloads/delete-uniform/plan.json
86
- 91f7d9f1cf48b563bf441c32e7f5fa6125df273308348bbc7dd1a0eaa1d6a1bb spatial-workloads/v1/workloads/delete-uniform/profile.json
87
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/delete-uniform/queries/queries.fbin
88
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/delete-uniform/queries/query_refs.u32
89
- 72de57db2f053f06d5b2df1ab16967e2316e13be754cbf10a548b3ebb2b6b5c2 spatial-workloads/v1/workloads/delete-uniform/spec.json
90
- 983d2da109e19a194fe7bb42670dbe4c73118c36d9e648776dca64cde16715ea spatial-workloads/v1/workloads/delete-uniform/streams/delete_ids.u32
91
- 3a1eb30479ca3e3759e44fc15167f9a2eaaad38fb8c5fe719565c6c5c475daff spatial-workloads/v1/workloads/delete-uniform/traces/delete-uniform/batches/batch_0001.json
92
- 2eb75e23f58dd7ff1824230a736fe781f1e5aa3507746a7878b5514af1340506 spatial-workloads/v1/workloads/delete-uniform/traces/delete-uniform/groundtruth/checkpoint_0001.bin
93
- 7f38ff520ca1a901573b5eb1b2e2b26649a2b2bc5f61d20903b29d8ea3840a63 spatial-workloads/v1/workloads/delete-uniform/traces/delete-uniform/trace.json
94
- fa22470561fa9cd25c17c5a875cd56957b3f21616dccf496d011ffb56e19c5f9 spatial-workloads/v1/workloads/delete-uniform/validation.json
95
- 763f24629e91ca81cadc076dde2a968255e7c1339e6d0b084e98047436cfee10 spatial-workloads/v1/workloads/delete-uniform/workload.json
96
- 2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 spatial-workloads/v1/workloads/insert-hot/groundtruth/initial.bin
97
- 34f3f6d80fcf7ddedf7d2849647cbe130a6155e61ee5372174b38d78dc20b4f0 spatial-workloads/v1/workloads/insert-hot/plan.json
98
- 1c971affa9f872b43428cb0965900ff2d64de7ad0c1b8f4102d23d6cfbdb526f spatial-workloads/v1/workloads/insert-hot/profile.json
99
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/insert-hot/queries/queries.fbin
100
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/insert-hot/queries/query_refs.u32
101
- a48a6aa48ba7ee643685d3c72bf35cb51d2c75eee5952bf47d34545f9d264ca1 spatial-workloads/v1/workloads/insert-hot/spec.json
102
- 2ea95525aad57a3d259ce3a225dd33d99ad46fc02e91e2decf0660b9295b5685 spatial-workloads/v1/workloads/insert-hot/streams/insert_ids.u32
103
- a3693d5fca97bc14db60e1dfef2e77554a47a081010e532c58b2d6a98829af84 spatial-workloads/v1/workloads/insert-hot/streams/insert_refs.u32
104
- 0225f980c33be4807c8aefd0a38ec729d987f1c29f62a270e07e605766ac533d spatial-workloads/v1/workloads/insert-hot/traces/insert-hot/batches/batch_0001.json
105
- eddc89c271f59f8a79a727c59942306323e9236d3e8f85ab66953e9353257d0c spatial-workloads/v1/workloads/insert-hot/traces/insert-hot/groundtruth/checkpoint_0001.bin
106
- 4e3bd05a1003192d89086150eb42e1868411d4aa5aceb52ea1312c196604490b spatial-workloads/v1/workloads/insert-hot/traces/insert-hot/trace.json
107
- 235bf4873efba223379135e641d05df8e9e46964428280f5d04366954d80cc67 spatial-workloads/v1/workloads/insert-hot/validation.json
108
- c039059ae51da1152f3538d9bc542db806c10739e9f2a7992e7a6f186dc98b2d spatial-workloads/v1/workloads/insert-hot/workload.json
109
- 2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 spatial-workloads/v1/workloads/insert-uniform/groundtruth/initial.bin
110
- 24d73319e92ebc0239a414f9fa253a7015013127cd0c3269125967f984d5c273 spatial-workloads/v1/workloads/insert-uniform/plan.json
111
- d576ecc5e49776672e79e22d95c6204ee1f3171a9830579538b56ea4be6302c4 spatial-workloads/v1/workloads/insert-uniform/profile.json
112
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/insert-uniform/queries/queries.fbin
113
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/insert-uniform/queries/query_refs.u32
114
- 17b4ba59cf474c4e00b2f14cc9ec3779dad3d5ae1d4f61bfc4b8516551c4e766 spatial-workloads/v1/workloads/insert-uniform/spec.json
115
- 7645185e472fdb701373f88c738d6e0c1fb76ac972c8c9f85eefc15cd6b7ad33 spatial-workloads/v1/workloads/insert-uniform/streams/insert_ids.u32
116
- eb8f64166af30085990c173b69f9ccdfea86c8356758942bf4f739f1c6b37b36 spatial-workloads/v1/workloads/insert-uniform/streams/insert_refs.u32
117
- 74fe30a38252827ac5165367a2be4628b0ba5603f59804b1a6483d63ea3b9197 spatial-workloads/v1/workloads/insert-uniform/traces/insert-uniform/batches/batch_0001.json
118
- fe23c7f1dbf05d03611596ed201a19a5f4120e50e8207a044eb5952926d02934 spatial-workloads/v1/workloads/insert-uniform/traces/insert-uniform/groundtruth/checkpoint_0001.bin
119
- 6b09d9f4c201867a385a79a089c062492a47166af281f2b9a497f3e129d7247d spatial-workloads/v1/workloads/insert-uniform/traces/insert-uniform/trace.json
120
- 029db1070342882d6c2b55ff3484a92f4289eafabe53e4724265a5b1936b5d14 spatial-workloads/v1/workloads/insert-uniform/validation.json
121
- f20685dd093e6b0a89bc85e8bcda17434264c8d57c378a6fcfef2cd3bf57af22 spatial-workloads/v1/workloads/insert-uniform/workload.json
122
- 2f7e3141edebde6835bf852f96ca843e9fbd681e7805a0d1889f1be04eb30825 spatial-workloads/v1/workloads/mixed-shared-hot/groundtruth/initial.bin
123
- da4ef8337bfbe7052b9a52d937d56539ce862e7a2e0b73aca682ad3f4894d00e spatial-workloads/v1/workloads/mixed-shared-hot/plan.json
124
- f929c5bf261963c1ed9455ee44a4751a5abb38cdb75fd91036ae258a39d1a2ea spatial-workloads/v1/workloads/mixed-shared-hot/profile.json
125
- 02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 spatial-workloads/v1/workloads/mixed-shared-hot/queries/queries.fbin
126
- d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 spatial-workloads/v1/workloads/mixed-shared-hot/queries/query_refs.u32
127
- 4ca84a8267511fdb97f213f39a691c2ddddd68f3637bc0d18f0bb8e2402644e0 spatial-workloads/v1/workloads/mixed-shared-hot/spec.json
128
- e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 spatial-workloads/v1/workloads/mixed-shared-hot/streams/delete_ids.u32
129
- e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_ids.u32
130
- 524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_refs.u32
131
- 1c886fce94c360b3ba0c5b3ab63e0444a5650d5283971d357a9ac5136ab1ac8c spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0001.json
132
- 696ae063c19f51d4859f388381f5d2fb7d5938d9cf2da567adc82a6f9007ff23 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0002.json
133
- e4eece8a7f04add213da00ce0d8aeb8a58b0b6a374434365d70d3b153cdf9810 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0003.json
134
- d1f54f507c4e490162301c0ce835787bed836ba66a5ec94cc2f464149b3a291b spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0001.bin
135
- 42b4cf74e060cc281d57710e33b03d9de21937d7fd7291647b97a2ea7f4b5acf spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0002.bin
136
- 6b88fc4434adfd26fac1f37398ddbcacc276ac11b3367555e6b61542b79ce924 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0003.bin
137
- cf90c4aa870695cb584a6989477aa4c85108c6124f8545cd2a0c345edf7cdd52 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/trace.json
138
- 0653bdb6d7ae8b0408e0c601f57767da5b423f8242a023dfb9fa8336560fa35d spatial-workloads/v1/workloads/mixed-shared-hot/validation.json
139
- 67f3bd5183f4cd69ab57c4dbe71afc58783e6459ebc0ea884f754ffff3c80052 spatial-workloads/v1/workloads/mixed-shared-hot/workload.json
140
- 4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b spatial-workloads/v1/workloads/mixed-uniform/groundtruth/initial.bin
141
- 42e02c30c8da440c972aabcc5ac2db25cfe1a83900dfac9309c5b128fded9b74 spatial-workloads/v1/workloads/mixed-uniform/plan.json
142
- 1f5ccd0fcc57c38f59ee5960d71a1f4b38951566e3cff3e4e38e53814df25d4a spatial-workloads/v1/workloads/mixed-uniform/profile.json
143
- fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 spatial-workloads/v1/workloads/mixed-uniform/queries/queries.fbin
144
- c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 spatial-workloads/v1/workloads/mixed-uniform/queries/query_refs.u32
145
- 3b32b072b8fc883b4cfb7c7edd51d9533a77773176f4223dfe8f6408fa65afde spatial-workloads/v1/workloads/mixed-uniform/spec.json
146
- a493493fda91aafab5333843afa5d4b742d6aef49ec1629c1cc5e8bcabff1c0b spatial-workloads/v1/workloads/mixed-uniform/streams/delete_ids.u32
147
- fba0903e5198441a698c07af803089d87d158a84ae5c47ba5f7b95a2c1b8ca5e spatial-workloads/v1/workloads/mixed-uniform/streams/insert_ids.u32
148
- 02546a8f23a5bbf7dd0fedc5c3b19e1e3a08687c90ddd1b71e65df57bac09e09 spatial-workloads/v1/workloads/mixed-uniform/streams/insert_refs.u32
149
- cd70aa375ade4b8935448f7efb7f259c40818c25c84410bccbcffc11724b0451 spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0001.json
150
- a0b175f34b5be6a8fdf2c4a71ee5692bc4562f1b4ac93bec7140cf5997d820e3 spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0002.json
151
- c52f3bb89beea25e7339844605049668c5f550585bc73824e942eb6280109aaf spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0003.json
152
- 0506231e994c847947961848fd20b417745db176662321dabb399270390bd05c spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0001.bin
153
- 3765877ed824f102d5e613f5ebcfc843a1018f98f6a46f09043f5f270f94ed8f spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0002.bin
154
- 5c43e19ae18aabf216c2da27f405345228ebc61e53af5f1fde636ce1de95f7fa spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0003.bin
155
- a8df857f8411b3f9f8f864f31c578e75ff9c8b50d835f800fec1a228e800f83f spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/trace.json
156
- 583fc0619a8ab7335411a9e68ae3bf397fbd3a4a9a2e174b4d47af68c2866e1a spatial-workloads/v1/workloads/mixed-uniform/validation.json
157
- b481dd233729c74e493bdd7494358e3cf86cd6eb2f87cb4f5ad50e7c8bd306c6 spatial-workloads/v1/workloads/mixed-uniform/workload.json
158
- 4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b spatial-workloads/v1/workloads/mixed-update-hot/groundtruth/initial.bin
159
- 62dae8c05c6fd5c080108876b5dd4909e6e5481bb0ced297f696b5ade9156770 spatial-workloads/v1/workloads/mixed-update-hot/plan.json
160
- a1595bbeca15b20f2d450d28699745e172d7621fdde731d625dd4bb6feb77f04 spatial-workloads/v1/workloads/mixed-update-hot/profile.json
161
- fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 spatial-workloads/v1/workloads/mixed-update-hot/queries/queries.fbin
162
- c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 spatial-workloads/v1/workloads/mixed-update-hot/queries/query_refs.u32
163
- 6702d3b84f24295b58de2e2c787676a06dc4f67df394fb62b524b61edd84f088 spatial-workloads/v1/workloads/mixed-update-hot/spec.json
164
- e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 spatial-workloads/v1/workloads/mixed-update-hot/streams/delete_ids.u32
165
- e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_ids.u32
166
- 524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_refs.u32
167
- bd8fdb8db21b35923e6454d0cd1dc47679a805d46da34f810ec2f8cd65915ef6 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0001.json
168
- 1b6fee9d4d78f39baf6e7970721364fe84382bdf725ba9f4bd49c68427b114cd spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0002.json
169
- 096dabd915fc7b222567fd1d76b003150b2e57332aaa9d0d1733e7acb54eccc7 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0003.json
170
- 689d4eceee9abdb03b2ad15b0d5cb3fae619b5b1b1b13633782ef8a37bc121bd spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0001.bin
171
- 24d40d4367109eb5b1c8760518e46bc62bfc2d162b64d1df3ff240c4e73af623 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0002.bin
172
- ed74a258093ac6c8e17af6c92bed512ec728b1ae18fbf0f679a53019be9987c1 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0003.bin
173
- 79ba8d5424a3689b5fe6bbf668a3301db70a8a3d72357b1f8037c4484478e188 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/trace.json
174
- c55ee0452c57f96078656f3a0289070fc57581014e2d0cdc6870bcf2f775de43 spatial-workloads/v1/workloads/mixed-update-hot/validation.json
175
- fdeaf645db887856ab9c91e9ee5283eda6451ee150a7c7ec2d1d25336c0ea48f spatial-workloads/v1/workloads/mixed-update-hot/workload.json
176
- 1a851806c69474054b0c0cdc20297e686280f1606b368ed83c5870e954fc9a7f spatial-workloads/v1/workloads/query-hot/groundtruth/initial.bin
177
- 341ad34db11c474b8a75889c3e0899d7cabe0f6500b1402533c9269d6dd851bc spatial-workloads/v1/workloads/query-hot/plan.json
178
- c7584185831d610f4a378bf0e796f071462c3abd9873c1aee1e2d5b690153dfe spatial-workloads/v1/workloads/query-hot/profile.json
179
- 02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 spatial-workloads/v1/workloads/query-hot/queries/queries.fbin
180
- d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 spatial-workloads/v1/workloads/query-hot/queries/query_refs.u32
181
- 6f9cdfbb75c1a8da8ede369006e2779b113da1be5b51f061473da56dc393aadc spatial-workloads/v1/workloads/query-hot/spec.json
182
- bffe9c94733e4607b21e361675ed51a04a50d31ddbe6b0d96991937c03976852 spatial-workloads/v1/workloads/query-hot/validation.json
183
- 23ecf08523b50728398358055263167541a4671f46705664b6b591a364645fc3 spatial-workloads/v1/workloads/query-hot/workload.json
184
- 2f2f35ca838119f8753d11216e691d885c7e4e4e385e7eb1c88b031a19f60097 spatial-workloads/v1/workloads/query-uniform/groundtruth/initial.bin
185
- 13075df6e6211d8087a6ff53b3aa402883facfcd7dbfe3e3790184f3133bce61 spatial-workloads/v1/workloads/query-uniform/plan.json
186
- e4c60a42de88de2ad8070cf50312782c717c703238c464f1c77ae81bd77144ae spatial-workloads/v1/workloads/query-uniform/profile.json
187
- fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 spatial-workloads/v1/workloads/query-uniform/queries/queries.fbin
188
- c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 spatial-workloads/v1/workloads/query-uniform/queries/query_refs.u32
189
- df6c4ef44152c293f4d0aa89f0c576b84a4b23d62a9a0fb662e967f2b604ee57 spatial-workloads/v1/workloads/query-uniform/spec.json
190
- bdd37876dca3b256834e2534e57811e298ca9a3b743d261199a23765f50ac6c7 spatial-workloads/v1/workloads/query-uniform/validation.json
191
- b6a5bdd4692bbf15149d700d706e5a4b5562d2133c99a0e18566313fd933ac1b spatial-workloads/v1/workloads/query-uniform/workload.json
192
- 4a5b8cc43e59f4987874c91e22a9d9a08a001c7997f39141cc6c336d082cc2a2 spatial-workloads/v2/README.md
193
  5a085d3112223d5f6cdfbe301fa46313df0eb531179c6e963fcc89ff137372bc spatial-workloads/v2/cache/groundtruth/1110ca435215baa04437de490e5a0696b6f992a733397608f13f71af09d4d8e8.bin
194
  ba0e19c62867009580548c681cc7a3948f1d3994af63d8a8fcd98160104fa8eb spatial-workloads/v2/cache/groundtruth/1110ca435215baa04437de490e5a0696b6f992a733397608f13f71af09d4d8e8.json
195
  11dc06300369e447708f48fb7f74d1fc27cbcd883b8ec3ae39dc0717eb1b1d29 spatial-workloads/v2/cache/groundtruth/1263038ce4bc0da4f543052eae3785f01c37a17170f0d6bfbed2bd066e7b72fe.bin
@@ -217,8 +47,8 @@ bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43 spatial-worklo
217
  99cf33db5213342df68e6777e56c09ccc4f18b4c1795588b31346fa967dc5eab spatial-workloads/v2/cache/groundtruth/f1c60e62c92545242bcbda461fa59e223b49401de578ce1c85ead51b339d0f79.bin
218
  550de07f4ab1259c5827d900356cbe28dcec845d0b7c9fb556ce5fee90c30b37 spatial-workloads/v2/cache/groundtruth/f1c60e62c92545242bcbda461fa59e223b49401de578ce1c85ead51b339d0f79.json
219
  8cb99e227b429a188b598198e78b3a27996d005a643e97266d113678d41dd50c spatial-workloads/v2/catalog.json
220
- d3b4168f6cbbfbbf46d4388c79eb15680cfd1c932b4d61555492a7597318cd2b spatial-workloads/v2/checksums.sha256
221
- db5bfec1875cd695c38ab2de4c8c1393e76014692a56bdd36cb12a7923e44f31 spatial-workloads/v2/code-provenance.json
222
  8cd57b62419783be8dc1ea0399353b68a8561f549b169df95698271b8ddd0bc4 spatial-workloads/v2/generation-spec.json
223
  3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 spatial-workloads/v2/partitions/k128-seed42/assignments.u32
224
  8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877 spatial-workloads/v2/partitions/k128-seed42/centroids.fbin
@@ -241,7 +71,7 @@ cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749 spatial-worklo
241
  0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0 spatial-workloads/v2/tools/generator/spatial_groundtruth.py
242
  4c81e1bf4389ec94e9667726f8dd8c58801d2c532d55786a9d6d750d2ae99a39 spatial-workloads/v2/tools/generator/spatial_partition.py
243
  063040be52c4ecdee3c272eff97629a2506cf6c5ea6ca36d7526afb9de1ad35f spatial-workloads/v2/tools/generator/spatial_workload.py
244
- 079ae40ecd6ab2514c6ff600e425008e77c48079528c8ddaee5cc9779481ce48 spatial-workloads/v2/tools/generator/stage_release.py
245
  3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff spatial-workloads/v2/tools/generator/verify_spatial_consumers.py
246
  bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 spatial-workloads/v2/workloads/delete-hot/groundtruth/initial.bin
247
  462ce413370c1f5e1950c3f55783c5e9797cfc981ff679e9b7b8706c3a7c6886 spatial-workloads/v2/workloads/delete-hot/plan.json
 
1
+ d899d27b949c6701bc36c3afb2acc525c0f6fceba64e77c811e181c7d2b94b7c README.md
2
  1c8bf71f320a52e763ba1fa1168d88dbd45f5b36ce74cf2fa71d7bdc399eba93 base_permuted.fbin
3
  0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 groundtruth/active_80m.bin
4
  5793ba574761e11c41087eb1e9e7b1e232350af3c6f17c5c18ed071b05e56031 groundtruth_manifest.json
 
19
  cbdf00b2bb52fd734dd2fd9b72a0acfc3d5d3006a4f1d630596fa6aa84befbb5 initial_pq_manifest.json
20
  c33bcf46d80fbe91f66bb3f480769e39613fd3f490b528732c330e1253f79025 reordered_insert_manifest.json
21
  4a36d2c637cf2baaf733fff385f112f99af18f0f115708b5342d52eb6d08a4ec source_manifest.json
22
+ 541347cf90b744148590cee6010f734384c55a7af0ad5a60cd518ed63834ba25 spatial-workloads/v2/README.md
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  5a085d3112223d5f6cdfbe301fa46313df0eb531179c6e963fcc89ff137372bc spatial-workloads/v2/cache/groundtruth/1110ca435215baa04437de490e5a0696b6f992a733397608f13f71af09d4d8e8.bin
24
  ba0e19c62867009580548c681cc7a3948f1d3994af63d8a8fcd98160104fa8eb spatial-workloads/v2/cache/groundtruth/1110ca435215baa04437de490e5a0696b6f992a733397608f13f71af09d4d8e8.json
25
  11dc06300369e447708f48fb7f74d1fc27cbcd883b8ec3ae39dc0717eb1b1d29 spatial-workloads/v2/cache/groundtruth/1263038ce4bc0da4f543052eae3785f01c37a17170f0d6bfbed2bd066e7b72fe.bin
 
47
  99cf33db5213342df68e6777e56c09ccc4f18b4c1795588b31346fa967dc5eab spatial-workloads/v2/cache/groundtruth/f1c60e62c92545242bcbda461fa59e223b49401de578ce1c85ead51b339d0f79.bin
48
  550de07f4ab1259c5827d900356cbe28dcec845d0b7c9fb556ce5fee90c30b37 spatial-workloads/v2/cache/groundtruth/f1c60e62c92545242bcbda461fa59e223b49401de578ce1c85ead51b339d0f79.json
49
  8cb99e227b429a188b598198e78b3a27996d005a643e97266d113678d41dd50c spatial-workloads/v2/catalog.json
50
+ f9409442df40d248b0e6c587d0e9339eaeb197a54e999bac3b9477dbe0423e5e spatial-workloads/v2/checksums.sha256
51
+ ce0a6cf81901d23e9a99dd8b8d52367c5d3d64dd7eb235e5ed24a3c6e80e15ae spatial-workloads/v2/code-provenance.json
52
  8cd57b62419783be8dc1ea0399353b68a8561f549b169df95698271b8ddd0bc4 spatial-workloads/v2/generation-spec.json
53
  3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 spatial-workloads/v2/partitions/k128-seed42/assignments.u32
54
  8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877 spatial-workloads/v2/partitions/k128-seed42/centroids.fbin
 
71
  0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0 spatial-workloads/v2/tools/generator/spatial_groundtruth.py
72
  4c81e1bf4389ec94e9667726f8dd8c58801d2c532d55786a9d6d750d2ae99a39 spatial-workloads/v2/tools/generator/spatial_partition.py
73
  063040be52c4ecdee3c272eff97629a2506cf6c5ea6ca36d7526afb9de1ad35f spatial-workloads/v2/tools/generator/spatial_workload.py
74
+ 177e1b2cf546be4a3accd996909ddcbf341ee9d866c213c0030dc2d417d5290a spatial-workloads/v2/tools/generator/stage_release.py
75
  3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff spatial-workloads/v2/tools/generator/verify_spatial_consumers.py
76
  bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 spatial-workloads/v2/workloads/delete-hot/groundtruth/initial.bin
77
  462ce413370c1f5e1950c3f55783c5e9797cfc981ff679e9b7b8706c3a7c6886 spatial-workloads/v2/workloads/delete-hot/plan.json
spatial-workloads/v1/README.md DELETED
@@ -1,67 +0,0 @@
1
- # DEEP100M fixed spatial hotspot workloads (v1)
2
-
3
- Derived workloads for the existing DEEP100M static and initial-80M indexes. All CNs share one fixed hotspot for each complete run. Clustering controls input sampling; operations still access the shared HNSW graph.
4
-
5
- The hotspot contains **5,388,897 vectors (5.388897%)**, **1,078,071 fresh insert candidates**, and **557 official query vectors**. Its cluster IDs are `[22, 0, 111, 59, 122, 121, 127]`.
6
-
7
- Hot streams draw 80% of their inputs from this region and 20% from its complement. Insert/delete IDs are unique across a run. Inserts use the fresh bank; deletes use initially live vectors. Queries may repeat. Uniform controls sample eligible vectors globally.
8
-
9
- | Profile | Initial state | Logical queries | Inserts | Deletes |
10
- | --- | --- | ---: | ---: | ---: |
11
- | [query-uniform](workloads/query-uniform/profile.json) | static-100m | 500,000 | 0 | 0 |
12
- | [query-hot](workloads/query-hot/profile.json) | static-100m | 500,000 | 0 | 0 |
13
- | [insert-uniform](workloads/insert-uniform/profile.json) | initial-80m | 500,000 (checkpoints) | 500,000 | 0 |
14
- | [insert-hot](workloads/insert-hot/profile.json) | initial-80m | 500,000 (checkpoints) | 500,000 | 0 |
15
- | [delete-uniform](workloads/delete-uniform/profile.json) | static-100m | 500,000 (checkpoints) | 0 | 1,000,000 |
16
- | [delete-hot](workloads/delete-hot/profile.json) | static-100m | 500,000 (checkpoints) | 0 | 1,000,000 |
17
- | [mixed-uniform](workloads/mixed-uniform/profile.json) | initial-80m | 21,600,000 | 600,000 | 600,000 |
18
- | [mixed-update-hot](workloads/mixed-update-hot/profile.json) | initial-80m | 21,600,000 | 600,000 | 600,000 |
19
- | [mixed-shared-hot](workloads/mixed-shared-hot/profile.json) | initial-80m | 21,600,000 | 600,000 | 600,000 |
20
-
21
- Mixed profiles use 36:1:1 Q/I/D and three 200K-pair segments, with a 200K acknowledged-deletion threshold and final maintenance enabled. The two mixed hot profiles have identical updates; only their query distribution differs. Query hot quotas describe the stored 500K-row cycle; a partial final cycle can slightly change the execution fraction.
22
-
23
- ## Inputs and identity
24
-
25
- - Static: [Odeinjul/deep-100m-static-search-eval](https://huggingface.co/datasets/Odeinjul/deep-100m-static-search-eval/tree/567847cb68fa512676e77aa84a977311593560a9) (`567847cb68fa512676e77aa84a977311593560a9`).
26
- - Update: [Odeinjul/deep-100m-batch-update-eval](https://huggingface.co/datasets/Odeinjul/deep-100m-batch-update-eval/tree/9956c8a4aa36f58f9607222fc8fc261591fe32b2) (`9956c8a4aa36f58f9607222fc8fc261591fe32b2`).
27
-
28
- Large base/insert vectors, indexes, and PQ files are referenced, not duplicated here. `source_identities` records their trusted package hashes and sampled fingerprints. `assignments.u32` is indexed by original source ID. Insert `vector_refs` index `base_permuted.fbin` through the inverse update permutation. PQ stays aligned with the corresponding HNSW internal IDs.
29
-
30
- ## Use and reproduce
31
-
32
- The `tools/` directory includes the generator and reviewed Python runtime adapters. `code-provenance.json` identifies these exact sources. Existing C++ binaries require no hotspot-specific change. Use the included materializer/derive adapters in your vectordb-cxl checkout; the original materializer does not separate workload and vector roots.
33
-
34
- From this directory, with the original static/update packages installed:
35
-
36
- ```bash
37
- python tools/generator/spatial_workload.py validate --config generation-spec.json \
38
- --static-root /path/to/static --update-root /path/to/update --output .
39
- python tools/evaluation_runners/prepare_spatial_config.py \
40
- --profile workloads/mixed-shared-hot/profile.json \
41
- --base-config tools/evaluation_runners/configs/deep100.json \
42
- --static-root /path/to/static --update-root /path/to/update \
43
- --output /tmp/deep100-mixed-shared-hot.json
44
- ```
45
-
46
- With a configured CXL checkout and built binaries, install the two `tools/cxl/` adapters into its `scripts/datasets/general/` directory, then plan the mixed campaign with the packaged entry point:
47
-
48
- ```bash
49
- export VECTORDB_CXL_ROOT=/path/to/vectordb-cxl
50
- python tools/evaluation_runners/e6.py plan \
51
- --config /tmp/deep100-mixed-shared-hot.json \
52
- --campaign-root /tmp/deep100-spatial-campaign
53
- ```
54
-
55
- The same snapshot includes `e1.py` for query profiles and `e2.py` for insert/delete profiles (select `--workload insert` or `--workload delete`). Cluster execution uses the selected checkout's existing launcher and readiness tools.
56
-
57
- To regenerate into another directory, run the generator's `partition`, `plan`, then `generate` commands with the same configuration and `--threads 16`. `requirements.txt` pins the generation environment.
58
-
59
- ## Validation and limits
60
-
61
- Each workload includes `validation.json`. Validation checks every selected insert payload against its original vector, legal/unique update IDs, hot quotas, query payload order, and every checkpoint GT row. Exact GT uses the actual live set; exhausted static top-100 prefixes trigger a full exact scan for affected queries. GT is never padded.
62
-
63
- Run `sha256sum -c checksums.sha256` here after downloading. Runtime configs and manifests are generated locally because they contain machine paths. Update counts are bound to their checkpoint GT and cannot be truncated without regeneration.
64
-
65
- These artifacts establish spatially concentrated inputs and parser compatibility. They do not establish higher runtime conflict rates, throughput, or distributed correctness. Graph searches/repair can leave the input hotspot. Recall from hot queries is workload-weighted; it does not represent an independently executed global-query evaluation.
66
-
67
- Original DEEP vectors are credited to Yandex under the source dataset's [CC BY 4.0 license](../../LICENSE).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80500000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80500000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 66,
9
- "path": "7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 99000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 76,
9
- "path": "873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 99000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 93,
9
- "path": "9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 100000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 100,
9
- "path": "c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b
3
- size 400008
 
 
 
 
spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "fallback_distance_precision": "float64",
3
- "fallback_query_count": 0,
4
- "fallback_query_ids": [],
5
- "k": 10,
6
- "live_count": 80000000,
7
- "metric": "l2",
8
- "min_live_source_candidates": 65,
9
- "path": "fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin",
10
- "query_count": 10000,
11
- "schema": "spatial-checkpoint-groundtruth.v1",
12
- "sha256": "8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b",
13
- "source_filtered_query_count": 10000,
14
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
15
- "source_gt_depth": 100,
16
- "tie_policy": "preserve source order; fallback distance then external ID"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/catalog.json DELETED
@@ -1,151 +0,0 @@
1
- {
2
- "dataset": "deep",
3
- "hotspot": {
4
- "actual_mass": 0.05388897,
5
- "clusters": [
6
- 22,
7
- 0,
8
- 111,
9
- 59,
10
- 122,
11
- 121,
12
- 127
13
- ],
14
- "fresh_vectors": 1078071,
15
- "initial_live_vectors": 4310826,
16
- "query_vectors": 557,
17
- "root_cluster": 22,
18
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
19
- "source_vectors": 5388897,
20
- "target_mass": 0.05
21
- },
22
- "limitations": [
23
- "Spatial input concentration does not guarantee graph-access conflicts.",
24
- "Queries can repeat; report unique query counts and workload-weighted recall.",
25
- "All profiles reuse existing shared HNSW/PQ artifacts; clustering only controls sampling."
26
- ],
27
- "partition": "partitions/k128-seed42/partition.json",
28
- "profiles": [
29
- {
30
- "control": null,
31
- "id": "query-uniform",
32
- "kind": "query",
33
- "path": "workloads/query-uniform/profile.json",
34
- "validation": "passed"
35
- },
36
- {
37
- "control": "query-uniform",
38
- "id": "query-hot",
39
- "kind": "query",
40
- "path": "workloads/query-hot/profile.json",
41
- "validation": "passed"
42
- },
43
- {
44
- "control": null,
45
- "id": "insert-uniform",
46
- "kind": "insert",
47
- "path": "workloads/insert-uniform/profile.json",
48
- "validation": "passed"
49
- },
50
- {
51
- "control": "insert-uniform",
52
- "id": "insert-hot",
53
- "kind": "insert",
54
- "path": "workloads/insert-hot/profile.json",
55
- "validation": "passed"
56
- },
57
- {
58
- "control": null,
59
- "id": "delete-uniform",
60
- "kind": "delete",
61
- "path": "workloads/delete-uniform/profile.json",
62
- "validation": "passed"
63
- },
64
- {
65
- "control": "delete-uniform",
66
- "id": "delete-hot",
67
- "kind": "delete",
68
- "path": "workloads/delete-hot/profile.json",
69
- "validation": "passed"
70
- },
71
- {
72
- "control": null,
73
- "id": "mixed-uniform",
74
- "kind": "mixed",
75
- "path": "workloads/mixed-uniform/profile.json",
76
- "validation": "passed"
77
- },
78
- {
79
- "control": "mixed-uniform",
80
- "id": "mixed-update-hot",
81
- "kind": "mixed",
82
- "path": "workloads/mixed-update-hot/profile.json",
83
- "validation": "passed"
84
- },
85
- {
86
- "control": "mixed-uniform",
87
- "id": "mixed-shared-hot",
88
- "kind": "mixed",
89
- "path": "workloads/mixed-shared-hot/profile.json",
90
- "validation": "passed"
91
- }
92
- ],
93
- "schema": "spatial-workload-catalog.v1",
94
- "source": {
95
- "base": "base.fbin",
96
- "base_count": 100000000,
97
- "dtype": "float32",
98
- "groundtruth": "groundtruth.bin",
99
- "initial_count": 80000000,
100
- "insert_vector_order": "permuted",
101
- "insert_vectors": "base_permuted.fbin",
102
- "metric": "l2",
103
- "queries": "orig_query_10k.fbin",
104
- "static_hf": {
105
- "repo": "Odeinjul/deep-100m-static-search-eval",
106
- "revision": "567847cb68fa512676e77aa84a977311593560a9"
107
- },
108
- "update_hf": {
109
- "repo": "Odeinjul/deep-100m-batch-update-eval",
110
- "revision": "9956c8a4aa36f58f9607222fc8fc261591fe32b2"
111
- },
112
- "update_order": "update_order.u32"
113
- },
114
- "source_identities": {
115
- "base": {
116
- "bytes": 38400000008,
117
- "file": "base.fbin",
118
- "package_sha256": "162cef480f030deead496c745b4214abc3fcbd9849c2561ab1251e84b6904ba4",
119
- "package_sha256_status": "trusted source record; not rehashed",
120
- "sample_sha256": "bfb8d14cd9320dd206e9e165bf10ff5d70285beb9a6380622010a01abfee4094"
121
- },
122
- "groundtruth": {
123
- "bytes": 8000008,
124
- "file": "groundtruth.bin",
125
- "package_sha256": "766d7e0e2ff81796f44adfc46e2cab98809c8e802b952063d7b8fa647697066f",
126
- "package_sha256_status": "trusted source record; not rehashed",
127
- "sample_sha256": "5dd3bce8290ae748784916e9d62ec7bf4f0c19cfe40c652697d0ed807fcda761"
128
- },
129
- "insert_vectors": {
130
- "bytes": 38400000008,
131
- "file": "base_permuted.fbin",
132
- "package_sha256": "1c8bf71f320a52e763ba1fa1168d88dbd45f5b36ce74cf2fa71d7bdc399eba93",
133
- "package_sha256_status": "trusted source record; not rehashed",
134
- "sample_sha256": "648534790d99934dd9cbb697f299c36a698f80263c2d344180b786890305227f"
135
- },
136
- "queries": {
137
- "bytes": 3840008,
138
- "file": "orig_query_10k.fbin",
139
- "package_sha256": "8438fc763f14e0f9741fda15b3e11215aef089ce17d1ad47d53b52a7c9fda5bb",
140
- "package_sha256_status": "trusted source record; not rehashed",
141
- "sample_sha256": "a7afbec60a892eaf16eda71baca8f099e364eac84e27818a75bfe2f462e454c8"
142
- },
143
- "update_order": {
144
- "bytes": 400000000,
145
- "file": "update_order.u32",
146
- "package_sha256": "88332fcfc0662b21c7283197570e8957baf89275e06b635b84a9647da71cdcad",
147
- "package_sha256_status": "trusted source record; not rehashed",
148
- "sample_sha256": "5e8fa93c166c6c34714dc5a97d969a5d1b3895bb3fd50f8fdf66fde2190ac37f"
149
- }
150
- }
151
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/checksums.sha256 DELETED
@@ -1,169 +0,0 @@
1
- 0262b930cd55a42336108545b8b2b17af79cee237a173b9f124da299d508adf9 README.md
2
- 4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454 cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin
3
- ebd2f5852533b2f1c4bc90b4d7f2f87feca2649759461260ef06c72d7e4b4025 cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json
4
- df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5 cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin
5
- 174f25a58aad3d57c38db71a2684133cd6bf625a6fc6feb15678f5afaafe7ead cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json
6
- 0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin
7
- 363192ee85853529fa016c029dd51a5ccd5e58351c286806aea37ccebcd485c6 cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json
8
- b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin
9
- dba30c20f2ec43cc854d461b74c263e3858104acd7c6e0c3879eb53c3fa3e54a cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json
10
- 97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7 cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin
11
- 0123a0ad340f7db6967a5bd0edeabc954176db8bb9fca45d1c5cf9ef1987588d cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json
12
- f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin
13
- e236e49f6baf00bd5969fb21ce8ca3d4acfe27047a1034d9ceb2777c42235828 cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json
14
- b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0 cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin
15
- 881532cf320ae91ee066472418f1190c418a79dcd2e7524e7485d7dbfd5105ca cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json
16
- a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584 cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin
17
- 42b81b526e150aad4f6a15e5cc7ba7d277fba122988156c4e118f8faadd8785c cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json
18
- 6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin
19
- 5fdaea6e59fafd1bcecd2d72da6bdfb1645a6cb2804b6b3ff8a3aeb263983793 cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json
20
- bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43 cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin
21
- 19b43e37edac283c91906df67cdd18a49238aa2ac275790917bb8be9da4c5f4a cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json
22
- 0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin
23
- 133fb957197800a0ed821e9a4e0bdbac535b96d1a5cd792f8a2ee4bc7f49365d cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json
24
- 8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin
25
- 4fe180cdcc6d14f982266432e2b1b59df17b3991bb6f5a8b53c13dcf75166f3a cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json
26
- af3b7696e04c272f97c4bf13329e06da8acf3ef752779e1b990fc4b7e4165181 catalog.json
27
- 29f3841ac2e651931ea64dc54667dce8ff416e58da8d234c4d3b88638b32bf9c code-provenance.json
28
- 2585e060c231d981f165824896ed65389c5c04c36def65f02e20532141b5063b generation-spec.json
29
- 3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 partitions/k128-seed42/assignments.u32
30
- 8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877 partitions/k128-seed42/centroids.fbin
31
- abe6ef6ba3119b480f45fde41a52eab8c5b1d13631b402dc63878fab40f20543 partitions/k128-seed42/partition.json
32
- 49a52421492b803544f01575b7c9a96c76a7ed39271ab9353558b9b5028b606c partitions/k128-seed42/query_assignments.u32
33
- 73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe partitions/k128-seed42/training_source_ids.u32
34
- 5352ee47e6e0bc687f79af633bf53b61f4bcd958644cc0ee567539d5748892d6 plan.json
35
- f5adf71ee42604d49b0eaa261b64a575b5971b4271eaefefbb9918939efe790a requirements.txt
36
- 81ef6ebf171e1148d6550b3d20f99b78952e65eceb327246051731cd6ee730b8 tools/cxl/derive_concurrent_manifest.py
37
- 284572d32ec143b7f51e6716dfe4b01669a576d99c9198e030ef5efa8e51458e tools/cxl/materialize_concurrent_batch_update.py
38
- 55c326ae4f71e63a402851fc744e2a287b5d031a87f246567286b4d956f2818b tools/evaluation_runners/configs/deep100.json
39
- 9342db9244643ca971d84e405435117579e4b0204e6a9bd875cff393965bcdca tools/evaluation_runners/e1.py
40
- 0b9b4e8143f608773bf687a09553a18377d11495168ae357ae62dddaf5ac7270 tools/evaluation_runners/e2.py
41
- b12e15b00f867267b357de7db578656f1c2811fc6e81e66272c8fbce0c7d2e4f tools/evaluation_runners/e6.py
42
- 349a77a32a74506c00cc43a4b4007706055330889395541a6dbc2c3084b8def6 tools/evaluation_runners/prepare_spatial_config.py
43
- 03a69485ce73254352436ff51cada5c9a78880a35a52e240ccb4aba0b9206fcb tools/evaluation_runners/runner.py
44
- cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749 tools/generator/spatial_common.py
45
- 0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0 tools/generator/spatial_groundtruth.py
46
- d4763d5918ed4b0630d9f013b4269de2746e237f53a4eedbdc65aca8ce7c8b02 tools/generator/spatial_partition.py
47
- 86e39bd83b69ee8fa0fc10428dc48371b62e3538ec1d674686288f3ecb052f6c tools/generator/spatial_workload.py
48
- 4cc0af40a2ce20eb2cd0a18954d647640800301ce220e3218b200295ba9a005e tools/generator/stage_release.py
49
- 3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff tools/generator/verify_spatial_consumers.py
50
- bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 workloads/delete-hot/groundtruth/initial.bin
51
- 5aeedf5eafe810a3ea6006a74d511d4a985cdbe2e95684b6522940b55e648ec8 workloads/delete-hot/plan.json
52
- 75bfc783f74e3322fb0d9053714566f0a9dba646a4b04a2b3f527af7970b7686 workloads/delete-hot/profile.json
53
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/delete-hot/queries/queries.fbin
54
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/delete-hot/queries/query_refs.u32
55
- e336b2103179c7bb9ca271b7bb53ed9b49bfc81ecdde79159f0f0a95aad23f71 workloads/delete-hot/spec.json
56
- d216f20eaffd03ca7811a30311d9b6ab379d6e128ca5f14803cce17af3c6e807 workloads/delete-hot/streams/delete_ids.u32
57
- 169871c7f0628e75b643de65688c4977ae010299ff840821596e74671c458f91 workloads/delete-hot/traces/delete-hot/batches/batch_0001.json
58
- a3dacd9b244e326e5dc8eb35296e849bea7dd2f36372ade5c58e5185b2aaa049 workloads/delete-hot/traces/delete-hot/groundtruth/checkpoint_0001.bin
59
- afea38c57bc2c61a4119cc40132b8414618bc2aaf720cd7fac59e50d6df20c1b workloads/delete-hot/traces/delete-hot/trace.json
60
- 754b577478eb5e75f55c5242a751fb1a8068897a1fce143bae07f4ce59781cf7 workloads/delete-hot/validation.json
61
- b485a90d492885f7a3d5834593b38f2b91f1e661ca70f7234193a3fd6050f503 workloads/delete-hot/workload.json
62
- bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 workloads/delete-uniform/groundtruth/initial.bin
63
- 59e3d918fa91c607be57e74f083039eac2d37206ef283f1586803feb1f8ba51b workloads/delete-uniform/plan.json
64
- 91f7d9f1cf48b563bf441c32e7f5fa6125df273308348bbc7dd1a0eaa1d6a1bb workloads/delete-uniform/profile.json
65
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/delete-uniform/queries/queries.fbin
66
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/delete-uniform/queries/query_refs.u32
67
- 72de57db2f053f06d5b2df1ab16967e2316e13be754cbf10a548b3ebb2b6b5c2 workloads/delete-uniform/spec.json
68
- 983d2da109e19a194fe7bb42670dbe4c73118c36d9e648776dca64cde16715ea workloads/delete-uniform/streams/delete_ids.u32
69
- 3a1eb30479ca3e3759e44fc15167f9a2eaaad38fb8c5fe719565c6c5c475daff workloads/delete-uniform/traces/delete-uniform/batches/batch_0001.json
70
- 2eb75e23f58dd7ff1824230a736fe781f1e5aa3507746a7878b5514af1340506 workloads/delete-uniform/traces/delete-uniform/groundtruth/checkpoint_0001.bin
71
- 7f38ff520ca1a901573b5eb1b2e2b26649a2b2bc5f61d20903b29d8ea3840a63 workloads/delete-uniform/traces/delete-uniform/trace.json
72
- fa22470561fa9cd25c17c5a875cd56957b3f21616dccf496d011ffb56e19c5f9 workloads/delete-uniform/validation.json
73
- 763f24629e91ca81cadc076dde2a968255e7c1339e6d0b084e98047436cfee10 workloads/delete-uniform/workload.json
74
- 2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 workloads/insert-hot/groundtruth/initial.bin
75
- 34f3f6d80fcf7ddedf7d2849647cbe130a6155e61ee5372174b38d78dc20b4f0 workloads/insert-hot/plan.json
76
- 1c971affa9f872b43428cb0965900ff2d64de7ad0c1b8f4102d23d6cfbdb526f workloads/insert-hot/profile.json
77
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/insert-hot/queries/queries.fbin
78
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/insert-hot/queries/query_refs.u32
79
- a48a6aa48ba7ee643685d3c72bf35cb51d2c75eee5952bf47d34545f9d264ca1 workloads/insert-hot/spec.json
80
- 2ea95525aad57a3d259ce3a225dd33d99ad46fc02e91e2decf0660b9295b5685 workloads/insert-hot/streams/insert_ids.u32
81
- a3693d5fca97bc14db60e1dfef2e77554a47a081010e532c58b2d6a98829af84 workloads/insert-hot/streams/insert_refs.u32
82
- 0225f980c33be4807c8aefd0a38ec729d987f1c29f62a270e07e605766ac533d workloads/insert-hot/traces/insert-hot/batches/batch_0001.json
83
- eddc89c271f59f8a79a727c59942306323e9236d3e8f85ab66953e9353257d0c workloads/insert-hot/traces/insert-hot/groundtruth/checkpoint_0001.bin
84
- 4e3bd05a1003192d89086150eb42e1868411d4aa5aceb52ea1312c196604490b workloads/insert-hot/traces/insert-hot/trace.json
85
- 235bf4873efba223379135e641d05df8e9e46964428280f5d04366954d80cc67 workloads/insert-hot/validation.json
86
- c039059ae51da1152f3538d9bc542db806c10739e9f2a7992e7a6f186dc98b2d workloads/insert-hot/workload.json
87
- 2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 workloads/insert-uniform/groundtruth/initial.bin
88
- 24d73319e92ebc0239a414f9fa253a7015013127cd0c3269125967f984d5c273 workloads/insert-uniform/plan.json
89
- d576ecc5e49776672e79e22d95c6204ee1f3171a9830579538b56ea4be6302c4 workloads/insert-uniform/profile.json
90
- 08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/insert-uniform/queries/queries.fbin
91
- bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/insert-uniform/queries/query_refs.u32
92
- 17b4ba59cf474c4e00b2f14cc9ec3779dad3d5ae1d4f61bfc4b8516551c4e766 workloads/insert-uniform/spec.json
93
- 7645185e472fdb701373f88c738d6e0c1fb76ac972c8c9f85eefc15cd6b7ad33 workloads/insert-uniform/streams/insert_ids.u32
94
- eb8f64166af30085990c173b69f9ccdfea86c8356758942bf4f739f1c6b37b36 workloads/insert-uniform/streams/insert_refs.u32
95
- 74fe30a38252827ac5165367a2be4628b0ba5603f59804b1a6483d63ea3b9197 workloads/insert-uniform/traces/insert-uniform/batches/batch_0001.json
96
- fe23c7f1dbf05d03611596ed201a19a5f4120e50e8207a044eb5952926d02934 workloads/insert-uniform/traces/insert-uniform/groundtruth/checkpoint_0001.bin
97
- 6b09d9f4c201867a385a79a089c062492a47166af281f2b9a497f3e129d7247d workloads/insert-uniform/traces/insert-uniform/trace.json
98
- 029db1070342882d6c2b55ff3484a92f4289eafabe53e4724265a5b1936b5d14 workloads/insert-uniform/validation.json
99
- f20685dd093e6b0a89bc85e8bcda17434264c8d57c378a6fcfef2cd3bf57af22 workloads/insert-uniform/workload.json
100
- 2f7e3141edebde6835bf852f96ca843e9fbd681e7805a0d1889f1be04eb30825 workloads/mixed-shared-hot/groundtruth/initial.bin
101
- da4ef8337bfbe7052b9a52d937d56539ce862e7a2e0b73aca682ad3f4894d00e workloads/mixed-shared-hot/plan.json
102
- f929c5bf261963c1ed9455ee44a4751a5abb38cdb75fd91036ae258a39d1a2ea workloads/mixed-shared-hot/profile.json
103
- 02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 workloads/mixed-shared-hot/queries/queries.fbin
104
- d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 workloads/mixed-shared-hot/queries/query_refs.u32
105
- 4ca84a8267511fdb97f213f39a691c2ddddd68f3637bc0d18f0bb8e2402644e0 workloads/mixed-shared-hot/spec.json
106
- e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 workloads/mixed-shared-hot/streams/delete_ids.u32
107
- e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c workloads/mixed-shared-hot/streams/insert_ids.u32
108
- 524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 workloads/mixed-shared-hot/streams/insert_refs.u32
109
- 1c886fce94c360b3ba0c5b3ab63e0444a5650d5283971d357a9ac5136ab1ac8c workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0001.json
110
- 696ae063c19f51d4859f388381f5d2fb7d5938d9cf2da567adc82a6f9007ff23 workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0002.json
111
- e4eece8a7f04add213da00ce0d8aeb8a58b0b6a374434365d70d3b153cdf9810 workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0003.json
112
- d1f54f507c4e490162301c0ce835787bed836ba66a5ec94cc2f464149b3a291b workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0001.bin
113
- 42b4cf74e060cc281d57710e33b03d9de21937d7fd7291647b97a2ea7f4b5acf workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0002.bin
114
- 6b88fc4434adfd26fac1f37398ddbcacc276ac11b3367555e6b61542b79ce924 workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0003.bin
115
- cf90c4aa870695cb584a6989477aa4c85108c6124f8545cd2a0c345edf7cdd52 workloads/mixed-shared-hot/traces/mixed-shared-hot/trace.json
116
- 0653bdb6d7ae8b0408e0c601f57767da5b423f8242a023dfb9fa8336560fa35d workloads/mixed-shared-hot/validation.json
117
- 67f3bd5183f4cd69ab57c4dbe71afc58783e6459ebc0ea884f754ffff3c80052 workloads/mixed-shared-hot/workload.json
118
- 4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b workloads/mixed-uniform/groundtruth/initial.bin
119
- 42e02c30c8da440c972aabcc5ac2db25cfe1a83900dfac9309c5b128fded9b74 workloads/mixed-uniform/plan.json
120
- 1f5ccd0fcc57c38f59ee5960d71a1f4b38951566e3cff3e4e38e53814df25d4a workloads/mixed-uniform/profile.json
121
- fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 workloads/mixed-uniform/queries/queries.fbin
122
- c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 workloads/mixed-uniform/queries/query_refs.u32
123
- 3b32b072b8fc883b4cfb7c7edd51d9533a77773176f4223dfe8f6408fa65afde workloads/mixed-uniform/spec.json
124
- a493493fda91aafab5333843afa5d4b742d6aef49ec1629c1cc5e8bcabff1c0b workloads/mixed-uniform/streams/delete_ids.u32
125
- fba0903e5198441a698c07af803089d87d158a84ae5c47ba5f7b95a2c1b8ca5e workloads/mixed-uniform/streams/insert_ids.u32
126
- 02546a8f23a5bbf7dd0fedc5c3b19e1e3a08687c90ddd1b71e65df57bac09e09 workloads/mixed-uniform/streams/insert_refs.u32
127
- cd70aa375ade4b8935448f7efb7f259c40818c25c84410bccbcffc11724b0451 workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0001.json
128
- a0b175f34b5be6a8fdf2c4a71ee5692bc4562f1b4ac93bec7140cf5997d820e3 workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0002.json
129
- c52f3bb89beea25e7339844605049668c5f550585bc73824e942eb6280109aaf workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0003.json
130
- 0506231e994c847947961848fd20b417745db176662321dabb399270390bd05c workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0001.bin
131
- 3765877ed824f102d5e613f5ebcfc843a1018f98f6a46f09043f5f270f94ed8f workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0002.bin
132
- 5c43e19ae18aabf216c2da27f405345228ebc61e53af5f1fde636ce1de95f7fa workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0003.bin
133
- a8df857f8411b3f9f8f864f31c578e75ff9c8b50d835f800fec1a228e800f83f workloads/mixed-uniform/traces/mixed-uniform/trace.json
134
- 583fc0619a8ab7335411a9e68ae3bf397fbd3a4a9a2e174b4d47af68c2866e1a workloads/mixed-uniform/validation.json
135
- b481dd233729c74e493bdd7494358e3cf86cd6eb2f87cb4f5ad50e7c8bd306c6 workloads/mixed-uniform/workload.json
136
- 4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b workloads/mixed-update-hot/groundtruth/initial.bin
137
- 62dae8c05c6fd5c080108876b5dd4909e6e5481bb0ced297f696b5ade9156770 workloads/mixed-update-hot/plan.json
138
- a1595bbeca15b20f2d450d28699745e172d7621fdde731d625dd4bb6feb77f04 workloads/mixed-update-hot/profile.json
139
- fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 workloads/mixed-update-hot/queries/queries.fbin
140
- c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 workloads/mixed-update-hot/queries/query_refs.u32
141
- 6702d3b84f24295b58de2e2c787676a06dc4f67df394fb62b524b61edd84f088 workloads/mixed-update-hot/spec.json
142
- e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 workloads/mixed-update-hot/streams/delete_ids.u32
143
- e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c workloads/mixed-update-hot/streams/insert_ids.u32
144
- 524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 workloads/mixed-update-hot/streams/insert_refs.u32
145
- bd8fdb8db21b35923e6454d0cd1dc47679a805d46da34f810ec2f8cd65915ef6 workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0001.json
146
- 1b6fee9d4d78f39baf6e7970721364fe84382bdf725ba9f4bd49c68427b114cd workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0002.json
147
- 096dabd915fc7b222567fd1d76b003150b2e57332aaa9d0d1733e7acb54eccc7 workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0003.json
148
- 689d4eceee9abdb03b2ad15b0d5cb3fae619b5b1b1b13633782ef8a37bc121bd workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0001.bin
149
- 24d40d4367109eb5b1c8760518e46bc62bfc2d162b64d1df3ff240c4e73af623 workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0002.bin
150
- ed74a258093ac6c8e17af6c92bed512ec728b1ae18fbf0f679a53019be9987c1 workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0003.bin
151
- 79ba8d5424a3689b5fe6bbf668a3301db70a8a3d72357b1f8037c4484478e188 workloads/mixed-update-hot/traces/mixed-update-hot/trace.json
152
- c55ee0452c57f96078656f3a0289070fc57581014e2d0cdc6870bcf2f775de43 workloads/mixed-update-hot/validation.json
153
- fdeaf645db887856ab9c91e9ee5283eda6451ee150a7c7ec2d1d25336c0ea48f workloads/mixed-update-hot/workload.json
154
- 1a851806c69474054b0c0cdc20297e686280f1606b368ed83c5870e954fc9a7f workloads/query-hot/groundtruth/initial.bin
155
- 341ad34db11c474b8a75889c3e0899d7cabe0f6500b1402533c9269d6dd851bc workloads/query-hot/plan.json
156
- c7584185831d610f4a378bf0e796f071462c3abd9873c1aee1e2d5b690153dfe workloads/query-hot/profile.json
157
- 02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 workloads/query-hot/queries/queries.fbin
158
- d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 workloads/query-hot/queries/query_refs.u32
159
- 6f9cdfbb75c1a8da8ede369006e2779b113da1be5b51f061473da56dc393aadc workloads/query-hot/spec.json
160
- bffe9c94733e4607b21e361675ed51a04a50d31ddbe6b0d96991937c03976852 workloads/query-hot/validation.json
161
- 23ecf08523b50728398358055263167541a4671f46705664b6b591a364645fc3 workloads/query-hot/workload.json
162
- 2f2f35ca838119f8753d11216e691d885c7e4e4e385e7eb1c88b031a19f60097 workloads/query-uniform/groundtruth/initial.bin
163
- 13075df6e6211d8087a6ff53b3aa402883facfcd7dbfe3e3790184f3133bce61 workloads/query-uniform/plan.json
164
- e4c60a42de88de2ad8070cf50312782c717c703238c464f1c77ae81bd77144ae workloads/query-uniform/profile.json
165
- fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 workloads/query-uniform/queries/queries.fbin
166
- c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 workloads/query-uniform/queries/query_refs.u32
167
- df6c4ef44152c293f4d0aa89f0c576b84a4b23d62a9a0fb662e967f2b604ee57 workloads/query-uniform/spec.json
168
- bdd37876dca3b256834e2534e57811e298ca9a3b743d261199a23765f50ac6c7 workloads/query-uniform/validation.json
169
- b6a5bdd4692bbf15149d700d706e5a4b5562d2133c99a0e18566313fd933ac1b workloads/query-uniform/workload.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/code-provenance.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "files": {
3
- "requirements.txt": "f5adf71ee42604d49b0eaa261b64a575b5971b4271eaefefbb9918939efe790a",
4
- "tools/cxl/derive_concurrent_manifest.py": "81ef6ebf171e1148d6550b3d20f99b78952e65eceb327246051731cd6ee730b8",
5
- "tools/cxl/materialize_concurrent_batch_update.py": "284572d32ec143b7f51e6716dfe4b01669a576d99c9198e030ef5efa8e51458e",
6
- "tools/evaluation_runners/configs/deep100.json": "55c326ae4f71e63a402851fc744e2a287b5d031a87f246567286b4d956f2818b",
7
- "tools/evaluation_runners/e1.py": "9342db9244643ca971d84e405435117579e4b0204e6a9bd875cff393965bcdca",
8
- "tools/evaluation_runners/e2.py": "0b9b4e8143f608773bf687a09553a18377d11495168ae357ae62dddaf5ac7270",
9
- "tools/evaluation_runners/e6.py": "b12e15b00f867267b357de7db578656f1c2811fc6e81e66272c8fbce0c7d2e4f",
10
- "tools/evaluation_runners/prepare_spatial_config.py": "349a77a32a74506c00cc43a4b4007706055330889395541a6dbc2c3084b8def6",
11
- "tools/evaluation_runners/runner.py": "03a69485ce73254352436ff51cada5c9a78880a35a52e240ccb4aba0b9206fcb",
12
- "tools/generator/spatial_common.py": "cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749",
13
- "tools/generator/spatial_groundtruth.py": "0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0",
14
- "tools/generator/spatial_partition.py": "d4763d5918ed4b0630d9f013b4269de2746e237f53a4eedbdc65aca8ce7c8b02",
15
- "tools/generator/spatial_workload.py": "86e39bd83b69ee8fa0fc10428dc48371b62e3538ec1d674686288f3ecb052f6c",
16
- "tools/generator/stage_release.py": "4cc0af40a2ce20eb2cd0a18954d647640800301ce220e3218b200295ba9a005e",
17
- "tools/generator/verify_spatial_consumers.py": "3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff"
18
- },
19
- "repositories": {
20
- "vectordb-cxl": {
21
- "baseline": "6cfd5a0de9b79aac38a6a4afa796e91fe2b297f4",
22
- "branch": "feat/static-hotspot-workloads"
23
- },
24
- "vectordb-eval": {
25
- "baseline": "bcab614ecf90514ccba696312c01408a06d3e1e4",
26
- "branch": "feat/static-hotspot-workloads"
27
- }
28
- },
29
- "schema": "spatial-code-provenance.v1",
30
- "source_state": "reviewed feature worktree snapshot"
31
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/generation-spec.json DELETED
@@ -1,143 +0,0 @@
1
- {
2
- "dataset": "deep",
3
- "hotspot": {
4
- "seed": 42,
5
- "target_mass": 0.05
6
- },
7
- "partition": {
8
- "clusters": 128,
9
- "iterations": 20,
10
- "metric": "l2",
11
- "seed": 42,
12
- "training_rows": 262144
13
- },
14
- "profiles": [
15
- {
16
- "deletes": 0,
17
- "id": "query-uniform",
18
- "initial_state": "static-100m",
19
- "inserts": 0,
20
- "kind": "query",
21
- "queries": 500000,
22
- "query_rows": 500000
23
- },
24
- {
25
- "control": "query-uniform",
26
- "deletes": 0,
27
- "id": "query-hot",
28
- "initial_state": "static-100m",
29
- "inserts": 0,
30
- "kind": "query",
31
- "queries": 500000,
32
- "query_hot_fraction": 0.8,
33
- "query_rows": 500000
34
- },
35
- {
36
- "batch_size": 500000,
37
- "deletes": 0,
38
- "id": "insert-uniform",
39
- "initial_state": "initial-80m",
40
- "inserts": 500000,
41
- "kind": "insert",
42
- "queries": 500000,
43
- "query_rows": 10000
44
- },
45
- {
46
- "batch_size": 500000,
47
- "control": "insert-uniform",
48
- "deletes": 0,
49
- "id": "insert-hot",
50
- "initial_state": "initial-80m",
51
- "insert_hot_fraction": 0.8,
52
- "inserts": 500000,
53
- "kind": "insert",
54
- "queries": 500000,
55
- "query_rows": 10000
56
- },
57
- {
58
- "batch_size": 1000000,
59
- "deletes": 1000000,
60
- "id": "delete-uniform",
61
- "initial_state": "static-100m",
62
- "inserts": 0,
63
- "kind": "delete",
64
- "queries": 500000,
65
- "query_rows": 10000
66
- },
67
- {
68
- "batch_size": 1000000,
69
- "control": "delete-uniform",
70
- "delete_hot_fraction": 0.8,
71
- "deletes": 1000000,
72
- "id": "delete-hot",
73
- "initial_state": "static-100m",
74
- "inserts": 0,
75
- "kind": "delete",
76
- "queries": 500000,
77
- "query_rows": 10000
78
- },
79
- {
80
- "batch_size": 200000,
81
- "deletes": 600000,
82
- "id": "mixed-uniform",
83
- "initial_state": "initial-80m",
84
- "inserts": 600000,
85
- "kind": "mixed",
86
- "queries": 21600000,
87
- "query_rows": 500000,
88
- "update_stream": "mixed-uniform"
89
- },
90
- {
91
- "batch_size": 200000,
92
- "control": "mixed-uniform",
93
- "delete_hot_fraction": 0.8,
94
- "deletes": 600000,
95
- "id": "mixed-update-hot",
96
- "initial_state": "initial-80m",
97
- "insert_hot_fraction": 0.8,
98
- "inserts": 600000,
99
- "kind": "mixed",
100
- "queries": 21600000,
101
- "query_rows": 500000,
102
- "update_stream": "mixed-hot"
103
- },
104
- {
105
- "batch_size": 200000,
106
- "control": "mixed-uniform",
107
- "delete_hot_fraction": 0.8,
108
- "deletes": 600000,
109
- "id": "mixed-shared-hot",
110
- "initial_state": "initial-80m",
111
- "insert_hot_fraction": 0.8,
112
- "inserts": 600000,
113
- "kind": "mixed",
114
- "queries": 21600000,
115
- "query_hot_fraction": 0.8,
116
- "query_rows": 500000,
117
- "update_stream": "mixed-hot"
118
- }
119
- ],
120
- "sampling_seed": 20261001,
121
- "schema": "spatial-workload-spec.v1",
122
- "source": {
123
- "base": "base.fbin",
124
- "base_count": 100000000,
125
- "dtype": "float32",
126
- "groundtruth": "groundtruth.bin",
127
- "initial_count": 80000000,
128
- "insert_vector_order": "permuted",
129
- "insert_vectors": "base_permuted.fbin",
130
- "metric": "l2",
131
- "queries": "orig_query_10k.fbin",
132
- "static_hf": {
133
- "repo": "Odeinjul/deep-100m-static-search-eval",
134
- "revision": "567847cb68fa512676e77aa84a977311593560a9"
135
- },
136
- "update_hf": {
137
- "repo": "Odeinjul/deep-100m-batch-update-eval",
138
- "revision": "9956c8a4aa36f58f9607222fc8fc261591fe32b2"
139
- },
140
- "update_order": "update_order.u32"
141
- },
142
- "top_k": 10
143
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/partitions/k128-seed42/assignments.u32 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6
3
- size 400000000
 
 
 
 
spatial-workloads/v1/partitions/k128-seed42/centroids.fbin DELETED
Binary file (49.2 kB)
 
spatial-workloads/v1/partitions/k128-seed42/partition.json DELETED
@@ -1,315 +0,0 @@
1
- {
2
- "assignment_order": "original source vector ID; not HNSW internal ID or update_order row",
3
- "counts": [
4
- 1324263,
5
- 517046,
6
- 691524,
7
- 882738,
8
- 444113,
9
- 947564,
10
- 626518,
11
- 473321,
12
- 1963984,
13
- 889554,
14
- 755082,
15
- 472499,
16
- 865262,
17
- 921513,
18
- 841876,
19
- 1187506,
20
- 997698,
21
- 290217,
22
- 648656,
23
- 757617,
24
- 1042960,
25
- 543354,
26
- 933054,
27
- 903705,
28
- 661841,
29
- 850115,
30
- 403632,
31
- 745813,
32
- 644752,
33
- 803814,
34
- 589949,
35
- 465493,
36
- 1040583,
37
- 855269,
38
- 728156,
39
- 451711,
40
- 629170,
41
- 637292,
42
- 533185,
43
- 637181,
44
- 816864,
45
- 1126588,
46
- 538625,
47
- 453188,
48
- 828798,
49
- 946818,
50
- 891839,
51
- 793412,
52
- 863527,
53
- 705164,
54
- 717673,
55
- 957005,
56
- 702061,
57
- 1056973,
58
- 587031,
59
- 505741,
60
- 676903,
61
- 688886,
62
- 650943,
63
- 742777,
64
- 641521,
65
- 746534,
66
- 908990,
67
- 790635,
68
- 605461,
69
- 701390,
70
- 516954,
71
- 1084129,
72
- 561293,
73
- 727610,
74
- 866969,
75
- 763664,
76
- 1201926,
77
- 586091,
78
- 982296,
79
- 1052665,
80
- 760859,
81
- 710634,
82
- 810397,
83
- 550894,
84
- 562967,
85
- 630497,
86
- 623958,
87
- 1000811,
88
- 909607,
89
- 847262,
90
- 922736,
91
- 579122,
92
- 726866,
93
- 637125,
94
- 888092,
95
- 695013,
96
- 1039939,
97
- 893423,
98
- 692661,
99
- 628537,
100
- 1208071,
101
- 1022288,
102
- 868183,
103
- 915985,
104
- 869514,
105
- 845619,
106
- 937462,
107
- 961121,
108
- 672204,
109
- 642625,
110
- 636483,
111
- 732944,
112
- 510099,
113
- 793751,
114
- 569509,
115
- 593971,
116
- 1338957,
117
- 967123,
118
- 645606,
119
- 852451,
120
- 1261371,
121
- 552425,
122
- 752667,
123
- 976949,
124
- 695018,
125
- 632044,
126
- 640696,
127
- 906746,
128
- 1072280,
129
- 919201,
130
- 784621,
131
- 522092
132
- ],
133
- "dimension": 96,
134
- "elapsed_seconds": 253.89,
135
- "files": {
136
- "assignments.u32": {
137
- "bytes": 400000000,
138
- "sha256": "3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6"
139
- },
140
- "centroids.fbin": {
141
- "bytes": 49160,
142
- "sha256": "8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877"
143
- },
144
- "query_assignments.u32": {
145
- "bytes": 40000,
146
- "sha256": "49a52421492b803544f01575b7c9a96c76a7ed39271ab9353558b9b5028b606c"
147
- },
148
- "training_source_ids.u32": {
149
- "bytes": 1048576,
150
- "sha256": "73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe"
151
- }
152
- },
153
- "parameters": {
154
- "clusters": 128,
155
- "iterations": 20,
156
- "metric": "l2",
157
- "seed": 42,
158
- "training_rows": 262144
159
- },
160
- "query_counts": [
161
- 149,
162
- 41,
163
- 69,
164
- 95,
165
- 37,
166
- 87,
167
- 56,
168
- 51,
169
- 194,
170
- 98,
171
- 71,
172
- 54,
173
- 98,
174
- 92,
175
- 94,
176
- 122,
177
- 99,
178
- 23,
179
- 67,
180
- 66,
181
- 86,
182
- 48,
183
- 98,
184
- 87,
185
- 86,
186
- 88,
187
- 38,
188
- 75,
189
- 61,
190
- 75,
191
- 51,
192
- 39,
193
- 112,
194
- 79,
195
- 81,
196
- 51,
197
- 64,
198
- 55,
199
- 57,
200
- 56,
201
- 78,
202
- 154,
203
- 47,
204
- 58,
205
- 90,
206
- 82,
207
- 72,
208
- 84,
209
- 86,
210
- 68,
211
- 82,
212
- 102,
213
- 79,
214
- 105,
215
- 47,
216
- 53,
217
- 82,
218
- 61,
219
- 61,
220
- 69,
221
- 74,
222
- 72,
223
- 109,
224
- 79,
225
- 58,
226
- 71,
227
- 55,
228
- 101,
229
- 54,
230
- 70,
231
- 87,
232
- 95,
233
- 109,
234
- 51,
235
- 93,
236
- 113,
237
- 79,
238
- 94,
239
- 76,
240
- 48,
241
- 60,
242
- 59,
243
- 70,
244
- 93,
245
- 92,
246
- 78,
247
- 91,
248
- 64,
249
- 78,
250
- 67,
251
- 85,
252
- 56,
253
- 108,
254
- 68,
255
- 65,
256
- 60,
257
- 137,
258
- 119,
259
- 61,
260
- 106,
261
- 82,
262
- 79,
263
- 106,
264
- 87,
265
- 52,
266
- 65,
267
- 70,
268
- 68,
269
- 54,
270
- 58,
271
- 44,
272
- 61,
273
- 144,
274
- 90,
275
- 74,
276
- 83,
277
- 123,
278
- 71,
279
- 66,
280
- 116,
281
- 75,
282
- 65,
283
- 65,
284
- 83,
285
- 110,
286
- 71,
287
- 73,
288
- 50
289
- ],
290
- "query_rows": 10000,
291
- "schema": "spatial-partition.v1",
292
- "signature": "d50c5b5fb5f26e04b333ac70b3c2443167b17f1c7bd11198b8496aa5751063b0",
293
- "software": {
294
- "faiss": "1.15.1",
295
- "numpy": "2.2.6",
296
- "threads": 16
297
- },
298
- "source": {
299
- "base": {
300
- "bytes": 38400000008,
301
- "file": "base.fbin",
302
- "package_sha256": "162cef480f030deead496c745b4214abc3fcbd9849c2561ab1251e84b6904ba4",
303
- "package_sha256_status": "trusted source record; not rehashed",
304
- "sample_sha256": "bfb8d14cd9320dd206e9e165bf10ff5d70285beb9a6380622010a01abfee4094"
305
- },
306
- "queries": {
307
- "bytes": 3840008,
308
- "file": "orig_query_10k.fbin",
309
- "package_sha256": "8438fc763f14e0f9741fda15b3e11215aef089ce17d1ad47d53b52a7c9fda5bb",
310
- "package_sha256_status": "trusted source record; not rehashed",
311
- "sample_sha256": "a7afbec60a892eaf16eda71baca8f099e364eac84e27818a75bfe2f462e454c8"
312
- }
313
- },
314
- "source_rows": 100000000
315
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/partitions/k128-seed42/query_assignments.u32 DELETED
Binary file (40 kB)
 
spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe
3
- size 1048576
 
 
 
 
spatial-workloads/v1/plan.json DELETED
@@ -1,589 +0,0 @@
1
- {
2
- "hotspot": {
3
- "actual_mass": 0.05388897,
4
- "clusters": [
5
- 22,
6
- 0,
7
- 111,
8
- 59,
9
- 122,
10
- 121,
11
- 127
12
- ],
13
- "fresh_vectors": 1078071,
14
- "initial_live_vectors": 4310826,
15
- "query_vectors": 557,
16
- "root_cluster": 22,
17
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
18
- "source_vectors": 5388897,
19
- "target_mass": 0.05
20
- },
21
- "partition_signature": "d50c5b5fb5f26e04b333ac70b3c2443167b17f1c7bd11198b8496aa5751063b0",
22
- "profiles": [
23
- {
24
- "batch_count": 0,
25
- "capacities": {
26
- "delete": {
27
- "cold_eligible": 94611103,
28
- "eligible": 100000000,
29
- "hot_eligible": 5388897,
30
- "hot_quota": null,
31
- "requested": 0
32
- },
33
- "insert": {
34
- "cold_eligible": 0,
35
- "eligible": 0,
36
- "hot_eligible": 0,
37
- "hot_quota": null,
38
- "requested": 0
39
- },
40
- "query": {
41
- "cold_eligible": 9443,
42
- "eligible": 10000,
43
- "hot_eligible": 557,
44
- "hot_quota": null,
45
- "requested": 500000
46
- }
47
- },
48
- "final_live_count": 100000000,
49
- "hotspot": {
50
- "actual_mass": 0.05388897,
51
- "clusters": [
52
- 22,
53
- 0,
54
- 111,
55
- 59,
56
- 122,
57
- 121,
58
- 127
59
- ],
60
- "fresh_vectors": 1078071,
61
- "initial_live_vectors": 4310826,
62
- "query_vectors": 557,
63
- "root_cluster": 22,
64
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
65
- "source_vectors": 5388897,
66
- "target_mass": 0.05
67
- },
68
- "initial_live_count": 100000000,
69
- "profile": {
70
- "deletes": 0,
71
- "id": "query-uniform",
72
- "initial_state": "static-100m",
73
- "inserts": 0,
74
- "kind": "query",
75
- "queries": 500000,
76
- "query_rows": 500000
77
- }
78
- },
79
- {
80
- "batch_count": 0,
81
- "capacities": {
82
- "delete": {
83
- "cold_eligible": 94611103,
84
- "eligible": 100000000,
85
- "hot_eligible": 5388897,
86
- "hot_quota": null,
87
- "requested": 0
88
- },
89
- "insert": {
90
- "cold_eligible": 0,
91
- "eligible": 0,
92
- "hot_eligible": 0,
93
- "hot_quota": null,
94
- "requested": 0
95
- },
96
- "query": {
97
- "cold_eligible": 9443,
98
- "eligible": 10000,
99
- "hot_eligible": 557,
100
- "hot_quota": 400000,
101
- "requested": 500000
102
- }
103
- },
104
- "final_live_count": 100000000,
105
- "hotspot": {
106
- "actual_mass": 0.05388897,
107
- "clusters": [
108
- 22,
109
- 0,
110
- 111,
111
- 59,
112
- 122,
113
- 121,
114
- 127
115
- ],
116
- "fresh_vectors": 1078071,
117
- "initial_live_vectors": 4310826,
118
- "query_vectors": 557,
119
- "root_cluster": 22,
120
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
121
- "source_vectors": 5388897,
122
- "target_mass": 0.05
123
- },
124
- "initial_live_count": 100000000,
125
- "profile": {
126
- "control": "query-uniform",
127
- "deletes": 0,
128
- "id": "query-hot",
129
- "initial_state": "static-100m",
130
- "inserts": 0,
131
- "kind": "query",
132
- "queries": 500000,
133
- "query_hot_fraction": 0.8,
134
- "query_rows": 500000
135
- }
136
- },
137
- {
138
- "batch_count": 1,
139
- "capacities": {
140
- "delete": {
141
- "cold_eligible": 75689174,
142
- "eligible": 80000000,
143
- "hot_eligible": 4310826,
144
- "hot_quota": null,
145
- "requested": 0
146
- },
147
- "insert": {
148
- "cold_eligible": 18921929,
149
- "eligible": 20000000,
150
- "hot_eligible": 1078071,
151
- "hot_quota": null,
152
- "requested": 500000
153
- },
154
- "query": {
155
- "cold_eligible": 9443,
156
- "eligible": 10000,
157
- "hot_eligible": 557,
158
- "hot_quota": null,
159
- "requested": 10000
160
- }
161
- },
162
- "final_live_count": 80500000,
163
- "hotspot": {
164
- "actual_mass": 0.05388897,
165
- "clusters": [
166
- 22,
167
- 0,
168
- 111,
169
- 59,
170
- 122,
171
- 121,
172
- 127
173
- ],
174
- "fresh_vectors": 1078071,
175
- "initial_live_vectors": 4310826,
176
- "query_vectors": 557,
177
- "root_cluster": 22,
178
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
179
- "source_vectors": 5388897,
180
- "target_mass": 0.05
181
- },
182
- "initial_live_count": 80000000,
183
- "profile": {
184
- "batch_size": 500000,
185
- "deletes": 0,
186
- "id": "insert-uniform",
187
- "initial_state": "initial-80m",
188
- "inserts": 500000,
189
- "kind": "insert",
190
- "queries": 500000,
191
- "query_rows": 10000
192
- }
193
- },
194
- {
195
- "batch_count": 1,
196
- "capacities": {
197
- "delete": {
198
- "cold_eligible": 75689174,
199
- "eligible": 80000000,
200
- "hot_eligible": 4310826,
201
- "hot_quota": null,
202
- "requested": 0
203
- },
204
- "insert": {
205
- "cold_eligible": 18921929,
206
- "eligible": 20000000,
207
- "hot_eligible": 1078071,
208
- "hot_quota": 400000,
209
- "requested": 500000
210
- },
211
- "query": {
212
- "cold_eligible": 9443,
213
- "eligible": 10000,
214
- "hot_eligible": 557,
215
- "hot_quota": null,
216
- "requested": 10000
217
- }
218
- },
219
- "final_live_count": 80500000,
220
- "hotspot": {
221
- "actual_mass": 0.05388897,
222
- "clusters": [
223
- 22,
224
- 0,
225
- 111,
226
- 59,
227
- 122,
228
- 121,
229
- 127
230
- ],
231
- "fresh_vectors": 1078071,
232
- "initial_live_vectors": 4310826,
233
- "query_vectors": 557,
234
- "root_cluster": 22,
235
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
236
- "source_vectors": 5388897,
237
- "target_mass": 0.05
238
- },
239
- "initial_live_count": 80000000,
240
- "profile": {
241
- "batch_size": 500000,
242
- "control": "insert-uniform",
243
- "deletes": 0,
244
- "id": "insert-hot",
245
- "initial_state": "initial-80m",
246
- "insert_hot_fraction": 0.8,
247
- "inserts": 500000,
248
- "kind": "insert",
249
- "queries": 500000,
250
- "query_rows": 10000
251
- }
252
- },
253
- {
254
- "batch_count": 1,
255
- "capacities": {
256
- "delete": {
257
- "cold_eligible": 94611103,
258
- "eligible": 100000000,
259
- "hot_eligible": 5388897,
260
- "hot_quota": null,
261
- "requested": 1000000
262
- },
263
- "insert": {
264
- "cold_eligible": 0,
265
- "eligible": 0,
266
- "hot_eligible": 0,
267
- "hot_quota": null,
268
- "requested": 0
269
- },
270
- "query": {
271
- "cold_eligible": 9443,
272
- "eligible": 10000,
273
- "hot_eligible": 557,
274
- "hot_quota": null,
275
- "requested": 10000
276
- }
277
- },
278
- "final_live_count": 99000000,
279
- "hotspot": {
280
- "actual_mass": 0.05388897,
281
- "clusters": [
282
- 22,
283
- 0,
284
- 111,
285
- 59,
286
- 122,
287
- 121,
288
- 127
289
- ],
290
- "fresh_vectors": 1078071,
291
- "initial_live_vectors": 4310826,
292
- "query_vectors": 557,
293
- "root_cluster": 22,
294
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
295
- "source_vectors": 5388897,
296
- "target_mass": 0.05
297
- },
298
- "initial_live_count": 100000000,
299
- "profile": {
300
- "batch_size": 1000000,
301
- "deletes": 1000000,
302
- "id": "delete-uniform",
303
- "initial_state": "static-100m",
304
- "inserts": 0,
305
- "kind": "delete",
306
- "queries": 500000,
307
- "query_rows": 10000
308
- }
309
- },
310
- {
311
- "batch_count": 1,
312
- "capacities": {
313
- "delete": {
314
- "cold_eligible": 94611103,
315
- "eligible": 100000000,
316
- "hot_eligible": 5388897,
317
- "hot_quota": 800000,
318
- "requested": 1000000
319
- },
320
- "insert": {
321
- "cold_eligible": 0,
322
- "eligible": 0,
323
- "hot_eligible": 0,
324
- "hot_quota": null,
325
- "requested": 0
326
- },
327
- "query": {
328
- "cold_eligible": 9443,
329
- "eligible": 10000,
330
- "hot_eligible": 557,
331
- "hot_quota": null,
332
- "requested": 10000
333
- }
334
- },
335
- "final_live_count": 99000000,
336
- "hotspot": {
337
- "actual_mass": 0.05388897,
338
- "clusters": [
339
- 22,
340
- 0,
341
- 111,
342
- 59,
343
- 122,
344
- 121,
345
- 127
346
- ],
347
- "fresh_vectors": 1078071,
348
- "initial_live_vectors": 4310826,
349
- "query_vectors": 557,
350
- "root_cluster": 22,
351
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
352
- "source_vectors": 5388897,
353
- "target_mass": 0.05
354
- },
355
- "initial_live_count": 100000000,
356
- "profile": {
357
- "batch_size": 1000000,
358
- "control": "delete-uniform",
359
- "delete_hot_fraction": 0.8,
360
- "deletes": 1000000,
361
- "id": "delete-hot",
362
- "initial_state": "static-100m",
363
- "inserts": 0,
364
- "kind": "delete",
365
- "queries": 500000,
366
- "query_rows": 10000
367
- }
368
- },
369
- {
370
- "batch_count": 3,
371
- "capacities": {
372
- "delete": {
373
- "cold_eligible": 75689174,
374
- "eligible": 80000000,
375
- "hot_eligible": 4310826,
376
- "hot_quota": null,
377
- "requested": 600000
378
- },
379
- "insert": {
380
- "cold_eligible": 18921929,
381
- "eligible": 20000000,
382
- "hot_eligible": 1078071,
383
- "hot_quota": null,
384
- "requested": 600000
385
- },
386
- "query": {
387
- "cold_eligible": 9443,
388
- "eligible": 10000,
389
- "hot_eligible": 557,
390
- "hot_quota": null,
391
- "requested": 500000
392
- }
393
- },
394
- "final_live_count": 80000000,
395
- "hotspot": {
396
- "actual_mass": 0.05388897,
397
- "clusters": [
398
- 22,
399
- 0,
400
- 111,
401
- 59,
402
- 122,
403
- 121,
404
- 127
405
- ],
406
- "fresh_vectors": 1078071,
407
- "initial_live_vectors": 4310826,
408
- "query_vectors": 557,
409
- "root_cluster": 22,
410
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
411
- "source_vectors": 5388897,
412
- "target_mass": 0.05
413
- },
414
- "initial_live_count": 80000000,
415
- "profile": {
416
- "batch_size": 200000,
417
- "deletes": 600000,
418
- "id": "mixed-uniform",
419
- "initial_state": "initial-80m",
420
- "inserts": 600000,
421
- "kind": "mixed",
422
- "queries": 21600000,
423
- "query_rows": 500000,
424
- "update_stream": "mixed-uniform"
425
- }
426
- },
427
- {
428
- "batch_count": 3,
429
- "capacities": {
430
- "delete": {
431
- "cold_eligible": 75689174,
432
- "eligible": 80000000,
433
- "hot_eligible": 4310826,
434
- "hot_quota": 480000,
435
- "requested": 600000
436
- },
437
- "insert": {
438
- "cold_eligible": 18921929,
439
- "eligible": 20000000,
440
- "hot_eligible": 1078071,
441
- "hot_quota": 480000,
442
- "requested": 600000
443
- },
444
- "query": {
445
- "cold_eligible": 9443,
446
- "eligible": 10000,
447
- "hot_eligible": 557,
448
- "hot_quota": null,
449
- "requested": 500000
450
- }
451
- },
452
- "final_live_count": 80000000,
453
- "hotspot": {
454
- "actual_mass": 0.05388897,
455
- "clusters": [
456
- 22,
457
- 0,
458
- 111,
459
- 59,
460
- 122,
461
- 121,
462
- 127
463
- ],
464
- "fresh_vectors": 1078071,
465
- "initial_live_vectors": 4310826,
466
- "query_vectors": 557,
467
- "root_cluster": 22,
468
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
469
- "source_vectors": 5388897,
470
- "target_mass": 0.05
471
- },
472
- "initial_live_count": 80000000,
473
- "profile": {
474
- "batch_size": 200000,
475
- "control": "mixed-uniform",
476
- "delete_hot_fraction": 0.8,
477
- "deletes": 600000,
478
- "id": "mixed-update-hot",
479
- "initial_state": "initial-80m",
480
- "insert_hot_fraction": 0.8,
481
- "inserts": 600000,
482
- "kind": "mixed",
483
- "queries": 21600000,
484
- "query_rows": 500000,
485
- "update_stream": "mixed-hot"
486
- }
487
- },
488
- {
489
- "batch_count": 3,
490
- "capacities": {
491
- "delete": {
492
- "cold_eligible": 75689174,
493
- "eligible": 80000000,
494
- "hot_eligible": 4310826,
495
- "hot_quota": 480000,
496
- "requested": 600000
497
- },
498
- "insert": {
499
- "cold_eligible": 18921929,
500
- "eligible": 20000000,
501
- "hot_eligible": 1078071,
502
- "hot_quota": 480000,
503
- "requested": 600000
504
- },
505
- "query": {
506
- "cold_eligible": 9443,
507
- "eligible": 10000,
508
- "hot_eligible": 557,
509
- "hot_quota": 400000,
510
- "requested": 500000
511
- }
512
- },
513
- "final_live_count": 80000000,
514
- "hotspot": {
515
- "actual_mass": 0.05388897,
516
- "clusters": [
517
- 22,
518
- 0,
519
- 111,
520
- 59,
521
- 122,
522
- 121,
523
- 127
524
- ],
525
- "fresh_vectors": 1078071,
526
- "initial_live_vectors": 4310826,
527
- "query_vectors": 557,
528
- "root_cluster": 22,
529
- "scope": "one fixed hotspot for the entire run, shared by all CNs",
530
- "source_vectors": 5388897,
531
- "target_mass": 0.05
532
- },
533
- "initial_live_count": 80000000,
534
- "profile": {
535
- "batch_size": 200000,
536
- "control": "mixed-uniform",
537
- "delete_hot_fraction": 0.8,
538
- "deletes": 600000,
539
- "id": "mixed-shared-hot",
540
- "initial_state": "initial-80m",
541
- "insert_hot_fraction": 0.8,
542
- "inserts": 600000,
543
- "kind": "mixed",
544
- "queries": 21600000,
545
- "query_hot_fraction": 0.8,
546
- "query_rows": 500000,
547
- "update_stream": "mixed-hot"
548
- }
549
- }
550
- ],
551
- "schema": "spatial-workload-plan.v1",
552
- "source_identities": {
553
- "base": {
554
- "bytes": 38400000008,
555
- "file": "base.fbin",
556
- "package_sha256": "162cef480f030deead496c745b4214abc3fcbd9849c2561ab1251e84b6904ba4",
557
- "package_sha256_status": "trusted source record; not rehashed",
558
- "sample_sha256": "bfb8d14cd9320dd206e9e165bf10ff5d70285beb9a6380622010a01abfee4094"
559
- },
560
- "groundtruth": {
561
- "bytes": 8000008,
562
- "file": "groundtruth.bin",
563
- "package_sha256": "766d7e0e2ff81796f44adfc46e2cab98809c8e802b952063d7b8fa647697066f",
564
- "package_sha256_status": "trusted source record; not rehashed",
565
- "sample_sha256": "5dd3bce8290ae748784916e9d62ec7bf4f0c19cfe40c652697d0ed807fcda761"
566
- },
567
- "insert_vectors": {
568
- "bytes": 38400000008,
569
- "file": "base_permuted.fbin",
570
- "package_sha256": "1c8bf71f320a52e763ba1fa1168d88dbd45f5b36ce74cf2fa71d7bdc399eba93",
571
- "package_sha256_status": "trusted source record; not rehashed",
572
- "sample_sha256": "648534790d99934dd9cbb697f299c36a698f80263c2d344180b786890305227f"
573
- },
574
- "queries": {
575
- "bytes": 3840008,
576
- "file": "orig_query_10k.fbin",
577
- "package_sha256": "8438fc763f14e0f9741fda15b3e11215aef089ce17d1ad47d53b52a7c9fda5bb",
578
- "package_sha256_status": "trusted source record; not rehashed",
579
- "sample_sha256": "a7afbec60a892eaf16eda71baca8f099e364eac84e27818a75bfe2f462e454c8"
580
- },
581
- "update_order": {
582
- "bytes": 400000000,
583
- "file": "update_order.u32",
584
- "package_sha256": "88332fcfc0662b21c7283197570e8957baf89275e06b635b84a9647da71cdcad",
585
- "package_sha256_status": "trusted source record; not rehashed",
586
- "sample_sha256": "5e8fa93c166c6c34714dc5a97d969a5d1b3895bb3fd50f8fdf66fde2190ac37f"
587
- }
588
- }
589
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/requirements.txt DELETED
@@ -1,4 +0,0 @@
1
- # Versions used to generate and validate the DEEP100M v1 release.
2
- numpy==2.2.6
3
- faiss-cpu==1.15.1
4
- threadpoolctl==3.7.0
 
 
 
 
 
spatial-workloads/v1/tools/cxl/derive_concurrent_manifest.py DELETED
@@ -1,555 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- from __future__ import annotations
4
-
5
- import argparse
6
- import copy
7
- import json
8
- import tempfile
9
- from pathlib import Path
10
-
11
-
12
- DEFAULT_MIXED_STEADY_SEARCH_THREADS = 26
13
- DEFAULT_MIXED_STEADY_INSERT_THREADS = 4
14
- DEFAULT_MIXED_STEADY_MARK_DELETE_THREADS = 1
15
- DEFAULT_MIXED_STEADY_MERGE_DELETE_THREADS = 0
16
-
17
-
18
- def nonnegative_int(value: str) -> int:
19
- parsed = int(value)
20
- if parsed < 0:
21
- raise argparse.ArgumentTypeError("value must be non-negative")
22
- return parsed
23
-
24
-
25
- def nonnegative_float(value: str) -> float:
26
- parsed = float(value)
27
- if parsed < 0.0:
28
- raise argparse.ArgumentTypeError("value must be non-negative")
29
- return parsed
30
-
31
-
32
- def parse_args() -> argparse.Namespace:
33
- parser = argparse.ArgumentParser(
34
- description=(
35
- "Derive a concurrent benchmark manifest from an existing "
36
- "materialized manifest without copying query, ground-truth, or id "
37
- "streams."
38
- )
39
- )
40
- parser.add_argument("--base-manifest", type=Path)
41
- parser.add_argument("--output-manifest", type=Path)
42
- parser.add_argument("--workload-id", default="")
43
- parser.add_argument(
44
- "--workload-mode",
45
- choices=["final_full_overlap", "continuous_uniform", "decomposition", "smoke", "debug"],
46
- default=None,
47
- help="Defaults to the base mode for exact-count checkpoints, otherwise decomposition.",
48
- )
49
- parser.add_argument("--target-query-count", type=nonnegative_int)
50
- parser.add_argument("--target-insert-count", type=nonnegative_int)
51
- parser.add_argument("--target-mark-delete-count", type=nonnegative_int)
52
- parser.add_argument("--duration-seconds", type=nonnegative_float)
53
- parser.add_argument("--query-rate-qps", type=nonnegative_float)
54
- parser.add_argument("--insert-rate-ops", type=nonnegative_float)
55
- parser.add_argument("--mark-delete-rate-ops", type=nonnegative_float)
56
- for prefix in ("search", "insert", "mark-delete"):
57
- parser.add_argument(
58
- f"--{prefix}-arrival-mode",
59
- choices=["fixed-rate", "saturating-backlog"],
60
- )
61
- parser.add_argument(f"--{prefix}-low-watermark", type=nonnegative_int)
62
- parser.add_argument(f"--{prefix}-high-watermark", type=nonnegative_int)
63
- parser.add_argument(f"--{prefix}-poll-interval-us", type=nonnegative_int)
64
- parser.add_argument("--search-threads", type=nonnegative_int)
65
- parser.add_argument("--insert-threads", type=nonnegative_int)
66
- parser.add_argument("--mark-delete-threads", type=nonnegative_int)
67
- parser.add_argument("--merge-delete-threads", type=nonnegative_int)
68
- parser.add_argument(
69
- "--overflow-policy",
70
- choices=["reject_new", "wait_for_capacity"],
71
- )
72
- parser.add_argument(
73
- "--keep-merge-delete",
74
- action="store_true",
75
- help=(
76
- "Preserve base merge-delete schedules. By default decomposition, "
77
- "smoke, and debug derivatives clear merge-delete schedules."
78
- ),
79
- )
80
- parser.add_argument("--self-test", action="store_true")
81
- return parser.parse_args()
82
-
83
-
84
- def require_args(args: argparse.Namespace) -> None:
85
- missing = []
86
- if args.base_manifest is None:
87
- missing.append("--base-manifest")
88
- if args.output_manifest is None:
89
- missing.append("--output-manifest")
90
- if missing:
91
- raise ValueError("missing required arguments: " + ", ".join(missing))
92
- if args.duration_seconds is not None and args.duration_seconds <= 0.0:
93
- raise ValueError("--duration-seconds must be greater than zero")
94
- if args.base_manifest.resolve() == args.output_manifest.resolve():
95
- raise ValueError("--output-manifest must be separate from --base-manifest")
96
-
97
-
98
- def derived_rate(explicit: float | None, count: int, duration: float) -> float:
99
- if explicit is not None:
100
- return explicit
101
- if count == 0:
102
- return 0.0
103
- return count / duration
104
-
105
-
106
- def maybe_set(window: dict, field: str, value: object | None) -> object:
107
- if value is None:
108
- return window[field]
109
- window[field] = value
110
- return value
111
-
112
-
113
- def apply_arrival_override(window: dict, prefix: str, args: argparse.Namespace) -> None:
114
- mode = getattr(args, f"{prefix}_arrival_mode")
115
- low = getattr(args, f"{prefix}_low_watermark")
116
- high = getattr(args, f"{prefix}_high_watermark")
117
- poll = getattr(args, f"{prefix}_poll_interval_us")
118
- if mode is None and low is None and high is None and poll is None:
119
- return
120
- field = f"{prefix}_arrival"
121
- control = dict(
122
- window.get(
123
- field,
124
- {
125
- "mode": "fixed-rate",
126
- "low_watermark": 0,
127
- "high_watermark": 0,
128
- "poll_interval_us": 100,
129
- },
130
- )
131
- )
132
- if mode is not None:
133
- control["mode"] = mode
134
- if low is not None:
135
- control["low_watermark"] = low
136
- if high is not None:
137
- control["high_watermark"] = high
138
- if poll is not None:
139
- if poll <= 0:
140
- raise ValueError(f"--{prefix.replace('_', '-')}-poll-interval-us must be positive")
141
- control["poll_interval_us"] = poll
142
- window[field] = control
143
-
144
-
145
- def should_clear_merge_delete(args: argparse.Namespace) -> bool:
146
- return not args.keep_merge_delete and args.workload_mode not in (
147
- "final_full_overlap", "continuous_uniform"
148
- )
149
-
150
-
151
- def should_apply_default_mixed_steady_threads(
152
- args: argparse.Namespace,
153
- clear_merge_delete: bool,
154
- query_count: int,
155
- insert_count: int,
156
- mark_count: int,
157
- ) -> bool:
158
- return (
159
- clear_merge_delete
160
- and query_count > 0
161
- and insert_count > 0
162
- and mark_count > 0
163
- and args.search_threads is None
164
- and args.insert_threads is None
165
- and args.mark_delete_threads is None
166
- and args.merge_delete_threads is None
167
- )
168
-
169
-
170
- def derive_manifest(base: dict, args: argparse.Namespace) -> dict:
171
- manifest = copy.deepcopy(base)
172
- checkpoint_contract = manifest.get("checkpoint_contract")
173
- if checkpoint_contract not in (None, "exact-update-counts.v1"):
174
- raise ValueError(f"unsupported checkpoint contract: {checkpoint_contract!r}")
175
- args = argparse.Namespace(**vars(args))
176
- args.workload_mode = args.workload_mode or (
177
- manifest["workload_mode"] if checkpoint_contract else "decomposition"
178
- )
179
- if checkpoint_contract and (
180
- (args.workload_mode == "continuous_uniform")
181
- != (manifest.get("window_lifecycle") == "continuous_logical_windows")
182
- ):
183
- raise ValueError("exact-count checkpoint derivatives must preserve the window lifecycle")
184
- manifest["workload_mode"] = args.workload_mode
185
- if args.workload_id:
186
- manifest["workload_id"] = args.workload_id
187
-
188
- clear_merge_delete = should_clear_merge_delete(args)
189
- for window in manifest.get("windows", []):
190
- duration = float(maybe_set(window, "duration_seconds", args.duration_seconds))
191
- if duration <= 0.0:
192
- raise ValueError("duration_seconds must be greater than zero")
193
-
194
- query_count = int(maybe_set(window, "target_query_count", args.target_query_count))
195
- insert_count = int(maybe_set(window, "target_insert_count", args.target_insert_count))
196
- mark_count = int(maybe_set(window, "target_mark_delete_count", args.target_mark_delete_count))
197
- if query_count < 0 or insert_count < 0 or mark_count < 0:
198
- raise ValueError("target counts must be non-negative")
199
- if checkpoint_contract:
200
- bound = window.get("checkpoint_update_counts")
201
- if not isinstance(bound, dict) or (
202
- bound.get("insert") != insert_count
203
- or bound.get("mark_delete") != mark_count
204
- ):
205
- raise ValueError(
206
- "exact-update-counts.v1 forbids changing update counts while "
207
- "retaining checkpoint ground truth; generate a new workload"
208
- )
209
-
210
- window["query_rate_qps"] = derived_rate(
211
- args.query_rate_qps,
212
- query_count,
213
- duration,
214
- )
215
- window["insert_rate_ops"] = derived_rate(
216
- args.insert_rate_ops,
217
- insert_count,
218
- duration,
219
- )
220
- window["mark_delete_rate_ops"] = derived_rate(
221
- args.mark_delete_rate_ops,
222
- mark_count,
223
- duration,
224
- )
225
- apply_arrival_override(window, "search", args)
226
- apply_arrival_override(window, "insert", args)
227
- apply_arrival_override(window, "mark_delete", args)
228
- if args.overflow_policy is not None:
229
- window["overflow_policy"] = args.overflow_policy
230
-
231
- if should_apply_default_mixed_steady_threads(
232
- args,
233
- clear_merge_delete,
234
- query_count,
235
- insert_count,
236
- mark_count,
237
- ):
238
- window["search_threads"] = DEFAULT_MIXED_STEADY_SEARCH_THREADS
239
- window["insert_threads"] = DEFAULT_MIXED_STEADY_INSERT_THREADS
240
- window["mark_delete_threads"] = DEFAULT_MIXED_STEADY_MARK_DELETE_THREADS
241
- else:
242
- maybe_set(window, "search_threads", args.search_threads)
243
- maybe_set(window, "insert_threads", args.insert_threads)
244
- maybe_set(window, "mark_delete_threads", args.mark_delete_threads)
245
- maybe_set(window, "merge_delete_threads", args.merge_delete_threads)
246
-
247
- if clear_merge_delete:
248
- window["merge_delete_mode"] = "disabled"
249
- window["merge_delete_schedule"] = []
250
- if args.merge_delete_threads is None:
251
- window["merge_delete_threads"] = DEFAULT_MIXED_STEADY_MERGE_DELETE_THREADS
252
-
253
- return manifest
254
-
255
-
256
- def load_manifest(path: Path) -> dict:
257
- with path.open("r", encoding="utf-8") as inp:
258
- return json.load(inp)
259
-
260
-
261
- def write_manifest(path: Path, manifest: dict) -> None:
262
- path.parent.mkdir(parents=True, exist_ok=True)
263
- path.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
264
-
265
-
266
- def run_self_test() -> None:
267
- base = {
268
- "version": 1,
269
- "workload_id": "base",
270
- "workload_mode": "final_full_overlap",
271
- "window_lifecycle": "one_active_window",
272
- "windows": [
273
- {
274
- "window_id": 1,
275
- "query_path": "/remote/query.fbin",
276
- "pre_update_checkpoint_groundtruth_path": "/remote/gt.bin",
277
- "insert_ids_path": "/remote/insert.u32",
278
- "mark_delete_ids_path": "/remote/delete.u32",
279
- "target_query_count": 900000,
280
- "target_insert_count": 50000,
281
- "target_mark_delete_count": 50000,
282
- "duration_seconds": 60.0,
283
- "query_rate_qps": 15000.0,
284
- "insert_rate_ops": 833.333333,
285
- "mark_delete_rate_ops": 833.333333,
286
- "search_arrival": {
287
- "mode": "fixed-rate",
288
- "low_watermark": 0,
289
- "high_watermark": 0,
290
- "poll_interval_us": 100,
291
- },
292
- "insert_arrival": {
293
- "mode": "fixed-rate",
294
- "low_watermark": 0,
295
- "high_watermark": 0,
296
- "poll_interval_us": 100,
297
- },
298
- "mark_delete_arrival": {
299
- "mode": "fixed-rate",
300
- "low_watermark": 0,
301
- "high_watermark": 0,
302
- "poll_interval_us": 100,
303
- },
304
- "warmup_seconds": 0.0,
305
- "stop_policy": "drain_after_duration",
306
- "allocation_scope": "uniform_all_cns",
307
- "search_threads": 5,
308
- "insert_threads": 1,
309
- "mark_delete_threads": 1,
310
- "merge_delete_threads": 1,
311
- "merge_delete_mode": "concurrent",
312
- "merge_delete_trigger": {
313
- "kind": "deleted_node_fraction",
314
- "threshold": 0.05,
315
- "semantics": "offline_generator_emits_deterministic_schedule",
316
- },
317
- "merge_delete_schedule": [
318
- {
319
- "task_class": "merge_delete_repair",
320
- "start_after_seconds": 60.0,
321
- "repeat_interval_seconds": 0,
322
- "max_runs": 1,
323
- }
324
- ],
325
- "max_queue_depth": {
326
- "search": 10000,
327
- "insert": 5000,
328
- "mark_delete": 5000,
329
- "merge_delete_repair": 1000,
330
- "merge_delete_gc": 1000,
331
- },
332
- "max_inflight": {
333
- "search": 10000,
334
- "insert": 5000,
335
- "mark_delete": 5000,
336
- "merge_delete_repair": 1000,
337
- "merge_delete_gc": 1000,
338
- },
339
- "overflow_policy": "reject_new",
340
- "source": {
341
- "kind": "converted_batch",
342
- "batch_workload_root": "/remote/source",
343
- "batch_index": 1,
344
- "batch_json_path": "/remote/source/batches/batch_0001.json",
345
- "query_path": "/remote/source/queries/q.fbin",
346
- "pre_update_checkpoint_groundtruth_path": "/remote/source/groundtruth/g.bin",
347
- "insert_count": 100000,
348
- "delete_count": 100000,
349
- "active_begin": 0,
350
- "active_end_exclusive": 8000000,
351
- "active_count": 8000000,
352
- },
353
- }
354
- ],
355
- }
356
-
357
- with tempfile.TemporaryDirectory(prefix="vectordb_derive_manifest_") as tmp:
358
- root = Path(tmp)
359
- base_path = root / "base.json"
360
- out_path = root / "search_only.json"
361
- write_manifest(base_path, base)
362
- args = argparse.Namespace(
363
- base_manifest=base_path,
364
- output_manifest=out_path,
365
- workload_id="search-only",
366
- workload_mode="decomposition",
367
- target_query_count=100,
368
- target_insert_count=0,
369
- target_mark_delete_count=0,
370
- duration_seconds=10.0,
371
- query_rate_qps=None,
372
- insert_rate_ops=None,
373
- mark_delete_rate_ops=None,
374
- search_arrival_mode=None,
375
- search_low_watermark=None,
376
- search_high_watermark=None,
377
- search_poll_interval_us=None,
378
- insert_arrival_mode=None,
379
- insert_low_watermark=None,
380
- insert_high_watermark=None,
381
- insert_poll_interval_us=None,
382
- mark_delete_arrival_mode=None,
383
- mark_delete_low_watermark=None,
384
- mark_delete_high_watermark=None,
385
- mark_delete_poll_interval_us=None,
386
- search_threads=3,
387
- insert_threads=0,
388
- mark_delete_threads=0,
389
- merge_delete_threads=None,
390
- overflow_policy=None,
391
- keep_merge_delete=False,
392
- self_test=False,
393
- )
394
- same_path_args = argparse.Namespace(**vars(args))
395
- same_path_args.output_manifest = base_path
396
- try:
397
- require_args(same_path_args)
398
- except ValueError as exc:
399
- if "separate from --base-manifest" not in str(exc):
400
- raise
401
- else:
402
- raise AssertionError("derive should reject in-place manifest output")
403
-
404
- derived = derive_manifest(load_manifest(base_path), args)
405
- write_manifest(out_path, derived)
406
- reread = load_manifest(out_path)
407
- window = reread["windows"][0]
408
- if reread["workload_id"] != "search-only":
409
- raise AssertionError("workload id was not updated")
410
- if window["target_query_count"] != 100 or window["query_rate_qps"] != 10.0:
411
- raise AssertionError("query count/rate derivation failed")
412
- if window["target_insert_count"] != 0 or window["insert_rate_ops"] != 0.0:
413
- raise AssertionError("insert stream was not disabled")
414
- if window["target_mark_delete_count"] != 0 or window["mark_delete_rate_ops"] != 0.0:
415
- raise AssertionError("mark-delete stream was not disabled")
416
- if (
417
- window["search_threads"] != 3
418
- or window["insert_threads"] != 0
419
- or window["mark_delete_threads"] != 0
420
- or window["merge_delete_threads"] != 0
421
- ):
422
- raise AssertionError("thread override failed")
423
- if window["merge_delete_mode"] != "disabled" or window["merge_delete_schedule"]:
424
- raise AssertionError("decomposition should clear merge-delete by default")
425
- if window["query_path"] != "/remote/query.fbin":
426
- raise AssertionError("derived manifest should reuse materialized paths")
427
- if window["source"]["insert_count"] != 100000:
428
- raise AssertionError("source metadata should preserve original batch counts")
429
- if window["search_arrival"]["mode"] != "fixed-rate":
430
- raise AssertionError("derive should preserve arrival controls by default")
431
-
432
- mixed_path = root / "mixed_default.json"
433
- mixed_args = argparse.Namespace(**vars(args))
434
- mixed_args.output_manifest = mixed_path
435
- mixed_args.workload_id = "mixed-default"
436
- mixed_args.target_query_count = None
437
- mixed_args.target_insert_count = None
438
- mixed_args.target_mark_delete_count = None
439
- mixed_args.search_threads = None
440
- mixed_args.insert_threads = None
441
- mixed_args.mark_delete_threads = None
442
- mixed_args.merge_delete_threads = None
443
- mixed = derive_manifest(load_manifest(base_path), mixed_args)
444
- mixed_window = mixed["windows"][0]
445
- if (
446
- mixed_window["search_threads"] != DEFAULT_MIXED_STEADY_SEARCH_THREADS
447
- or mixed_window["insert_threads"] != DEFAULT_MIXED_STEADY_INSERT_THREADS
448
- or mixed_window["mark_delete_threads"]
449
- != DEFAULT_MIXED_STEADY_MARK_DELETE_THREADS
450
- or mixed_window["merge_delete_threads"]
451
- != DEFAULT_MIXED_STEADY_MERGE_DELETE_THREADS
452
- ):
453
- raise AssertionError("mixed decomposition should default to 26/4/1/0")
454
-
455
- keep_args = argparse.Namespace(**vars(args))
456
- keep_args.workload_mode = "final_full_overlap"
457
- keep_args.keep_merge_delete = True
458
- keep_args.merge_delete_threads = 1
459
- kept = derive_manifest(load_manifest(base_path), keep_args)
460
- kept_window = kept["windows"][0]
461
- if kept_window["merge_delete_mode"] != "concurrent" or not kept_window["merge_delete_schedule"]:
462
- raise AssertionError("keep-merge-delete should preserve schedules")
463
-
464
- arrival_args = argparse.Namespace(**vars(args))
465
- arrival_args.insert_arrival_mode = "saturating-backlog"
466
- arrival_args.insert_low_watermark = 100
467
- arrival_args.insert_high_watermark = 500
468
- arrival_args.insert_poll_interval_us = 25
469
- arrival = derive_manifest(load_manifest(base_path), arrival_args)
470
- insert_arrival = arrival["windows"][0]["insert_arrival"]
471
- if insert_arrival["mode"] != "saturating-backlog":
472
- raise AssertionError("arrival mode override failed")
473
- if insert_arrival["low_watermark"] != 100 or insert_arrival["high_watermark"] != 500:
474
- raise AssertionError("arrival watermark override failed")
475
- wait_args = argparse.Namespace(**vars(args))
476
- wait_args.overflow_policy = "wait_for_capacity"
477
- wait = derive_manifest(load_manifest(base_path), wait_args)
478
- if wait["windows"][0]["overflow_policy"] != "wait_for_capacity":
479
- raise AssertionError("overflow policy override failed")
480
-
481
- exact_base = copy.deepcopy(base)
482
- exact_base["checkpoint_contract"] = "exact-update-counts.v1"
483
- exact_base["workload_mode"] = "continuous_uniform"
484
- exact_base["window_lifecycle"] = "continuous_logical_windows"
485
- exact_base["windows"][0]["checkpoint_update_counts"] = {
486
- "insert": 50000,
487
- "mark_delete": 50000,
488
- }
489
- exact_args = argparse.Namespace(
490
- **{
491
- **vars(mixed_args),
492
- "workload_mode": None,
493
- "duration_seconds": 30.0,
494
- }
495
- )
496
- exact = derive_manifest(exact_base, exact_args)
497
- if exact["workload_mode"] != "continuous_uniform":
498
- raise AssertionError("exact checkpoint default should preserve the runtime mode")
499
- if exact["windows"][0]["merge_delete_mode"] != "concurrent":
500
- raise AssertionError("continuous derivatives must preserve the merge trigger")
501
- if exact["windows"][0]["checkpoint_update_counts"] != (
502
- exact_base["windows"][0]["checkpoint_update_counts"]
503
- ):
504
- raise AssertionError("exact checkpoint binding was not preserved")
505
- if exact["windows"][0]["duration_seconds"] != 30.0:
506
- raise AssertionError("exact checkpoint should allow duration changes")
507
- for field in ("target_insert_count", "target_mark_delete_count"):
508
- changed_args = argparse.Namespace(**{**vars(exact_args), field: 0})
509
- try:
510
- derive_manifest(exact_base, changed_args)
511
- except ValueError as exc:
512
- if "forbids changing update counts" not in str(exc):
513
- raise
514
- else:
515
- raise AssertionError(f"exact checkpoint accepted changed {field}")
516
- missing_binding = copy.deepcopy(exact_base)
517
- del missing_binding["windows"][0]["checkpoint_update_counts"]
518
- try:
519
- derive_manifest(missing_binding, exact_args)
520
- except ValueError as exc:
521
- if "forbids changing update counts" not in str(exc):
522
- raise
523
- else:
524
- raise AssertionError("exact checkpoint accepted a missing count binding")
525
- changed_mode_args = argparse.Namespace(
526
- **{**vars(exact_args), "workload_mode": "decomposition"}
527
- )
528
- try:
529
- derive_manifest(exact_base, changed_mode_args)
530
- except ValueError as exc:
531
- if "preserve the window lifecycle" not in str(exc):
532
- raise
533
- else:
534
- raise AssertionError("exact checkpoint accepted an incompatible lifecycle")
535
- legacy_default = derive_manifest(base, exact_args)
536
- if legacy_default["workload_mode"] != "decomposition":
537
- raise AssertionError("legacy default must remain decomposition")
538
-
539
- print("self-test: OK")
540
-
541
-
542
- def main() -> int:
543
- args = parse_args()
544
- if args.self_test:
545
- run_self_test()
546
- return 0
547
- require_args(args)
548
- manifest = derive_manifest(load_manifest(args.base_manifest), args)
549
- write_manifest(args.output_manifest, manifest)
550
- print(args.output_manifest)
551
- return 0
552
-
553
-
554
- if __name__ == "__main__":
555
- raise SystemExit(main())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/tools/cxl/materialize_concurrent_batch_update.py DELETED
@@ -1,1392 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- from __future__ import annotations
4
-
5
- import argparse
6
- import json
7
- import struct
8
- import sys
9
- import tempfile
10
- from array import array
11
- from pathlib import Path
12
-
13
-
14
- UINT32_SPACE = 1 << 32
15
- DEFAULT_UNIFORM_DATA_WORKERS = 7
16
- DEFAULT_UNIFORM_MERGE_WORKERS = 2
17
- DEFAULT_UNIFORM_QUERY_RATIO = 18
18
- DEFAULT_UNIFORM_INSERT_RATIO = 1
19
- DEFAULT_UNIFORM_MARK_DELETE_RATIO = 1
20
- DEFAULT_UNIFORM_RATIO_WINDOW_MULTIPLIER = 20
21
-
22
-
23
- def positive_int(value: str) -> int:
24
- parsed = int(value)
25
- if parsed <= 0:
26
- raise argparse.ArgumentTypeError("value must be positive")
27
- return parsed
28
-
29
-
30
- def positive_float(value: str) -> float:
31
- parsed = float(value)
32
- if parsed <= 0.0:
33
- raise argparse.ArgumentTypeError("value must be positive")
34
- return parsed
35
-
36
-
37
- def nonnegative_float(value: str) -> float:
38
- parsed = float(value)
39
- if parsed < 0.0:
40
- raise argparse.ArgumentTypeError("value must be non-negative")
41
- return parsed
42
-
43
-
44
- def fraction(value: str) -> float:
45
- parsed = float(value)
46
- if not 0.0 < parsed <= 1.0:
47
- raise argparse.ArgumentTypeError("value must be in (0, 1]")
48
- return parsed
49
-
50
-
51
- def parse_args() -> argparse.Namespace:
52
- parser = argparse.ArgumentParser(
53
- description=(
54
- "Materialize compact batch-update-eval descriptors as paired "
55
- "concurrent ID/vector-ref streams without copying vectors."
56
- ),
57
- formatter_class=argparse.ArgumentDefaultsHelpFormatter,
58
- )
59
- parser.add_argument("--batch-workload-root", type=Path)
60
- parser.add_argument(
61
- "--insert-vector-source-root",
62
- type=Path,
63
- help="Existing shared base_permuted vector directory; defaults to the workload root.",
64
- )
65
- parser.add_argument(
66
- "--runtime-insert-vector-source-root",
67
- type=Path,
68
- help=(
69
- "Cluster directory for shared vectors; defaults to an explicit local "
70
- "source root, otherwise the runtime workload root."
71
- ),
72
- )
73
- parser.add_argument("--trace-id", default="mixed-replace-100")
74
- parser.add_argument("--output-dir", type=Path)
75
- parser.add_argument(
76
- "--query-path",
77
- type=Path,
78
- help="Existing query matrix referenced by every generated window.",
79
- )
80
- parser.add_argument(
81
- "--initial-groundtruth-path",
82
- type=Path,
83
- help=(
84
- "Override the first pre-update checkpoint ground truth. Required "
85
- "when the selected initial-state object has no local path."
86
- ),
87
- )
88
- parser.add_argument(
89
- "--runtime-output-dir",
90
- type=Path,
91
- help="Cluster path for generated files; defaults to --output-dir.",
92
- )
93
- parser.add_argument(
94
- "--runtime-batch-workload-root",
95
- type=Path,
96
- help="Cluster path for the canonical package; defaults to its local path.",
97
- )
98
- parser.add_argument(
99
- "--runtime-query-path",
100
- type=Path,
101
- help="Cluster path for --query-path; defaults to its local path.",
102
- )
103
- parser.add_argument(
104
- "--runtime-initial-groundtruth-path",
105
- type=Path,
106
- help="Cluster path for an explicit initial ground-truth override.",
107
- )
108
- parser.add_argument("--start-batch-index", type=positive_int, default=1)
109
- parser.add_argument("--window-count", type=positive_int, default=1)
110
- parser.add_argument(
111
- "--target-query-count",
112
- type=positive_int,
113
- help=(
114
- "Defaults to the row count in --query-path, or the configured "
115
- "uniform ratio with --uniform-e6."
116
- ),
117
- )
118
- parser.add_argument(
119
- "--target-insert-count",
120
- type=positive_int,
121
- help="Defaults to each source batch's full insert count.",
122
- )
123
- parser.add_argument(
124
- "--target-mark-delete-count",
125
- type=positive_int,
126
- help="Defaults to each source batch's full delete count.",
127
- )
128
- parser.add_argument("--duration-seconds", type=positive_float, default=60.0)
129
- parser.add_argument("--warmup-seconds", type=nonnegative_float, default=0.0)
130
- parser.add_argument(
131
- "--query-rate-qps",
132
- type=nonnegative_float,
133
- default=0.0,
134
- help="Zero derives target_query_count / duration_seconds.",
135
- )
136
- parser.add_argument(
137
- "--insert-rate-ops",
138
- type=nonnegative_float,
139
- default=0.0,
140
- help="Zero derives target_insert_count / duration_seconds.",
141
- )
142
- parser.add_argument(
143
- "--mark-delete-rate-ops",
144
- type=nonnegative_float,
145
- default=0.0,
146
- help="Zero derives target_mark_delete_count / duration_seconds.",
147
- )
148
- parser.add_argument("--search-threads", type=positive_int)
149
- parser.add_argument("--insert-threads", type=positive_int)
150
- parser.add_argument("--mark-delete-threads", type=positive_int)
151
- parser.add_argument(
152
- "--merge-delete-threads",
153
- type=positive_int,
154
- help="Legacy manifest hint; incompatible with --uniform-e6.",
155
- )
156
- parser.add_argument("--search-max-queue-depth", type=positive_int, default=10000)
157
- parser.add_argument("--insert-max-queue-depth", type=positive_int, default=5000)
158
- parser.add_argument(
159
- "--mark-delete-max-queue-depth", type=positive_int, default=5000
160
- )
161
- parser.add_argument(
162
- "--merge-delete-max-queue-depth", type=positive_int, default=1000
163
- )
164
- parser.add_argument("--search-max-inflight", type=positive_int, default=10000)
165
- parser.add_argument("--insert-max-inflight", type=positive_int, default=5000)
166
- parser.add_argument(
167
- "--mark-delete-max-inflight", type=positive_int, default=5000
168
- )
169
- parser.add_argument("--merge-delete-max-inflight", type=positive_int, default=1000)
170
- parser.add_argument(
171
- "--overflow-policy",
172
- choices=("reject_new", "wait_for_capacity"),
173
- default="wait_for_capacity",
174
- )
175
- parser.add_argument("--workload-id", default="batch-update-concurrent")
176
- parser.add_argument(
177
- "--uniform-e6",
178
- action="store_true",
179
- help=(
180
- "Emit one continuous cyclic ratio-controlled E6 workload. Source "
181
- "windows remain logical input/progress segments only: they do not "
182
- "drain or synchronize the runtime. MergeDelete epochs are sealed "
183
- "at successful all-CN MarkDelete ACK thresholds."
184
- ),
185
- )
186
- parser.add_argument(
187
- "--uniform-skip-final-merge-delete",
188
- action="store_true",
189
- help=(
190
- "With --uniform-e6, keep the final source segment's foreground mix "
191
- "active but disable its MergeDelete trigger. Tombstones accumulated "
192
- "since the preceding frozen epoch remain unmerged; that group may "
193
- "span multiple source segments."
194
- ),
195
- )
196
- parser.add_argument(
197
- "--uniform-data-workers",
198
- type=positive_int,
199
- default=DEFAULT_UNIFORM_DATA_WORKERS,
200
- )
201
- parser.add_argument(
202
- "--uniform-merge-workers",
203
- type=positive_int,
204
- default=DEFAULT_UNIFORM_MERGE_WORKERS,
205
- )
206
- parser.add_argument(
207
- "--uniform-query-ratio",
208
- type=positive_int,
209
- default=DEFAULT_UNIFORM_QUERY_RATIO,
210
- )
211
- parser.add_argument(
212
- "--uniform-insert-ratio",
213
- type=positive_int,
214
- default=DEFAULT_UNIFORM_INSERT_RATIO,
215
- )
216
- parser.add_argument(
217
- "--uniform-mark-delete-ratio",
218
- type=positive_int,
219
- default=DEFAULT_UNIFORM_MARK_DELETE_RATIO,
220
- )
221
- parser.add_argument(
222
- "--uniform-ratio-window-multiplier",
223
- type=positive_int,
224
- default=DEFAULT_UNIFORM_RATIO_WINDOW_MULTIPLIER,
225
- help=(
226
- "Per-CN admission-window multiplier W; each full local window "
227
- "admits QW/IW/DW tickets."
228
- ),
229
- )
230
- parser.add_argument(
231
- "--acknowledged-tombstone-fraction",
232
- type=fraction,
233
- default=0.05,
234
- help="Active-set fraction of successful all-CN ACKs per repair epoch.",
235
- )
236
- parser.add_argument(
237
- "--workload-mode",
238
- choices=("decomposition", "smoke", "debug"),
239
- default="decomposition",
240
- help=(
241
- "Used for legacy materialization. --uniform-e6 emits "
242
- "continuous_uniform."
243
- ),
244
- )
245
- parser.add_argument(
246
- "--source-snapshot",
247
- default="",
248
- help="Optional dataset snapshot/commit recorded in metadata.json.",
249
- )
250
- parser.add_argument("--self-test", action="store_true")
251
- return parser.parse_args()
252
-
253
-
254
- def require_path(value: Path | None, flag: str) -> Path:
255
- if value is None:
256
- raise ValueError(f"{flag} is required")
257
- return value
258
-
259
-
260
- def checked_child(raw: str, base: Path, root: Path, name: str) -> Path:
261
- if not raw:
262
- raise ValueError(f"{name} path must not be empty")
263
- relative = Path(raw)
264
- if relative.is_absolute():
265
- raise ValueError(f"{name} path must be relative: {relative}")
266
- try:
267
- resolved = (base / relative).resolve(strict=True)
268
- except FileNotFoundError as exc:
269
- raise FileNotFoundError(f"missing {name}: {base / relative}") from exc
270
- try:
271
- resolved.relative_to(root)
272
- except ValueError as exc:
273
- raise ValueError(f"{name} escapes workload package: {relative}") from exc
274
- return resolved
275
-
276
-
277
- def runtime_path(local_path: Path, local_root: Path, runtime_root: Path) -> Path:
278
- return runtime_root / local_path.relative_to(local_root)
279
-
280
-
281
- def load_json(path: Path) -> dict:
282
- try:
283
- loaded = json.loads(path.read_text(encoding="utf-8"))
284
- except FileNotFoundError as exc:
285
- raise FileNotFoundError(f"missing JSON file: {path}") from exc
286
- if not isinstance(loaded, dict):
287
- raise ValueError(f"expected JSON object: {path}")
288
- return loaded
289
-
290
-
291
- def matrix_rows(path: Path, name: str) -> int:
292
- with path.open("rb") as inp:
293
- header = inp.read(8)
294
- if len(header) != 8:
295
- raise ValueError(f"missing {name} matrix header: {path}")
296
- rows, columns = struct.unpack("<II", header)
297
- if rows == 0 or columns == 0:
298
- raise ValueError(f"invalid {name} matrix header: {path}")
299
- return rows
300
-
301
-
302
- def read_u32(path: Path, offset: int, count: int) -> array:
303
- if sys.byteorder != "little":
304
- raise RuntimeError("u32 descriptors require a little-endian host")
305
- with path.open("rb") as inp:
306
- inp.seek(offset * 4)
307
- raw = inp.read(count * 4)
308
- if len(raw) != count * 4:
309
- raise ValueError(f"truncated u32 sequence file: {path}")
310
- values = array("I")
311
- values.frombytes(raw)
312
- return values
313
-
314
-
315
- def decode_sequence(descriptor: object, batch_path: Path, package_root: Path) -> array:
316
- if not isinstance(descriptor, dict):
317
- raise ValueError(f"expected sequence descriptor in {batch_path}")
318
- encoding = descriptor.get("encoding")
319
- count = int(descriptor.get("count", -1))
320
- if count < 0:
321
- raise ValueError(f"invalid sequence count in {batch_path}")
322
- if encoding == "range":
323
- begin = int(descriptor.get("begin", -1))
324
- if begin < 0 or begin > UINT32_SPACE or count > UINT32_SPACE - begin:
325
- raise ValueError(f"range sequence exceeds uint32 space in {batch_path}")
326
- return array("I", range(begin, begin + count))
327
- if encoding not in ("u32_slice", "u32_cyclic_slice"):
328
- raise ValueError(f"unsupported sequence encoding {encoding!r} in {batch_path}")
329
-
330
- sequence_path = checked_child(
331
- str(descriptor.get("path", "")),
332
- batch_path.parent,
333
- package_root,
334
- "sequence descriptor",
335
- )
336
- file_bytes = sequence_path.stat().st_size
337
- if file_bytes % 4:
338
- raise ValueError(f"unaligned u32 sequence file: {sequence_path}")
339
- file_items = file_bytes // 4
340
- offset = int(descriptor.get("offset_items", -1))
341
- if offset < 0:
342
- raise ValueError(f"invalid sequence offset in {batch_path}")
343
- if encoding == "u32_slice":
344
- if offset > file_items or count > file_items - offset:
345
- raise ValueError(f"u32_slice exceeds sequence file: {sequence_path}")
346
- return read_u32(sequence_path, offset, count)
347
-
348
- wrap = int(descriptor.get("wrap_at_items", 0))
349
- if wrap <= 0 or wrap > file_items:
350
- raise ValueError(f"invalid cyclic wrap in {batch_path}")
351
- values = array("I")
352
- cursor = offset % wrap
353
- remaining = count
354
- while remaining:
355
- chunk_count = min(remaining, wrap - cursor)
356
- values.extend(read_u32(sequence_path, cursor, chunk_count))
357
- remaining -= chunk_count
358
- cursor = 0
359
- return values
360
-
361
-
362
- def validate_unique(values: array, name: str) -> None:
363
- if len(set(values)) != len(values):
364
- raise ValueError(f"duplicate values in {name}")
365
-
366
-
367
- def resolve_batch(
368
- batch_path: Path, package_root: Path, trace_id: str, vector_count: int
369
- ) -> tuple[array, array, array, dict]:
370
- batch = load_json(batch_path)
371
- if batch.get("schema") != "batch-update-eval-batch.v1":
372
- raise ValueError(f"unsupported batch schema: {batch_path}")
373
- if batch.get("trace_id") != trace_id:
374
- raise ValueError(f"batch trace ID mismatch: {batch_path}")
375
- expected_index = int(batch_path.stem.removeprefix("batch_"))
376
- if int(batch.get("batch_index", -1)) != expected_index:
377
- raise ValueError(f"batch index mismatch: {batch_path}")
378
-
379
- insert_ids = None
380
- insert_refs = None
381
- delete_ids = None
382
- operations = batch.get("operations")
383
- if not isinstance(operations, list):
384
- raise ValueError(f"missing batch operations: {batch_path}")
385
- for operation in operations:
386
- if not isinstance(operation, dict):
387
- raise ValueError(f"invalid batch operation: {batch_path}")
388
- operation_type = operation.get("type")
389
- ids = decode_sequence(operation.get("external_ids"), batch_path, package_root)
390
- if len(ids) != int(operation.get("count", -1)):
391
- raise ValueError(f"operation count mismatch: {batch_path}")
392
- validate_unique(ids, f"{operation_type}.external_ids")
393
- if operation_type == "insert":
394
- if insert_ids is not None:
395
- raise ValueError(f"multiple insert operations: {batch_path}")
396
- refs = decode_sequence(operation.get("vector_refs"), batch_path, package_root)
397
- if len(refs) != len(ids):
398
- raise ValueError(f"insert ID/vector-ref count mismatch: {batch_path}")
399
- validate_unique(refs, "insert.vector_refs")
400
- if any(ref >= vector_count for ref in refs):
401
- raise ValueError(f"insert vector ref exceeds source count: {batch_path}")
402
- insert_ids, insert_refs = ids, refs
403
- elif operation_type == "delete":
404
- if delete_ids is not None:
405
- raise ValueError(f"multiple delete operations: {batch_path}")
406
- delete_ids = ids
407
- else:
408
- raise ValueError(f"unsupported operation type {operation_type!r}: {batch_path}")
409
- if insert_ids is None or insert_refs is None or delete_ids is None:
410
- raise ValueError(f"concurrent materialization requires insert and delete: {batch_path}")
411
- return insert_ids, insert_refs, delete_ids, batch
412
-
413
-
414
- def write_u32(path: Path, values: array) -> None:
415
- if sys.byteorder != "little":
416
- raise RuntimeError("u32 streams require a little-endian host")
417
- with path.open("xb") as out:
418
- values.tofile(out)
419
-
420
-
421
- def write_json(path: Path, value: dict) -> None:
422
- with path.open("x", encoding="utf-8") as out:
423
- json.dump(value, out, indent=2)
424
- out.write("\n")
425
-
426
-
427
- def resolve_package(args: argparse.Namespace) -> tuple[Path, dict, Path, dict]:
428
- root = require_path(args.batch_workload_root, "--batch-workload-root").resolve(
429
- strict=True
430
- )
431
- workload = load_json(root / "workload.json")
432
- if workload.get("schema") != "batch-update-eval-workload.v1":
433
- raise ValueError(f"unsupported workload schema: {root / 'workload.json'}")
434
- trace_entry = next(
435
- (
436
- item
437
- for item in workload.get("traces", [])
438
- if isinstance(item, dict) and item.get("id") == args.trace_id
439
- ),
440
- None,
441
- )
442
- if trace_entry is None:
443
- raise ValueError(f"unknown trace {args.trace_id!r}")
444
- batch_dir = checked_child(
445
- str(trace_entry.get("batches", "")), root, root, "trace batch directory"
446
- )
447
- trace = load_json(batch_dir.parent / "trace.json")
448
- if trace.get("schema") != "batch-update-eval-trace.v1":
449
- raise ValueError(f"unsupported trace schema: {batch_dir.parent / 'trace.json'}")
450
- if trace.get("trace_id") != args.trace_id:
451
- raise ValueError(f"trace ID mismatch: {batch_dir.parent / 'trace.json'}")
452
- last_batch = args.start_batch_index + args.window_count - 1
453
- if last_batch > int(trace.get("batch_count", 0)):
454
- raise ValueError("requested windows exceed trace batch_count")
455
- return root, workload, batch_dir, trace
456
-
457
-
458
- def pre_update_groundtruth(
459
- *,
460
- args: argparse.Namespace,
461
- root: Path,
462
- runtime_root: Path,
463
- initial_state: dict,
464
- batch_dir: Path,
465
- batch_index: int,
466
- ) -> tuple[Path, Path, int]:
467
- if batch_index == 1:
468
- if args.initial_groundtruth_path is not None:
469
- local = args.initial_groundtruth_path.resolve(strict=True)
470
- runtime = (
471
- args.runtime_initial_groundtruth_path
472
- or args.initial_groundtruth_path.resolve()
473
- )
474
- else:
475
- raw_groundtruth = initial_state.get("groundtruth")
476
- if not raw_groundtruth:
477
- raise ValueError(
478
- "trace needs --initial-groundtruth-path because its initial "
479
- "state has no local groundtruth path"
480
- )
481
- local = checked_child(
482
- str(raw_groundtruth), root, root, "initial ground truth"
483
- )
484
- runtime = runtime_path(local, root, runtime_root)
485
- live_count = int(initial_state.get("live_count", 0))
486
- else:
487
- previous_path = batch_dir / f"batch_{batch_index - 1:04d}.json"
488
- previous = load_json(previous_path)
489
- checkpoint = previous.get("checkpoint")
490
- if not isinstance(checkpoint, dict):
491
- raise ValueError(f"missing checkpoint: {previous_path}")
492
- local = checked_child(
493
- str(checkpoint.get("groundtruth", checkpoint.get("groundtruth_path", ""))),
494
- batch_dir.parent,
495
- root,
496
- "checkpoint ground truth",
497
- )
498
- runtime = runtime_path(local, root, runtime_root)
499
- live_count = int(checkpoint.get("live_count", checkpoint.get("active_count", 0)))
500
- if live_count <= 0 or live_count >= UINT32_SPACE:
501
- raise ValueError(f"invalid pre-update live count for batch {batch_index}")
502
- return local, Path(runtime), live_count
503
-
504
-
505
- def materialize(args: argparse.Namespace) -> Path:
506
- if args.uniform_skip_final_merge_delete and not args.uniform_e6:
507
- raise ValueError(
508
- "--uniform-skip-final-merge-delete requires --uniform-e6"
509
- )
510
- if args.uniform_e6:
511
- if any(
512
- value is not None
513
- for value in (
514
- args.search_threads,
515
- args.insert_threads,
516
- args.mark_delete_threads,
517
- args.merge_delete_threads,
518
- )
519
- ):
520
- raise ValueError(
521
- "--uniform-e6 cannot be combined with legacy per-class thread hints"
522
- )
523
- if args.uniform_merge_workers > args.uniform_data_workers:
524
- raise ValueError(
525
- "--uniform-merge-workers must not exceed --uniform-data-workers"
526
- )
527
- if args.overflow_policy != "wait_for_capacity":
528
- raise ValueError(
529
- "--uniform-e6 requires --overflow-policy=wait_for_capacity"
530
- )
531
- root, workload, batch_dir, trace = resolve_package(args)
532
- checkpoint_contract = workload.get("checkpoint_contract")
533
- if checkpoint_contract not in (None, "exact-update-counts.v1"):
534
- raise ValueError(f"unsupported checkpoint contract: {checkpoint_contract!r}")
535
- if checkpoint_contract and args.start_batch_index != 1:
536
- raise ValueError(
537
- "exact-update-counts.v1 requires --start-batch-index=1; "
538
- "later batches need a separately generated initial-state package"
539
- )
540
- output = require_path(args.output_dir, "--output-dir").resolve()
541
- try:
542
- output.relative_to(root)
543
- except ValueError:
544
- pass
545
- else:
546
- raise ValueError("--output-dir must not be inside --batch-workload-root")
547
- output.mkdir(parents=True, exist_ok=True)
548
- if any(output.iterdir()):
549
- raise ValueError(f"--output-dir must be empty: {output}")
550
-
551
- query = require_path(args.query_path, "--query-path").resolve(strict=True)
552
- runtime_output = (args.runtime_output_dir or output).resolve()
553
- runtime_root = (args.runtime_batch_workload_root or root).resolve()
554
- runtime_query = Path(args.runtime_query_path or query)
555
- query_rows = matrix_rows(query, "query")
556
-
557
- vector_source = workload.get("insert_vector_source")
558
- if not isinstance(vector_source, dict):
559
- raise ValueError("workload is missing insert_vector_source")
560
- vector_count = int(vector_source.get("row_count", workload.get("base_count", 0)))
561
- explicit_vector_root = getattr(args, "insert_vector_source_root", None)
562
- explicit_runtime_vector_root = getattr(args, "runtime_insert_vector_source_root", None)
563
- local_vector_root = (
564
- Path(explicit_vector_root).resolve(strict=True) if explicit_vector_root else root
565
- )
566
- runtime_vector_root = Path(explicit_runtime_vector_root or runtime_root).resolve()
567
- if explicit_vector_root and not explicit_runtime_vector_root:
568
- runtime_vector_root = local_vector_root
569
- if explicit_vector_root or explicit_runtime_vector_root:
570
- if vector_source.get("path") not in (
571
- "base_permuted.fbin", "base_permuted.u8bin", "base_permuted.i8bin"
572
- ):
573
- raise ValueError(
574
- "shared insert vector source must use the runtime filename "
575
- "base_permuted.fbin, base_permuted.u8bin, or base_permuted.i8bin"
576
- )
577
- local_vector_path = checked_child(
578
- str(vector_source.get("path", "")),
579
- local_vector_root,
580
- local_vector_root,
581
- "insert vector source",
582
- )
583
- runtime_vector_path = runtime_path(local_vector_path, local_vector_root, runtime_vector_root)
584
- initial_state_id = trace.get("initial_state")
585
- initial_state = workload.get("initial", {})
586
- if initial_state_id:
587
- initial_state = next(
588
- (
589
- value
590
- for value in workload.values()
591
- if isinstance(value, dict)
592
- and value.get("state_id") == initial_state_id
593
- ),
594
- {},
595
- )
596
- if not isinstance(initial_state, dict) or not initial_state:
597
- raise ValueError(f"missing initial-state metadata for trace {args.trace_id!r}")
598
-
599
- windows = []
600
- generated = []
601
- for window_offset in range(args.window_count):
602
- batch_index = args.start_batch_index + window_offset
603
- batch_path = batch_dir / f"batch_{batch_index:04d}.json"
604
- insert_ids, insert_refs, delete_ids, batch = resolve_batch(
605
- batch_path, root, args.trace_id, vector_count
606
- )
607
- source_insert_count = len(insert_ids)
608
- source_delete_count = len(delete_ids)
609
- if checkpoint_contract and (
610
- args.target_insert_count not in (None, source_insert_count)
611
- or args.target_mark_delete_count not in (None, source_delete_count)
612
- ):
613
- raise ValueError(
614
- "exact-update-counts.v1 forbids changing update counts while "
615
- "retaining checkpoint ground truth; generate a new workload"
616
- )
617
- insert_count = args.target_insert_count or len(insert_ids)
618
- delete_count = args.target_mark_delete_count or len(delete_ids)
619
- if insert_count > len(insert_ids) or delete_count > len(delete_ids):
620
- raise ValueError(f"target operation count exceeds source batch {batch_index}")
621
- insert_ids = insert_ids[:insert_count]
622
- insert_refs = insert_refs[:insert_count]
623
- delete_ids = delete_ids[:delete_count]
624
- ratio_units = 0
625
- if args.uniform_e6:
626
- if (
627
- insert_count == 0
628
- or insert_count % args.uniform_insert_ratio != 0
629
- or delete_count % args.uniform_mark_delete_ratio != 0
630
- or insert_count // args.uniform_insert_ratio
631
- != delete_count // args.uniform_mark_delete_ratio
632
- ):
633
- raise ValueError(
634
- "--uniform-e6 update counts must match the configured "
635
- "insert:mark-delete ratio"
636
- )
637
- ratio_units = insert_count // args.uniform_insert_ratio
638
- e6_target_queries = args.uniform_query_ratio * ratio_units
639
- if (
640
- args.uniform_e6
641
- and args.target_query_count is not None
642
- and args.target_query_count != e6_target_queries
643
- ):
644
- raise ValueError(
645
- "--uniform-e6 target_query_count does not match the configured ratio"
646
- )
647
- target_queries = (
648
- e6_target_queries
649
- if args.uniform_e6
650
- else (args.target_query_count or query_rows)
651
- )
652
- if not args.uniform_e6 and target_queries > query_rows:
653
- raise ValueError(
654
- "--target-query-count exceeds --query-path rows; use "
655
- "--uniform-e6 for cyclic canonical queries"
656
- )
657
-
658
- window_id = window_offset + 1
659
- insert_name = f"window_{window_id:04d}_insert_external_ids.u32"
660
- refs_name = f"window_{window_id:04d}_insert_vector_refs.u32"
661
- delete_name = f"window_{window_id:04d}_mark_delete_external_ids.u32"
662
- write_u32(output / insert_name, insert_ids)
663
- write_u32(output / refs_name, insert_refs)
664
- write_u32(output / delete_name, delete_ids)
665
-
666
- local_gt, runtime_gt, live_count = pre_update_groundtruth(
667
- args=args,
668
- root=root,
669
- runtime_root=runtime_root,
670
- initial_state=initial_state,
671
- batch_dir=batch_dir,
672
- batch_index=batch_index,
673
- )
674
- post_update_runtime_gt = None
675
- checkpoint = batch.get("checkpoint")
676
- if isinstance(checkpoint, dict):
677
- checkpoint_path = checkpoint.get(
678
- "groundtruth", checkpoint.get("groundtruth_path", "")
679
- )
680
- if checkpoint_path:
681
- post_update_local_gt = checked_child(
682
- str(checkpoint_path),
683
- batch_dir.parent,
684
- root,
685
- "post-update checkpoint ground truth",
686
- )
687
- post_update_runtime_gt = runtime_path(
688
- post_update_local_gt, root, runtime_root
689
- )
690
- if (
691
- args.uniform_e6
692
- and matrix_rows(post_update_local_gt, "ground-truth")
693
- != query_rows
694
- ):
695
- raise ValueError(
696
- "--uniform-e6 requires query and post-update checkpoint "
697
- "ground-truth row counts to match"
698
- )
699
- if args.uniform_e6 and post_update_runtime_gt is None:
700
- raise ValueError(
701
- "--uniform-e6 requires post-update checkpoint ground truth"
702
- )
703
- if not args.uniform_e6 and target_queries > matrix_rows(
704
- local_gt, "ground-truth"
705
- ):
706
- raise ValueError(
707
- f"target query count exceeds pre-update ground-truth rows: {local_gt}"
708
- )
709
- if args.uniform_e6 and matrix_rows(local_gt, "ground-truth") != query_rows:
710
- raise ValueError(
711
- "--uniform-e6 requires query and checkpoint ground-truth row "
712
- f"counts to match: query={query_rows} groundtruth={local_gt}"
713
- )
714
- query_rate = args.query_rate_qps or target_queries / args.duration_seconds
715
- insert_rate = args.insert_rate_ops or insert_count / args.duration_seconds
716
- delete_rate = (
717
- args.mark_delete_rate_ops or delete_count / args.duration_seconds
718
- )
719
- legacy_thread_hints = {
720
- "search": args.search_threads or 26,
721
- "insert": args.insert_threads or 4,
722
- "mark_delete": args.mark_delete_threads or 1,
723
- "merge_delete": args.merge_delete_threads or 0,
724
- }
725
- skip_merge_delete = (
726
- args.uniform_e6
727
- and args.uniform_skip_final_merge_delete
728
- and window_offset + 1 == args.window_count
729
- )
730
- merge_delete_mode = "disabled"
731
- merge_delete_schedule: list[dict] = []
732
- merge_delete_trigger = None
733
- if args.uniform_e6:
734
- legacy_thread_hints = {
735
- "search": 1,
736
- "insert": 1,
737
- "mark_delete": 1,
738
- "merge_delete": 1,
739
- }
740
- if not skip_merge_delete:
741
- merge_delete_mode = "concurrent"
742
- merge_delete_trigger = {
743
- "kind": "acknowledged_tombstone_fraction",
744
- "threshold": args.acknowledged_tombstone_fraction,
745
- "semantics": (
746
- "successful_all_cn_acks_since_previous_frozen_epoch"
747
- ),
748
- "reference_node_count": vector_count,
749
- }
750
-
751
- windows.append(
752
- {
753
- "window_id": window_id,
754
- "query_path": str(runtime_query),
755
- "pre_update_checkpoint_groundtruth_path": str(runtime_gt),
756
- "insert_ids_path": str(runtime_output / insert_name),
757
- "insert_vector_refs_path": str(runtime_output / refs_name),
758
- "mark_delete_ids_path": str(runtime_output / delete_name),
759
- "target_query_count": target_queries,
760
- "target_insert_count": insert_count,
761
- "target_mark_delete_count": delete_count,
762
- "duration_seconds": args.duration_seconds,
763
- "query_rate_qps": query_rate,
764
- "insert_rate_ops": insert_rate,
765
- "mark_delete_rate_ops": delete_rate,
766
- "search_arrival": {
767
- "mode": "fixed-rate",
768
- "low_watermark": 0,
769
- "high_watermark": 0,
770
- "poll_interval_us": 100,
771
- },
772
- "insert_arrival": {
773
- "mode": "fixed-rate",
774
- "low_watermark": 0,
775
- "high_watermark": 0,
776
- "poll_interval_us": 100,
777
- },
778
- "mark_delete_arrival": {
779
- "mode": "fixed-rate",
780
- "low_watermark": 0,
781
- "high_watermark": 0,
782
- "poll_interval_us": 100,
783
- },
784
- "warmup_seconds": args.warmup_seconds,
785
- "stop_policy": "drain_after_duration",
786
- "allocation_scope": "uniform_all_cns",
787
- "search_threads": legacy_thread_hints["search"],
788
- "insert_threads": legacy_thread_hints["insert"],
789
- "mark_delete_threads": legacy_thread_hints["mark_delete"],
790
- "merge_delete_threads": legacy_thread_hints["merge_delete"],
791
- "merge_delete_mode": merge_delete_mode,
792
- "merge_delete_schedule": merge_delete_schedule,
793
- "max_queue_depth": {
794
- "search": args.search_max_queue_depth,
795
- "insert": args.insert_max_queue_depth,
796
- "mark_delete": args.mark_delete_max_queue_depth,
797
- "merge_delete_repair": (
798
- args.merge_delete_max_queue_depth if args.uniform_e6 else 1
799
- ),
800
- "merge_delete_gc": (
801
- args.merge_delete_max_queue_depth if args.uniform_e6 else 1
802
- ),
803
- },
804
- "max_inflight": {
805
- "search": args.search_max_inflight,
806
- "insert": args.insert_max_inflight,
807
- "mark_delete": args.mark_delete_max_inflight,
808
- "merge_delete_repair": (
809
- args.merge_delete_max_inflight if args.uniform_e6 else 1
810
- ),
811
- "merge_delete_gc": (
812
- args.merge_delete_max_inflight if args.uniform_e6 else 1
813
- ),
814
- },
815
- "overflow_policy": args.overflow_policy,
816
- "source": {
817
- "kind": "converted_batch",
818
- "batch_workload_root": str(runtime_vector_root),
819
- "batch_index": batch_index,
820
- "batch_json_path": str(
821
- runtime_path(batch_path, root, runtime_root)
822
- ),
823
- "query_path": str(runtime_query),
824
- "pre_update_checkpoint_groundtruth_path": str(runtime_gt),
825
- "insert_count": source_insert_count,
826
- "delete_count": source_delete_count,
827
- "active_begin": 0,
828
- "active_end_exclusive": live_count,
829
- "active_count": live_count,
830
- },
831
- }
832
- )
833
- if checkpoint_contract:
834
- windows[-1]["checkpoint_update_counts"] = {
835
- "insert": source_insert_count,
836
- "mark_delete": source_delete_count,
837
- }
838
- if args.uniform_e6:
839
- windows[-1]["query_repetition"] = "cyclic"
840
- if merge_delete_trigger is not None:
841
- windows[-1]["merge_delete_trigger"] = merge_delete_trigger
842
- if post_update_runtime_gt is not None and (
843
- not args.uniform_e6 or window_offset + 1 == args.window_count
844
- ):
845
- windows[-1]["post_update_checkpoint_groundtruth_path"] = str(
846
- post_update_runtime_gt
847
- )
848
- generated.append(
849
- {
850
- "window_id": window_id,
851
- "batch_index": batch_index,
852
- "source_batch_json": str(batch_path),
853
- "insert_external_ids": insert_name,
854
- "insert_vector_refs": refs_name,
855
- "mark_delete_external_ids": delete_name,
856
- "insert_count": insert_count,
857
- "mark_delete_count": delete_count,
858
- "checkpoint": batch.get("checkpoint"),
859
- }
860
- )
861
-
862
- manifest = {
863
- "version": 1,
864
- "workload_id": args.workload_id,
865
- "workload_mode": "continuous_uniform" if args.uniform_e6 else args.workload_mode,
866
- "window_lifecycle": (
867
- "continuous_logical_windows"
868
- if args.uniform_e6
869
- else "one_active_window"
870
- ),
871
- "windows": windows,
872
- }
873
- metadata = {
874
- "schema": "concurrent-batch-materialization.v1",
875
- "source_snapshot": args.source_snapshot or None,
876
- "source_workload_root": str(root),
877
- "runtime_batch_workload_root": str(runtime_root),
878
- "trace_id": args.trace_id,
879
- "insert_vector_source": {
880
- "local_root": str(local_vector_root),
881
- "runtime_root": str(runtime_vector_root),
882
- "local_path": str(local_vector_path),
883
- "runtime_path": str(runtime_vector_path),
884
- "row_count": vector_count,
885
- "copied": False,
886
- },
887
- "query": {
888
- "local_path": str(query),
889
- "runtime_path": str(runtime_query),
890
- "copied": False,
891
- },
892
- "generated": generated,
893
- }
894
- if checkpoint_contract:
895
- manifest["checkpoint_contract"] = checkpoint_contract
896
- metadata["checkpoint_contract"] = checkpoint_contract
897
- if args.uniform_e6:
898
- metadata["runtime_contract"] = {
899
- "task_runtime": "uniform",
900
- "execution_model": "continuous_total_admission",
901
- "legacy_thread_fields": "schema_validation_only",
902
- "query_repetition": "cyclic",
903
- "merge_trigger": "successful_all_cn_delete_ack_threshold",
904
- "repair_partition": "striped_by_sorted_tombstone_index",
905
- "final_window_merge_delete": (
906
- "disabled"
907
- if args.uniform_skip_final_merge_delete
908
- else "trigger_enabled"
909
- ),
910
- "uniform_profile": {
911
- "total_threads": args.uniform_data_workers + 1,
912
- "control_workers": 1,
913
- "data_workers": args.uniform_data_workers,
914
- "merge_workers": args.uniform_merge_workers,
915
- "admission_ratio": {
916
- "query": args.uniform_query_ratio,
917
- "insert": args.uniform_insert_ratio,
918
- "mark_delete": args.uniform_mark_delete_ratio,
919
- },
920
- "ratio_window_multiplier": args.uniform_ratio_window_multiplier,
921
- "ratio_window_scope": "per_cn",
922
- "logical_windows": "input_and_progress_only",
923
- "merge_trigger": "successful_all_cn_delete_ack_threshold",
924
- "repair_partition": "striped_by_sorted_tombstone_index",
925
- },
926
- "final_safepoint": "query_insert_quiescence_recorded",
927
- }
928
- write_json(output / "metadata.json", metadata)
929
- manifest_path = output / "manifest.json"
930
- write_json(manifest_path, manifest)
931
- return manifest_path
932
-
933
-
934
- def write_matrix_header(path: Path, rows: int, columns: int) -> None:
935
- path.parent.mkdir(parents=True, exist_ok=True)
936
- path.write_bytes(struct.pack("<II", rows, columns))
937
-
938
-
939
- def write_test_batch(
940
- path: Path,
941
- index: int,
942
- operations: list[dict],
943
- *,
944
- include_checkpoint: bool = True,
945
- ) -> None:
946
- path.parent.mkdir(parents=True, exist_ok=True)
947
- payload = {
948
- "schema": "batch-update-eval-batch.v1",
949
- "trace_id": "mixed",
950
- "batch_index": index,
951
- "operations": operations,
952
- }
953
- if include_checkpoint:
954
- payload["checkpoint"] = {
955
- "index": index,
956
- "groundtruth": f"groundtruth/checkpoint_{index:04d}.bin",
957
- "live_count": 8,
958
- }
959
- write_json(path, payload)
960
-
961
-
962
- def run_self_test() -> None:
963
- with tempfile.TemporaryDirectory(prefix="vectordb_concurrent_batch_") as tmp:
964
- temp_root = Path(tmp)
965
- root = temp_root / "package"
966
- output = temp_root / "output"
967
- trace_root = root / "traces/mixed"
968
- batch_dir = trace_root / "batches"
969
- batch_dir.mkdir(parents=True)
970
- write_json(
971
- root / "workload.json",
972
- {
973
- "schema": "batch-update-eval-workload.v1",
974
- "base_count": 8,
975
- "initial_count": 8,
976
- "initial": {
977
- "state_id": "initial-8",
978
- "groundtruth": "groundtruth/initial.bin",
979
- "live_count": 8,
980
- },
981
- "insert_vector_source": {
982
- "path": "base_permuted.fbin",
983
- "row_count": 8,
984
- },
985
- "traces": [
986
- {
987
- "id": "mixed",
988
- "batches": "traces/mixed/batches",
989
- "batch_count": 6,
990
- }
991
- ],
992
- },
993
- )
994
- write_json(
995
- trace_root / "trace.json",
996
- {
997
- "schema": "batch-update-eval-trace.v1",
998
- "trace_id": "mixed",
999
- "batch_count": 6,
1000
- },
1001
- )
1002
- write_matrix_header(root / "groundtruth/initial.bin", 4, 10)
1003
- for checkpoint_index in range(1, 7):
1004
- write_matrix_header(
1005
- trace_root
1006
- / f"groundtruth/checkpoint_{checkpoint_index:04d}.bin",
1007
- 4,
1008
- 10,
1009
- )
1010
- write_matrix_header(root / "query.fbin", 4, 2)
1011
- write_matrix_header(root / "base_permuted.fbin", 8, 2)
1012
- order = array("I", [7, 2, 6, 1, 5, 0, 4, 3])
1013
- write_u32(root / "update_order.u32", order)
1014
- write_test_batch(
1015
- batch_dir / "batch_0001.json",
1016
- 1,
1017
- [
1018
- {
1019
- "type": "delete",
1020
- "count": 2,
1021
- "external_ids": {
1022
- "encoding": "u32_cyclic_slice",
1023
- "path": "../../../update_order.u32",
1024
- "offset_items": 7,
1025
- "count": 2,
1026
- "wrap_at_items": 8,
1027
- },
1028
- },
1029
- {
1030
- "type": "insert",
1031
- "count": 2,
1032
- "external_ids": {
1033
- "encoding": "u32_slice",
1034
- "path": "../../../update_order.u32",
1035
- "offset_items": 2,
1036
- "count": 2,
1037
- },
1038
- "vector_refs": {
1039
- "encoding": "range",
1040
- "begin": 4,
1041
- "count": 2,
1042
- },
1043
- },
1044
- ],
1045
- )
1046
- for batch_index in range(2, 7):
1047
- write_test_batch(
1048
- batch_dir / f"batch_{batch_index:04d}.json",
1049
- batch_index,
1050
- load_json(batch_dir / "batch_0001.json")["operations"],
1051
- )
1052
- args = argparse.Namespace(
1053
- batch_workload_root=root,
1054
- trace_id="mixed",
1055
- output_dir=output,
1056
- query_path=root / "query.fbin",
1057
- initial_groundtruth_path=None,
1058
- runtime_output_dir=Path("/runtime/output"),
1059
- runtime_batch_workload_root=Path("/runtime/package"),
1060
- runtime_query_path=Path("/runtime/query.fbin"),
1061
- runtime_initial_groundtruth_path=None,
1062
- start_batch_index=1,
1063
- window_count=1,
1064
- target_query_count=4,
1065
- target_insert_count=None,
1066
- target_mark_delete_count=None,
1067
- duration_seconds=2.0,
1068
- warmup_seconds=0.0,
1069
- query_rate_qps=0.0,
1070
- insert_rate_ops=0.0,
1071
- mark_delete_rate_ops=0.0,
1072
- search_threads=26,
1073
- insert_threads=4,
1074
- mark_delete_threads=1,
1075
- merge_delete_threads=8,
1076
- search_max_queue_depth=100,
1077
- insert_max_queue_depth=20,
1078
- mark_delete_max_queue_depth=20,
1079
- merge_delete_max_queue_depth=10,
1080
- search_max_inflight=100,
1081
- insert_max_inflight=20,
1082
- mark_delete_max_inflight=20,
1083
- merge_delete_max_inflight=10,
1084
- overflow_policy="wait_for_capacity",
1085
- workload_id="self-test",
1086
- uniform_e6=False,
1087
- uniform_skip_final_merge_delete=False,
1088
- uniform_data_workers=7,
1089
- uniform_merge_workers=2,
1090
- uniform_query_ratio=18,
1091
- uniform_insert_ratio=1,
1092
- uniform_mark_delete_ratio=1,
1093
- uniform_ratio_window_multiplier=20,
1094
- acknowledged_tombstone_fraction=0.05,
1095
- workload_mode="smoke",
1096
- source_snapshot="test-snapshot",
1097
- self_test=False,
1098
- )
1099
- manifest_path = materialize(args)
1100
- manifest = load_json(manifest_path)
1101
- metadata = load_json(output / "metadata.json")
1102
- window = manifest["windows"][0]
1103
- if list(read_u32(output / "window_0001_insert_external_ids.u32", 0, 2)) != [6, 1]:
1104
- raise AssertionError("u32_slice external IDs were not materialized")
1105
- if list(read_u32(output / "window_0001_insert_vector_refs.u32", 0, 2)) != [4, 5]:
1106
- raise AssertionError("range vector refs were not materialized")
1107
- if list(read_u32(output / "window_0001_mark_delete_external_ids.u32", 0, 2)) != [3, 7]:
1108
- raise AssertionError("cyclic delete IDs were not materialized")
1109
- expected_refs_path = "/runtime/output/window_0001_insert_vector_refs.u32"
1110
- if window["insert_vector_refs_path"] != expected_refs_path:
1111
- raise AssertionError("runtime vector-ref path was not emitted")
1112
- if "query_repetition" in window or window["merge_delete_mode"] != "disabled":
1113
- raise AssertionError("legacy output should remain single-pass and repair-free")
1114
- if window["merge_delete_threads"] != 8:
1115
- raise AssertionError("legacy MergeDelete thread hint was not preserved")
1116
- if metadata["insert_vector_source"]["copied"] is not False:
1117
- raise AssertionError("vector source should only be referenced")
1118
- if (output / "base_permuted.fbin").exists():
1119
- raise AssertionError("materializer copied the vector source")
1120
-
1121
- e6_output = temp_root / "e6-output"
1122
- e6_args = argparse.Namespace(
1123
- **{
1124
- **vars(args),
1125
- "output_dir": e6_output,
1126
- "window_count": 6,
1127
- "target_query_count": None,
1128
- "uniform_e6": True,
1129
- "uniform_skip_final_merge_delete": True,
1130
- "search_threads": None,
1131
- "insert_threads": None,
1132
- "mark_delete_threads": None,
1133
- "merge_delete_threads": None,
1134
- "uniform_data_workers": 7,
1135
- "uniform_merge_workers": 2,
1136
- "uniform_query_ratio": 3,
1137
- "uniform_ratio_window_multiplier": 20,
1138
- }
1139
- )
1140
- e6_manifest = load_json(materialize(e6_args))
1141
- e6_metadata = load_json(e6_output / "metadata.json")
1142
- e6_window = e6_manifest["windows"][0]
1143
- e6_final_window = e6_manifest["windows"][-1]
1144
- if (
1145
- e6_manifest["workload_mode"] != "continuous_uniform"
1146
- or e6_manifest["window_lifecycle"]
1147
- != "continuous_logical_windows"
1148
- or e6_window["target_query_count"] != 6
1149
- or e6_window["target_insert_count"] != 2
1150
- or e6_window["target_mark_delete_count"] != 2
1151
- or e6_window["query_repetition"] != "cyclic"
1152
- or e6_window["merge_delete_mode"] != "concurrent"
1153
- or e6_window["merge_delete_schedule"]
1154
- ):
1155
- raise AssertionError("uniform E6 counts and modes were not emitted")
1156
- if e6_window["merge_delete_trigger"] != {
1157
- "kind": "acknowledged_tombstone_fraction",
1158
- "threshold": 0.05,
1159
- "semantics": "successful_all_cn_acks_since_previous_frozen_epoch",
1160
- "reference_node_count": 8,
1161
- }:
1162
- raise AssertionError("uniform E6 ACK trigger was not emitted")
1163
- if any(
1164
- "post_update_checkpoint_groundtruth_path" in window
1165
- for window in e6_manifest["windows"][:-1]
1166
- ):
1167
- raise AssertionError(
1168
- "uniform E6 must not drain for a checkpoint before window 6"
1169
- )
1170
- if e6_final_window["post_update_checkpoint_groundtruth_path"] != (
1171
- "/runtime/package/traces/mixed/groundtruth/checkpoint_0006.bin"
1172
- ):
1173
- raise AssertionError(
1174
- "uniform E6 final post-update checkpoint was not emitted"
1175
- )
1176
- if (
1177
- e6_final_window["merge_delete_mode"] != "disabled"
1178
- or "merge_delete_trigger" in e6_final_window
1179
- or any(
1180
- window["merge_delete_mode"] != "concurrent"
1181
- or "merge_delete_trigger" not in window
1182
- for window in e6_manifest["windows"][:-1]
1183
- )
1184
- ):
1185
- raise AssertionError(
1186
- "uniform E6 final-no-merge policy was not emitted"
1187
- )
1188
- if [
1189
- e6_window["search_threads"],
1190
- e6_window["insert_threads"],
1191
- e6_window["mark_delete_threads"],
1192
- e6_window["merge_delete_threads"],
1193
- ] != [1, 1, 1, 1]:
1194
- raise AssertionError("uniform E6 compatibility thread hints are invalid")
1195
- if e6_metadata["runtime_contract"] != {
1196
- "task_runtime": "uniform",
1197
- "execution_model": "continuous_total_admission",
1198
- "legacy_thread_fields": "schema_validation_only",
1199
- "query_repetition": "cyclic",
1200
- "merge_trigger": "successful_all_cn_delete_ack_threshold",
1201
- "repair_partition": "striped_by_sorted_tombstone_index",
1202
- "final_window_merge_delete": "disabled",
1203
- "uniform_profile": {
1204
- "total_threads": 8,
1205
- "control_workers": 1,
1206
- "data_workers": 7,
1207
- "merge_workers": 2,
1208
- "admission_ratio": {
1209
- "query": 3,
1210
- "insert": 1,
1211
- "mark_delete": 1,
1212
- },
1213
- "ratio_window_multiplier": 20,
1214
- "ratio_window_scope": "per_cn",
1215
- "logical_windows": "input_and_progress_only",
1216
- "merge_trigger": "successful_all_cn_delete_ack_threshold",
1217
- "repair_partition": "striped_by_sorted_tombstone_index",
1218
- },
1219
- "final_safepoint": "query_insert_quiescence_recorded",
1220
- }:
1221
- raise AssertionError("uniform E6 runtime contract is ambiguous")
1222
-
1223
- missing_gt_output = temp_root / "missing-gt-output"
1224
- (trace_root / "groundtruth/checkpoint_0002.bin").rename(
1225
- temp_root / "checkpoint_0002.missing"
1226
- )
1227
- missing_gt_args = argparse.Namespace(
1228
- **{
1229
- **vars(e6_args),
1230
- "output_dir": missing_gt_output,
1231
- "start_batch_index": 2,
1232
- "window_count": 1,
1233
- }
1234
- )
1235
- try:
1236
- materialize(missing_gt_args)
1237
- except (FileNotFoundError, ValueError) as exc:
1238
- if "post-update checkpoint ground truth" not in str(exc):
1239
- raise
1240
- else:
1241
- raise AssertionError(
1242
- "uniform E6 should require post-update checkpoint ground truth"
1243
- )
1244
-
1245
- mismatched_output = temp_root / "mismatched-output"
1246
- mismatched_args = argparse.Namespace(
1247
- **{
1248
- **vars(e6_args),
1249
- "output_dir": mismatched_output,
1250
- "target_mark_delete_count": 1,
1251
- }
1252
- )
1253
- try:
1254
- materialize(mismatched_args)
1255
- except ValueError as exc:
1256
- if "configured insert:mark-delete ratio" not in str(exc):
1257
- raise
1258
- else:
1259
- raise AssertionError("uniform E6 should reject unpaired mixed counts")
1260
-
1261
- legacy_hint_output = temp_root / "legacy-hint-output"
1262
- legacy_hint_args = argparse.Namespace(
1263
- **{
1264
- **vars(e6_args),
1265
- "output_dir": legacy_hint_output,
1266
- "search_threads": 1,
1267
- }
1268
- )
1269
- try:
1270
- materialize(legacy_hint_args)
1271
- except ValueError as exc:
1272
- if "legacy per-class thread hints" not in str(exc):
1273
- raise
1274
- else:
1275
- raise AssertionError("uniform E6 should reject legacy thread hints")
1276
-
1277
- escaped = temp_root / "outside.u32"
1278
- write_u32(escaped, array("I", [1]))
1279
- try:
1280
- decode_sequence(
1281
- {
1282
- "encoding": "u32_slice",
1283
- "path": "../../../../outside.u32",
1284
- "offset_items": 0,
1285
- "count": 1,
1286
- },
1287
- batch_dir / "batch_0001.json",
1288
- root.resolve(),
1289
- )
1290
- except ValueError as exc:
1291
- if "escapes workload package" not in str(exc):
1292
- raise
1293
- else:
1294
- raise AssertionError("descriptor path escape should fail")
1295
-
1296
- shared_root = temp_root / "shared-vectors"
1297
- shared_root.mkdir()
1298
- (root / "base_permuted.fbin").rename(shared_root / "base_permuted.fbin")
1299
- exact_workload = load_json(root / "workload.json")
1300
- exact_workload["checkpoint_contract"] = "exact-update-counts.v1"
1301
- (root / "workload.json").write_text(json.dumps(exact_workload), encoding="utf-8")
1302
- write_u32(root / "selected_refs.u32", array("I", [7, 4]))
1303
- exact_batch = load_json(batch_dir / "batch_0001.json")
1304
- exact_batch["operations"][1]["vector_refs"] = {
1305
- "encoding": "u32_slice",
1306
- "path": "../../../selected_refs.u32",
1307
- "offset_items": 0,
1308
- "count": 2,
1309
- }
1310
- (batch_dir / "batch_0001.json").write_text(json.dumps(exact_batch), encoding="utf-8")
1311
- exact_args = argparse.Namespace(
1312
- **{
1313
- **vars(e6_args),
1314
- "output_dir": temp_root / "shared-output",
1315
- "window_count": 1,
1316
- "uniform_skip_final_merge_delete": False,
1317
- "insert_vector_source_root": shared_root,
1318
- "runtime_insert_vector_source_root": Path("/runtime/shared-vectors"),
1319
- "target_insert_count": 2,
1320
- "target_mark_delete_count": 2,
1321
- }
1322
- )
1323
- exact_manifest = load_json(materialize(exact_args))
1324
- exact_window = exact_manifest["windows"][0]
1325
- if exact_manifest.get("checkpoint_contract") != "exact-update-counts.v1":
1326
- raise AssertionError("checkpoint count contract was not preserved")
1327
- if exact_window["checkpoint_update_counts"] != {"insert": 2, "mark_delete": 2}:
1328
- raise AssertionError("checkpoint update counts were not bound")
1329
- if list(read_u32(exact_args.output_dir / "window_0001_insert_vector_refs.u32", 0, 2)) != [7, 4]:
1330
- raise AssertionError("arbitrary selected vector refs were not preserved")
1331
- if exact_window["source"]["batch_workload_root"] != "/runtime/shared-vectors":
1332
- raise AssertionError("runtime did not receive the shared vector root")
1333
- if exact_window["source"]["batch_json_path"] != (
1334
- "/runtime/package/traces/mixed/batches/batch_0001.json"
1335
- ):
1336
- raise AssertionError("shared vectors changed the workload artifact root")
1337
- exact_metadata = load_json(exact_args.output_dir / "metadata.json")
1338
- if exact_metadata["insert_vector_source"]["runtime_path"] != (
1339
- "/runtime/shared-vectors/base_permuted.fbin"
1340
- ):
1341
- raise AssertionError("shared vector metadata does not match runtime source")
1342
- if (exact_args.output_dir / "base_permuted.fbin").exists():
1343
- raise AssertionError("shared vector source was copied")
1344
-
1345
- for field, value, message in (
1346
- ("target_insert_count", 1, "forbids changing update counts"),
1347
- ("target_mark_delete_count", 1, "forbids changing update counts"),
1348
- ("start_batch_index", 2, "requires --start-batch-index=1"),
1349
- ):
1350
- rejected_args = argparse.Namespace(
1351
- **{**vars(exact_args), field: value, "output_dir": temp_root / field}
1352
- )
1353
- try:
1354
- materialize(rejected_args)
1355
- except ValueError as exc:
1356
- if message not in str(exc):
1357
- raise
1358
- else:
1359
- raise AssertionError(f"exact checkpoint accepted invalid {field}")
1360
-
1361
- linked_root = temp_root / "escaped-vectors"
1362
- linked_root.mkdir()
1363
- (linked_root / "base_permuted.fbin").symlink_to(shared_root / "base_permuted.fbin")
1364
- escaped_args = argparse.Namespace(
1365
- **{
1366
- **vars(exact_args),
1367
- "insert_vector_source_root": linked_root,
1368
- "output_dir": temp_root / "escaped-vector-output",
1369
- }
1370
- )
1371
- try:
1372
- materialize(escaped_args)
1373
- except ValueError as exc:
1374
- if "escapes workload package" not in str(exc):
1375
- raise
1376
- else:
1377
- raise AssertionError("shared vector source escaped its explicit root")
1378
- print("self-test: OK")
1379
-
1380
-
1381
- def main() -> int:
1382
- args = parse_args()
1383
- if args.self_test:
1384
- run_self_test()
1385
- return 0
1386
- manifest_path = materialize(args)
1387
- print(manifest_path)
1388
- return 0
1389
-
1390
-
1391
- if __name__ == "__main__":
1392
- raise SystemExit(main())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/tools/evaluation_runners/configs/deep100.json DELETED
@@ -1,123 +0,0 @@
1
- {
2
- "schema_version": 1,
3
- "dataset_id": "deep100",
4
- "dataset_label": "DEEP-100M",
5
- "path_variables": {
6
- "data_root": "/data/vectordb-cxl/data",
7
- "dataset_prefix": "deep-100m"
8
- },
9
- "source_snapshot": "",
10
- "dtype": "float32",
11
- "distance": "l2",
12
- "dimension": 96,
13
- "k": 10,
14
- "topology": {
15
- "compute_nodes": ["node-0", "node-1", "node-2", "node-3", "node-4"],
16
- "storage_nodes": ["node-5", "node-6", "node-7"],
17
- "num_cns": 5,
18
- "num_mns": 3,
19
- "workers_per_cn": 31,
20
- "memory_bytes_per_mn": 42949672960,
21
- "storage_max_node_capacity": 100000000,
22
- "hash_directory_load_factor": 0.5,
23
- "cache_capacity_bytes_per_cn": 20000000000
24
- },
25
- "query": {
26
- "path": "{data_root}/{dataset_prefix}-static-search-eval/orig_query_10k.fbin",
27
- "source_count": 10000,
28
- "logical_count": 500000,
29
- "checkpoint_count": 10000,
30
- "ef_search": 100,
31
- "ef_sweep": [75, 120, 150, 225, 300, 500, 800],
32
- "worker_sweep": [1, 4, 8, 16, 24, 31],
33
- "cn_sweep": [1, 3, 5]
34
- },
35
- "pq": {
36
- "meta": "{data_root}/{dataset_prefix}-static-search-eval/pq_m48.pqmeta",
37
- "codebook": "{data_root}/{dataset_prefix}-static-search-eval/pq_m48.pqcodebook"
38
- },
39
- "static_snapshot": {
40
- "index": "{data_root}/{dataset_prefix}-static-search-eval/index_m_32_ef_500",
41
- "groundtruth": "{data_root}/{dataset_prefix}-static-search-eval/groundtruth.bin",
42
- "pq_codes": "{data_root}/{dataset_prefix}-static-search-eval/pq_m48.pqcodes",
43
- "sidecar": "{data_root}/{dataset_prefix}-static-search-eval/layout-sidecar/index_m_32_ef_500.layout.json"
44
- },
45
- "initial_snapshot": {
46
- "index": "{data_root}/{dataset_prefix}-batch-update-eval/initial/index_80m_m32_efc500",
47
- "groundtruth": "{data_root}/{dataset_prefix}-batch-update-eval/groundtruth/active_80m.bin",
48
- "pq_codes": "{data_root}/{dataset_prefix}-batch-update-eval/initial/pq/pq_m48.pqcodes",
49
- "sidecar": "{data_root}/{dataset_prefix}-batch-update-eval/initial/layout-sidecar/index_80m_m32_efc500.layout.json"
50
- },
51
- "batch": {
52
- "root": "{data_root}/{dataset_prefix}-batch-update-eval",
53
- "insert_vector_path": "{data_root}/{dataset_prefix}-batch-update-eval/base_permuted.fbin",
54
- "insert_trace": "insert-20",
55
- "delete_trace": "delete-20",
56
- "replacement_trace": "mixed-replace-100",
57
- "start_index": 1,
58
- "batch_count": 1,
59
- "e6_window_count": 4,
60
- "e6_source_segments_per_window": 3,
61
- "e6_source_segment_update_count": 1000000,
62
- "e6_skip_final_merge_delete": true,
63
- "e8_batch_count": 50,
64
- "e8_merge_every_batches": 5
65
- },
66
- "runtime": {
67
- "runtime_id_mode": "internal-array",
68
- "record_concurrency_control": "relaxed-snapshot",
69
- "coroutines_per_thread": 1,
70
- "reranking_factor": 20,
71
- "rerank_parallelism": 1,
72
- "l0_beam_width": 1,
73
- "l0_pipe_width": 32,
74
- "l0_pipe_initial_width": 4,
75
- "l0_pipe_max_waste_ratio": 0.1,
76
- "query_idle_timeout_seconds": 1800,
77
- "update_idle_timeout_seconds": 21600
78
- },
79
- "repair": {
80
- "algorithm": "ipdiskann-alg5",
81
- "driver": "tombstone-driven",
82
- "prune_mode": "ipdiskann-pq",
83
- "alpha": 1.2,
84
- "l": 128,
85
- "search_k": 75,
86
- "c": 3,
87
- "per_deleted_expansion": 3,
88
- "pq_window_l0": 64,
89
- "pq_window_upper": 32,
90
- "chunk_buckets": 64
91
- },
92
- "uniform": {
93
- "execution_model": "continuous_total_admission",
94
- "merge_trigger": "successful_all_cn_delete_ack_threshold",
95
- "repair_partition": "striped_by_sorted_tombstone_index",
96
- "final_safepoint": "query_insert_quiescence_recorded",
97
- "merge_workers": 8,
98
- "query_ratio": 36,
99
- "insert_ratio": 1,
100
- "mark_delete_ratio": 1,
101
- "ratio_window_multiplier": 20,
102
- "acknowledged_tombstone_fraction": 0.03,
103
- "search_queue_depth": 10000,
104
- "insert_queue_depth": 5000,
105
- "mark_delete_queue_depth": 5000,
106
- "merge_delete_queue_depth": 1000,
107
- "search_max_inflight": 10000,
108
- "insert_max_inflight": 5000,
109
- "mark_delete_max_inflight": 5000,
110
- "merge_delete_max_inflight": 1000
111
- },
112
- "repetitions": {
113
- "E1": 3,
114
- "E2": 3,
115
- "E3": 3,
116
- "E4": 3,
117
- "E5": 3,
118
- "E6": 3,
119
- "E7": 3,
120
- "E8": 1,
121
- "E9": 1
122
- }
123
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/tools/evaluation_runners/e1.py DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env python3
2
- from runner import main
3
-
4
- raise SystemExit(main("E1"))
 
 
 
 
 
spatial-workloads/v1/tools/evaluation_runners/e2.py DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env python3
2
- from runner import main
3
-
4
- raise SystemExit(main("E2"))
 
 
 
 
 
spatial-workloads/v1/tools/evaluation_runners/e6.py DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env python3
2
- from runner import main
3
-
4
- raise SystemExit(main("E6"))
 
 
 
 
 
spatial-workloads/v1/tools/evaluation_runners/prepare_spatial_config.py DELETED
@@ -1,230 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Bind one portable spatial workload profile to installed dataset snapshots."""
3
-
4
- from __future__ import annotations
5
-
6
- import argparse
7
- from copy import deepcopy
8
- import json
9
- from pathlib import Path
10
- import re
11
- import struct
12
-
13
- if __package__:
14
- from .runner import (
15
- DEFAULT_CONFIG, batch_payload_paths, file_sha256, load_config,
16
- read_json, require_mapping, validate_profile_status, write_json,
17
- )
18
- else:
19
- from runner import (
20
- DEFAULT_CONFIG, batch_payload_paths, file_sha256, load_config,
21
- read_json, require_mapping, validate_profile_status, write_json,
22
- )
23
-
24
-
25
- def matrix_shape(path: Path) -> tuple[int, int]:
26
- with path.open("rb") as handle:
27
- header = handle.read(8)
28
- if len(header) != 8:
29
- raise ValueError(f"truncated matrix header: {path}")
30
- return struct.unpack("<II", header)
31
-
32
-
33
- def profile_path(root: Path, value: object) -> Path:
34
- if not isinstance(value, str) or not value or Path(value).is_absolute():
35
- raise ValueError(f"profile paths must be nonempty relative paths: {value!r}")
36
- result = (root / value).resolve()
37
- if not result.is_relative_to(root.resolve()):
38
- raise ValueError(f"profile artifact escapes its instance: {value}")
39
- if not result.exists():
40
- raise FileNotFoundError(result)
41
- return result
42
-
43
-
44
- def relocate(value: object, old_root: Path, new_root: Path) -> str:
45
- try:
46
- relative = Path(str(value)).relative_to(old_root)
47
- except ValueError as exc:
48
- raise ValueError(
49
- f"base config asset {value!r} is outside its dataset root {old_root}"
50
- ) from exc
51
- return str(new_root / relative)
52
-
53
-
54
- def derive(
55
- profile_path_value: Path,
56
- base_config: Path,
57
- static_root: Path,
58
- update_root: Path,
59
- ) -> dict[str, object]:
60
- profile_file = profile_path_value.resolve()
61
- profile = read_json(profile_file)
62
- validate_profile_status(profile_file)
63
- bindings = require_mapping(profile, "runner_bindings")
64
- kind = str(bindings["kind"])
65
- if kind not in {"query", "insert", "delete", "mixed"}:
66
- raise ValueError("profile kind must be query, insert, delete, or mixed")
67
- config = deepcopy(load_config(base_config))
68
- old_static = Path(str(require_mapping(config, "static_snapshot")["index"])).parent
69
- old_update = Path(str(require_mapping(config, "initial_snapshot")["index"])).parent.parent
70
- static_root, update_root = static_root.resolve(), update_root.resolve()
71
- for name, old, new in (
72
- ("static_snapshot", old_static, static_root),
73
- ("initial_snapshot", old_update, update_root),
74
- ):
75
- selected = require_mapping(config, name)
76
- for key in ("index", "groundtruth", "pq_codes", "sidecar", "compute_pq_codes", "storage_pq_codes"):
77
- if selected.get(key):
78
- selected[key] = relocate(selected[key], old, new)
79
- pq = require_mapping(config, "pq")
80
- for key in ("meta", "codebook"):
81
- pq[key] = relocate(pq[key], old_static, static_root)
82
-
83
- root = profile_file.parent
84
- query_file = profile_path(root, bindings["query_path"])
85
- initial_gt = profile_path(root, bindings["initial_groundtruth"])
86
- query_rows, query_dim = matrix_shape(query_file)
87
- if query_rows != int(bindings["query_source_count"]) or query_dim != int(config["dimension"]):
88
- raise ValueError("profile query header does not match its binding or base config")
89
- if matrix_shape(initial_gt)[0] != query_rows:
90
- raise ValueError("profile initial GT rows must match query rows")
91
- initial_state = str(bindings["initial_state"])
92
- if not initial_state.startswith(("static-", "initial-")):
93
- raise ValueError("profile initial_state must identify a static or initial snapshot")
94
- expected_state = "static-" if kind in {"query", "delete"} else "initial-"
95
- if not initial_state.startswith(expected_state):
96
- raise ValueError(f"{kind} profile has an incompatible initial state")
97
- selected_snapshot = require_mapping(
98
- config, "static_snapshot" if initial_state.startswith("static-") else "initial_snapshot"
99
- )
100
- selected_snapshot["groundtruth"] = str(initial_gt)
101
- counts_raw = require_mapping(bindings, "operation_counts")
102
- counts = {name: int(counts_raw[name]) for name in ("query", "insert", "delete")}
103
- if any(value < 0 for value in counts.values()):
104
- raise ValueError("profile operation counts must be nonnegative")
105
- update_kinds = {name for name in ("insert", "delete") if counts[name] > 0}
106
- expected_updates = {
107
- "query": set(), "insert": {"insert"}, "delete": {"delete"},
108
- "mixed": {"insert", "delete"},
109
- }[kind]
110
- if update_kinds != expected_updates or (kind in {"query", "mixed"} and counts["query"] <= 0):
111
- raise ValueError("profile operation counts do not match its kind")
112
- query = require_mapping(config, "query")
113
- logical_queries = int(bindings["query_logical_count"])
114
- if logical_queries <= 0:
115
- raise ValueError("query_logical_count must be positive")
116
- query.update({
117
- "path": str(query_file), "source_count": query_rows,
118
- "logical_count": logical_queries,
119
- "checkpoint_count": logical_queries if kind in {"insert", "delete"} else query_rows,
120
- "manifest": str(profile_file),
121
- })
122
- if kind == "query" and int(query["logical_count"]) != counts["query"]:
123
- raise ValueError("query logical count must match profile operation counts")
124
-
125
- batch = require_mapping(config, "batch")
126
- # Query-only profiles still retain a valid shared vector binding in the full config.
127
- vector_path = Path(str(batch["insert_vector_path"]))
128
- source_old, source_new = (
129
- (old_update, update_root) if vector_path.is_relative_to(old_update)
130
- else (old_static, static_root)
131
- )
132
- batch["insert_vector_path"] = relocate(vector_path, source_old, source_new)
133
- batch_count = int(bindings.get("batch_count", 0))
134
- trace_id = str(bindings.get("trace_id", ""))
135
- if kind != "query":
136
- if batch_count <= 0 or re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9._-]*", trace_id) is None:
137
- raise ValueError("update profiles need a positive batch_count and one-component trace_id")
138
- workload_root = profile_path(root, bindings.get("workload_root", "."))
139
- workload = read_json(workload_root / "workload.json")
140
- if workload.get("checkpoint_contract") != "exact-update-counts.v1":
141
- raise ValueError("prepared update package must bind exact checkpoint update counts")
142
- trace_root = workload_root / "traces" / trace_id
143
- trace = read_json(trace_root / "trace.json")
144
- if trace.get("initial_state") != initial_state:
145
- raise ValueError("trace initial state differs from profile binding")
146
- totals = {"insert": 0, "delete": 0}
147
- segment_counts = []
148
- for index in range(1, batch_count + 1):
149
- batch_file = trace_root / "batches" / f"batch_{index:04d}.json"
150
- document = read_json(batch_file)
151
- current = {"insert": 0, "delete": 0}
152
- for operation in document["operations"]:
153
- operation_kind = str(operation["type"])
154
- if operation_kind not in totals:
155
- raise ValueError(f"unsupported prepared operation: {operation_kind}")
156
- count = int(operation["count"])
157
- if count < 0:
158
- raise ValueError("negative prepared operation count")
159
- for field in ("external_ids", "vector_refs"):
160
- descriptor = operation.get(field)
161
- if descriptor is not None and int(descriptor["count"]) != count:
162
- raise ValueError("prepared descriptor count differs from operation count")
163
- current[operation_kind] += count
164
- totals[operation_kind] += count
165
- dependencies = batch_payload_paths(workload_root, batch_file)
166
- for dependency in dependencies:
167
- if not Path(dependency).is_file():
168
- raise FileNotFoundError(dependency)
169
- if matrix_shape(Path(dependencies[-1]))[0] != query_rows:
170
- raise ValueError("prepared checkpoint GT rows must match query rows")
171
- segment_counts.append(current)
172
- if totals != {name: counts[name] for name in totals}:
173
- raise ValueError("prepared batch operations differ from profile counts")
174
- batch.update({
175
- "root": str(workload_root), "start_index": 1, "batch_count": batch_count,
176
- {"insert": "insert_trace", "delete": "delete_trace", "mixed": "replacement_trace"}[kind]: trace_id,
177
- })
178
- if kind == "mixed":
179
- segment_count = int(bindings["source_segment_update_count"])
180
- if segment_count <= 0 or any(
181
- segment != {"insert": segment_count, "delete": segment_count}
182
- for segment in segment_counts
183
- ):
184
- raise ValueError("mixed profile must have equal declared update counts per segment")
185
- uniform = require_mapping(config, "uniform")
186
- pair_count = counts["insert"]
187
- ratio, remainder = divmod(counts["query"], pair_count)
188
- if remainder or ratio <= 0:
189
- raise ValueError("mixed query count must be a positive integer multiple of pairs")
190
- uniform.update({
191
- "query_ratio": ratio, "insert_ratio": 1, "mark_delete_ratio": 1,
192
- "acknowledged_tombstone_fraction": segment_count / int(require_mapping(config, "topology")["storage_max_node_capacity"]),
193
- })
194
- batch.update({
195
- "e6_window_count": batch_count, "e6_source_segments_per_window": 1,
196
- "e6_source_segment_update_count": segment_count,
197
- "e6_skip_final_merge_delete": bool(bindings.get("skip_final_merge_delete", False)),
198
- })
199
- config["prepared_workload"] = {
200
- "profile": str(profile_file), "profile_sha256": file_sha256(profile_file),
201
- "kind": kind, "initial_state": initial_state, "batch_count": batch_count,
202
- "trace_id": trace_id, "operation_counts": counts,
203
- "query_source_count": query_rows,
204
- "query_role": profile.get("query_role", "foreground" if kind in {"query", "mixed"} else "recall checkpoints"),
205
- }
206
- config["source_snapshot"] = str(profile.get("workload_id", profile.get("profile_id", profile_file.parent.name)))
207
- return config
208
-
209
-
210
- def main() -> int:
211
- parser = argparse.ArgumentParser(description=__doc__)
212
- parser.add_argument("--profile", type=Path, required=True)
213
- parser.add_argument("--base-config", type=Path, default=DEFAULT_CONFIG)
214
- parser.add_argument("--static-root", type=Path, required=True)
215
- parser.add_argument("--update-root", type=Path, required=True)
216
- parser.add_argument("--output", type=Path, required=True)
217
- args = parser.parse_args()
218
- if args.output.exists():
219
- parser.error(f"refusing to overwrite {args.output}")
220
- try:
221
- config = derive(args.profile, args.base_config, args.static_root, args.update_root)
222
- write_json(args.output, config)
223
- except (KeyError, ValueError, OSError) as exc:
224
- parser.error(str(exc))
225
- print(json.dumps({"config": str(args.output.resolve()), "kind": config["prepared_workload"]["kind"]}))
226
- return 0
227
-
228
-
229
- if __name__ == "__main__":
230
- raise SystemExit(main())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/tools/evaluation_runners/runner.py DELETED
@@ -1,2556 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Plan and run compact E1-E9 evaluation campaigns."""
3
-
4
- from __future__ import annotations
5
-
6
- import argparse
7
- from dataclasses import asdict, dataclass, replace
8
- from datetime import datetime, timezone
9
- import hashlib
10
- import json
11
- import os
12
- from pathlib import Path
13
- import re
14
- import shlex
15
- import subprocess
16
- import sys
17
- import threading
18
- import time
19
- from typing import Callable, Iterable
20
-
21
- try:
22
- from tqdm import tqdm
23
- except ImportError: # pragma: no cover - the runner retains a text fallback.
24
- tqdm = None
25
-
26
-
27
- EVAL_ROOT = Path(__file__).resolve().parents[1]
28
- CXL_ROOT = Path(
29
- os.environ.get("VECTORDB_CXL_ROOT", EVAL_ROOT.parent / "vectordb-cxl")
30
- ).resolve()
31
- DEFAULT_CONFIG = Path(__file__).resolve().parent / "configs/deep100.json"
32
- PYTHON = CXL_ROOT / "venv/bin/python"
33
- LAUNCHER = CXL_ROOT / "scripts/e2e/run_compute_search.py"
34
- READINESS = CXL_ROOT / "scripts/e2e/check_readiness.py"
35
- KILL_ALL = CXL_ROOT / "scripts/e2e/kill_all.py"
36
- MATERIALIZER = (
37
- CXL_ROOT / "scripts/datasets/general/materialize_concurrent_batch_update.py"
38
- )
39
- M1_PREPARER = Path(__file__).resolve().parent / "prepare_m1.py"
40
- REMOTE_COMPUTE_BINARY = "/data/vectordb-cxl/build/src/compute/vectordb_compute_node"
41
- REMOTE_STORAGE_BINARY = "/data/vectordb-cxl/build/src/storage/vectordb_storage_node"
42
- DEFAULT_RECORD_MODES = ("strict-mcas", "relaxed-reread", "relaxed-snapshot")
43
- RECORD_MODES = (
44
- "read-rmw-atomic",
45
- "read-write-atomic",
46
- "relaxed",
47
- "mn-linearizable",
48
- *DEFAULT_RECORD_MODES,
49
- )
50
- ATOMIC_RECORD_MODES = ("read-rmw-atomic", "read-write-atomic", "strict-mcas")
51
- RMW_ATOMIC_RECORD_MODES = ("read-rmw-atomic", "strict-mcas")
52
- E9_CACHE_VARIANTS = ("no-cache", "pq", "upper-only", "both")
53
- E6_RUNTIME_CONTRACT = {
54
- "execution_model": "continuous_total_admission",
55
- "merge_trigger": "successful_all_cn_delete_ack_threshold",
56
- "repair_partition": "striped_by_sorted_tombstone_index",
57
- "final_safepoint": "query_insert_quiescence_recorded",
58
- }
59
-
60
-
61
- @dataclass(frozen=True)
62
- class RunSpec:
63
- run_id: str
64
- experiment: str
65
- repetition: int
66
- kind: str
67
- workload: str
68
- snapshot: str
69
- num_cns: int
70
- num_mns: int
71
- workers_per_cn: int
72
- ef_search: int
73
- reranking_factor: float
74
- record_mode: str
75
- query_limit: int
76
- mutation_snapshot: bool | None = None
77
- merge_workers: int = 0
78
- batch_count: int = 0
79
- merge_every_batches: int = 0
80
- sweep_axis: str = ""
81
- checkpoint_phase: str = ""
82
- cache_variant: str = ""
83
-
84
-
85
- def utc_now() -> str:
86
- return datetime.now(timezone.utc).isoformat()
87
-
88
-
89
- def read_json(path: Path) -> dict[str, object]:
90
- document = json.loads(path.read_text(encoding="utf-8"))
91
- if not isinstance(document, dict):
92
- raise ValueError(f"JSON root must be an object: {path}")
93
- return document
94
-
95
-
96
- def write_json(path: Path, value: object) -> None:
97
- path.parent.mkdir(parents=True, exist_ok=True)
98
- path.write_text(json.dumps(value, indent=2, sort_keys=True) + "\n")
99
-
100
-
101
- def file_sha256(path: Path) -> str:
102
- digest = hashlib.sha256()
103
- with path.open("rb") as handle:
104
- for block in iter(lambda: handle.read(1024 * 1024), b""):
105
- digest.update(block)
106
- return digest.hexdigest()
107
-
108
-
109
- def binary_sha(
110
- explicit: str | None, relative_path: str, label: str
111
- ) -> str:
112
- if explicit:
113
- if len(explicit) != 64 or any(char not in "0123456789abcdef" for char in explicit):
114
- raise ValueError(f"--{label}-sha256 must be 64 lowercase hex characters")
115
- return explicit
116
- path = CXL_ROOT / relative_path
117
- if not path.is_file():
118
- raise ValueError(
119
- f"{label} binary is missing at {path}; build it or pass "
120
- f"--{label}-sha256"
121
- )
122
- return file_sha256(path)
123
-
124
-
125
- def require_mapping(document: dict[str, object], key: str) -> dict[str, object]:
126
- value = document.get(key)
127
- if not isinstance(value, dict):
128
- raise ValueError(f"configuration field {key!r} must be an object")
129
- return value
130
-
131
-
132
- def expand_templates(value: object, variables: dict[str, str]) -> object:
133
- if isinstance(value, str):
134
- try:
135
- return value.format_map(variables)
136
- except KeyError as exc:
137
- raise ValueError(
138
- f"unknown path variable {exc.args[0]!r} in {value!r}"
139
- ) from exc
140
- if isinstance(value, list):
141
- return [expand_templates(item, variables) for item in value]
142
- if isinstance(value, dict):
143
- return {
144
- key: expand_templates(item, variables)
145
- for key, item in value.items()
146
- }
147
- return value
148
-
149
-
150
- def dataset_id(prefix: str) -> str:
151
- return re.sub(r"[^a-z0-9]+", "-", prefix.lower()).strip("-")
152
-
153
-
154
- def load_config(
155
- path: Path,
156
- *,
157
- data_root: Path | None = None,
158
- dataset_prefix: str | None = None,
159
- selected_dataset_id: str | None = None,
160
- dataset_label: str | None = None,
161
- ) -> dict[str, object]:
162
- config = read_json(path)
163
- if config.get("schema_version") != 1:
164
- raise ValueError("configuration schema_version must be 1")
165
- configured_variables = require_mapping(config, "path_variables")
166
- variables = {
167
- key: str(value) for key, value in configured_variables.items()
168
- }
169
- if data_root is not None:
170
- variables["data_root"] = str(data_root)
171
- if dataset_prefix is not None:
172
- if not dataset_prefix or "/" in dataset_prefix:
173
- raise ValueError("--dataset-prefix must be one non-empty path component")
174
- variables["dataset_prefix"] = dataset_prefix
175
- config["dataset_id"] = selected_dataset_id or dataset_id(dataset_prefix)
176
- config["dataset_label"] = dataset_label or dataset_prefix.upper()
177
- elif selected_dataset_id is not None:
178
- config["dataset_id"] = selected_dataset_id
179
- if dataset_label is not None:
180
- config["dataset_label"] = dataset_label
181
- if not Path(variables.get("data_root", "")).is_absolute():
182
- raise ValueError("path variable data_root must be absolute")
183
- if not variables.get("dataset_prefix"):
184
- raise ValueError("path variable dataset_prefix must be non-empty")
185
- if re.fullmatch(r"[A-Za-z0-9._-]+", str(config.get("dataset_id", ""))) is None:
186
- raise ValueError("dataset_id must use only letters, digits, '.', '_', or '-'")
187
- if not config.get("dataset_label"):
188
- raise ValueError("dataset_label must be non-empty")
189
- config["path_variables"] = variables
190
- config = expand_templates(config, variables)
191
- for key in (
192
- "topology",
193
- "query",
194
- "pq",
195
- "static_snapshot",
196
- "initial_snapshot",
197
- "batch",
198
- "runtime",
199
- "repair",
200
- "uniform",
201
- "repetitions",
202
- ):
203
- require_mapping(config, key)
204
- return config
205
-
206
-
207
- def values(override: list[int] | None, configured: object) -> list[int]:
208
- selected = override if override is not None else list(configured)
209
- if not selected or any(value <= 0 for value in selected):
210
- raise ValueError("sweep values must be positive")
211
- return list(dict.fromkeys(selected))
212
-
213
-
214
- def nonnegative_float(value: str) -> float:
215
- parsed = float(value)
216
- if parsed < 0.0:
217
- raise argparse.ArgumentTypeError("value must be non-negative")
218
- return parsed
219
-
220
-
221
- def fixed_value(override: list[int] | None, configured: object, name: str) -> int:
222
- selected = values(override, [int(configured)])
223
- if len(selected) != 1:
224
- raise ValueError(f"{name} accepts one value for this experiment")
225
- return selected[0]
226
-
227
-
228
- def selected_workloads(
229
- requested: list[str] | None, allowed: tuple[str, ...]
230
- ) -> tuple[str, ...]:
231
- if requested is None:
232
- return allowed
233
- invalid = sorted(set(requested) - set(allowed))
234
- if invalid:
235
- raise ValueError(f"unsupported workload(s): {','.join(invalid)}")
236
- return tuple(item for item in allowed if item in requested)
237
-
238
-
239
- def effective_mutation_snapshot(
240
- mode: str, requested: str | None
241
- ) -> bool | None:
242
- if mode not in RECORD_MODES:
243
- raise ValueError(f"unsupported record mode: {mode}")
244
- if requested not in (None, "true", "false"):
245
- raise ValueError("--mutation-snapshot must be true or false")
246
- if mode in {"read-rmw-atomic", "strict-mcas", "mn-linearizable"}:
247
- if requested is not None:
248
- raise ValueError(
249
- "--mutation-snapshot requires relaxed or read-write-atomic"
250
- )
251
- return None
252
- alias_snapshot = {
253
- "relaxed-snapshot": True,
254
- "relaxed-reread": False,
255
- }.get(mode)
256
- if alias_snapshot is not None:
257
- if requested is not None and (requested == "true") != alias_snapshot:
258
- raise ValueError(
259
- "--mutation-snapshot conflicts with the selected relaxed alias"
260
- )
261
- return alias_snapshot
262
- return requested != "false"
263
-
264
-
265
- def build_specs(
266
- experiment: str, config: dict[str, object], args: argparse.Namespace
267
- ) -> list[RunSpec]:
268
- topology = require_mapping(config, "topology")
269
- query = require_mapping(config, "query")
270
- batch = require_mapping(config, "batch")
271
- runtime = require_mapping(config, "runtime")
272
- uniform = require_mapping(config, "uniform")
273
- repetitions_config = require_mapping(config, "repetitions")
274
- repetitions = (
275
- args.repetitions
276
- if args.repetitions is not None
277
- else int(repetitions_config[experiment])
278
- )
279
- if repetitions <= 0:
280
- raise ValueError("--repetitions must be positive")
281
- if experiment == "E9" and repetitions != 1:
282
- raise ValueError("E9 requires exactly one repetition")
283
- if args.cache_variant and experiment not in {"E7", "E9"}:
284
- raise ValueError("--cache-variant is only supported by E7 and E9")
285
- if args.repetition_start <= 0:
286
- raise ValueError("--repetition-start must be positive")
287
- fixed_cns = (
288
- int(topology["num_cns"])
289
- if experiment in {"E4", "E5"}
290
- else fixed_value(args.num_cns, topology["num_cns"], "--num-cns")
291
- )
292
- fixed_workers = fixed_value(
293
- args.workers_per_cn,
294
- topology["workers_per_cn"],
295
- "--workers-per-cn",
296
- )
297
- num_mns = (
298
- args.num_mns
299
- if args.num_mns is not None
300
- else int(topology["num_mns"])
301
- )
302
- if num_mns <= 0:
303
- raise ValueError("--num-mns must be positive")
304
- selected_ef = (
305
- int(query["ef_search"])
306
- if experiment in {"E1", "EX1"}
307
- else fixed_value(args.ef_search, query["ef_search"], "--ef-search")
308
- )
309
- query_limit = (
310
- args.query_limit
311
- if args.query_limit is not None
312
- else int(query["logical_count"])
313
- )
314
- checkpoint_limit = (
315
- args.checkpoint_query_limit
316
- if args.checkpoint_query_limit is not None
317
- else int(query["checkpoint_count"])
318
- )
319
- if query_limit <= 0 or checkpoint_limit <= 0:
320
- raise ValueError("query limits must be positive")
321
- batch_count = (
322
- args.batch_count
323
- if args.batch_count is not None
324
- else int(batch["batch_count"])
325
- )
326
- if batch_count <= 0:
327
- raise ValueError("--batch-count must be positive")
328
- if experiment != "E7" and args.record_mode and len(args.record_mode) != 1:
329
- raise ValueError("--record-mode accepts one value outside E7")
330
- record_mode = (
331
- args.record_mode[0]
332
- if experiment != "E7" and args.record_mode
333
- else str(runtime["record_concurrency_control"])
334
- )
335
- workloads = selected_workloads(
336
- args.workload,
337
- {
338
- "E1": ("query",),
339
- "EX1": ("query",),
340
- "M1": ("replacement",),
341
- "E2": ("insert", "delete"),
342
- "E3": ("replacement",),
343
- "E4": ("query",),
344
- "E5": ("insert", "delete"),
345
- "E6": ("replacement",),
346
- "E7": ("query", "insert", "delete"),
347
- "E8": ("replacement",),
348
- "E9": ("query", "insert", "delete"),
349
- }[experiment],
350
- )
351
- if args.merge_workers is not None and experiment not in {"E6", "M1"}:
352
- raise ValueError("--merge-workers applies only to E6 and M1")
353
- if args.merge_every_batches is not None and experiment in {"E1", "EX1", "E4", "E6", "M1"}:
354
- raise ValueError(
355
- "--merge-every-batches applies only to batch update experiments"
356
- )
357
- if args.merge_every_batches is not None and not any(
358
- workload in {"delete", "replacement"} for workload in workloads
359
- ):
360
- raise ValueError(
361
- "--merge-every-batches requires a delete or replacement workload"
362
- )
363
- specs: list[RunSpec] = []
364
-
365
- def merge_interval(batches: int, *, default: int | None = None) -> int:
366
- interval = batches if default is None else default
367
- if args.merge_every_batches is not None:
368
- interval = args.merge_every_batches
369
- if not 0 <= interval <= batches:
370
- raise ValueError(
371
- "--merge-every-batches must be between zero and --batch-count"
372
- )
373
- return interval
374
-
375
- def add(
376
- repetition: int,
377
- *,
378
- kind: str,
379
- workload: str,
380
- snapshot: str,
381
- num_cns: int = fixed_cns,
382
- workers: int = fixed_workers,
383
- ef_search: int = selected_ef,
384
- reranking_factor: float | None = None,
385
- mode: str = record_mode,
386
- queries: int = checkpoint_limit,
387
- merge_workers: int = 0,
388
- batches: int = 0,
389
- merge_every_batches: int = 0,
390
- sweep_axis: str = "",
391
- checkpoint_phase: str = "",
392
- cache_variant: str = "",
393
- ) -> None:
394
- mutation_snapshot = effective_mutation_snapshot(mode, args.mutation_snapshot)
395
- selected_reranking_factor = (
396
- float(runtime["reranking_factor"])
397
- if reranking_factor is None
398
- else reranking_factor
399
- )
400
- if selected_reranking_factor <= 0:
401
- raise ValueError("reranking factor must be positive")
402
- reranking_suffix = (
403
- f"-rr{selected_reranking_factor:g}"
404
- if "reranking_factor_divisor" in query
405
- else ""
406
- )
407
- snapshot_suffix = (
408
- f"-ms-{str(mutation_snapshot).lower()}"
409
- if mutation_snapshot is not None
410
- else ""
411
- )
412
- suffix = (
413
- f"{workload}-ef{ef_search}-cn{num_cns}-mn{num_mns}-w{workers}"
414
- f"{reranking_suffix}"
415
- f"{f'-cache-{cache_variant}' if cache_variant else ''}"
416
- f"{snapshot_suffix}"
417
- f"-cc-{mode}-r{repetition}"
418
- )
419
- specs.append(
420
- RunSpec(
421
- run_id=f"{experiment.lower()}-{config['dataset_id']}-{suffix}",
422
- experiment=experiment,
423
- repetition=repetition,
424
- kind=kind,
425
- workload=workload,
426
- snapshot=snapshot,
427
- num_cns=num_cns,
428
- num_mns=num_mns,
429
- workers_per_cn=workers,
430
- ef_search=ef_search,
431
- reranking_factor=selected_reranking_factor,
432
- record_mode=mode,
433
- query_limit=queries,
434
- mutation_snapshot=mutation_snapshot,
435
- merge_workers=merge_workers,
436
- batch_count=batches,
437
- merge_every_batches=merge_every_batches,
438
- sweep_axis=sweep_axis,
439
- checkpoint_phase=checkpoint_phase,
440
- cache_variant=cache_variant,
441
- )
442
- )
443
-
444
- for repetition in range(
445
- args.repetition_start, args.repetition_start + repetitions
446
- ):
447
- if experiment in {"E1", "EX1"}:
448
- reranking_divisor = query.get("reranking_factor_divisor")
449
- if reranking_divisor is not None and (
450
- isinstance(reranking_divisor, bool)
451
- or not isinstance(reranking_divisor, (int, float))
452
- or reranking_divisor <= 0
453
- ):
454
- raise ValueError("query.reranking_factor_divisor must be positive")
455
- for ef_search in values(args.ef_search, query["ef_sweep"]):
456
- add(
457
- repetition,
458
- kind="query",
459
- workload="query",
460
- snapshot="static",
461
- ef_search=ef_search,
462
- reranking_factor=(
463
- ef_search / float(reranking_divisor)
464
- if reranking_divisor is not None
465
- else None
466
- ),
467
- queries=query_limit,
468
- sweep_axis="ef_search",
469
- )
470
- elif experiment == "E2":
471
- for workload in workloads:
472
- add(
473
- repetition,
474
- kind="batch",
475
- workload=workload,
476
- snapshot="initial" if workload == "insert" else "static",
477
- batches=batch_count,
478
- merge_every_batches=(
479
- 0 if workload == "insert" else merge_interval(batch_count)
480
- ),
481
- )
482
- elif experiment == "E3":
483
- add(
484
- repetition,
485
- kind="batch",
486
- workload="replacement",
487
- snapshot="initial",
488
- batches=batch_count,
489
- merge_every_batches=merge_interval(batch_count),
490
- )
491
- elif experiment == "E4":
492
- for num_cns in values(args.num_cns, query["cn_sweep"]):
493
- add(
494
- repetition,
495
- kind="query",
496
- workload="query",
497
- snapshot="static",
498
- num_cns=num_cns,
499
- queries=query_limit,
500
- sweep_axis="num_cns",
501
- )
502
- elif experiment == "E5":
503
- for num_cns in values(args.num_cns, query["cn_sweep"]):
504
- for workload in workloads:
505
- add(
506
- repetition,
507
- kind="batch",
508
- workload=workload,
509
- snapshot="initial" if workload == "insert" else "static",
510
- num_cns=num_cns,
511
- batches=batch_count,
512
- merge_every_batches=(
513
- 0
514
- if workload == "insert"
515
- else merge_interval(batch_count)
516
- ),
517
- sweep_axis="num_cns",
518
- )
519
- elif experiment == "E6":
520
- selected_merge_workers = (
521
- args.merge_workers
522
- if args.merge_workers is not None
523
- else int(uniform["merge_workers"])
524
- )
525
- if not 1 <= selected_merge_workers <= fixed_workers:
526
- raise ValueError(
527
- "E6 requires 1 <= --merge-workers <= --workers-per-cn"
528
- )
529
- add(
530
- repetition,
531
- kind="concurrent",
532
- workload="replacement",
533
- snapshot="initial",
534
- merge_workers=selected_merge_workers,
535
- batches=(
536
- args.batch_count
537
- if args.batch_count is not None
538
- else int(batch["e6_window_count"])
539
- ),
540
- )
541
- elif experiment == "M1":
542
- selected_merge_workers = (
543
- args.merge_workers
544
- if args.merge_workers is not None
545
- else int(uniform["merge_workers"])
546
- )
547
- if not 1 <= selected_merge_workers < fixed_workers:
548
- raise ValueError(
549
- "M1 requires 1 <= --merge-workers < --workers-per-cn"
550
- )
551
- add(
552
- repetition,
553
- kind="concurrent",
554
- workload="replacement",
555
- snapshot="initial",
556
- merge_workers=selected_merge_workers,
557
- batches=int(batch["m1_measurement_batches"]),
558
- mode="strict-mcas",
559
- )
560
- elif experiment == "E7":
561
- modes = args.record_mode or list(DEFAULT_RECORD_MODES)
562
- cache_variants = args.cache_variant or (None,)
563
- for mode in modes:
564
- if mode not in RECORD_MODES:
565
- raise ValueError(f"unsupported record mode: {mode}")
566
- for cache_variant in cache_variants:
567
- for workload in workloads:
568
- add(
569
- repetition,
570
- kind="query" if workload == "query" else "batch",
571
- workload=workload,
572
- snapshot=(
573
- "initial" if workload == "insert" else "static"
574
- ),
575
- mode=mode,
576
- queries=query_limit if workload == "query" else checkpoint_limit,
577
- batches=0 if workload == "query" else batch_count,
578
- merge_every_batches=(
579
- 0
580
- if workload in {"query", "insert"}
581
- else merge_interval(batch_count)
582
- ),
583
- cache_variant=cache_variant,
584
- )
585
- elif experiment == "E8":
586
- e8_batches = (
587
- args.batch_count
588
- if args.batch_count is not None
589
- else int(batch["e8_batch_count"])
590
- )
591
- if e8_batches <= 0:
592
- raise ValueError("E8 --batch-count must be positive")
593
- add(
594
- repetition,
595
- kind="query",
596
- workload="query",
597
- snapshot="initial",
598
- queries=checkpoint_limit,
599
- checkpoint_phase="pre_update",
600
- )
601
- add(
602
- repetition,
603
- kind="batch",
604
- workload="replacement",
605
- snapshot="initial",
606
- batches=e8_batches,
607
- merge_every_batches=merge_interval(
608
- e8_batches,
609
- default=int(batch["e8_merge_every_batches"]),
610
- ),
611
- )
612
- elif experiment == "E9":
613
- if config["dataset_id"] != "bigann100":
614
- raise ValueError("E9 supports BIGANN-100M only")
615
- e9 = require_mapping(config, "e9")
616
- cache_variants = (
617
- E9_CACHE_VARIANTS
618
- if args.cache_variant is None
619
- else tuple(
620
- variant
621
- for variant in E9_CACHE_VARIANTS
622
- if variant in args.cache_variant
623
- )
624
- )
625
- for cache_variant in cache_variants:
626
- for workload in workloads:
627
- add(
628
- repetition,
629
- kind="query" if workload == "query" else "batch",
630
- workload=workload,
631
- snapshot=(
632
- "initial" if workload == "insert" else "static"
633
- ),
634
- ef_search=int(e9["ef_search"]),
635
- reranking_factor=float(e9["reranking_factor"]),
636
- queries=(
637
- query_limit
638
- if workload == "query"
639
- else checkpoint_limit
640
- ),
641
- batches=0 if workload == "query" else batch_count,
642
- merge_every_batches=(
643
- 0
644
- if workload in {"query", "insert"}
645
- else merge_interval(batch_count)
646
- ),
647
- cache_variant=cache_variant,
648
- )
649
- else:
650
- raise ValueError(f"unsupported experiment: {experiment}")
651
-
652
- unique: dict[str, RunSpec] = {}
653
- for spec in specs:
654
- existing = unique.get(spec.run_id)
655
- if existing is None:
656
- unique[spec.run_id] = spec
657
- elif existing.sweep_axis != spec.sweep_axis:
658
- unique[spec.run_id] = replace(existing, sweep_axis="shared")
659
- compute_nodes = topology.get("compute_nodes")
660
- storage_nodes = topology.get("storage_nodes")
661
- if not isinstance(compute_nodes, list) or not isinstance(storage_nodes, list):
662
- raise ValueError("topology node lists must be arrays")
663
- for spec in unique.values():
664
- validate_prepared_workload(config, spec)
665
- if spec.num_cns > len(compute_nodes):
666
- raise ValueError(
667
- f"{spec.run_id} needs {spec.num_cns} CNs, "
668
- f"but only {len(compute_nodes)} are configured"
669
- )
670
- if spec.num_mns > len(storage_nodes):
671
- raise ValueError(
672
- f"{spec.run_id} needs {spec.num_mns} MNs, "
673
- f"but only {len(storage_nodes)} are configured"
674
- )
675
- return list(unique.values())
676
-
677
-
678
- def validate_prepared_workload(
679
- config: dict[str, object], spec: RunSpec
680
- ) -> None:
681
- """Keep generated traces and their exact checkpoint ground truth together."""
682
- prepared = config.get("prepared_workload")
683
- if prepared is None:
684
- return
685
- if not isinstance(prepared, dict):
686
- raise ValueError("prepared_workload must be an object")
687
- profile_file = Path(str(prepared["profile"]))
688
- if file_sha256(profile_file) != prepared["profile_sha256"]:
689
- raise ValueError("prepared profile changed after config generation")
690
- validate_profile_status(profile_file)
691
- kind = str(prepared["kind"])
692
- workload = "replacement" if kind == "mixed" else kind
693
- if spec.workload != workload:
694
- raise ValueError(
695
- f"prepared {kind} profile requires --workload {workload}; "
696
- f"got {spec.workload}"
697
- )
698
- expected_snapshot = (
699
- "static" if str(prepared["initial_state"]).startswith("static-")
700
- else "initial"
701
- )
702
- if spec.snapshot != expected_snapshot:
703
- raise ValueError("prepared workload initial state does not match this run")
704
- counts = require_mapping(prepared, "operation_counts")
705
- if kind == "query":
706
- if spec.query_limit != int(counts["query"]):
707
- raise ValueError("prepared query count cannot be overridden")
708
- return
709
- batch = require_mapping(config, "batch")
710
- if int(batch["start_index"]) != 1:
711
- raise ValueError("prepared exact checkpoints require batch start index 1")
712
- if kind == "mixed":
713
- if spec.experiment != "E6":
714
- raise ValueError("prepared mixed profiles require the E6 runner")
715
- contract = e6_materialization_contract(config, spec)
716
- actual = {
717
- "query": contract["total_query_count"],
718
- "insert": contract["total_insert_count"],
719
- "delete": contract["total_mark_delete_count"],
720
- }
721
- if actual != counts:
722
- raise ValueError("prepared mixed operation counts cannot be overridden")
723
- elif spec.batch_count != int(prepared["batch_count"]):
724
- raise ValueError("prepared checkpoint batch count cannot be overridden")
725
- expected_checkpoint_queries = (
726
- int(prepared["query_source_count"]) if kind == "mixed"
727
- else int(counts["query"])
728
- )
729
- if expected_checkpoint_queries > 0 and spec.query_limit != expected_checkpoint_queries:
730
- raise ValueError("prepared checkpoint query count cannot be overridden")
731
-
732
-
733
- def validate_profile_status(profile_file: Path) -> Path | None:
734
- validation_file = profile_file.parent / "validation.json"
735
- if validation_file.exists():
736
- result = read_json(validation_file)
737
- if result.get("status") != "passed":
738
- raise ValueError(
739
- "prepared profile validation must be passed; "
740
- f"got {result.get('status')!r} in {validation_file}"
741
- )
742
- return validation_file
743
- return None
744
-
745
-
746
- def sidecar_files(path: str) -> list[str]:
747
- suffix = ".layout.json"
748
- if not path.endswith(suffix):
749
- raise ValueError(f"sidecar manifest must end with {suffix}: {path}")
750
- prefix = path[: -len(suffix)]
751
- return [path, prefix + ".levels.u16", prefix + ".id_mapping.u32"]
752
-
753
-
754
- def snapshot(config: dict[str, object], name: str) -> dict[str, object]:
755
- return require_mapping(
756
- config, "static_snapshot" if name == "static" else "initial_snapshot"
757
- )
758
-
759
-
760
- def snapshot_pq_codes(
761
- selected_snapshot: dict[str, object], role: str
762
- ) -> str:
763
- role_key = f"{role}_pq_codes"
764
- return str(
765
- selected_snapshot.get(role_key, selected_snapshot["pq_codes"])
766
- )
767
-
768
-
769
- def common_command(
770
- config: dict[str, object], spec: RunSpec, port: int
771
- ) -> list[str]:
772
- topology = require_mapping(config, "topology")
773
- query = require_mapping(config, "query")
774
- pq = require_mapping(config, "pq")
775
- runtime = require_mapping(config, "runtime")
776
- selected_snapshot = snapshot(config, spec.snapshot)
777
- read_qp_pool_size = int(
778
- topology.get("read_qp_pool_size", spec.workers_per_cn)
779
- )
780
- if read_qp_pool_size <= 0:
781
- raise ValueError("topology.read_qp_pool_size must be positive")
782
- memory_bytes = ",".join(
783
- [str(topology["memory_bytes_per_mn"])] * spec.num_mns
784
- )
785
- command = [
786
- str(PYTHON),
787
- str(LAUNCHER),
788
- "--num-cns",
789
- str(spec.num_cns),
790
- "--num-sns",
791
- str(spec.num_mns),
792
- "--port",
793
- str(port),
794
- "--ib-port",
795
- "1",
796
- "--max-poll-cqes",
797
- "16",
798
- "--max-send-wrs",
799
- "1024",
800
- "--max-receive-wrs",
801
- "1024",
802
- "--server-wait-seconds",
803
- "5",
804
- "--storage-exit-timeout-seconds",
805
- "300",
806
- "--idle-timeout-seconds",
807
- str(
808
- runtime[
809
- "query_idle_timeout_seconds"
810
- if spec.kind == "query"
811
- else "update_idle_timeout_seconds"
812
- ]
813
- ),
814
- "--storage-max-node-capacity",
815
- str(topology["storage_max_node_capacity"]),
816
- "--storage-hash-directory-load-factor",
817
- str(topology["hash_directory_load_factor"]),
818
- "--cluster-memory-node-bytes",
819
- memory_bytes,
820
- "--num-threads",
821
- str(spec.workers_per_cn + 1),
822
- "--read-qp-pool-size",
823
- str(read_qp_pool_size),
824
- "--coroutines-per-thread",
825
- str(runtime["coroutines_per_thread"]),
826
- "--k",
827
- str(config["k"]),
828
- "--ef-search",
829
- str(spec.ef_search),
830
- "--distance",
831
- str(config["distance"]),
832
- "--query-limit",
833
- str(spec.query_limit),
834
- "--progress-interval",
835
- "1000",
836
- "--storage-index-path",
837
- str(selected_snapshot["index"]),
838
- "--hnsw-layout-sidecar-manifest-path",
839
- str(selected_snapshot["sidecar"]),
840
- "--storage-data-type",
841
- str(config["dtype"]),
842
- "--compute-query-data-type",
843
- str(config["dtype"]),
844
- "--compute-query-path",
845
- str(query["path"]),
846
- "--compute-groundtruth-path",
847
- str(selected_snapshot["groundtruth"]),
848
- "--use-pq",
849
- "--storage-pq-codes-path",
850
- snapshot_pq_codes(selected_snapshot, "storage"),
851
- "--storage-pq-meta-path",
852
- str(pq["meta"]),
853
- "--compute-pq-meta-path",
854
- str(pq["meta"]),
855
- "--compute-pq-codebook-path",
856
- str(pq["codebook"]),
857
- "--runtime-id-mode",
858
- str(runtime["runtime_id_mode"]),
859
- "--record-concurrency-control",
860
- spec.record_mode,
861
- "--compute-pq-cache-mode",
862
- "uniform-paged",
863
- "--compute-cache-capacity-bytes",
864
- str(topology["cache_capacity_bytes_per_cn"]),
865
- "--reranking-factor",
866
- str(spec.reranking_factor),
867
- "--rerank-parallelism",
868
- str(runtime["rerank_parallelism"]),
869
- "--l0-beam-width",
870
- str(runtime["l0_beam_width"]),
871
- "--l0-pipe-width",
872
- str(runtime["l0_pipe_width"]),
873
- "--l0-pipe-initial-width",
874
- str(runtime["l0_pipe_initial_width"]),
875
- "--l0-pipe-max-waste-ratio",
876
- str(runtime["l0_pipe_max_waste_ratio"]),
877
- ]
878
- if not (spec.experiment == "E6" and spec.record_mode in RMW_ATOMIC_RECORD_MODES):
879
- command.extend(["--l0-pipe-search", "--l0-pipe-adaptive"])
880
- if spec.mutation_snapshot is not None:
881
- command.extend(
882
- ["--mutation-snapshot", str(spec.mutation_snapshot).lower()]
883
- )
884
- if spec.cache_variant in {"no-cache", "upper-only"}:
885
- command.extend(
886
- ["--compute-pq-residency", "mn"]
887
- )
888
- if spec.cache_variant == "no-cache":
889
- command.append("--disable-upper-cache")
890
- elif spec.cache_variant in {"pq", "both"}:
891
- command.extend(
892
- [
893
- "--compute-pq-residency",
894
- "cn",
895
- "--compute-pq-codes-path",
896
- snapshot_pq_codes(selected_snapshot, "compute"),
897
- ]
898
- )
899
- if spec.cache_variant == "pq":
900
- command.append("--disable-upper-cache")
901
- else:
902
- command.extend(
903
- [
904
- "--compute-pq-codes-path",
905
- snapshot_pq_codes(selected_snapshot, "compute"),
906
- ]
907
- )
908
- if topology.get("storage_low_memory_bootstrap", False):
909
- command.append("--storage-low-memory-bootstrap")
910
- if topology.get("storage_skip_initial_pq_codes", False):
911
- command.append("--storage-skip-initial-pq-codes")
912
- if (
913
- spec.kind == "query"
914
- or spec.query_limit > int(query["source_count"])
915
- ):
916
- command.append("--repeat-queries")
917
- return command
918
-
919
-
920
- def repair_arguments(config: dict[str, object]) -> list[str]:
921
- repair = require_mapping(config, "repair")
922
- return [
923
- "--batchdelete-chunk-buckets",
924
- str(repair["chunk_buckets"]),
925
- "--batchdelete-repair-algorithm",
926
- str(repair["algorithm"]),
927
- "--batchdelete-alpha",
928
- str(repair["alpha"]),
929
- "--batchdelete-repair-driver",
930
- str(repair["driver"]),
931
- "--batchdelete-repair-prune-mode",
932
- str(repair["prune_mode"]),
933
- "--batchdelete-per-deleted-expansion",
934
- str(repair["per_deleted_expansion"]),
935
- "--batchdelete-pq-window-l0",
936
- str(repair["pq_window_l0"]),
937
- "--batchdelete-pq-window-upper",
938
- str(repair["pq_window_upper"]),
939
- "--batchdelete-delete-search-l",
940
- str(repair["l"]),
941
- "--batchdelete-delete-search-k",
942
- str(repair["search_k"]),
943
- "--batchdelete-delete-repair-c",
944
- str(repair["c"]),
945
- "--batchdelete-delete-search-full-rerank-window",
946
- "0",
947
- ]
948
-
949
-
950
- def batch_command(
951
- config: dict[str, object], spec: RunSpec, port: int
952
- ) -> list[str]:
953
- batch = require_mapping(config, "batch")
954
- trace = {
955
- "insert": batch["insert_trace"],
956
- "delete": batch["delete_trace"],
957
- "replacement": batch["replacement_trace"],
958
- }[spec.workload]
959
- command = common_command(config, spec, port)
960
- command.extend(
961
- [
962
- "--insert-search-ef",
963
- str(spec.ef_search),
964
- "--batch-workload-root",
965
- str(batch["root"]),
966
- "--batch-workload-trace",
967
- str(trace),
968
- "--batch-start-index",
969
- str(batch["start_index"]),
970
- "--batch-count",
971
- str(spec.batch_count),
972
- "--batchdelete-every-batches",
973
- str(spec.merge_every_batches),
974
- "--insert-vector-data-type",
975
- str(config["dtype"]),
976
- "--insert-vector-path",
977
- str(batch["insert_vector_path"]),
978
- "--insert-l0-pipe-search",
979
- "--insert-l0-pipe-adaptive",
980
- "--insert-l0-pipe-width",
981
- "32",
982
- "--insert-l0-pipe-initial-width",
983
- "4",
984
- "--insert-l0-pipe-max-waste-ratio",
985
- "0.1",
986
- *repair_arguments(config),
987
- ]
988
- )
989
- if spec.experiment == "E8":
990
- command.append("--batch-read-before-merge-delete")
991
- return command
992
-
993
-
994
- def e6_prepare_command(
995
- config: dict[str, object], spec: RunSpec, output: Path
996
- ) -> list[str]:
997
- batch = require_mapping(config, "batch")
998
- query = require_mapping(config, "query")
999
- uniform = require_mapping(config, "uniform")
1000
- e6_runtime_contract(config)
1001
- materialization_contract = e6_materialization_contract(config, spec)
1002
- initial = snapshot(config, "initial")
1003
- command = [
1004
- str(PYTHON),
1005
- str(MATERIALIZER),
1006
- "--batch-workload-root",
1007
- str(batch["root"]),
1008
- "--trace-id",
1009
- str(batch["replacement_trace"]),
1010
- "--output-dir",
1011
- str(output),
1012
- "--runtime-output-dir",
1013
- str(output),
1014
- "--runtime-batch-workload-root",
1015
- str(batch["root"]),
1016
- "--query-path",
1017
- str(query["path"]),
1018
- "--runtime-query-path",
1019
- str(query["path"]),
1020
- "--initial-groundtruth-path",
1021
- str(initial["groundtruth"]),
1022
- "--runtime-initial-groundtruth-path",
1023
- str(initial["groundtruth"]),
1024
- "--start-batch-index",
1025
- str(batch["start_index"]),
1026
- "--window-count",
1027
- str(materialization_contract["source_segment_count"]),
1028
- "--uniform-e6",
1029
- "--uniform-data-workers",
1030
- str(spec.workers_per_cn),
1031
- "--uniform-merge-workers",
1032
- str(spec.merge_workers),
1033
- "--uniform-query-ratio",
1034
- str(uniform["query_ratio"]),
1035
- "--uniform-insert-ratio",
1036
- str(uniform["insert_ratio"]),
1037
- "--uniform-mark-delete-ratio",
1038
- str(uniform["mark_delete_ratio"]),
1039
- "--uniform-ratio-window-multiplier",
1040
- str(uniform["ratio_window_multiplier"]),
1041
- "--acknowledged-tombstone-fraction",
1042
- str(uniform["acknowledged_tombstone_fraction"]),
1043
- "--search-max-queue-depth",
1044
- str(uniform["search_queue_depth"]),
1045
- "--insert-max-queue-depth",
1046
- str(uniform["insert_queue_depth"]),
1047
- "--mark-delete-max-queue-depth",
1048
- str(uniform["mark_delete_queue_depth"]),
1049
- "--merge-delete-max-queue-depth",
1050
- str(uniform["merge_delete_queue_depth"]),
1051
- "--search-max-inflight",
1052
- str(uniform["search_max_inflight"]),
1053
- "--insert-max-inflight",
1054
- str(uniform["insert_max_inflight"]),
1055
- "--mark-delete-max-inflight",
1056
- str(uniform["mark_delete_max_inflight"]),
1057
- "--merge-delete-max-inflight",
1058
- str(uniform["merge_delete_max_inflight"]),
1059
- "--overflow-policy",
1060
- "wait_for_capacity",
1061
- "--workload-id",
1062
- spec.run_id,
1063
- "--source-snapshot",
1064
- str(config.get("source_snapshot", "")),
1065
- ]
1066
- vector_root = Path(str(batch["insert_vector_path"])).parent
1067
- if config.get("prepared_workload") or vector_root.resolve() != Path(str(batch["root"])).resolve():
1068
- command.extend([
1069
- "--insert-vector-source-root", str(vector_root),
1070
- "--runtime-insert-vector-source-root", str(vector_root),
1071
- ])
1072
- if bool(batch.get("e6_skip_final_merge_delete", False)):
1073
- command.append("--uniform-skip-final-merge-delete")
1074
- return command
1075
-
1076
-
1077
- def m1_prepare_command(
1078
- config: dict[str, object], spec: RunSpec, output: Path
1079
- ) -> list[str]:
1080
- batch = require_mapping(config, "batch")
1081
- query = require_mapping(config, "query")
1082
- uniform = require_mapping(config, "uniform")
1083
- topology = require_mapping(config, "topology")
1084
- initial = snapshot(config, "initial")
1085
- return [
1086
- str(PYTHON),
1087
- str(M1_PREPARER),
1088
- "--batch-workload-root",
1089
- str(batch["root"]),
1090
- "--trace-id",
1091
- str(batch["replacement_trace"]),
1092
- "--output-dir",
1093
- str(output),
1094
- "--runtime-output-dir",
1095
- str(output),
1096
- "--query-path",
1097
- str(query["path"]),
1098
- "--initial-groundtruth-path",
1099
- str(initial["groundtruth"]),
1100
- "--start-batch-index",
1101
- str(batch["start_index"]),
1102
- "--prepare-batches",
1103
- str(batch["m1_prepare_batches"]),
1104
- "--measurement-batches",
1105
- str(batch["m1_measurement_batches"]),
1106
- "--reference-node-count",
1107
- str(topology["storage_max_node_capacity"]),
1108
- "--acknowledged-tombstone-fraction",
1109
- str(uniform["acknowledged_tombstone_fraction"]),
1110
- "--uniform-data-workers",
1111
- str(spec.workers_per_cn),
1112
- "--uniform-merge-workers",
1113
- str(spec.merge_workers),
1114
- "--ratio-window-multiplier",
1115
- str(uniform["ratio_window_multiplier"]),
1116
- "--search-max-queue-depth",
1117
- str(uniform["search_queue_depth"]),
1118
- "--insert-max-queue-depth",
1119
- str(uniform["insert_queue_depth"]),
1120
- "--mark-delete-max-queue-depth",
1121
- str(uniform["mark_delete_queue_depth"]),
1122
- "--merge-delete-max-queue-depth",
1123
- str(uniform["merge_delete_queue_depth"]),
1124
- "--search-max-inflight",
1125
- str(uniform["search_max_inflight"]),
1126
- "--insert-max-inflight",
1127
- str(uniform["insert_max_inflight"]),
1128
- "--mark-delete-max-inflight",
1129
- str(uniform["mark_delete_max_inflight"]),
1130
- "--merge-delete-max-inflight",
1131
- str(uniform["merge_delete_max_inflight"]),
1132
- "--workload-id",
1133
- spec.run_id,
1134
- "--source-snapshot",
1135
- str(config.get("source_snapshot", "")),
1136
- ]
1137
-
1138
-
1139
- def validate_m1_materialization(materialized: Path) -> None:
1140
- manifest = read_json(materialized / "manifest.json")
1141
- metadata = read_json(materialized / "metadata.json")
1142
- if (
1143
- manifest.get("workload_mode") != "m1_access_overlap"
1144
- or manifest.get("window_lifecycle") != "continuous_logical_windows"
1145
- ):
1146
- raise ValueError("M1 manifest has the wrong runtime mode")
1147
- windows = manifest.get("windows")
1148
- if not isinstance(windows, list) or len(windows) != 2:
1149
- raise ValueError("M1 manifest must contain setup and measurement windows")
1150
- setup, measurement = windows
1151
- if (
1152
- setup.get("target_mark_delete_count", 0) <= 0
1153
- or setup.get("target_query_count") != 0
1154
- or setup.get("target_insert_count") != 0
1155
- or setup.get("merge_delete_mode") != "concurrent"
1156
- or "merge_delete_trigger" not in setup
1157
- ):
1158
- raise ValueError(
1159
- "M1 setup window must be MarkDelete-only and trigger repair"
1160
- )
1161
- if (
1162
- measurement.get("target_mark_delete_count") != 0
1163
- or measurement.get("target_query_count")
1164
- != measurement.get("target_insert_count")
1165
- or measurement.get("duration_seconds") != 60.0
1166
- or measurement.get("merge_delete_mode") != "disabled"
1167
- ):
1168
- raise ValueError("M1 measurement window must be 60-second Query/Insert 1:1")
1169
- if not isinstance(metadata.get("m1"), dict):
1170
- raise ValueError("M1 metadata is missing its experiment contract")
1171
-
1172
-
1173
- def e6_runtime_contract(config: dict[str, object]) -> dict[str, str]:
1174
- uniform = require_mapping(config, "uniform")
1175
- expected = dict(E6_RUNTIME_CONTRACT)
1176
- for field, value in expected.items():
1177
- if uniform.get(field) != value:
1178
- raise ValueError(
1179
- f"E6 uniform.{field} must be {value!r}, "
1180
- f"got {uniform.get(field)!r}"
1181
- )
1182
- return expected
1183
-
1184
-
1185
- def e6_materialization_contract(
1186
- config: dict[str, object], spec: RunSpec
1187
- ) -> dict[str, int | bool]:
1188
- batch = require_mapping(config, "batch")
1189
- topology = require_mapping(config, "topology")
1190
- uniform = require_mapping(config, "uniform")
1191
- evaluation_windows = spec.batch_count
1192
- source_segments_per_window = int(
1193
- batch.get("e6_source_segments_per_window", 1)
1194
- )
1195
- source_insert_count = int(
1196
- batch.get("e6_source_segment_update_count", 0)
1197
- )
1198
- if evaluation_windows <= 0:
1199
- raise ValueError("E6 evaluation window count must be positive")
1200
- if source_segments_per_window <= 0:
1201
- raise ValueError("E6 source segments per window must be positive")
1202
- if source_insert_count <= 0:
1203
- raise ValueError("E6 source segment update count must be positive")
1204
-
1205
- query_ratio = int(uniform["query_ratio"])
1206
- insert_ratio = int(uniform["insert_ratio"])
1207
- mark_delete_ratio = int(uniform["mark_delete_ratio"])
1208
- if min(query_ratio, insert_ratio, mark_delete_ratio) <= 0:
1209
- raise ValueError("E6 operation ratios must be positive")
1210
- ratio_units, remainder = divmod(source_insert_count, insert_ratio)
1211
- if remainder:
1212
- raise ValueError(
1213
- "E6 source segment update count must be divisible by insert ratio"
1214
- )
1215
- source_query_count = ratio_units * query_ratio
1216
- source_mark_delete_count = ratio_units * mark_delete_ratio
1217
- evaluation_insert_count = (
1218
- source_insert_count * source_segments_per_window
1219
- )
1220
- evaluation_query_count = (
1221
- source_query_count * source_segments_per_window
1222
- )
1223
- evaluation_mark_delete_count = (
1224
- source_mark_delete_count * source_segments_per_window
1225
- )
1226
-
1227
- reference_count = int(topology["storage_max_node_capacity"])
1228
- threshold_fraction = float(
1229
- uniform["acknowledged_tombstone_fraction"]
1230
- )
1231
- threshold_value = threshold_fraction * reference_count
1232
- threshold_count = round(threshold_value)
1233
- if abs(threshold_value - threshold_count) > 1e-6:
1234
- raise ValueError(
1235
- "E6 acknowledged tombstone fraction must produce an integer count"
1236
- )
1237
- if threshold_count != evaluation_mark_delete_count:
1238
- raise ValueError(
1239
- "E6 acknowledged tombstone threshold must equal one evaluation "
1240
- f"window: threshold={threshold_count} "
1241
- f"window_mark_deletes={evaluation_mark_delete_count}"
1242
- )
1243
-
1244
- source_segment_count = (
1245
- evaluation_windows * source_segments_per_window
1246
- )
1247
- skip_final_merge = bool(
1248
- batch.get("e6_skip_final_merge_delete", False)
1249
- )
1250
- return {
1251
- "evaluation_window_count": evaluation_windows,
1252
- "source_segments_per_evaluation_window": (
1253
- source_segments_per_window
1254
- ),
1255
- "source_segment_count": source_segment_count,
1256
- "source_query_count": source_query_count,
1257
- "source_insert_count": source_insert_count,
1258
- "source_mark_delete_count": source_mark_delete_count,
1259
- "evaluation_window_query_count": evaluation_query_count,
1260
- "evaluation_window_insert_count": evaluation_insert_count,
1261
- "evaluation_window_mark_delete_count": (
1262
- evaluation_mark_delete_count
1263
- ),
1264
- "total_query_count": evaluation_query_count * evaluation_windows,
1265
- "total_insert_count": evaluation_insert_count * evaluation_windows,
1266
- "total_mark_delete_count": (
1267
- evaluation_mark_delete_count * evaluation_windows
1268
- ),
1269
- "merge_threshold_mark_delete_count": threshold_count,
1270
- "expected_merge_epoch_count": (
1271
- evaluation_windows - int(skip_final_merge)
1272
- ),
1273
- "skip_final_merge_delete": skip_final_merge,
1274
- }
1275
-
1276
-
1277
- def validate_e6_materialization(
1278
- materialized: Path,
1279
- contract: dict[str, object],
1280
- materialization_contract: dict[str, object] | None = None,
1281
- ) -> None:
1282
- expected_contract = contract or E6_RUNTIME_CONTRACT
1283
- manifest = read_json(materialized / "manifest.json")
1284
- metadata = read_json(materialized / "metadata.json")
1285
- if manifest.get("workload_mode") != "continuous_uniform":
1286
- raise ValueError("E6 manifest must use continuous_uniform workload mode")
1287
- if manifest.get("window_lifecycle") != "continuous_logical_windows":
1288
- raise ValueError(
1289
- "E6 manifest windows must be logical input/progress segments"
1290
- )
1291
- windows = manifest.get("windows")
1292
- if not isinstance(windows, list) or not windows:
1293
- raise ValueError("E6 manifest must contain logical workload segments")
1294
- skip_final_merge = (
1295
- bool(
1296
- materialization_contract.get(
1297
- "skip_final_merge_delete", True
1298
- )
1299
- )
1300
- if materialization_contract
1301
- else True
1302
- )
1303
- expected_final_mode = (
1304
- "disabled" if skip_final_merge else "concurrent"
1305
- )
1306
- if (
1307
- not isinstance(windows[-1], dict)
1308
- or windows[-1].get("merge_delete_mode") != expected_final_mode
1309
- ):
1310
- raise ValueError(
1311
- "E6 final logical segment must use "
1312
- f"merge_delete_mode={expected_final_mode}"
1313
- )
1314
- if not any(
1315
- isinstance(window, dict)
1316
- and window.get("merge_delete_mode") == "concurrent"
1317
- for window in windows
1318
- ):
1319
- raise ValueError("E6 requires at least one acknowledged-delete trigger")
1320
- materialized_contract = metadata.get("runtime_contract")
1321
- if not isinstance(materialized_contract, dict):
1322
- raise ValueError("E6 metadata is missing runtime_contract")
1323
- for field, expected in expected_contract.items():
1324
- if materialized_contract.get(field) != expected:
1325
- raise ValueError(
1326
- f"E6 materialized runtime_contract.{field} must be "
1327
- f"{expected!r}, got {materialized_contract.get(field)!r}"
1328
- )
1329
- if materialization_contract:
1330
- expected_segments = int(
1331
- materialization_contract["source_segment_count"]
1332
- )
1333
- if len(windows) != expected_segments:
1334
- raise ValueError(
1335
- "E6 materialized source segment count must be "
1336
- f"{expected_segments}, got {len(windows)}"
1337
- )
1338
- expected_query = int(
1339
- materialization_contract["source_query_count"]
1340
- )
1341
- expected_insert = int(
1342
- materialization_contract["source_insert_count"]
1343
- )
1344
- expected_delete = int(
1345
- materialization_contract["source_mark_delete_count"]
1346
- )
1347
- expected_threshold = int(
1348
- materialization_contract[
1349
- "merge_threshold_mark_delete_count"
1350
- ]
1351
- )
1352
- for index, window in enumerate(windows, start=1):
1353
- if not isinstance(window, dict):
1354
- raise ValueError(
1355
- f"E6 materialized source segment {index} is invalid"
1356
- )
1357
- counts = (
1358
- int(window.get("target_query_count", -1)),
1359
- int(window.get("target_insert_count", -1)),
1360
- int(window.get("target_mark_delete_count", -1)),
1361
- )
1362
- if counts != (expected_query, expected_insert, expected_delete):
1363
- raise ValueError(
1364
- f"E6 materialized source segment {index} has counts "
1365
- f"{counts}, expected "
1366
- f"{(expected_query, expected_insert, expected_delete)}"
1367
- )
1368
- expected_mode = (
1369
- "disabled"
1370
- if skip_final_merge and index == expected_segments
1371
- else "concurrent"
1372
- )
1373
- if window.get("merge_delete_mode") != expected_mode:
1374
- raise ValueError(
1375
- f"E6 materialized source segment {index} must use "
1376
- f"merge_delete_mode={expected_mode}"
1377
- )
1378
- trigger = window.get("merge_delete_trigger")
1379
- if expected_mode == "disabled":
1380
- if trigger is not None:
1381
- raise ValueError(
1382
- "E6 final source segment must omit its merge trigger"
1383
- )
1384
- continue
1385
- if not isinstance(trigger, dict):
1386
- raise ValueError(
1387
- f"E6 materialized source segment {index} is missing "
1388
- "its merge trigger"
1389
- )
1390
- reference_count = int(
1391
- trigger.get("reference_node_count", 0)
1392
- )
1393
- threshold_count = round(
1394
- float(trigger.get("threshold", 0.0)) * reference_count
1395
- )
1396
- if threshold_count != expected_threshold:
1397
- raise ValueError(
1398
- f"E6 materialized source segment {index} has "
1399
- f"merge threshold {threshold_count}, expected "
1400
- f"{expected_threshold}"
1401
- )
1402
-
1403
-
1404
- def concurrent_command(
1405
- config: dict[str, object], spec: RunSpec, port: int, manifest: Path
1406
- ) -> list[str]:
1407
- uniform = require_mapping(config, "uniform")
1408
- command = common_command(config, spec, port)
1409
- command.extend(
1410
- [
1411
- "--concurrent-mode",
1412
- "--concurrent-workload-manifest",
1413
- str(manifest),
1414
- "--task-runtime",
1415
- "uniform",
1416
- "--uniform-data-workers",
1417
- str(spec.workers_per_cn),
1418
- "--uniform-merge-workers",
1419
- str(spec.merge_workers),
1420
- "--uniform-query-ratio",
1421
- str(uniform["query_ratio"]),
1422
- "--uniform-insert-ratio",
1423
- str(uniform["insert_ratio"]),
1424
- "--uniform-mark-delete-ratio",
1425
- str(uniform["mark_delete_ratio"]),
1426
- "--uniform-ratio-window-multiplier",
1427
- str(uniform["ratio_window_multiplier"]),
1428
- "--search-max-queue-depth",
1429
- str(uniform["search_queue_depth"]),
1430
- "--insert-max-queue-depth",
1431
- str(uniform["insert_queue_depth"]),
1432
- "--mark-delete-max-queue-depth",
1433
- str(uniform["mark_delete_queue_depth"]),
1434
- "--merge-delete-max-queue-depth",
1435
- str(uniform["merge_delete_queue_depth"]),
1436
- "--search-max-inflight",
1437
- str(uniform["search_max_inflight"]),
1438
- "--insert-max-inflight",
1439
- str(uniform["insert_max_inflight"]),
1440
- "--mark-delete-max-inflight",
1441
- str(uniform["mark_delete_max_inflight"]),
1442
- "--merge-delete-max-inflight",
1443
- str(uniform["merge_delete_max_inflight"]),
1444
- "--overflow-policy",
1445
- "wait_for_capacity",
1446
- "--insert-search-ef",
1447
- str(spec.ef_search),
1448
- *repair_arguments(config),
1449
- ]
1450
- )
1451
- return command
1452
-
1453
-
1454
- def trace_for(config: dict[str, object], workload: str) -> str:
1455
- batch = require_mapping(config, "batch")
1456
- return str(
1457
- {
1458
- "insert": batch["insert_trace"],
1459
- "delete": batch["delete_trace"],
1460
- "replacement": batch["replacement_trace"],
1461
- }[workload]
1462
- )
1463
-
1464
-
1465
- def run_artifacts(
1466
- config: dict[str, object], spec: RunSpec
1467
- ) -> tuple[list[str], list[str]]:
1468
- selected_snapshot = snapshot(config, spec.snapshot)
1469
- pq = require_mapping(config, "pq")
1470
- query = require_mapping(config, "query")
1471
- compute = [
1472
- str(selected_snapshot["index"]),
1473
- str(query["path"]),
1474
- str(selected_snapshot["groundtruth"]),
1475
- str(pq["meta"]),
1476
- str(pq["codebook"]),
1477
- snapshot_pq_codes(selected_snapshot, "compute"),
1478
- *sidecar_files(str(selected_snapshot["sidecar"])),
1479
- ]
1480
- if query.get("manifest"):
1481
- compute.append(str(query["manifest"]))
1482
- storage = [
1483
- str(selected_snapshot["index"]),
1484
- str(pq["meta"]),
1485
- snapshot_pq_codes(selected_snapshot, "storage"),
1486
- *sidecar_files(str(selected_snapshot["sidecar"])),
1487
- ]
1488
- if spec.kind in {"batch", "concurrent"}:
1489
- batch = require_mapping(config, "batch")
1490
- root = Path(str(batch["root"]))
1491
- trace = trace_for(config, spec.workload)
1492
- if spec.experiment == "E6":
1493
- source_batch_count = int(
1494
- e6_materialization_contract(config, spec)[
1495
- "source_segment_count"
1496
- ]
1497
- )
1498
- elif spec.experiment == "M1":
1499
- source_batch_count = int(batch["m1_prepare_batches"]) + int(
1500
- batch["m1_measurement_batches"]
1501
- )
1502
- else:
1503
- source_batch_count = spec.batch_count
1504
- compute.extend(
1505
- [
1506
- str(root / "workload.json"),
1507
- str(root / "traces" / trace / "trace.json"),
1508
- str(batch["insert_vector_path"]),
1509
- ]
1510
- )
1511
- for index in range(
1512
- int(batch["start_index"]),
1513
- int(batch["start_index"]) + source_batch_count,
1514
- ):
1515
- batch_path = root / "traces" / trace / "batches" / f"batch_{index:04d}.json"
1516
- compute.append(str(batch_path))
1517
- if batch_path.is_file():
1518
- compute.extend(batch_payload_paths(root, batch_path))
1519
- else:
1520
- compute.append(str(
1521
- root / "traces" / trace / "groundtruth" / f"checkpoint_{index:04d}.bin"
1522
- ))
1523
- prepared = config.get("prepared_workload")
1524
- if isinstance(prepared, dict) and prepared.get("profile"):
1525
- compute.append(str(prepared["profile"]))
1526
- validation = Path(str(prepared["profile"])).parent / "validation.json"
1527
- if validation.is_file():
1528
- compute.append(str(validation))
1529
- return list(dict.fromkeys(compute)), list(dict.fromkeys(storage))
1530
-
1531
-
1532
- def batch_payload_paths(root: Path, batch_path: Path) -> list[str]:
1533
- """Include the actual u32 streams and checkpoint selected by compact JSON."""
1534
- document = read_json(batch_path)
1535
- package_root = root.resolve()
1536
- trace_root = batch_path.parent.parent.resolve()
1537
-
1538
- def contained_path(raw: object, relative_to: Path, boundary: Path) -> str:
1539
- if not isinstance(raw, str) or not raw or Path(raw).is_absolute():
1540
- raise ValueError(f"batch artifact path must be relative: {raw!r}")
1541
- resolved = (relative_to / raw).resolve()
1542
- if not resolved.is_relative_to(boundary):
1543
- raise ValueError(f"batch artifact escapes its package: {raw}")
1544
- return str(resolved)
1545
-
1546
- paths = []
1547
- for operation in document.get("operations", []):
1548
- for field in ("external_ids", "vector_refs"):
1549
- descriptor = operation.get(field)
1550
- if isinstance(descriptor, dict) and descriptor.get("encoding") in {
1551
- "u32_slice", "u32_cyclic_slice"
1552
- }:
1553
- paths.append(contained_path(
1554
- descriptor.get("path"), batch_path.parent, package_root
1555
- ))
1556
- checkpoint = require_mapping(document, "checkpoint")
1557
- paths.append(contained_path(
1558
- checkpoint.get("groundtruth", checkpoint.get("groundtruth_path")),
1559
- trace_root,
1560
- trace_root,
1561
- ))
1562
- return list(dict.fromkeys(paths))
1563
-
1564
-
1565
- def readiness_command(
1566
- config: dict[str, object],
1567
- spec: RunSpec,
1568
- port: int,
1569
- compute_sha256: str,
1570
- storage_sha256: str,
1571
- ) -> list[str]:
1572
- topology = require_mapping(config, "topology")
1573
- compute_artifacts, storage_artifacts = run_artifacts(config, spec)
1574
- command = [
1575
- str(PYTHON),
1576
- str(READINESS),
1577
- "--num-cns",
1578
- str(spec.num_cns),
1579
- "--num-sns",
1580
- str(spec.num_mns),
1581
- "--port",
1582
- str(port),
1583
- "--storage-bytes-per-node",
1584
- str(topology["memory_bytes_per_mn"]),
1585
- "--compute-sha256",
1586
- compute_sha256,
1587
- "--storage-sha256",
1588
- storage_sha256,
1589
- ]
1590
- for path in compute_artifacts:
1591
- command.extend(["--compute-artifact", path])
1592
- for path in storage_artifacts:
1593
- command.extend(["--storage-artifact", path])
1594
- return command
1595
-
1596
-
1597
- def query_storage_key(
1598
- config: dict[str, object],
1599
- spec: RunSpec,
1600
- storage_sha256: str,
1601
- ) -> dict[str, object]:
1602
- topology = require_mapping(config, "topology")
1603
- runtime = require_mapping(config, "runtime")
1604
- pq = require_mapping(config, "pq")
1605
- selected_snapshot = snapshot(config, spec.snapshot)
1606
- storage_nodes = list(topology["storage_nodes"])[: spec.num_mns]
1607
- return {
1608
- "dataset_id": config["dataset_id"],
1609
- "storage_nodes": storage_nodes,
1610
- "memory_node_ids": [7] if spec.num_mns == 1 else list(range(spec.num_mns)),
1611
- "num_mns": spec.num_mns,
1612
- "storage_binary_path": REMOTE_STORAGE_BINARY,
1613
- "storage_binary_sha256": storage_sha256,
1614
- "mn_linearizable": spec.record_mode == "mn-linearizable",
1615
- "runtime_id_mode": runtime["runtime_id_mode"],
1616
- "index_path": selected_snapshot["index"],
1617
- "data_type": config["dtype"],
1618
- "pq_codes_path": snapshot_pq_codes(selected_snapshot, "storage"),
1619
- "skip_initial_pq_codes": bool(
1620
- topology.get("storage_skip_initial_pq_codes", False)
1621
- ),
1622
- "pq_meta_path": pq["meta"],
1623
- "sidecar_manifest_path": selected_snapshot["sidecar"],
1624
- "max_node_capacity": topology["storage_max_node_capacity"],
1625
- "hash_directory_load_factor": topology["hash_directory_load_factor"],
1626
- "registered_bytes_per_mn": topology["memory_bytes_per_mn"],
1627
- }
1628
-
1629
-
1630
- def shell_script(path: Path, command: list[str], config: dict[str, object]) -> None:
1631
- topology = require_mapping(config, "topology")
1632
- content = (
1633
- "#!/usr/bin/env bash\n"
1634
- "set -euo pipefail\n"
1635
- f"export VECTORDB_CXL_COMPUTE_NODES={','.join(topology['compute_nodes'])}\n"
1636
- f"export VECTORDB_CXL_STORAGE_NODES={','.join(topology['storage_nodes'])}\n"
1637
- f"exec {shlex.join(command)}\n"
1638
- )
1639
- path.parent.mkdir(parents=True, exist_ok=True)
1640
- path.write_text(content, encoding="utf-8")
1641
- path.chmod(0o755)
1642
-
1643
-
1644
- def create_query_cohorts(
1645
- config: dict[str, object],
1646
- root: Path,
1647
- specs: list[RunSpec],
1648
- rows: list[dict[str, object]],
1649
- port_base: int,
1650
- compute_sha256: str,
1651
- storage_sha256: str,
1652
- inter_run_wait_seconds: float,
1653
- ) -> list[dict[str, object]]:
1654
- topology = require_mapping(config, "topology")
1655
- read_qp_pool_size = int(
1656
- topology.get("read_qp_pool_size", topology["workers_per_cn"])
1657
- )
1658
- if read_qp_pool_size <= 0:
1659
- raise ValueError("topology.read_qp_pool_size must be positive")
1660
- grouped: dict[tuple[object, ...], list[RunSpec]] = {}
1661
- for spec in specs:
1662
- if spec.kind != "query":
1663
- continue
1664
- key = (
1665
- spec.snapshot,
1666
- spec.num_mns,
1667
- spec.record_mode,
1668
- )
1669
- grouped.setdefault(key, []).append(spec)
1670
- row_by_id = {str(row["run_id"]): row for row in rows}
1671
- cohorts = []
1672
- for offset, group in enumerate(grouped.values()):
1673
- cohort_id = (
1674
- f"{group[0].experiment.lower()}-{config['dataset_id']}-"
1675
- f"{group[0].record_mode}-q{offset + 1}"
1676
- )
1677
- manifest_path = (root / "artifacts" / f"{cohort_id}.session.json").resolve()
1678
- sessions = []
1679
- for spec in group:
1680
- run_root = (root / "runs" / spec.run_id).resolve()
1681
- sessions.append(
1682
- {
1683
- "run_id": spec.run_id,
1684
- "num_cns": spec.num_cns,
1685
- "num_threads": spec.workers_per_cn + 1,
1686
- "read_qp_pool_size": read_qp_pool_size,
1687
- "ef_search": spec.ef_search,
1688
- "reranking_factor": spec.reranking_factor,
1689
- "query_limit": spec.query_limit,
1690
- "progress_interval": 1000,
1691
- "compute_pq_residency": (
1692
- "mn"
1693
- if spec.cache_variant in {"no-cache", "upper-only"}
1694
- else "cn"
1695
- ),
1696
- "compute_pq_codes_path": (
1697
- ""
1698
- if spec.cache_variant in {"no-cache", "upper-only"}
1699
- else snapshot_pq_codes(snapshot(config, spec.snapshot), "compute")
1700
- ),
1701
- "disable_upper_cache": spec.cache_variant
1702
- in {"no-cache", "pq"},
1703
- "compute_hosts": list(topology["compute_nodes"])[: spec.num_cns],
1704
- "stdout_path": str(run_root / "stdout.log"),
1705
- "stderr_path": str(run_root / "stderr.log"),
1706
- "result_path": str(run_root / "session_result.json"),
1707
- }
1708
- )
1709
- row_by_id[spec.run_id]["cohort_id"] = cohort_id
1710
- manifest = {
1711
- "schema_version": 1,
1712
- "storage_lifecycle": "reuse",
1713
- "inter_session_wait_seconds": inter_run_wait_seconds,
1714
- "cohort_id": cohort_id,
1715
- "storage_key": query_storage_key(config, group[0], storage_sha256),
1716
- "result_path": str((root / "artifacts" / f"{cohort_id}.result.json").resolve()),
1717
- "storage_stdout_path": str(
1718
- (root / "logs" / f"{cohort_id}.storage.stdout.log").resolve()
1719
- ),
1720
- "storage_stderr_path": str(
1721
- (root / "logs" / f"{cohort_id}.storage.stderr.log").resolve()
1722
- ),
1723
- "sessions": sessions,
1724
- }
1725
- write_json(manifest_path, manifest)
1726
- command_spec = max(
1727
- group, key=lambda item: (item.num_cns, item.workers_per_cn)
1728
- )
1729
- port = port_base + offset
1730
- command = common_command(config, command_spec, port)
1731
- if command_spec.record_mode in ATOMIC_RECORD_MODES:
1732
- command.append("--query-session-requires-atomics")
1733
- command.extend(["--query-session-manifest", str(manifest_path)])
1734
- readiness = readiness_command(
1735
- config,
1736
- command_spec,
1737
- port,
1738
- compute_sha256,
1739
- storage_sha256,
1740
- )
1741
- command_path = root / "commands" / f"{cohort_id}.sh"
1742
- shell_script(command_path, command, config)
1743
- cohorts.append(
1744
- {
1745
- "cohort_id": cohort_id,
1746
- "run_ids": [spec.run_id for spec in group],
1747
- "manifest_path": str(manifest_path),
1748
- "command": command,
1749
- "command_path": str(command_path),
1750
- "readiness_command": readiness,
1751
- "port": port,
1752
- "num_cns": command_spec.num_cns,
1753
- "num_mns": command_spec.num_mns,
1754
- }
1755
- )
1756
- return cohorts
1757
-
1758
-
1759
- def git_text(*args: str) -> str:
1760
- result = subprocess.run(
1761
- ["git", *args],
1762
- cwd=CXL_ROOT,
1763
- text=True,
1764
- capture_output=True,
1765
- check=True,
1766
- )
1767
- return result.stdout.strip()
1768
-
1769
-
1770
- def create_campaign(
1771
- experiment: str,
1772
- config_path: Path,
1773
- root: Path,
1774
- args: argparse.Namespace,
1775
- ) -> dict[str, object]:
1776
- if (root / "campaign.json").exists():
1777
- raise ValueError(
1778
- f"campaign already exists: {root}; use run/status or a new directory"
1779
- )
1780
- config = load_config(
1781
- config_path,
1782
- data_root=args.data_root,
1783
- dataset_prefix=args.dataset_prefix,
1784
- selected_dataset_id=args.dataset_id,
1785
- dataset_label=args.dataset_label,
1786
- )
1787
- specs = build_specs(experiment, config, args)
1788
- compute_sha256 = binary_sha(
1789
- args.compute_sha256,
1790
- "build/src/compute/vectordb_compute_node",
1791
- "compute",
1792
- )
1793
- storage_sha256 = binary_sha(
1794
- args.storage_sha256,
1795
- "build/src/storage/vectordb_storage_node",
1796
- "storage",
1797
- )
1798
- root.mkdir(parents=True, exist_ok=True)
1799
- rows: list[dict[str, object]] = []
1800
- for index, spec in enumerate(specs):
1801
- run_root = (root / "runs" / spec.run_id).resolve()
1802
- run_root.mkdir(parents=True, exist_ok=True)
1803
- row = asdict(spec) | {
1804
- "run_root": str(run_root),
1805
- "cohort_id": "",
1806
- "status": "pending",
1807
- "port": args.port_base + 100 + index,
1808
- }
1809
- rows.append(row)
1810
- write_json(run_root / "spec.json", row)
1811
-
1812
- cohorts = create_query_cohorts(
1813
- config,
1814
- root.resolve(),
1815
- specs,
1816
- rows,
1817
- args.port_base,
1818
- compute_sha256,
1819
- storage_sha256,
1820
- args.inter_run_wait_seconds,
1821
- )
1822
- standalone = []
1823
- for index, spec in enumerate(item for item in specs if item.kind != "query"):
1824
- row = next(item for item in rows if item["run_id"] == spec.run_id)
1825
- port = int(row["port"])
1826
- prepare_command: list[str] = []
1827
- materialized_dir = (Path(str(row["run_root"])) / "materialized").resolve()
1828
- if spec.kind == "batch":
1829
- command = batch_command(config, spec, port)
1830
- else:
1831
- prepare_command = (
1832
- m1_prepare_command(config, spec, materialized_dir)
1833
- if spec.experiment == "M1"
1834
- else e6_prepare_command(config, spec, materialized_dir)
1835
- )
1836
- command = concurrent_command(
1837
- config, spec, port, materialized_dir / "manifest.json"
1838
- )
1839
- readiness = readiness_command(
1840
- config, spec, port, compute_sha256, storage_sha256
1841
- )
1842
- command_path = root / "commands" / f"{spec.run_id}.sh"
1843
- shell_script(command_path, command, config)
1844
- if prepare_command:
1845
- shell_script(
1846
- root / "commands" / f"{spec.run_id}.prepare.sh",
1847
- prepare_command,
1848
- config,
1849
- )
1850
- standalone.append(
1851
- {
1852
- "run_id": spec.run_id,
1853
- "kind": spec.kind,
1854
- "command": command,
1855
- "command_path": str(command_path),
1856
- "prepare_command": prepare_command,
1857
- "readiness_command": readiness,
1858
- "materialized_dir": (
1859
- str(materialized_dir) if prepare_command else ""
1860
- ),
1861
- "runtime_contract": (
1862
- e6_runtime_contract(config)
1863
- if spec.experiment == "E6"
1864
- else {}
1865
- ),
1866
- "materialization_contract": (
1867
- e6_materialization_contract(config, spec)
1868
- if spec.experiment == "E6"
1869
- else {}
1870
- ),
1871
- "port": port,
1872
- "num_cns": spec.num_cns,
1873
- "num_mns": spec.num_mns,
1874
- }
1875
- )
1876
-
1877
- campaign = {
1878
- "schema_version": 1,
1879
- "created_utc": utc_now(),
1880
- "experiment": experiment,
1881
- "dataset_id": config["dataset_id"],
1882
- "dataset_label": config["dataset_label"],
1883
- "config_path": str(config_path.resolve()),
1884
- "config_sha256": file_sha256(config_path),
1885
- "source_branch": git_text("branch", "--show-current"),
1886
- "source_commit": git_text("rev-parse", "HEAD"),
1887
- "dirty_paths": git_text("status", "--short").splitlines(),
1888
- "compute_binary_sha256": compute_sha256,
1889
- "storage_binary_sha256": storage_sha256,
1890
- "inter_run_wait_seconds": args.inter_run_wait_seconds,
1891
- "compute_nodes": require_mapping(config, "topology")["compute_nodes"],
1892
- "storage_nodes": require_mapping(config, "topology")["storage_nodes"],
1893
- "runs": rows,
1894
- "query_cohorts": cohorts,
1895
- "standalone_runs": standalone,
1896
- }
1897
- write_json(root / "campaign.json", campaign)
1898
- return campaign
1899
-
1900
-
1901
- def load_campaign(root: Path) -> dict[str, object]:
1902
- path = root / "campaign.json"
1903
- if not path.is_file():
1904
- raise ValueError(f"campaign is not planned: {path}")
1905
- return read_json(path)
1906
-
1907
-
1908
- def campaign_env(campaign: dict[str, object]) -> dict[str, str]:
1909
- env = os.environ.copy()
1910
- if env.get("VECTORDB_EVAL_PRESERVE_SSH_AUTH_SOCK") != "1":
1911
- env.pop("SSH_AUTH_SOCK", None)
1912
- env["VECTORDB_CXL_COMPUTE_NODES"] = ",".join(campaign["compute_nodes"])
1913
- env["VECTORDB_CXL_STORAGE_NODES"] = ",".join(campaign["storage_nodes"])
1914
- return env
1915
-
1916
-
1917
- def run_logged(
1918
- command: list[str],
1919
- *,
1920
- stdout_path: Path,
1921
- stderr_path: Path,
1922
- env: dict[str, str],
1923
- heartbeat: Callable[[], None] | None = None,
1924
- ) -> int:
1925
- stdout_path.parent.mkdir(parents=True, exist_ok=True)
1926
- stop_heartbeat = threading.Event()
1927
- heartbeat_thread: threading.Thread | None = None
1928
- if heartbeat is not None:
1929
- def pulse() -> None:
1930
- while not stop_heartbeat.wait(5.0):
1931
- heartbeat()
1932
-
1933
- heartbeat_thread = threading.Thread(target=pulse, daemon=True)
1934
- heartbeat_thread.start()
1935
- with stdout_path.open("w", encoding="utf-8") as stdout, stderr_path.open(
1936
- "w", encoding="utf-8"
1937
- ) as stderr:
1938
- try:
1939
- return subprocess.run(
1940
- command,
1941
- cwd=CXL_ROOT,
1942
- env=env,
1943
- stdout=stdout,
1944
- stderr=stderr,
1945
- check=False,
1946
- ).returncode
1947
- finally:
1948
- stop_heartbeat.set()
1949
- if heartbeat_thread is not None:
1950
- heartbeat_thread.join()
1951
-
1952
-
1953
- def run_checked(
1954
- command: list[str],
1955
- *,
1956
- env: dict[str, str],
1957
- label: str,
1958
- ) -> None:
1959
- result = subprocess.run(command, cwd=CXL_ROOT, env=env, check=False)
1960
- if result.returncode != 0:
1961
- raise RuntimeError(f"{label} failed with return code {result.returncode}")
1962
-
1963
-
1964
- def kill_command(num_cns: int, num_mns: int) -> list[str]:
1965
- return [
1966
- str(PYTHON),
1967
- str(KILL_ALL),
1968
- "--num-cns",
1969
- str(num_cns),
1970
- "--num-sns",
1971
- str(num_mns),
1972
- ]
1973
-
1974
-
1975
- def completion_path(root: Path, run_id: str) -> Path:
1976
- return root / "runs" / run_id / "completed.json"
1977
-
1978
-
1979
- def pending_run_ids(
1980
- root: Path, run_ids: Iterable[str], resume: bool
1981
- ) -> list[str]:
1982
- if resume:
1983
- for run_id in run_ids:
1984
- completed_path = completion_path(root, run_id)
1985
- if completed_path.exists():
1986
- continue
1987
- session_result_path = root / "runs" / run_id / "session_result.json"
1988
- try:
1989
- session_result = read_json(session_result_path)
1990
- except (OSError, ValueError, json.JSONDecodeError):
1991
- continue
1992
- if session_result.get("status") == "completed":
1993
- write_json(
1994
- completed_path,
1995
- {
1996
- "finished_utc": utc_now(),
1997
- "returncode": 0,
1998
- "status": "completed",
1999
- "recovered_from": "session_result.json",
2000
- },
2001
- )
2002
- completed = [
2003
- run_id for run_id in run_ids if completion_path(root, run_id).exists()
2004
- ]
2005
- if completed and not resume:
2006
- raise ValueError(
2007
- "campaign has completed runs; pass --resume or use a new campaign root"
2008
- )
2009
- return [run_id for run_id in run_ids if run_id not in completed]
2010
-
2011
-
2012
- def resume_query_manifest(
2013
- root: Path,
2014
- cohort: dict[str, object],
2015
- pending: list[str],
2016
- ) -> Path:
2017
- original = read_json(Path(str(cohort["manifest_path"])))
2018
- if pending == list(cohort["run_ids"]):
2019
- return Path(str(cohort["manifest_path"]))
2020
- attempt = 1
2021
- while True:
2022
- path = root / "artifacts" / f"{cohort['cohort_id']}.resume{attempt}.session.json"
2023
- if not path.exists():
2024
- break
2025
- attempt += 1
2026
- original["cohort_id"] = f"{cohort['cohort_id']}-resume{attempt}"
2027
- original["result_path"] = str(
2028
- (root / "artifacts" / f"{cohort['cohort_id']}.resume{attempt}.result.json").resolve()
2029
- )
2030
- original["storage_stdout_path"] = str(
2031
- (root / "logs" / f"{cohort['cohort_id']}.resume{attempt}.storage.stdout.log").resolve()
2032
- )
2033
- original["storage_stderr_path"] = str(
2034
- (root / "logs" / f"{cohort['cohort_id']}.resume{attempt}.storage.stderr.log").resolve()
2035
- )
2036
- original["sessions"] = [
2037
- session
2038
- for session in original["sessions"]
2039
- if session["run_id"] in pending
2040
- ]
2041
- write_json(path, original)
2042
- return path
2043
-
2044
-
2045
- def append_compute_artifacts(
2046
- readiness: list[str], paths: Iterable[Path]
2047
- ) -> list[str]:
2048
- result = list(readiness)
2049
- for path in paths:
2050
- result.extend(["--compute-artifact", str(path)])
2051
- return result
2052
-
2053
-
2054
- def sync_generated(
2055
- campaign: dict[str, object],
2056
- source: Path,
2057
- num_cns: int,
2058
- env: dict[str, str],
2059
- ) -> None:
2060
- for host in list(campaign["compute_nodes"])[:num_cns]:
2061
- subprocess.run(
2062
- ["ssh", "-n", host, "mkdir", "-p", str(source)],
2063
- check=True,
2064
- env=env,
2065
- )
2066
- subprocess.run(
2067
- ["rsync", "-a", f"{source}/", f"{host}:{source}/"],
2068
- check=True,
2069
- env=env,
2070
- )
2071
-
2072
-
2073
- def prepare_generated_unit(
2074
- campaign: dict[str, object],
2075
- unit: dict[str, object],
2076
- env: dict[str, str],
2077
- ) -> list[str]:
2078
- readiness = list(unit["readiness_command"])
2079
- prepare = list(unit["prepare_command"])
2080
- if not prepare:
2081
- return readiness
2082
- run_id = str(unit["run_id"])
2083
- materialized = Path(str(unit["materialized_dir"]))
2084
- manifest = materialized / "manifest.json"
2085
- if not manifest.exists():
2086
- if materialized.exists() and any(materialized.iterdir()):
2087
- raise ValueError(f"partial materialization exists: {materialized}")
2088
- run_checked(prepare, env=env, label=f"{run_id} materialization")
2089
- if campaign["experiment"] == "M1":
2090
- validate_m1_materialization(materialized)
2091
- else:
2092
- validate_e6_materialization(
2093
- materialized,
2094
- dict(unit.get("runtime_contract", {})),
2095
- dict(unit.get("materialization_contract", {})),
2096
- )
2097
- sync_generated(
2098
- campaign,
2099
- materialized,
2100
- int(unit["num_cns"]),
2101
- env,
2102
- )
2103
- return generated_unit_readiness(unit)
2104
-
2105
-
2106
- def generated_unit_readiness(unit: dict[str, object]) -> list[str]:
2107
- readiness = list(unit["readiness_command"])
2108
- materialized = Path(str(unit["materialized_dir"]))
2109
- manifest = materialized / "manifest.json"
2110
- return append_compute_artifacts(
2111
- readiness,
2112
- [
2113
- manifest,
2114
- materialized / "metadata.json",
2115
- *sorted(materialized.glob("*.u32")),
2116
- ],
2117
- )
2118
-
2119
-
2120
- def prepare_campaign(root: Path) -> None:
2121
- campaign = load_campaign(root)
2122
- env = campaign_env(campaign)
2123
- prepared = 0
2124
- for unit in campaign["standalone_runs"]:
2125
- if not unit["prepare_command"]:
2126
- continue
2127
- prepare_generated_unit(campaign, unit, env)
2128
- prepared += 1
2129
- print(f"prepared_generated_units={prepared}", flush=True)
2130
-
2131
-
2132
- def execute_campaign(root: Path, resume: bool) -> None:
2133
- campaign = load_campaign(root)
2134
- if campaign["experiment"] == "EX1":
2135
- verify_ex1_query_views(campaign)
2136
- env = campaign_env(campaign)
2137
- inter_run_wait_seconds = float(campaign.get("inter_run_wait_seconds", 0.0))
2138
- initial_pending = {
2139
- str(run["run_id"])
2140
- for run in campaign["runs"]
2141
- if pending_run_ids(root, [str(run["run_id"])], resume)
2142
- }
2143
- total = len(initial_pending)
2144
- completed_count = 0
2145
- started_at = time.monotonic()
2146
- progress_bar = (
2147
- tqdm(
2148
- total=total,
2149
- desc=f"{campaign['experiment']} {campaign['dataset_id']}",
2150
- unit="run",
2151
- dynamic_ncols=True,
2152
- )
2153
- if tqdm is not None
2154
- else None
2155
- )
2156
-
2157
- def refresh_progress(active: str) -> None:
2158
- if progress_bar is not None:
2159
- progress_bar.set_postfix_str(f"active={active}", refresh=True)
2160
-
2161
- def progress(label: str) -> None:
2162
- nonlocal completed_count
2163
- completed_count += 1
2164
- elapsed = time.monotonic() - started_at
2165
- rate = completed_count / elapsed if elapsed > 0 else 0.0
2166
- eta = (total - completed_count) / rate if rate > 0 else 0.0
2167
- message = (
2168
- f"progress={completed_count}/{total} elapsed_s={elapsed:.1f} "
2169
- f"eta_s={eta:.1f} completed_run={label}"
2170
- )
2171
- if progress_bar is not None:
2172
- progress_bar.update(1)
2173
- progress_bar.set_postfix_str(f"completed={label}", refresh=True)
2174
- progress_bar.write(message)
2175
- else:
2176
- print(message, flush=True)
2177
-
2178
- print(f"campaign_pending_runs={total}", flush=True)
2179
- for cohort in campaign["query_cohorts"]:
2180
- pending = pending_run_ids(root, cohort["run_ids"], resume)
2181
- if not pending:
2182
- continue
2183
- manifest = resume_query_manifest(root, cohort, pending)
2184
- command = list(cohort["command"])
2185
- command[-1] = str(manifest)
2186
- kill = kill_command(int(cohort["num_cns"]), int(cohort["num_mns"]))
2187
- refresh_progress(str(cohort["cohort_id"]))
2188
- run_checked(kill, env=env, label="pre-run cleanup")
2189
- run_checked(
2190
- list(cohort["readiness_command"]),
2191
- env=env,
2192
- label=f"{cohort['cohort_id']} readiness",
2193
- )
2194
- reported: set[str] = set()
2195
- launched_at = time.time()
2196
-
2197
- def query_heartbeat() -> None:
2198
- refresh_progress(str(cohort["cohort_id"]))
2199
- for run_id in pending:
2200
- if run_id in reported:
2201
- continue
2202
- result_path = root / "runs" / run_id / "session_result.json"
2203
- try:
2204
- fresh = result_path.stat().st_mtime >= launched_at
2205
- completed = (
2206
- fresh
2207
- and read_json(result_path).get("status") == "completed"
2208
- )
2209
- except (OSError, ValueError, json.JSONDecodeError):
2210
- continue
2211
- if completed:
2212
- reported.add(run_id)
2213
- progress(run_id)
2214
-
2215
- try:
2216
- returncode = run_logged(
2217
- command,
2218
- stdout_path=root / "logs" / f"{cohort['cohort_id']}.launcher.stdout.log",
2219
- stderr_path=root / "logs" / f"{cohort['cohort_id']}.launcher.stderr.log",
2220
- env=env,
2221
- heartbeat=query_heartbeat,
2222
- )
2223
- finally:
2224
- run_checked(kill, env=env, label="post-run cleanup")
2225
- for run_id in pending:
2226
- result_path = root / "runs" / run_id / "session_result.json"
2227
- run_completed = (
2228
- result_path.is_file()
2229
- and read_json(result_path).get("status") == "completed"
2230
- )
2231
- write_json(
2232
- root
2233
- / "runs"
2234
- / run_id
2235
- / ("completed.json" if run_completed else "failed.json"),
2236
- {
2237
- "finished_utc": utc_now(),
2238
- "returncode": returncode,
2239
- "status": "completed" if run_completed else "failed",
2240
- },
2241
- )
2242
- if run_completed and run_id not in reported:
2243
- progress(run_id)
2244
- run_checked(
2245
- list(cohort["readiness_command"]),
2246
- env=env,
2247
- label=f"{cohort['cohort_id']} post-cleanup readiness",
2248
- )
2249
- if returncode != 0:
2250
- raise RuntimeError(f"{cohort['cohort_id']} failed: {returncode}")
2251
- if completed_count < total and inter_run_wait_seconds > 0.0:
2252
- refresh_progress(f"inter-run wait {inter_run_wait_seconds:g}s")
2253
- time.sleep(inter_run_wait_seconds)
2254
-
2255
- for unit in campaign["standalone_runs"]:
2256
- run_id = str(unit["run_id"])
2257
- if not pending_run_ids(root, [run_id], resume):
2258
- continue
2259
- run_root = root / "runs" / run_id
2260
- readiness = prepare_generated_unit(campaign, unit, env)
2261
- kill = kill_command(int(unit["num_cns"]), int(unit["num_mns"]))
2262
- refresh_progress(run_id)
2263
- run_checked(kill, env=env, label="pre-run cleanup")
2264
- run_checked(readiness, env=env, label=f"{run_id} readiness")
2265
- started = utc_now()
2266
- try:
2267
- returncode = run_logged(
2268
- list(unit["command"]),
2269
- stdout_path=run_root / "stdout.log",
2270
- stderr_path=run_root / "stderr.log",
2271
- env=env,
2272
- heartbeat=lambda: refresh_progress(run_id),
2273
- )
2274
- finally:
2275
- run_checked(kill, env=env, label="post-run cleanup")
2276
- write_json(
2277
- run_root / ("completed.json" if returncode == 0 else "failed.json"),
2278
- {
2279
- "started_utc": started,
2280
- "finished_utc": utc_now(),
2281
- "returncode": returncode,
2282
- "status": "completed" if returncode == 0 else "failed",
2283
- },
2284
- )
2285
- if returncode == 0:
2286
- progress(run_id)
2287
- run_checked(readiness, env=env, label=f"{run_id} post-cleanup readiness")
2288
- if returncode != 0:
2289
- raise RuntimeError(f"{run_id} failed: {returncode}")
2290
- if completed_count < total and inter_run_wait_seconds > 0.0:
2291
- refresh_progress(f"inter-run wait {inter_run_wait_seconds:g}s")
2292
- time.sleep(inter_run_wait_seconds)
2293
- if progress_bar is not None:
2294
- progress_bar.close()
2295
-
2296
-
2297
- def check_campaign(root: Path) -> None:
2298
- campaign = load_campaign(root)
2299
- env = campaign_env(campaign)
2300
- for cohort in campaign["query_cohorts"]:
2301
- run_checked(
2302
- list(cohort["readiness_command"]),
2303
- env=env,
2304
- label=f"{cohort['cohort_id']} readiness",
2305
- )
2306
- for unit in campaign["standalone_runs"]:
2307
- if unit["prepare_command"]:
2308
- manifest = Path(str(unit["materialized_dir"])) / "manifest.json"
2309
- if manifest.exists():
2310
- readiness = generated_unit_readiness(unit)
2311
- else:
2312
- readiness = list(unit["readiness_command"])
2313
- print(
2314
- f"{unit['run_id']}: source readiness only; run prepare "
2315
- "before the final generated-artifact check"
2316
- )
2317
- else:
2318
- readiness = list(unit["readiness_command"])
2319
- run_checked(
2320
- readiness,
2321
- env=env,
2322
- label=f"{unit['run_id']} readiness",
2323
- )
2324
- if campaign["experiment"] == "EX1":
2325
- verify_ex1_query_views(campaign)
2326
-
2327
-
2328
- def verify_ex1_query_views(campaign: dict[str, object]) -> None:
2329
- config_path = Path(str(campaign["config_path"]))
2330
- if file_sha256(config_path) != campaign["config_sha256"]:
2331
- raise ValueError("EX1 configuration changed after planning")
2332
- config = load_config(config_path)
2333
- query = require_mapping(config, "query")
2334
- manifest = str(query["manifest"])
2335
- verification = """\
2336
- import hashlib,json,pathlib,sys
2337
- p=pathlib.Path(sys.argv[1])
2338
- m=json.loads(p.read_text())
2339
- def h(path):
2340
- d=hashlib.sha256()
2341
- with path.open('rb') as f:
2342
- for b in iter(lambda:f.read(1048576),b''): d.update(b)
2343
- return d.hexdigest()
2344
- assert h(pathlib.Path(m['query_source']))==m['query_source_sha256']
2345
- assert h(pathlib.Path(m['groundtruth_source']))==m['groundtruth_source_sha256']
2346
- for name,meta in m['outputs'].items():
2347
- q=p.parent/name
2348
- assert q.stat().st_size==meta['bytes']
2349
- assert h(q)==meta['sha256']
2350
- print(json.dumps(m['outputs'],sort_keys=True))
2351
- """
2352
- identities = {}
2353
- for host in campaign["compute_nodes"]:
2354
- command = (
2355
- f"python3 -c {shlex.quote(verification)} "
2356
- f"{shlex.quote(manifest)}"
2357
- )
2358
- result = subprocess.run(
2359
- [
2360
- "ssh",
2361
- "-o",
2362
- "BatchMode=yes",
2363
- "-o",
2364
- "ConnectTimeout=10",
2365
- str(host),
2366
- command,
2367
- ],
2368
- text=True,
2369
- capture_output=True,
2370
- check=False,
2371
- )
2372
- if result.returncode != 0:
2373
- raise RuntimeError(
2374
- f"EX1 query manifest verification failed on {host}: "
2375
- f"{result.stderr.strip()}"
2376
- )
2377
- identities[str(host)] = json.loads(result.stdout)
2378
- serialized = {json.dumps(value, sort_keys=True) for value in identities.values()}
2379
- if len(serialized) != 1:
2380
- raise ValueError("EX1 query-view hashes differ across compute nodes")
2381
-
2382
-
2383
- def status(root: Path) -> int:
2384
- campaign = load_campaign(root)
2385
- rows = []
2386
- for row in campaign["runs"]:
2387
- run_id = str(row["run_id"])
2388
- state = "pending"
2389
- if completion_path(root, run_id).exists():
2390
- state = "completed"
2391
- elif (root / "runs" / run_id / "failed.json").exists():
2392
- state = "failed"
2393
- rows.append({"run_id": run_id, "status": state})
2394
- print(json.dumps(rows, indent=2))
2395
- return 0 if all(row["status"] == "completed" for row in rows) else 1
2396
-
2397
-
2398
- def parser_for(experiment: str) -> argparse.ArgumentParser:
2399
- default_config = (
2400
- Path(__file__).resolve().parent / "configs/bigann100.json"
2401
- if experiment == "E9"
2402
- else DEFAULT_CONFIG
2403
- )
2404
- parser = argparse.ArgumentParser(
2405
- description=(
2406
- f"Plan or run {experiment}; defaults come from "
2407
- f"{'BIGANN-100M' if experiment == 'E9' else 'DEEP-100M'}."
2408
- ),
2409
- formatter_class=argparse.ArgumentDefaultsHelpFormatter,
2410
- )
2411
- parser.add_argument(
2412
- "action",
2413
- choices=("plan", "prepare", "check", "run", "collect", "status", "plot"),
2414
- )
2415
- parser.add_argument("--config", type=Path, default=default_config)
2416
- parser.add_argument(
2417
- "--data-root",
2418
- type=Path,
2419
- help="Override the {data_root} path variable",
2420
- )
2421
- parser.add_argument(
2422
- "--dataset-prefix",
2423
- help="Override the shared dataset package-name prefix",
2424
- )
2425
- parser.add_argument("--dataset-id", help="Short ID used in run IDs")
2426
- parser.add_argument("--dataset-label", help="Dataset name used in figures")
2427
- parser.add_argument("--campaign-root", type=Path)
2428
- parser.add_argument("--repetitions", type=int)
2429
- parser.add_argument(
2430
- "--repetition-start",
2431
- type=int,
2432
- default=1,
2433
- help="First repetition number, useful for phased campaigns",
2434
- )
2435
- parser.add_argument("--ef-search", type=int, action="append")
2436
- parser.add_argument("--num-cns", type=int, action="append")
2437
- parser.add_argument("--num-mns", type=int)
2438
- parser.add_argument("--workers-per-cn", type=int, action="append")
2439
- parser.add_argument("--merge-workers", type=int, help="E6 merge-only workers")
2440
- parser.add_argument("--query-limit", type=int)
2441
- parser.add_argument("--checkpoint-query-limit", type=int)
2442
- parser.add_argument(
2443
- "--batch-count",
2444
- type=int,
2445
- help=(
2446
- "E6 evaluation-window count; each window contains the configured "
2447
- "number of continuous 1M source segments"
2448
- if experiment == "E6"
2449
- else "Batch count for this experiment"
2450
- ),
2451
- )
2452
- parser.add_argument("--merge-every-batches", type=int)
2453
- parser.add_argument(
2454
- "--workload",
2455
- choices=("query", "insert", "delete", "replacement"),
2456
- action="append",
2457
- )
2458
- parser.add_argument(
2459
- "--record-mode", choices=RECORD_MODES, action="append"
2460
- )
2461
- parser.add_argument("--mutation-snapshot", choices=("true", "false"))
2462
- parser.add_argument(
2463
- "--cache-variant",
2464
- choices=E9_CACHE_VARIANTS,
2465
- action="append",
2466
- help="Select one or more E7/E9 cache variants",
2467
- )
2468
- parser.add_argument("--port-base", type=int, default=17000)
2469
- parser.add_argument("--compute-sha256")
2470
- parser.add_argument("--storage-sha256")
2471
- parser.add_argument(
2472
- "--inter-run-wait-seconds",
2473
- type=nonnegative_float,
2474
- default=0.0,
2475
- help=(
2476
- "Wait between logical runs; query cohorts keep MNs resident while "
2477
- "waiting between sessions"
2478
- ),
2479
- )
2480
- parser.add_argument("--resume", action="store_true")
2481
- parser.add_argument(
2482
- "--approved-run-plan",
2483
- action="store_true",
2484
- help="Required for EX1 remote prepare/run after plan approval",
2485
- )
2486
- parser.add_argument("--results", type=Path, help="Normalized CSV for plot")
2487
- parser.add_argument("--output", type=Path, help="Figure output path")
2488
- return parser
2489
-
2490
-
2491
- def main(experiment: str) -> int:
2492
- parser = parser_for(experiment)
2493
- args = parser.parse_args()
2494
- try:
2495
- config = load_config(
2496
- args.config,
2497
- data_root=args.data_root,
2498
- dataset_prefix=args.dataset_prefix,
2499
- selected_dataset_id=args.dataset_id,
2500
- dataset_label=args.dataset_label,
2501
- )
2502
- root = (
2503
- args.campaign_root
2504
- or Path(
2505
- f"/tmp/vectordb-evaluation/"
2506
- f"{experiment.lower()}-{config['dataset_id']}"
2507
- )
2508
- ).resolve()
2509
- if args.action == "plan":
2510
- campaign = create_campaign(experiment, args.config, root, args)
2511
- print(
2512
- f"planned_runs={len(campaign['runs'])} "
2513
- f"campaign={root / 'campaign.json'}"
2514
- )
2515
- return 0
2516
- if args.action == "check":
2517
- check_campaign(root)
2518
- return 0
2519
- if args.action == "prepare":
2520
- if experiment == "EX1" and not args.approved_run_plan:
2521
- raise ValueError("EX1 prepare requires --approved-run-plan")
2522
- prepare_campaign(root)
2523
- return 0
2524
- if args.action == "run":
2525
- if experiment == "EX1" and not args.approved_run_plan:
2526
- raise ValueError("EX1 run requires --approved-run-plan")
2527
- execute_campaign(root, args.resume)
2528
- from collect import collect_campaign
2529
-
2530
- paths = collect_campaign(root)
2531
- print("collected=" + ",".join(str(path) for path in paths))
2532
- return status(root)
2533
- if args.action == "collect":
2534
- from collect import collect_campaign
2535
-
2536
- paths = collect_campaign(root)
2537
- print("collected=" + ",".join(str(path) for path in paths))
2538
- return 0
2539
- if args.action == "status":
2540
- return status(root)
2541
- if args.results is None:
2542
- parser.error("plot requires --results")
2543
- from plot import plot_results
2544
-
2545
- output = args.output or root / "figures" / f"{experiment.lower()}.png"
2546
- plot_results(experiment, args.results, output)
2547
- print(output)
2548
- return 0
2549
- except (
2550
- OSError,
2551
- RuntimeError,
2552
- subprocess.CalledProcessError,
2553
- ValueError,
2554
- ) as exc:
2555
- print(exc, file=sys.stderr)
2556
- return 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/tools/generator/spatial_common.py DELETED
@@ -1,109 +0,0 @@
1
- """Binary formats and reproducible metadata for spatial workload preparation."""
2
-
3
- from __future__ import annotations
4
-
5
- import hashlib
6
- import json
7
- import os
8
- import struct
9
- from pathlib import Path
10
-
11
- import numpy as np
12
-
13
-
14
- def read_json(path):
15
- return json.loads(Path(path).read_text(encoding="utf-8"))
16
-
17
-
18
- def write_json(path, value):
19
- path = Path(path)
20
- path.parent.mkdir(parents=True, exist_ok=True)
21
- temporary = path.with_name(path.name + ".tmp")
22
- temporary.write_text(json.dumps(value, indent=2, sort_keys=True) + "\n", encoding="utf-8")
23
- os.replace(temporary, path)
24
-
25
-
26
- def digest_json(value):
27
- return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(",", ":")).encode()).hexdigest()
28
-
29
-
30
- def sha256(path):
31
- h = hashlib.sha256()
32
- with Path(path).open("rb") as stream:
33
- for block in iter(lambda: stream.read(8 * 1024 * 1024), b""):
34
- h.update(block)
35
- return h.hexdigest()
36
-
37
-
38
- def file_identity(path):
39
- """Record trusted package checksums plus a cheap, independently read fingerprint."""
40
- path = Path(path)
41
- size = path.stat().st_size
42
- h = hashlib.sha256(struct.pack("<Q", size))
43
- with path.open("rb") as stream:
44
- for offset in sorted({0, max(0, size // 2 - 32768), max(0, size - 65536)}):
45
- stream.seek(offset)
46
- h.update(stream.read(65536))
47
- result = {"file": path.name, "bytes": size, "sample_sha256": h.hexdigest()}
48
- for root in (path.parent, *path.parents):
49
- checksums = root / "checksums.sha256"
50
- if not checksums.is_file():
51
- continue
52
- rel = path.relative_to(root).as_posix()
53
- for line in checksums.read_text().splitlines():
54
- parts = line.split(maxsplit=1)
55
- if len(parts) == 2 and parts[1].lstrip(" *") == rel:
56
- result["package_sha256"] = parts[0]
57
- result["package_sha256_status"] = "trusted source record; not rehashed"
58
- return result
59
- return result
60
-
61
-
62
- def matrix(path, dtype="float32", allow_distances=False):
63
- path = Path(path)
64
- with path.open("rb") as stream:
65
- header = stream.read(8)
66
- if len(header) != 8:
67
- raise ValueError(f"Truncated matrix header: {path}")
68
- rows, columns = struct.unpack("<II", header)
69
- if not rows or not columns:
70
- raise ValueError(f"Empty matrix: {path}")
71
- dtype = np.dtype(dtype).newbyteorder("<")
72
- expected = 8 + rows * columns * dtype.itemsize
73
- sizes = (expected, expected + rows * columns * 4) if allow_distances else (expected,)
74
- if path.stat().st_size not in sizes:
75
- raise ValueError(f"Matrix payload does not match header: {path}")
76
- return np.memmap(path, mode="r", dtype=dtype, offset=8, shape=(rows, columns))
77
-
78
-
79
- def write_matrix(path, values, dtype=None):
80
- values = np.asarray(values, dtype=dtype)
81
- path = Path(path)
82
- path.parent.mkdir(parents=True, exist_ok=True)
83
- temporary = path.with_name(path.name + ".tmp")
84
- with temporary.open("wb") as stream:
85
- stream.write(struct.pack("<II", *values.shape))
86
- values.astype(values.dtype.newbyteorder("<"), copy=False).tofile(stream)
87
- os.replace(temporary, path)
88
-
89
-
90
- def write_u32(path, values):
91
- path = Path(path)
92
- path.parent.mkdir(parents=True, exist_ok=True)
93
- temporary = path.with_name(path.name + ".tmp")
94
- np.asarray(values, dtype="<u4").tofile(temporary)
95
- os.replace(temporary, path)
96
-
97
-
98
- def safe_child(root, relative):
99
- root = Path(root).resolve()
100
- path = (root / relative).resolve()
101
- if not path.is_relative_to(root):
102
- raise ValueError(f"Path escapes artifact root: {relative}")
103
- return path
104
-
105
-
106
- def seeded_rng(seed, stream):
107
- # Stable named streams isolate Q/I/D changes and avoid Python's salted hash().
108
- key = int.from_bytes(hashlib.sha256(stream.encode()).digest()[:8], "little")
109
- return np.random.default_rng(np.random.SeedSequence([seed, key]))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/tools/generator/spatial_groundtruth.py DELETED
@@ -1,263 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Create exact checkpoint GT for subsets of an unchanged vector universe.
3
-
4
- The source GT must be trusted exact, sorted nearest first, and computed over
5
- the *entire* source universe for the same query vectors and metric. Its IDs,
6
- the live mask, and output IDs all use original/external source IDs. Filtering
7
- an initial-index GT is not sufficient when a checkpoint adds other vectors.
8
-
9
- Keeping k live entries from an exact source prefix gives an exact live top-k.
10
- Queries with fewer survivors instead scan every live source vector. Source
11
- tie order is preserved; exhaustive fallback orders equal computed distances
12
- by external ID. Both are valid top-k tie choices. This helper does not certify
13
- the provenance or mathematical exactness of a supplied source GT.
14
- """
15
-
16
- from __future__ import annotations
17
-
18
- from contextlib import nullcontext
19
- from pathlib import Path
20
- import os
21
- import struct
22
- import tempfile
23
- from typing import Callable
24
-
25
- import numpy as np
26
-
27
-
28
- def _matrix_header(path: Path) -> tuple[int, int]:
29
- with path.open("rb") as handle:
30
- header = handle.read(8)
31
- if len(header) != 8:
32
- raise ValueError(f"truncated matrix header: {path}")
33
- rows, columns = struct.unpack("<II", header)
34
- if rows == 0 or columns == 0:
35
- raise ValueError(f"matrix dimensions must be positive: {path}")
36
- return rows, columns
37
-
38
-
39
- def _vector_matrix(path: Path, dtype: str | np.dtype) -> np.memmap:
40
- rows, dimensions = _matrix_header(path)
41
- element_type = np.dtype(dtype).newbyteorder("<")
42
- if element_type.kind not in "fiu" or element_type.itemsize > 8:
43
- raise ValueError(f"unsupported vector dtype: {dtype}")
44
- expected = 8 + rows * dimensions * element_type.itemsize
45
- if path.stat().st_size != expected:
46
- raise ValueError(f"vector payload size does not match header/dtype: {path}")
47
- return np.memmap(
48
- path, mode="r", dtype=element_type, offset=8, shape=(rows, dimensions)
49
- )
50
-
51
-
52
- def _source_ids(path: Path, universe_size: int) -> np.memmap:
53
- rows, depth = _matrix_header(path)
54
- ids_bytes = rows * depth * 4
55
- if path.stat().st_size not in (8 + ids_bytes, 8 + 2 * ids_bytes):
56
- raise ValueError(f"GT must contain u32 IDs and optional f32 distances: {path}")
57
- ids = np.memmap(path, mode="r", dtype="<u4", offset=8, shape=(rows, depth))
58
- # Validate row chunks so even a deep source GT needs no second full copy.
59
- for begin in range(0, rows, 1024):
60
- chunk = np.asarray(ids[begin : begin + 1024])
61
- if np.any(chunk >= universe_size):
62
- raise ValueError("source GT contains an ID outside the source universe")
63
- ordered = np.sort(chunk, axis=1)
64
- if depth > 1 and np.any(ordered[:, 1:] == ordered[:, :-1]):
65
- raise ValueError("source GT contains duplicate IDs within a query row")
66
- return ids
67
-
68
-
69
- def _select_topk(
70
- scores: np.ndarray, external_ids: np.ndarray, k: int
71
- ) -> tuple[np.ndarray, np.ndarray]:
72
- """Select smallest scores, breaking every boundary tie by external ID."""
73
- count = min(k, scores.size)
74
- if scores.size > count:
75
- provisional = np.argpartition(scores, count - 1)[:count]
76
- cutoff = np.max(scores[provisional])
77
- smaller = np.flatnonzero(scores < cutoff)
78
- equal = np.flatnonzero(scores == cutoff)
79
- remaining = count - smaller.size
80
- if equal.size > remaining:
81
- tie_order = np.argpartition(external_ids[equal], remaining - 1)
82
- equal = equal[tie_order[:remaining]]
83
- chosen = np.concatenate((smaller, equal))
84
- else:
85
- chosen = np.arange(scores.size)
86
- order = np.lexsort((external_ids[chosen], scores[chosen]))
87
- chosen = chosen[order]
88
- return scores[chosen], external_ids[chosen]
89
-
90
-
91
- def _exact_fallback(
92
- base: np.ndarray,
93
- queries: np.ndarray,
94
- live: np.ndarray,
95
- base_external_ids: np.ndarray | None,
96
- *,
97
- k: int,
98
- metric: str,
99
- block_rows: int,
100
- query_batch_size: int,
101
- progress: Callable[[dict], None] | None,
102
- ) -> np.ndarray:
103
- """Exhaustive scan; L2 uses direct differences to avoid cancellation."""
104
- query_count = queries.shape[0]
105
- best_scores = [np.empty(0, dtype=np.float64) for _ in range(query_count)]
106
- best_ids = [np.empty(0, dtype=np.uint32) for _ in range(query_count)]
107
- # A permuted base must still represent every external source ID once.
108
- seen = np.zeros(live.size, dtype=np.bool_) if base_external_ids is not None else None
109
- for begin in range(0, base.shape[0], block_rows):
110
- end = min(begin + block_rows, base.shape[0])
111
- ids = (
112
- np.arange(begin, end, dtype=np.uint32)
113
- if base_external_ids is None
114
- else np.asarray(base_external_ids[begin:end])
115
- )
116
- if seen is not None:
117
- if np.any(ids < 0) or np.any(ids >= live.size):
118
- raise ValueError("base_external_ids contains an out-of-range ID")
119
- if np.unique(ids).size != ids.size or np.any(seen[ids]):
120
- raise ValueError("base_external_ids must be a permutation of source IDs")
121
- seen[ids] = True
122
- keep = live[ids]
123
- ids = ids[keep].astype(np.uint32, copy=False)
124
- if not ids.size:
125
- continue
126
- vectors = np.asarray(base[begin:end][keep], dtype=np.float64)
127
- if not np.all(np.isfinite(vectors)):
128
- raise ValueError("live base vectors contain non-finite values")
129
- for query_begin in range(0, query_count, query_batch_size):
130
- query_end = min(query_begin + query_batch_size, query_count)
131
- if metric == "ip":
132
- # Negate inner products so both metrics select smallest scores.
133
- scores_batch = -(queries[query_begin:query_end] @ vectors.T)
134
- if not np.all(np.isfinite(scores_batch)):
135
- raise ValueError("inner-product scores overflowed")
136
- for index in range(query_begin, query_end):
137
- if metric == "l2":
138
- differences = vectors - queries[index]
139
- scores = np.einsum("ij,ij->i", differences, differences)
140
- if not np.all(np.isfinite(scores)):
141
- raise ValueError("squared-L2 scores overflowed")
142
- else:
143
- scores = scores_batch[index - query_begin]
144
- local_scores, local_ids = _select_topk(scores, ids, k)
145
- best_scores[index], best_ids[index] = _select_topk(
146
- np.concatenate((best_scores[index], local_scores)),
147
- np.concatenate((best_ids[index], local_ids)),
148
- k,
149
- )
150
- if progress is not None:
151
- progress({"event": "exact_gt_scan", "source_rows_scanned": end,
152
- "source_rows": base.shape[0], "fallback_queries": query_count})
153
- if any(ids.size != k for ids in best_ids):
154
- raise ValueError("exact fallback found fewer than k live vectors")
155
- return np.stack(best_ids)
156
-
157
-
158
- def write_checkpoint_groundtruth(
159
- *,
160
- source_groundtruth_path: str | Path,
161
- query_path: str | Path,
162
- base_path: str | Path,
163
- output_path: str | Path,
164
- live_mask: np.ndarray,
165
- k: int = 10,
166
- metric: str = "l2",
167
- base_dtype: str | np.dtype = "float32",
168
- query_dtype: str | np.dtype = "float32",
169
- base_external_ids: np.ndarray | None = None,
170
- block_rows: int = 250_000,
171
- query_batch_size: int = 32,
172
- threads: int = 32,
173
- progress: Callable[[dict], None] | None = None,
174
- ) -> dict:
175
- """Write IDs-only checkpoint GT and return JSON-serializable audit stats.
176
-
177
- ``live_mask`` is indexed by original source ID. The base contains the complete
178
- source universe in original row order, or ``base_external_ids`` supplies the
179
- per-row mapping (for example update_order.u32 for base_permuted). Fallback
180
- uses float64 arithmetic without approximate indexes. The source GT ordering
181
- is trusted; optional source distances are not reinterpreted or recomputed.
182
- The thread limit applies to BLAS if threadpoolctl is installed; direct L2
183
- differences intentionally avoid the cancellation of norm/dot-product L2.
184
- """
185
- if metric not in ("l2", "ip"):
186
- raise ValueError("metric must be l2 or ip")
187
- if min(k, block_rows, query_batch_size, threads) <= 0:
188
- raise ValueError("k, block_rows, query_batch_size, and threads must be positive")
189
- live = np.asarray(live_mask)
190
- if live.ndim != 1 or live.dtype != np.bool_ or live.size == 0:
191
- raise ValueError("live_mask must be a nonempty one-dimensional boolean array")
192
- if live.size > np.iinfo(np.uint32).max + 1:
193
- raise ValueError("source universe exceeds uint32 ID space")
194
- live_count = int(np.count_nonzero(live))
195
- if live_count < k:
196
- raise ValueError("checkpoint contains fewer than k live vectors")
197
- base = _vector_matrix(Path(base_path), base_dtype)
198
- query_matrix = _vector_matrix(Path(query_path), query_dtype)
199
- source = _source_ids(Path(source_groundtruth_path), live.size)
200
- if base.shape[0] != live.size:
201
- raise ValueError("base must contain the complete source universe")
202
- if query_matrix.shape[1] != base.shape[1] or query_matrix.shape[0] != source.shape[0]:
203
- raise ValueError("query dimensions/count do not match base and source GT")
204
- queries = np.asarray(query_matrix, dtype=np.float64)
205
- if not np.all(np.isfinite(queries)):
206
- raise ValueError("query vectors contain non-finite values")
207
- if base_external_ids is not None:
208
- base_external_ids = np.asarray(base_external_ids)
209
- if (base_external_ids.ndim != 1 or base_external_ids.size != live.size
210
- or base_external_ids.dtype.kind not in "iu"):
211
- raise ValueError("base_external_ids must have one integer ID per source row")
212
-
213
- result = np.empty((source.shape[0], k), dtype="<u4")
214
- missing = []
215
- min_survivors = source.shape[1]
216
- for query_index, candidates in enumerate(source):
217
- surviving = candidates[live[candidates]]
218
- min_survivors = min(min_survivors, surviving.size)
219
- if surviving.size >= k:
220
- result[query_index] = surviving[:k]
221
- else:
222
- missing.append(query_index)
223
- if missing:
224
- try:
225
- from threadpoolctl import threadpool_limits
226
- except ImportError:
227
- limits = nullcontext()
228
- else:
229
- limits = threadpool_limits(limits=threads)
230
- with limits:
231
- result[missing] = _exact_fallback(
232
- base, queries[missing], live, base_external_ids, k=k, metric=metric,
233
- block_rows=block_rows, query_batch_size=query_batch_size, progress=progress,
234
- )
235
-
236
- output = Path(output_path)
237
- inputs = [Path(source_groundtruth_path), Path(query_path), Path(base_path)]
238
- if any(output.resolve() == path.resolve() for path in inputs):
239
- raise ValueError("output_path must not overwrite an input artifact")
240
- output.parent.mkdir(parents=True, exist_ok=True)
241
- temporary_path = None
242
- try:
243
- with tempfile.NamedTemporaryFile(dir=output.parent, prefix=output.name + ".",
244
- suffix=".tmp", delete=False) as handle:
245
- temporary_path = Path(handle.name)
246
- handle.write(struct.pack("<II", result.shape[0], k))
247
- result.tofile(handle)
248
- os.replace(temporary_path, output)
249
- finally:
250
- if temporary_path is not None:
251
- temporary_path.unlink(missing_ok=True)
252
- return {
253
- "schema": "spatial-checkpoint-groundtruth.v1",
254
- "path": str(output), "query_count": int(source.shape[0]), "k": k,
255
- "live_count": live_count, "metric": metric,
256
- "source_gt_depth": int(source.shape[1]),
257
- "min_live_source_candidates": int(min_survivors),
258
- "source_filtered_query_count": int(source.shape[0] - len(missing)),
259
- "fallback_query_count": len(missing), "fallback_query_ids": missing,
260
- "source_gt_contract": "trusted exact over full universe, same queries and metric",
261
- "fallback_distance_precision": "float64",
262
- "tie_policy": "preserve source order; fallback distance then external ID",
263
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spatial-workloads/v1/tools/generator/spatial_partition.py DELETED
@@ -1,131 +0,0 @@
1
- """Train sampled centroids, then assign every source and official query vector."""
2
-
3
- from __future__ import annotations
4
-
5
- import argparse
6
- import math
7
- import time
8
- from pathlib import Path
9
-
10
- import numpy as np
11
-
12
- from spatial_common import digest_json, file_identity, matrix, read_json, sha256, write_json, write_matrix, write_u32
13
-
14
-
15
- def prepare_partition(config, static_root, output, threads=16, chunk_rows=250000):
16
- import faiss
17
-
18
- source = config["source"]
19
- parameters = config["partition"]
20
- static_root, output = Path(static_root), Path(output)
21
- base_path = static_root / source["base"]
22
- query_path = static_root / source["queries"]
23
- base = matrix(base_path, source["dtype"])
24
- queries = matrix(query_path, source.get("query_dtype", source["dtype"]))
25
- if base.shape[1] != queries.shape[1] or base.shape[0] != source["base_count"]:
26
- raise ValueError("Base/query dimensions or configured source count mismatch")
27
- if base.shape[0] >= 2**32:
28
- raise ValueError("v1 requires source IDs to fit uint32")
29
- clusters = int(parameters["clusters"])
30
- sample_count = min(int(parameters["training_rows"]), len(base))
31
- if not 2 <= clusters <= sample_count or threads < 1 or chunk_rows < 1:
32
- raise ValueError("Invalid cluster/sample/thread/chunk counts")
33
- partition_metric = parameters.get("metric", "l2")
34
- if partition_metric not in ("l2", "cosine"):
35
- raise ValueError("Partition metric must be l2 or cosine")
36
- inputs = {"base": file_identity(base_path), "queries": file_identity(query_path)}
37
- signature_inputs = {"parameters": parameters, "source": inputs, "dtype": source["dtype"]}
38
- if source.get("query_dtype", source["dtype"]) != source["dtype"]:
39
- signature_inputs["query_dtype"] = source["query_dtype"]
40
- signature = digest_json(signature_inputs)
41
- manifest_path = output / "partition.json"
42
- if manifest_path.exists():
43
- manifest = read_json(manifest_path)
44
- if manifest["signature"] != signature:
45
- raise ValueError("Existing partition uses different source/parameters; choose a new output directory")
46
- for rel, identity in manifest["files"].items():
47
- if (output / rel).stat().st_size != identity["bytes"] or sha256(output / rel) != identity["sha256"]:
48
- raise ValueError(f"Corrupted existing partition artifact: {rel}")
49
- return manifest
50
- output.mkdir(parents=True, exist_ok=True)
51
- faiss.omp_set_num_threads(threads)
52
- rng = np.random.default_rng(parameters["seed"])
53
- sample_ids = np.sort(rng.choice(len(base), sample_count, replace=False)).astype("<u4")
54
- print(f"Reading {sample_count:,} sampled training vectors", flush=True)
55
- training = np.ascontiguousarray(base[sample_ids], dtype="float32")
56
- if not np.isfinite(training).all():
57
- raise ValueError("Training vectors contain nonfinite values")
58
- if partition_metric == "cosine":
59
- faiss.normalize_L2(training)
60
- print(f"Training {clusters} centroids on {sample_count:,} vectors", flush=True)
61
- start = time.monotonic()
62
- kmeans = faiss.Kmeans(
63
- base.shape[1], clusters, niter=int(parameters["iterations"]),
64
- seed=int(parameters["seed"]), verbose=True,
65
- spherical=partition_metric == "cosine",
66
- max_points_per_centroid=math.ceil(sample_count / clusters),
67
- )
68
- kmeans.train(training)
69
- centroids = np.asarray(kmeans.centroids, dtype="float32")
70
- if not np.isfinite(centroids).all():
71
- raise ValueError("Clustering produced nonfinite centroids")
72
- write_matrix(output / "centroids.fbin", centroids)
73
- write_u32(output / "training_source_ids.u32", sample_ids)
74
- index = faiss.IndexFlatL2(base.shape[1]) if partition_metric == "l2" else faiss.IndexFlatIP(base.shape[1])
75
- index.add(centroids)
76
- counts = np.zeros(clusters, dtype=np.int64)
77
- assignments_path = output / "assignments.u32"
78
- with assignments_path.with_suffix(".u32.tmp").open("wb") as stream:
79
- for offset in range(0, len(base), chunk_rows):
80
- block = np.ascontiguousarray(base[offset:offset + chunk_rows], dtype="float32")
81
- if not np.isfinite(block).all():
82
- raise ValueError(f"Nonfinite vectors at offset {offset}")
83
- if partition_metric == "cosine":
84
- block = block.copy()
85
- faiss.normalize_L2(block)
86
- _, labels = index.search(block, 1)
87
- if np.any(labels < 0) or np.any(labels >= clusters):
88
- raise ValueError("Clustering produced invalid source assignments")
89
- labels = labels[:, 0].astype("<u4")
90
- labels.tofile(stream)
91
- counts += np.bincount(labels, minlength=clusters)
92
- if offset == 0 or (offset + len(block)) % (chunk_rows * 20) == 0 or offset + len(block) == len(base):
93
- print(f"Assigned {offset + len(block):,}/{len(base):,} vectors ({time.monotonic()-start:.1f}s)", flush=True)
94
- assignments_path.with_suffix(".u32.tmp").replace(assignments_path)
95
- query_values = np.ascontiguousarray(queries, dtype="float32")
96
- if not np.isfinite(query_values).all():
97
- raise ValueError("Query vectors contain nonfinite values")
98
- if partition_metric == "cosine":
99
- query_values = query_values.copy()
100
- faiss.normalize_L2(query_values)
101
- _, query_labels = index.search(query_values, 1)
102
- if np.any(query_labels < 0) or np.any(query_labels >= clusters):
103
- raise ValueError("Clustering produced invalid query assignments")
104
- write_u32(output / "query_assignments.u32", query_labels[:, 0])
105
- manifest = {
106
- "schema": "spatial-partition.v1", "signature": signature,
107
- "parameters": parameters, "source": inputs, "source_rows": len(base),
108
- "dimension": base.shape[1], "query_rows": len(queries),
109
- "assignment_order": "original source vector ID; not HNSW internal ID or update_order row",
110
- "counts": counts.tolist(),
111
- "query_counts": np.bincount(query_labels[:, 0], minlength=clusters).tolist(),
112
- "software": {"numpy": np.__version__, "faiss": faiss.__version__, "threads": threads},
113
- "elapsed_seconds": round(time.monotonic() - start, 3),
114
- "files": {},
115
- }
116
- for name in ("centroids.fbin", "training_source_ids.u32", "assignments.u32", "query_assignments.u32"):
117
- path = output / name
118
- manifest["files"][name] = {"bytes": path.stat().st_size, "sha256": sha256(path)}
119
- write_json(manifest_path, manifest)
120
- return manifest
121
-
122
-
123
- if __name__ == "__main__":
124
- parser = argparse.ArgumentParser(description=__doc__)
125
- parser.add_argument("--config", required=True, type=Path)
126
- parser.add_argument("--static-root", required=True, type=Path)
127
- parser.add_argument("--output", required=True, type=Path)
128
- parser.add_argument("--threads", type=int, default=16)
129
- parser.add_argument("--chunk-rows", type=int, default=250000)
130
- args = parser.parse_args()
131
- prepare_partition(read_json(args.config), args.static_root, args.output, args.threads, args.chunk_rows)