diff --git a/.gitattributes b/.gitattributes index a3f526e2780391e94b159a265c60f3afffc2c35e..8dcef59441ed6bb22e83e4f3291cc6c2c1c9728f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -66,37 +66,6 @@ base_permuted.fbin filter=lfs diff=lfs merge=lfs -text initial/pq/pq_m24.pqcodes filter=lfs diff=lfs merge=lfs -text initial/pq/pq_m48.pqcodes filter=lfs diff=lfs merge=lfs -text initial/pq/pq_m96.pqcodes filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/partitions/k128-seed42/assignments.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/delete-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/delete-hot/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/delete-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/delete-uniform/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/insert-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/insert-hot/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/insert-hot/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/insert-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/insert-uniform/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/insert-uniform/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-shared-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-shared-hot/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-shared-hot/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-uniform/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-uniform/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-uniform/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-uniform/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-update-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-update-hot/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-update-hot/streams/delete_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_ids.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/query-hot/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/query-hot/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/query-uniform/queries/queries.fbin filter=lfs diff=lfs merge=lfs -text -spatial-workloads/v1/workloads/query-uniform/queries/query_refs.u32 filter=lfs diff=lfs merge=lfs -text spatial-workloads/v2/partitions/k128-seed42/assignments.u32 filter=lfs diff=lfs merge=lfs -text spatial-workloads/v2/partitions/k128-seed42/query_banks/uniform/query_assignments.u32 filter=lfs diff=lfs merge=lfs -text spatial-workloads/v2/partitions/k128-seed42/training_source_ids.u32 filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 183d3b8cb964ab5ad84fe392f303fbffee49e216..673d55cdf5103ca7d73c214fc6163fcc96600a5d 100644 --- a/README.md +++ b/README.md @@ -83,10 +83,12 @@ We generated the indexes ourselves. ## Fixed spatial hotspot workloads -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. +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. -## Current fixed spatial hotspot release: v2 +- `query-original` / `query-original-hot`: official Original10K queries, repeated or resampled into 500K query rows. +- `query-uniform` / `query-uniform-hot`: the separate heldout DEEP1B random500K query bank. +- Standalone insert/delete: one batch of 1M operations. +- Mixed: three batches, each with 1M inserts and 1M deletes. +- Corresponding query and initial/post-batch GT, validation reports, scripts, and checksums are included. -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. - -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. +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. diff --git a/checksums.sha256 b/checksums.sha256 index 1d60822ca61fb9cc1741aaae7ec49ad2b676cee4..20b0523a90478317dded679c51c378a51cd935c5 100644 --- a/checksums.sha256 +++ b/checksums.sha256 @@ -1,4 +1,4 @@ -e6302475693ade2d9c2cf69edb4d5b3986c3b901efce05bb9597607cb4178a61 README.md +d899d27b949c6701bc36c3afb2acc525c0f6fceba64e77c811e181c7d2b94b7c README.md 1c8bf71f320a52e763ba1fa1168d88dbd45f5b36ce74cf2fa71d7bdc399eba93 base_permuted.fbin 0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 groundtruth/active_80m.bin 5793ba574761e11c41087eb1e9e7b1e232350af3c6f17c5c18ed071b05e56031 groundtruth_manifest.json @@ -19,177 +19,7 @@ a76f3833c7fa915910396c52975576953fb95c3269733b5c75f49f33004567a1 initial/pq/pq_ cbdf00b2bb52fd734dd2fd9b72a0acfc3d5d3006a4f1d630596fa6aa84befbb5 initial_pq_manifest.json c33bcf46d80fbe91f66bb3f480769e39613fd3f490b528732c330e1253f79025 reordered_insert_manifest.json 4a36d2c637cf2baaf733fff385f112f99af18f0f115708b5342d52eb6d08a4ec source_manifest.json -0262b930cd55a42336108545b8b2b17af79cee237a173b9f124da299d508adf9 spatial-workloads/v1/README.md -4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454 spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin -ebd2f5852533b2f1c4bc90b4d7f2f87feca2649759461260ef06c72d7e4b4025 spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json -df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5 spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin -174f25a58aad3d57c38db71a2684133cd6bf625a6fc6feb15678f5afaafe7ead spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json -0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin -363192ee85853529fa016c029dd51a5ccd5e58351c286806aea37ccebcd485c6 spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json -b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin -dba30c20f2ec43cc854d461b74c263e3858104acd7c6e0c3879eb53c3fa3e54a spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json -97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7 spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin -0123a0ad340f7db6967a5bd0edeabc954176db8bb9fca45d1c5cf9ef1987588d spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json -f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin -e236e49f6baf00bd5969fb21ce8ca3d4acfe27047a1034d9ceb2777c42235828 spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json -b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0 spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin -881532cf320ae91ee066472418f1190c418a79dcd2e7524e7485d7dbfd5105ca spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json -a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584 spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin -42b81b526e150aad4f6a15e5cc7ba7d277fba122988156c4e118f8faadd8785c spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json -6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin -5fdaea6e59fafd1bcecd2d72da6bdfb1645a6cb2804b6b3ff8a3aeb263983793 spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json -bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43 spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin -19b43e37edac283c91906df67cdd18a49238aa2ac275790917bb8be9da4c5f4a spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json -0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin -133fb957197800a0ed821e9a4e0bdbac535b96d1a5cd792f8a2ee4bc7f49365d spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json -8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin -4fe180cdcc6d14f982266432e2b1b59df17b3991bb6f5a8b53c13dcf75166f3a spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json -af3b7696e04c272f97c4bf13329e06da8acf3ef752779e1b990fc4b7e4165181 spatial-workloads/v1/catalog.json -71230865a86cc453ac9db74b18acf5309df211c98e47937d60bf27b8a8727f29 spatial-workloads/v1/checksums.sha256 -29f3841ac2e651931ea64dc54667dce8ff416e58da8d234c4d3b88638b32bf9c spatial-workloads/v1/code-provenance.json -2585e060c231d981f165824896ed65389c5c04c36def65f02e20532141b5063b spatial-workloads/v1/generation-spec.json -3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 spatial-workloads/v1/partitions/k128-seed42/assignments.u32 -8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877 spatial-workloads/v1/partitions/k128-seed42/centroids.fbin -abe6ef6ba3119b480f45fde41a52eab8c5b1d13631b402dc63878fab40f20543 spatial-workloads/v1/partitions/k128-seed42/partition.json -49a52421492b803544f01575b7c9a96c76a7ed39271ab9353558b9b5028b606c spatial-workloads/v1/partitions/k128-seed42/query_assignments.u32 -73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 -5352ee47e6e0bc687f79af633bf53b61f4bcd958644cc0ee567539d5748892d6 spatial-workloads/v1/plan.json -f5adf71ee42604d49b0eaa261b64a575b5971b4271eaefefbb9918939efe790a spatial-workloads/v1/requirements.txt -81ef6ebf171e1148d6550b3d20f99b78952e65eceb327246051731cd6ee730b8 spatial-workloads/v1/tools/cxl/derive_concurrent_manifest.py -284572d32ec143b7f51e6716dfe4b01669a576d99c9198e030ef5efa8e51458e spatial-workloads/v1/tools/cxl/materialize_concurrent_batch_update.py -55c326ae4f71e63a402851fc744e2a287b5d031a87f246567286b4d956f2818b spatial-workloads/v1/tools/evaluation_runners/configs/deep100.json -9342db9244643ca971d84e405435117579e4b0204e6a9bd875cff393965bcdca spatial-workloads/v1/tools/evaluation_runners/e1.py -0b9b4e8143f608773bf687a09553a18377d11495168ae357ae62dddaf5ac7270 spatial-workloads/v1/tools/evaluation_runners/e2.py -b12e15b00f867267b357de7db578656f1c2811fc6e81e66272c8fbce0c7d2e4f spatial-workloads/v1/tools/evaluation_runners/e6.py -349a77a32a74506c00cc43a4b4007706055330889395541a6dbc2c3084b8def6 spatial-workloads/v1/tools/evaluation_runners/prepare_spatial_config.py -03a69485ce73254352436ff51cada5c9a78880a35a52e240ccb4aba0b9206fcb spatial-workloads/v1/tools/evaluation_runners/runner.py -cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749 spatial-workloads/v1/tools/generator/spatial_common.py -0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0 spatial-workloads/v1/tools/generator/spatial_groundtruth.py -d4763d5918ed4b0630d9f013b4269de2746e237f53a4eedbdc65aca8ce7c8b02 spatial-workloads/v1/tools/generator/spatial_partition.py -86e39bd83b69ee8fa0fc10428dc48371b62e3538ec1d674686288f3ecb052f6c spatial-workloads/v1/tools/generator/spatial_workload.py -4cc0af40a2ce20eb2cd0a18954d647640800301ce220e3218b200295ba9a005e spatial-workloads/v1/tools/generator/stage_release.py -3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff spatial-workloads/v1/tools/generator/verify_spatial_consumers.py -bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 spatial-workloads/v1/workloads/delete-hot/groundtruth/initial.bin -5aeedf5eafe810a3ea6006a74d511d4a985cdbe2e95684b6522940b55e648ec8 spatial-workloads/v1/workloads/delete-hot/plan.json -75bfc783f74e3322fb0d9053714566f0a9dba646a4b04a2b3f527af7970b7686 spatial-workloads/v1/workloads/delete-hot/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/delete-hot/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/delete-hot/queries/query_refs.u32 -e336b2103179c7bb9ca271b7bb53ed9b49bfc81ecdde79159f0f0a95aad23f71 spatial-workloads/v1/workloads/delete-hot/spec.json -d216f20eaffd03ca7811a30311d9b6ab379d6e128ca5f14803cce17af3c6e807 spatial-workloads/v1/workloads/delete-hot/streams/delete_ids.u32 -169871c7f0628e75b643de65688c4977ae010299ff840821596e74671c458f91 spatial-workloads/v1/workloads/delete-hot/traces/delete-hot/batches/batch_0001.json -a3dacd9b244e326e5dc8eb35296e849bea7dd2f36372ade5c58e5185b2aaa049 spatial-workloads/v1/workloads/delete-hot/traces/delete-hot/groundtruth/checkpoint_0001.bin -afea38c57bc2c61a4119cc40132b8414618bc2aaf720cd7fac59e50d6df20c1b spatial-workloads/v1/workloads/delete-hot/traces/delete-hot/trace.json -754b577478eb5e75f55c5242a751fb1a8068897a1fce143bae07f4ce59781cf7 spatial-workloads/v1/workloads/delete-hot/validation.json -b485a90d492885f7a3d5834593b38f2b91f1e661ca70f7234193a3fd6050f503 spatial-workloads/v1/workloads/delete-hot/workload.json -bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 spatial-workloads/v1/workloads/delete-uniform/groundtruth/initial.bin -59e3d918fa91c607be57e74f083039eac2d37206ef283f1586803feb1f8ba51b spatial-workloads/v1/workloads/delete-uniform/plan.json -91f7d9f1cf48b563bf441c32e7f5fa6125df273308348bbc7dd1a0eaa1d6a1bb spatial-workloads/v1/workloads/delete-uniform/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/delete-uniform/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/delete-uniform/queries/query_refs.u32 -72de57db2f053f06d5b2df1ab16967e2316e13be754cbf10a548b3ebb2b6b5c2 spatial-workloads/v1/workloads/delete-uniform/spec.json -983d2da109e19a194fe7bb42670dbe4c73118c36d9e648776dca64cde16715ea spatial-workloads/v1/workloads/delete-uniform/streams/delete_ids.u32 -3a1eb30479ca3e3759e44fc15167f9a2eaaad38fb8c5fe719565c6c5c475daff spatial-workloads/v1/workloads/delete-uniform/traces/delete-uniform/batches/batch_0001.json -2eb75e23f58dd7ff1824230a736fe781f1e5aa3507746a7878b5514af1340506 spatial-workloads/v1/workloads/delete-uniform/traces/delete-uniform/groundtruth/checkpoint_0001.bin -7f38ff520ca1a901573b5eb1b2e2b26649a2b2bc5f61d20903b29d8ea3840a63 spatial-workloads/v1/workloads/delete-uniform/traces/delete-uniform/trace.json -fa22470561fa9cd25c17c5a875cd56957b3f21616dccf496d011ffb56e19c5f9 spatial-workloads/v1/workloads/delete-uniform/validation.json -763f24629e91ca81cadc076dde2a968255e7c1339e6d0b084e98047436cfee10 spatial-workloads/v1/workloads/delete-uniform/workload.json -2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 spatial-workloads/v1/workloads/insert-hot/groundtruth/initial.bin -34f3f6d80fcf7ddedf7d2849647cbe130a6155e61ee5372174b38d78dc20b4f0 spatial-workloads/v1/workloads/insert-hot/plan.json -1c971affa9f872b43428cb0965900ff2d64de7ad0c1b8f4102d23d6cfbdb526f spatial-workloads/v1/workloads/insert-hot/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/insert-hot/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/insert-hot/queries/query_refs.u32 -a48a6aa48ba7ee643685d3c72bf35cb51d2c75eee5952bf47d34545f9d264ca1 spatial-workloads/v1/workloads/insert-hot/spec.json -2ea95525aad57a3d259ce3a225dd33d99ad46fc02e91e2decf0660b9295b5685 spatial-workloads/v1/workloads/insert-hot/streams/insert_ids.u32 -a3693d5fca97bc14db60e1dfef2e77554a47a081010e532c58b2d6a98829af84 spatial-workloads/v1/workloads/insert-hot/streams/insert_refs.u32 -0225f980c33be4807c8aefd0a38ec729d987f1c29f62a270e07e605766ac533d spatial-workloads/v1/workloads/insert-hot/traces/insert-hot/batches/batch_0001.json -eddc89c271f59f8a79a727c59942306323e9236d3e8f85ab66953e9353257d0c spatial-workloads/v1/workloads/insert-hot/traces/insert-hot/groundtruth/checkpoint_0001.bin -4e3bd05a1003192d89086150eb42e1868411d4aa5aceb52ea1312c196604490b spatial-workloads/v1/workloads/insert-hot/traces/insert-hot/trace.json -235bf4873efba223379135e641d05df8e9e46964428280f5d04366954d80cc67 spatial-workloads/v1/workloads/insert-hot/validation.json -c039059ae51da1152f3538d9bc542db806c10739e9f2a7992e7a6f186dc98b2d spatial-workloads/v1/workloads/insert-hot/workload.json -2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 spatial-workloads/v1/workloads/insert-uniform/groundtruth/initial.bin -24d73319e92ebc0239a414f9fa253a7015013127cd0c3269125967f984d5c273 spatial-workloads/v1/workloads/insert-uniform/plan.json -d576ecc5e49776672e79e22d95c6204ee1f3171a9830579538b56ea4be6302c4 spatial-workloads/v1/workloads/insert-uniform/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e spatial-workloads/v1/workloads/insert-uniform/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 spatial-workloads/v1/workloads/insert-uniform/queries/query_refs.u32 -17b4ba59cf474c4e00b2f14cc9ec3779dad3d5ae1d4f61bfc4b8516551c4e766 spatial-workloads/v1/workloads/insert-uniform/spec.json -7645185e472fdb701373f88c738d6e0c1fb76ac972c8c9f85eefc15cd6b7ad33 spatial-workloads/v1/workloads/insert-uniform/streams/insert_ids.u32 -eb8f64166af30085990c173b69f9ccdfea86c8356758942bf4f739f1c6b37b36 spatial-workloads/v1/workloads/insert-uniform/streams/insert_refs.u32 -74fe30a38252827ac5165367a2be4628b0ba5603f59804b1a6483d63ea3b9197 spatial-workloads/v1/workloads/insert-uniform/traces/insert-uniform/batches/batch_0001.json -fe23c7f1dbf05d03611596ed201a19a5f4120e50e8207a044eb5952926d02934 spatial-workloads/v1/workloads/insert-uniform/traces/insert-uniform/groundtruth/checkpoint_0001.bin -6b09d9f4c201867a385a79a089c062492a47166af281f2b9a497f3e129d7247d spatial-workloads/v1/workloads/insert-uniform/traces/insert-uniform/trace.json -029db1070342882d6c2b55ff3484a92f4289eafabe53e4724265a5b1936b5d14 spatial-workloads/v1/workloads/insert-uniform/validation.json -f20685dd093e6b0a89bc85e8bcda17434264c8d57c378a6fcfef2cd3bf57af22 spatial-workloads/v1/workloads/insert-uniform/workload.json -2f7e3141edebde6835bf852f96ca843e9fbd681e7805a0d1889f1be04eb30825 spatial-workloads/v1/workloads/mixed-shared-hot/groundtruth/initial.bin -da4ef8337bfbe7052b9a52d937d56539ce862e7a2e0b73aca682ad3f4894d00e spatial-workloads/v1/workloads/mixed-shared-hot/plan.json -f929c5bf261963c1ed9455ee44a4751a5abb38cdb75fd91036ae258a39d1a2ea spatial-workloads/v1/workloads/mixed-shared-hot/profile.json -02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 spatial-workloads/v1/workloads/mixed-shared-hot/queries/queries.fbin -d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 spatial-workloads/v1/workloads/mixed-shared-hot/queries/query_refs.u32 -4ca84a8267511fdb97f213f39a691c2ddddd68f3637bc0d18f0bb8e2402644e0 spatial-workloads/v1/workloads/mixed-shared-hot/spec.json -e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 spatial-workloads/v1/workloads/mixed-shared-hot/streams/delete_ids.u32 -e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_ids.u32 -524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 spatial-workloads/v1/workloads/mixed-shared-hot/streams/insert_refs.u32 -1c886fce94c360b3ba0c5b3ab63e0444a5650d5283971d357a9ac5136ab1ac8c spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0001.json -696ae063c19f51d4859f388381f5d2fb7d5938d9cf2da567adc82a6f9007ff23 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0002.json -e4eece8a7f04add213da00ce0d8aeb8a58b0b6a374434365d70d3b153cdf9810 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0003.json -d1f54f507c4e490162301c0ce835787bed836ba66a5ec94cc2f464149b3a291b spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0001.bin -42b4cf74e060cc281d57710e33b03d9de21937d7fd7291647b97a2ea7f4b5acf spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0002.bin -6b88fc4434adfd26fac1f37398ddbcacc276ac11b3367555e6b61542b79ce924 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0003.bin -cf90c4aa870695cb584a6989477aa4c85108c6124f8545cd2a0c345edf7cdd52 spatial-workloads/v1/workloads/mixed-shared-hot/traces/mixed-shared-hot/trace.json -0653bdb6d7ae8b0408e0c601f57767da5b423f8242a023dfb9fa8336560fa35d spatial-workloads/v1/workloads/mixed-shared-hot/validation.json -67f3bd5183f4cd69ab57c4dbe71afc58783e6459ebc0ea884f754ffff3c80052 spatial-workloads/v1/workloads/mixed-shared-hot/workload.json -4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b spatial-workloads/v1/workloads/mixed-uniform/groundtruth/initial.bin -42e02c30c8da440c972aabcc5ac2db25cfe1a83900dfac9309c5b128fded9b74 spatial-workloads/v1/workloads/mixed-uniform/plan.json -1f5ccd0fcc57c38f59ee5960d71a1f4b38951566e3cff3e4e38e53814df25d4a spatial-workloads/v1/workloads/mixed-uniform/profile.json -fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 spatial-workloads/v1/workloads/mixed-uniform/queries/queries.fbin -c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 spatial-workloads/v1/workloads/mixed-uniform/queries/query_refs.u32 -3b32b072b8fc883b4cfb7c7edd51d9533a77773176f4223dfe8f6408fa65afde spatial-workloads/v1/workloads/mixed-uniform/spec.json -a493493fda91aafab5333843afa5d4b742d6aef49ec1629c1cc5e8bcabff1c0b spatial-workloads/v1/workloads/mixed-uniform/streams/delete_ids.u32 -fba0903e5198441a698c07af803089d87d158a84ae5c47ba5f7b95a2c1b8ca5e spatial-workloads/v1/workloads/mixed-uniform/streams/insert_ids.u32 -02546a8f23a5bbf7dd0fedc5c3b19e1e3a08687c90ddd1b71e65df57bac09e09 spatial-workloads/v1/workloads/mixed-uniform/streams/insert_refs.u32 -cd70aa375ade4b8935448f7efb7f259c40818c25c84410bccbcffc11724b0451 spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0001.json -a0b175f34b5be6a8fdf2c4a71ee5692bc4562f1b4ac93bec7140cf5997d820e3 spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0002.json -c52f3bb89beea25e7339844605049668c5f550585bc73824e942eb6280109aaf spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0003.json -0506231e994c847947961848fd20b417745db176662321dabb399270390bd05c spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0001.bin -3765877ed824f102d5e613f5ebcfc843a1018f98f6a46f09043f5f270f94ed8f spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0002.bin -5c43e19ae18aabf216c2da27f405345228ebc61e53af5f1fde636ce1de95f7fa spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0003.bin -a8df857f8411b3f9f8f864f31c578e75ff9c8b50d835f800fec1a228e800f83f spatial-workloads/v1/workloads/mixed-uniform/traces/mixed-uniform/trace.json -583fc0619a8ab7335411a9e68ae3bf397fbd3a4a9a2e174b4d47af68c2866e1a spatial-workloads/v1/workloads/mixed-uniform/validation.json -b481dd233729c74e493bdd7494358e3cf86cd6eb2f87cb4f5ad50e7c8bd306c6 spatial-workloads/v1/workloads/mixed-uniform/workload.json -4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b spatial-workloads/v1/workloads/mixed-update-hot/groundtruth/initial.bin -62dae8c05c6fd5c080108876b5dd4909e6e5481bb0ced297f696b5ade9156770 spatial-workloads/v1/workloads/mixed-update-hot/plan.json -a1595bbeca15b20f2d450d28699745e172d7621fdde731d625dd4bb6feb77f04 spatial-workloads/v1/workloads/mixed-update-hot/profile.json -fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 spatial-workloads/v1/workloads/mixed-update-hot/queries/queries.fbin -c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 spatial-workloads/v1/workloads/mixed-update-hot/queries/query_refs.u32 -6702d3b84f24295b58de2e2c787676a06dc4f67df394fb62b524b61edd84f088 spatial-workloads/v1/workloads/mixed-update-hot/spec.json -e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 spatial-workloads/v1/workloads/mixed-update-hot/streams/delete_ids.u32 -e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_ids.u32 -524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 spatial-workloads/v1/workloads/mixed-update-hot/streams/insert_refs.u32 -bd8fdb8db21b35923e6454d0cd1dc47679a805d46da34f810ec2f8cd65915ef6 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0001.json -1b6fee9d4d78f39baf6e7970721364fe84382bdf725ba9f4bd49c68427b114cd spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0002.json -096dabd915fc7b222567fd1d76b003150b2e57332aaa9d0d1733e7acb54eccc7 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0003.json -689d4eceee9abdb03b2ad15b0d5cb3fae619b5b1b1b13633782ef8a37bc121bd spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0001.bin -24d40d4367109eb5b1c8760518e46bc62bfc2d162b64d1df3ff240c4e73af623 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0002.bin -ed74a258093ac6c8e17af6c92bed512ec728b1ae18fbf0f679a53019be9987c1 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0003.bin -79ba8d5424a3689b5fe6bbf668a3301db70a8a3d72357b1f8037c4484478e188 spatial-workloads/v1/workloads/mixed-update-hot/traces/mixed-update-hot/trace.json -c55ee0452c57f96078656f3a0289070fc57581014e2d0cdc6870bcf2f775de43 spatial-workloads/v1/workloads/mixed-update-hot/validation.json -fdeaf645db887856ab9c91e9ee5283eda6451ee150a7c7ec2d1d25336c0ea48f spatial-workloads/v1/workloads/mixed-update-hot/workload.json -1a851806c69474054b0c0cdc20297e686280f1606b368ed83c5870e954fc9a7f spatial-workloads/v1/workloads/query-hot/groundtruth/initial.bin -341ad34db11c474b8a75889c3e0899d7cabe0f6500b1402533c9269d6dd851bc spatial-workloads/v1/workloads/query-hot/plan.json -c7584185831d610f4a378bf0e796f071462c3abd9873c1aee1e2d5b690153dfe spatial-workloads/v1/workloads/query-hot/profile.json -02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 spatial-workloads/v1/workloads/query-hot/queries/queries.fbin -d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 spatial-workloads/v1/workloads/query-hot/queries/query_refs.u32 -6f9cdfbb75c1a8da8ede369006e2779b113da1be5b51f061473da56dc393aadc spatial-workloads/v1/workloads/query-hot/spec.json -bffe9c94733e4607b21e361675ed51a04a50d31ddbe6b0d96991937c03976852 spatial-workloads/v1/workloads/query-hot/validation.json -23ecf08523b50728398358055263167541a4671f46705664b6b591a364645fc3 spatial-workloads/v1/workloads/query-hot/workload.json -2f2f35ca838119f8753d11216e691d885c7e4e4e385e7eb1c88b031a19f60097 spatial-workloads/v1/workloads/query-uniform/groundtruth/initial.bin -13075df6e6211d8087a6ff53b3aa402883facfcd7dbfe3e3790184f3133bce61 spatial-workloads/v1/workloads/query-uniform/plan.json -e4c60a42de88de2ad8070cf50312782c717c703238c464f1c77ae81bd77144ae spatial-workloads/v1/workloads/query-uniform/profile.json -fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 spatial-workloads/v1/workloads/query-uniform/queries/queries.fbin -c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 spatial-workloads/v1/workloads/query-uniform/queries/query_refs.u32 -df6c4ef44152c293f4d0aa89f0c576b84a4b23d62a9a0fb662e967f2b604ee57 spatial-workloads/v1/workloads/query-uniform/spec.json -bdd37876dca3b256834e2534e57811e298ca9a3b743d261199a23765f50ac6c7 spatial-workloads/v1/workloads/query-uniform/validation.json -b6a5bdd4692bbf15149d700d706e5a4b5562d2133c99a0e18566313fd933ac1b spatial-workloads/v1/workloads/query-uniform/workload.json -4a5b8cc43e59f4987874c91e22a9d9a08a001c7997f39141cc6c336d082cc2a2 spatial-workloads/v2/README.md +541347cf90b744148590cee6010f734384c55a7af0ad5a60cd518ed63834ba25 spatial-workloads/v2/README.md 5a085d3112223d5f6cdfbe301fa46313df0eb531179c6e963fcc89ff137372bc spatial-workloads/v2/cache/groundtruth/1110ca435215baa04437de490e5a0696b6f992a733397608f13f71af09d4d8e8.bin ba0e19c62867009580548c681cc7a3948f1d3994af63d8a8fcd98160104fa8eb spatial-workloads/v2/cache/groundtruth/1110ca435215baa04437de490e5a0696b6f992a733397608f13f71af09d4d8e8.json 11dc06300369e447708f48fb7f74d1fc27cbcd883b8ec3ae39dc0717eb1b1d29 spatial-workloads/v2/cache/groundtruth/1263038ce4bc0da4f543052eae3785f01c37a17170f0d6bfbed2bd066e7b72fe.bin @@ -217,8 +47,8 @@ bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43 spatial-worklo 99cf33db5213342df68e6777e56c09ccc4f18b4c1795588b31346fa967dc5eab spatial-workloads/v2/cache/groundtruth/f1c60e62c92545242bcbda461fa59e223b49401de578ce1c85ead51b339d0f79.bin 550de07f4ab1259c5827d900356cbe28dcec845d0b7c9fb556ce5fee90c30b37 spatial-workloads/v2/cache/groundtruth/f1c60e62c92545242bcbda461fa59e223b49401de578ce1c85ead51b339d0f79.json 8cb99e227b429a188b598198e78b3a27996d005a643e97266d113678d41dd50c spatial-workloads/v2/catalog.json -d3b4168f6cbbfbbf46d4388c79eb15680cfd1c932b4d61555492a7597318cd2b spatial-workloads/v2/checksums.sha256 -db5bfec1875cd695c38ab2de4c8c1393e76014692a56bdd36cb12a7923e44f31 spatial-workloads/v2/code-provenance.json +f9409442df40d248b0e6c587d0e9339eaeb197a54e999bac3b9477dbe0423e5e spatial-workloads/v2/checksums.sha256 +ce0a6cf81901d23e9a99dd8b8d52367c5d3d64dd7eb235e5ed24a3c6e80e15ae spatial-workloads/v2/code-provenance.json 8cd57b62419783be8dc1ea0399353b68a8561f549b169df95698271b8ddd0bc4 spatial-workloads/v2/generation-spec.json 3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 spatial-workloads/v2/partitions/k128-seed42/assignments.u32 8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877 spatial-workloads/v2/partitions/k128-seed42/centroids.fbin @@ -241,7 +71,7 @@ cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749 spatial-worklo 0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0 spatial-workloads/v2/tools/generator/spatial_groundtruth.py 4c81e1bf4389ec94e9667726f8dd8c58801d2c532d55786a9d6d750d2ae99a39 spatial-workloads/v2/tools/generator/spatial_partition.py 063040be52c4ecdee3c272eff97629a2506cf6c5ea6ca36d7526afb9de1ad35f spatial-workloads/v2/tools/generator/spatial_workload.py -079ae40ecd6ab2514c6ff600e425008e77c48079528c8ddaee5cc9779481ce48 spatial-workloads/v2/tools/generator/stage_release.py +177e1b2cf546be4a3accd996909ddcbf341ee9d866c213c0030dc2d417d5290a spatial-workloads/v2/tools/generator/stage_release.py 3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff spatial-workloads/v2/tools/generator/verify_spatial_consumers.py bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 spatial-workloads/v2/workloads/delete-hot/groundtruth/initial.bin 462ce413370c1f5e1950c3f55783c5e9797cfc981ff679e9b7b8706c3a7c6886 spatial-workloads/v2/workloads/delete-hot/plan.json diff --git a/spatial-workloads/v1/README.md b/spatial-workloads/v1/README.md deleted file mode 100644 index 16d98c7cf4be1c0e91d57536418e9513ae8dd406..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# DEEP100M fixed spatial hotspot workloads (v1) - -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. - -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]`. - -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. - -| Profile | Initial state | Logical queries | Inserts | Deletes | -| --- | --- | ---: | ---: | ---: | -| [query-uniform](workloads/query-uniform/profile.json) | static-100m | 500,000 | 0 | 0 | -| [query-hot](workloads/query-hot/profile.json) | static-100m | 500,000 | 0 | 0 | -| [insert-uniform](workloads/insert-uniform/profile.json) | initial-80m | 500,000 (checkpoints) | 500,000 | 0 | -| [insert-hot](workloads/insert-hot/profile.json) | initial-80m | 500,000 (checkpoints) | 500,000 | 0 | -| [delete-uniform](workloads/delete-uniform/profile.json) | static-100m | 500,000 (checkpoints) | 0 | 1,000,000 | -| [delete-hot](workloads/delete-hot/profile.json) | static-100m | 500,000 (checkpoints) | 0 | 1,000,000 | -| [mixed-uniform](workloads/mixed-uniform/profile.json) | initial-80m | 21,600,000 | 600,000 | 600,000 | -| [mixed-update-hot](workloads/mixed-update-hot/profile.json) | initial-80m | 21,600,000 | 600,000 | 600,000 | -| [mixed-shared-hot](workloads/mixed-shared-hot/profile.json) | initial-80m | 21,600,000 | 600,000 | 600,000 | - -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. - -## Inputs and identity - -- Static: [Odeinjul/deep-100m-static-search-eval](https://huggingface.co/datasets/Odeinjul/deep-100m-static-search-eval/tree/567847cb68fa512676e77aa84a977311593560a9) (`567847cb68fa512676e77aa84a977311593560a9`). -- Update: [Odeinjul/deep-100m-batch-update-eval](https://huggingface.co/datasets/Odeinjul/deep-100m-batch-update-eval/tree/9956c8a4aa36f58f9607222fc8fc261591fe32b2) (`9956c8a4aa36f58f9607222fc8fc261591fe32b2`). - -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. - -## Use and reproduce - -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. - -From this directory, with the original static/update packages installed: - -```bash -python tools/generator/spatial_workload.py validate --config generation-spec.json \ - --static-root /path/to/static --update-root /path/to/update --output . -python tools/evaluation_runners/prepare_spatial_config.py \ - --profile workloads/mixed-shared-hot/profile.json \ - --base-config tools/evaluation_runners/configs/deep100.json \ - --static-root /path/to/static --update-root /path/to/update \ - --output /tmp/deep100-mixed-shared-hot.json -``` - -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: - -```bash -export VECTORDB_CXL_ROOT=/path/to/vectordb-cxl -python tools/evaluation_runners/e6.py plan \ - --config /tmp/deep100-mixed-shared-hot.json \ - --campaign-root /tmp/deep100-spatial-campaign -``` - -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. - -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. - -## Validation and limits - -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. - -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. - -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. - -Original DEEP vectors are credited to Yandex under the source dataset's [CC BY 4.0 license](../../LICENSE). diff --git a/spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin b/spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin deleted file mode 100644 index 1c67188c3a18417f5f01a6c851ebb24ce1648eac..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454 -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json b/spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json deleted file mode 100644 index f13d1c346930dcb2d457893c250da9e2913a8516..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80000000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin b/spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin deleted file mode 100644 index 7b047d2e7cfb50dd8b6f32cd5e134bfff09df274..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5 -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json b/spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json deleted file mode 100644 index 171ab9992a80d7b4f53c2a85659301da2adc8fbe..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80500000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin b/spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin deleted file mode 100644 index 553e8514140688da8c88692dea9bc698b1789eea..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json b/spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json deleted file mode 100644 index 60d78f5b1a291ffbe808d7c060f5fe1585059ab9..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80000000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin b/spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin deleted file mode 100644 index 7c327d408129b8e8d3d79bd54c5bd004a67f3b48..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json b/spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json deleted file mode 100644 index d02254b9b626e440130e1106abc0b6aa743847cf..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80500000, - "metric": "l2", - "min_live_source_candidates": 66, - "path": "7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin b/spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin deleted file mode 100644 index 7cb1b37b3315c9130baf38e0f8c29461eeef9b3c..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7 -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json b/spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json deleted file mode 100644 index b780a47e3fbf6b975b4d3cf2ba391f6e6274ec51..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 99000000, - "metric": "l2", - "min_live_source_candidates": 76, - "path": "873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin b/spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin deleted file mode 100644 index b4ab10c019895775ea66bd8dca1e046469a1cf5b..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json b/spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json deleted file mode 100644 index 4537f544fa1a5105fbf49ff0c4a5962ec9164c17..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80000000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin b/spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin deleted file mode 100644 index 0b12dfd372acdf6db22a3884ac185f3ee9402ffc..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0 -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json b/spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json deleted file mode 100644 index 0594a2722dce21a54a356f41a6f53a860515c5eb..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80000000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin b/spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin deleted file mode 100644 index cd015dacb182c9817ca48ff35e7fec00d5c69959..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584 -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json b/spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json deleted file mode 100644 index f6d904ac3e5190662271088e6e1bf6d2644c7dd6..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 99000000, - "metric": "l2", - "min_live_source_candidates": 93, - "path": "9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin b/spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin deleted file mode 100644 index e4aeaa4357ffa1d247880ad24aaf46f94ccdbd2d..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json b/spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json deleted file mode 100644 index 9071a2aee23ad661d876a1a7fcc4ffb9cca47e8d..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80000000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin b/spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin deleted file mode 100644 index d93cb05bf5aa6b7f8e56410a86e0402bd9067045..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43 -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json b/spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json deleted file mode 100644 index 27ff6b3e85ab1f3e88d63ad6be64050c3cc5c192..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 100000000, - "metric": "l2", - "min_live_source_candidates": 100, - "path": "c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin b/spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin deleted file mode 100644 index c60daf576b6c29e1e1a4f60f1255cfc5b192b5b4..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json b/spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json deleted file mode 100644 index a104dd958e31fd438a796c288af2ea9507af9dbd..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80000000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin b/spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin deleted file mode 100644 index f279a097688af0dfe6611fda4a3aebba44bccae7..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b -size 400008 diff --git a/spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json b/spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json deleted file mode 100644 index 9ab17228193bd2713e1bffe4646a401a2961d6e8..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "fallback_distance_precision": "float64", - "fallback_query_count": 0, - "fallback_query_ids": [], - "k": 10, - "live_count": 80000000, - "metric": "l2", - "min_live_source_candidates": 65, - "path": "fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin", - "query_count": 10000, - "schema": "spatial-checkpoint-groundtruth.v1", - "sha256": "8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b", - "source_filtered_query_count": 10000, - "source_gt_contract": "trusted exact over full universe, same queries and metric", - "source_gt_depth": 100, - "tie_policy": "preserve source order; fallback distance then external ID" -} diff --git a/spatial-workloads/v1/catalog.json b/spatial-workloads/v1/catalog.json deleted file mode 100644 index 52b3432757276ff7240e94c32951aeddcdc7847d..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/catalog.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "dataset": "deep", - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "limitations": [ - "Spatial input concentration does not guarantee graph-access conflicts.", - "Queries can repeat; report unique query counts and workload-weighted recall.", - "All profiles reuse existing shared HNSW/PQ artifacts; clustering only controls sampling." - ], - "partition": "partitions/k128-seed42/partition.json", - "profiles": [ - { - "control": null, - "id": "query-uniform", - "kind": "query", - "path": "workloads/query-uniform/profile.json", - "validation": "passed" - }, - { - "control": "query-uniform", - "id": "query-hot", - "kind": "query", - "path": "workloads/query-hot/profile.json", - "validation": "passed" - }, - { - "control": null, - "id": "insert-uniform", - "kind": "insert", - "path": "workloads/insert-uniform/profile.json", - "validation": "passed" - }, - { - "control": "insert-uniform", - "id": "insert-hot", - "kind": "insert", - "path": "workloads/insert-hot/profile.json", - "validation": "passed" - }, - { - "control": null, - "id": "delete-uniform", - "kind": "delete", - "path": "workloads/delete-uniform/profile.json", - "validation": "passed" - }, - { - "control": "delete-uniform", - "id": "delete-hot", - "kind": "delete", - "path": "workloads/delete-hot/profile.json", - "validation": "passed" - }, - { - "control": null, - "id": "mixed-uniform", - "kind": "mixed", - "path": "workloads/mixed-uniform/profile.json", - "validation": "passed" - }, - { - "control": "mixed-uniform", - "id": "mixed-update-hot", - "kind": "mixed", - "path": "workloads/mixed-update-hot/profile.json", - "validation": "passed" - }, - { - "control": "mixed-uniform", - "id": "mixed-shared-hot", - "kind": "mixed", - "path": "workloads/mixed-shared-hot/profile.json", - "validation": "passed" - } - ], - "schema": "spatial-workload-catalog.v1", - "source": { - "base": "base.fbin", - "base_count": 100000000, - "dtype": "float32", - "groundtruth": "groundtruth.bin", - "initial_count": 80000000, - "insert_vector_order": "permuted", - "insert_vectors": "base_permuted.fbin", - "metric": "l2", - "queries": "orig_query_10k.fbin", - "static_hf": { - "repo": "Odeinjul/deep-100m-static-search-eval", - "revision": "567847cb68fa512676e77aa84a977311593560a9" - }, - "update_hf": { - "repo": "Odeinjul/deep-100m-batch-update-eval", - "revision": "9956c8a4aa36f58f9607222fc8fc261591fe32b2" - }, - "update_order": "update_order.u32" - }, - "source_identities": { - "base": { - "bytes": 38400000008, - "file": "base.fbin", - "package_sha256": "162cef480f030deead496c745b4214abc3fcbd9849c2561ab1251e84b6904ba4", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "bfb8d14cd9320dd206e9e165bf10ff5d70285beb9a6380622010a01abfee4094" - }, - "groundtruth": { - "bytes": 8000008, - "file": "groundtruth.bin", - "package_sha256": "766d7e0e2ff81796f44adfc46e2cab98809c8e802b952063d7b8fa647697066f", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "5dd3bce8290ae748784916e9d62ec7bf4f0c19cfe40c652697d0ed807fcda761" - }, - "insert_vectors": { - "bytes": 38400000008, - "file": "base_permuted.fbin", - "package_sha256": "1c8bf71f320a52e763ba1fa1168d88dbd45f5b36ce74cf2fa71d7bdc399eba93", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "648534790d99934dd9cbb697f299c36a698f80263c2d344180b786890305227f" - }, - "queries": { - "bytes": 3840008, - "file": "orig_query_10k.fbin", - "package_sha256": "8438fc763f14e0f9741fda15b3e11215aef089ce17d1ad47d53b52a7c9fda5bb", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "a7afbec60a892eaf16eda71baca8f099e364eac84e27818a75bfe2f462e454c8" - }, - "update_order": { - "bytes": 400000000, - "file": "update_order.u32", - "package_sha256": "88332fcfc0662b21c7283197570e8957baf89275e06b635b84a9647da71cdcad", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "5e8fa93c166c6c34714dc5a97d969a5d1b3895bb3fd50f8fdf66fde2190ac37f" - } - } -} diff --git a/spatial-workloads/v1/checksums.sha256 b/spatial-workloads/v1/checksums.sha256 deleted file mode 100644 index ea4c8e0c15016feac2f59bba6e0e3573e821483a..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/checksums.sha256 +++ /dev/null @@ -1,169 +0,0 @@ -0262b930cd55a42336108545b8b2b17af79cee237a173b9f124da299d508adf9 README.md -4725d82f9a4e4e089c1e85ad28e063c61354b840edb68cf660429da0becdf454 cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.bin -ebd2f5852533b2f1c4bc90b4d7f2f87feca2649759461260ef06c72d7e4b4025 cache/groundtruth/0044b23d244fc0002ffb92da7ea71cc9d47d3af6fe5509101681ffe6481404bd.json -df4dbc6b1c2066cfecd7f688ac52715c198b9888de4fcb620489a8086e7e40a5 cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.bin -174f25a58aad3d57c38db71a2684133cd6bf625a6fc6feb15678f5afaafe7ead cache/groundtruth/402fb6d0ce0e2637c4cea863e6f341f685a1a26a552deadaeb8815ae96663ae7.json -0a105a680b67a49588dd9c889fcfc4f32a724d18883c88d5064e8061df232644 cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.bin -363192ee85853529fa016c029dd51a5ccd5e58351c286806aea37ccebcd485c6 cache/groundtruth/78f8274eb6cc4fa58773abc8d770968efd6dde0422afa3c8226fa65e269eb8e7.json -b3c2be4f5cda0b7c2f06603423c9f6d0b3938e5374600c7ddb3785c23b17f91a cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.bin -dba30c20f2ec43cc854d461b74c263e3858104acd7c6e0c3879eb53c3fa3e54a cache/groundtruth/7c9012d5c006cb369f82a5173129fc9068b563ea3831504d79d4647a5c45371f.json -97afc7c866d8b3d48d1988910be52ac6aae882a089e693e6343a7772ef5323d7 cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.bin -0123a0ad340f7db6967a5bd0edeabc954176db8bb9fca45d1c5cf9ef1987588d cache/groundtruth/873fe2e8659d576834f2ed4b261c70f2d0f1235c47305eb860bb5b95e0ce3696.json -f50098b67ec5d5dfb391a8d8c3661a4ba1859b999591bed500ba6ed3cfe4910c cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.bin -e236e49f6baf00bd5969fb21ce8ca3d4acfe27047a1034d9ceb2777c42235828 cache/groundtruth/98e90c24cde0e10b6882bfb88f8aa925e5ad93855b5cf77559bbb100084fd8ef.json -b2964fb30a8c821af00f5c178c2ea2803b053f11ac06b1152d84ef90a9ce67f0 cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.bin -881532cf320ae91ee066472418f1190c418a79dcd2e7524e7485d7dbfd5105ca cache/groundtruth/9c2ae58e45ca0946a7b165944bb8955b6e00eafed1831358805dca9988e04ffd.json -a79f857c8c3c26e8257fc667f34d49e49667d3454f49ceed036d6b9617dbf584 cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.bin -42b81b526e150aad4f6a15e5cc7ba7d277fba122988156c4e118f8faadd8785c cache/groundtruth/9fcd100d34d91611096f80f2ee7eb0f10fab77dd2a8267dddf6d41ac612ad008.json -6a39225a796c68850195aa9e77b394b207e0ade14496229ff808c01c77286b8b cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.bin -5fdaea6e59fafd1bcecd2d72da6bdfb1645a6cb2804b6b3ff8a3aeb263983793 cache/groundtruth/c159684687b40d63a3340a68cbfbb6386cc4b38397760d1fae4ca7c4566efc0f.json -bdb7bed086a6ef3d5a9a0f06c617fa4b67f2aaceae66d49467a8679815079c43 cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.bin -19b43e37edac283c91906df67cdd18a49238aa2ac275790917bb8be9da4c5f4a cache/groundtruth/c353a5705a268757c3938dedf755e7f232b4b046de059eac73b3f92b6d5c12a2.json -0a9e87fc4ae401b7c8c761b670e9e30fb8e2e5ec4d474985580555b02b0b6e7b cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.bin -133fb957197800a0ed821e9a4e0bdbac535b96d1a5cd792f8a2ee4bc7f49365d cache/groundtruth/ccf33ba79ad6952e2f4a99a7eca0acbc4696d4cce4f95d3e358f81b444076784.json -8b77019849de900f3d5f6425be56af48e9ebb0c6bd7d21677fd23a1e93cf721b cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.bin -4fe180cdcc6d14f982266432e2b1b59df17b3991bb6f5a8b53c13dcf75166f3a cache/groundtruth/fafeda2015f75eade921512586edb67c9ab52420264f9a44576ed30eb35a2029.json -af3b7696e04c272f97c4bf13329e06da8acf3ef752779e1b990fc4b7e4165181 catalog.json -29f3841ac2e651931ea64dc54667dce8ff416e58da8d234c4d3b88638b32bf9c code-provenance.json -2585e060c231d981f165824896ed65389c5c04c36def65f02e20532141b5063b generation-spec.json -3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 partitions/k128-seed42/assignments.u32 -8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877 partitions/k128-seed42/centroids.fbin -abe6ef6ba3119b480f45fde41a52eab8c5b1d13631b402dc63878fab40f20543 partitions/k128-seed42/partition.json -49a52421492b803544f01575b7c9a96c76a7ed39271ab9353558b9b5028b606c partitions/k128-seed42/query_assignments.u32 -73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe partitions/k128-seed42/training_source_ids.u32 -5352ee47e6e0bc687f79af633bf53b61f4bcd958644cc0ee567539d5748892d6 plan.json -f5adf71ee42604d49b0eaa261b64a575b5971b4271eaefefbb9918939efe790a requirements.txt -81ef6ebf171e1148d6550b3d20f99b78952e65eceb327246051731cd6ee730b8 tools/cxl/derive_concurrent_manifest.py -284572d32ec143b7f51e6716dfe4b01669a576d99c9198e030ef5efa8e51458e tools/cxl/materialize_concurrent_batch_update.py -55c326ae4f71e63a402851fc744e2a287b5d031a87f246567286b4d956f2818b tools/evaluation_runners/configs/deep100.json -9342db9244643ca971d84e405435117579e4b0204e6a9bd875cff393965bcdca tools/evaluation_runners/e1.py -0b9b4e8143f608773bf687a09553a18377d11495168ae357ae62dddaf5ac7270 tools/evaluation_runners/e2.py -b12e15b00f867267b357de7db578656f1c2811fc6e81e66272c8fbce0c7d2e4f tools/evaluation_runners/e6.py -349a77a32a74506c00cc43a4b4007706055330889395541a6dbc2c3084b8def6 tools/evaluation_runners/prepare_spatial_config.py -03a69485ce73254352436ff51cada5c9a78880a35a52e240ccb4aba0b9206fcb tools/evaluation_runners/runner.py -cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749 tools/generator/spatial_common.py -0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0 tools/generator/spatial_groundtruth.py -d4763d5918ed4b0630d9f013b4269de2746e237f53a4eedbdc65aca8ce7c8b02 tools/generator/spatial_partition.py -86e39bd83b69ee8fa0fc10428dc48371b62e3538ec1d674686288f3ecb052f6c tools/generator/spatial_workload.py -4cc0af40a2ce20eb2cd0a18954d647640800301ce220e3218b200295ba9a005e tools/generator/stage_release.py -3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff tools/generator/verify_spatial_consumers.py -bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 workloads/delete-hot/groundtruth/initial.bin -5aeedf5eafe810a3ea6006a74d511d4a985cdbe2e95684b6522940b55e648ec8 workloads/delete-hot/plan.json -75bfc783f74e3322fb0d9053714566f0a9dba646a4b04a2b3f527af7970b7686 workloads/delete-hot/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/delete-hot/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/delete-hot/queries/query_refs.u32 -e336b2103179c7bb9ca271b7bb53ed9b49bfc81ecdde79159f0f0a95aad23f71 workloads/delete-hot/spec.json -d216f20eaffd03ca7811a30311d9b6ab379d6e128ca5f14803cce17af3c6e807 workloads/delete-hot/streams/delete_ids.u32 -169871c7f0628e75b643de65688c4977ae010299ff840821596e74671c458f91 workloads/delete-hot/traces/delete-hot/batches/batch_0001.json -a3dacd9b244e326e5dc8eb35296e849bea7dd2f36372ade5c58e5185b2aaa049 workloads/delete-hot/traces/delete-hot/groundtruth/checkpoint_0001.bin -afea38c57bc2c61a4119cc40132b8414618bc2aaf720cd7fac59e50d6df20c1b workloads/delete-hot/traces/delete-hot/trace.json -754b577478eb5e75f55c5242a751fb1a8068897a1fce143bae07f4ce59781cf7 workloads/delete-hot/validation.json -b485a90d492885f7a3d5834593b38f2b91f1e661ca70f7234193a3fd6050f503 workloads/delete-hot/workload.json -bbf3dc57d7dcee84e239cc0c25287ee8256fc02259d7c91c60a9bbc8f945c3a3 workloads/delete-uniform/groundtruth/initial.bin -59e3d918fa91c607be57e74f083039eac2d37206ef283f1586803feb1f8ba51b workloads/delete-uniform/plan.json -91f7d9f1cf48b563bf441c32e7f5fa6125df273308348bbc7dd1a0eaa1d6a1bb workloads/delete-uniform/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/delete-uniform/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/delete-uniform/queries/query_refs.u32 -72de57db2f053f06d5b2df1ab16967e2316e13be754cbf10a548b3ebb2b6b5c2 workloads/delete-uniform/spec.json -983d2da109e19a194fe7bb42670dbe4c73118c36d9e648776dca64cde16715ea workloads/delete-uniform/streams/delete_ids.u32 -3a1eb30479ca3e3759e44fc15167f9a2eaaad38fb8c5fe719565c6c5c475daff workloads/delete-uniform/traces/delete-uniform/batches/batch_0001.json -2eb75e23f58dd7ff1824230a736fe781f1e5aa3507746a7878b5514af1340506 workloads/delete-uniform/traces/delete-uniform/groundtruth/checkpoint_0001.bin -7f38ff520ca1a901573b5eb1b2e2b26649a2b2bc5f61d20903b29d8ea3840a63 workloads/delete-uniform/traces/delete-uniform/trace.json -fa22470561fa9cd25c17c5a875cd56957b3f21616dccf496d011ffb56e19c5f9 workloads/delete-uniform/validation.json -763f24629e91ca81cadc076dde2a968255e7c1339e6d0b084e98047436cfee10 workloads/delete-uniform/workload.json -2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 workloads/insert-hot/groundtruth/initial.bin -34f3f6d80fcf7ddedf7d2849647cbe130a6155e61ee5372174b38d78dc20b4f0 workloads/insert-hot/plan.json -1c971affa9f872b43428cb0965900ff2d64de7ad0c1b8f4102d23d6cfbdb526f workloads/insert-hot/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/insert-hot/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/insert-hot/queries/query_refs.u32 -a48a6aa48ba7ee643685d3c72bf35cb51d2c75eee5952bf47d34545f9d264ca1 workloads/insert-hot/spec.json -2ea95525aad57a3d259ce3a225dd33d99ad46fc02e91e2decf0660b9295b5685 workloads/insert-hot/streams/insert_ids.u32 -a3693d5fca97bc14db60e1dfef2e77554a47a081010e532c58b2d6a98829af84 workloads/insert-hot/streams/insert_refs.u32 -0225f980c33be4807c8aefd0a38ec729d987f1c29f62a270e07e605766ac533d workloads/insert-hot/traces/insert-hot/batches/batch_0001.json -eddc89c271f59f8a79a727c59942306323e9236d3e8f85ab66953e9353257d0c workloads/insert-hot/traces/insert-hot/groundtruth/checkpoint_0001.bin -4e3bd05a1003192d89086150eb42e1868411d4aa5aceb52ea1312c196604490b workloads/insert-hot/traces/insert-hot/trace.json -235bf4873efba223379135e641d05df8e9e46964428280f5d04366954d80cc67 workloads/insert-hot/validation.json -c039059ae51da1152f3538d9bc542db806c10739e9f2a7992e7a6f186dc98b2d workloads/insert-hot/workload.json -2f3b96a70462a4a3324a35d31e202d6d649089022e29536473b7649352e18443 workloads/insert-uniform/groundtruth/initial.bin -24d73319e92ebc0239a414f9fa253a7015013127cd0c3269125967f984d5c273 workloads/insert-uniform/plan.json -d576ecc5e49776672e79e22d95c6204ee1f3171a9830579538b56ea4be6302c4 workloads/insert-uniform/profile.json -08599fc542996fdab4196142d9ba2be62f92e7da97d2703e7a855959480a095e workloads/insert-uniform/queries/queries.fbin -bb3ec08d099cd84d523cdc6fafc2dd7af53d14e0b8128d18bd91fefbfc50ee48 workloads/insert-uniform/queries/query_refs.u32 -17b4ba59cf474c4e00b2f14cc9ec3779dad3d5ae1d4f61bfc4b8516551c4e766 workloads/insert-uniform/spec.json -7645185e472fdb701373f88c738d6e0c1fb76ac972c8c9f85eefc15cd6b7ad33 workloads/insert-uniform/streams/insert_ids.u32 -eb8f64166af30085990c173b69f9ccdfea86c8356758942bf4f739f1c6b37b36 workloads/insert-uniform/streams/insert_refs.u32 -74fe30a38252827ac5165367a2be4628b0ba5603f59804b1a6483d63ea3b9197 workloads/insert-uniform/traces/insert-uniform/batches/batch_0001.json -fe23c7f1dbf05d03611596ed201a19a5f4120e50e8207a044eb5952926d02934 workloads/insert-uniform/traces/insert-uniform/groundtruth/checkpoint_0001.bin -6b09d9f4c201867a385a79a089c062492a47166af281f2b9a497f3e129d7247d workloads/insert-uniform/traces/insert-uniform/trace.json -029db1070342882d6c2b55ff3484a92f4289eafabe53e4724265a5b1936b5d14 workloads/insert-uniform/validation.json -f20685dd093e6b0a89bc85e8bcda17434264c8d57c378a6fcfef2cd3bf57af22 workloads/insert-uniform/workload.json -2f7e3141edebde6835bf852f96ca843e9fbd681e7805a0d1889f1be04eb30825 workloads/mixed-shared-hot/groundtruth/initial.bin -da4ef8337bfbe7052b9a52d937d56539ce862e7a2e0b73aca682ad3f4894d00e workloads/mixed-shared-hot/plan.json -f929c5bf261963c1ed9455ee44a4751a5abb38cdb75fd91036ae258a39d1a2ea workloads/mixed-shared-hot/profile.json -02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 workloads/mixed-shared-hot/queries/queries.fbin -d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 workloads/mixed-shared-hot/queries/query_refs.u32 -4ca84a8267511fdb97f213f39a691c2ddddd68f3637bc0d18f0bb8e2402644e0 workloads/mixed-shared-hot/spec.json -e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 workloads/mixed-shared-hot/streams/delete_ids.u32 -e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c workloads/mixed-shared-hot/streams/insert_ids.u32 -524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 workloads/mixed-shared-hot/streams/insert_refs.u32 -1c886fce94c360b3ba0c5b3ab63e0444a5650d5283971d357a9ac5136ab1ac8c workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0001.json -696ae063c19f51d4859f388381f5d2fb7d5938d9cf2da567adc82a6f9007ff23 workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0002.json -e4eece8a7f04add213da00ce0d8aeb8a58b0b6a374434365d70d3b153cdf9810 workloads/mixed-shared-hot/traces/mixed-shared-hot/batches/batch_0003.json -d1f54f507c4e490162301c0ce835787bed836ba66a5ec94cc2f464149b3a291b workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0001.bin -42b4cf74e060cc281d57710e33b03d9de21937d7fd7291647b97a2ea7f4b5acf workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0002.bin -6b88fc4434adfd26fac1f37398ddbcacc276ac11b3367555e6b61542b79ce924 workloads/mixed-shared-hot/traces/mixed-shared-hot/groundtruth/checkpoint_0003.bin -cf90c4aa870695cb584a6989477aa4c85108c6124f8545cd2a0c345edf7cdd52 workloads/mixed-shared-hot/traces/mixed-shared-hot/trace.json -0653bdb6d7ae8b0408e0c601f57767da5b423f8242a023dfb9fa8336560fa35d workloads/mixed-shared-hot/validation.json -67f3bd5183f4cd69ab57c4dbe71afc58783e6459ebc0ea884f754ffff3c80052 workloads/mixed-shared-hot/workload.json -4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b workloads/mixed-uniform/groundtruth/initial.bin -42e02c30c8da440c972aabcc5ac2db25cfe1a83900dfac9309c5b128fded9b74 workloads/mixed-uniform/plan.json -1f5ccd0fcc57c38f59ee5960d71a1f4b38951566e3cff3e4e38e53814df25d4a workloads/mixed-uniform/profile.json -fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 workloads/mixed-uniform/queries/queries.fbin -c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 workloads/mixed-uniform/queries/query_refs.u32 -3b32b072b8fc883b4cfb7c7edd51d9533a77773176f4223dfe8f6408fa65afde workloads/mixed-uniform/spec.json -a493493fda91aafab5333843afa5d4b742d6aef49ec1629c1cc5e8bcabff1c0b workloads/mixed-uniform/streams/delete_ids.u32 -fba0903e5198441a698c07af803089d87d158a84ae5c47ba5f7b95a2c1b8ca5e workloads/mixed-uniform/streams/insert_ids.u32 -02546a8f23a5bbf7dd0fedc5c3b19e1e3a08687c90ddd1b71e65df57bac09e09 workloads/mixed-uniform/streams/insert_refs.u32 -cd70aa375ade4b8935448f7efb7f259c40818c25c84410bccbcffc11724b0451 workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0001.json -a0b175f34b5be6a8fdf2c4a71ee5692bc4562f1b4ac93bec7140cf5997d820e3 workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0002.json -c52f3bb89beea25e7339844605049668c5f550585bc73824e942eb6280109aaf workloads/mixed-uniform/traces/mixed-uniform/batches/batch_0003.json -0506231e994c847947961848fd20b417745db176662321dabb399270390bd05c workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0001.bin -3765877ed824f102d5e613f5ebcfc843a1018f98f6a46f09043f5f270f94ed8f workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0002.bin -5c43e19ae18aabf216c2da27f405345228ebc61e53af5f1fde636ce1de95f7fa workloads/mixed-uniform/traces/mixed-uniform/groundtruth/checkpoint_0003.bin -a8df857f8411b3f9f8f864f31c578e75ff9c8b50d835f800fec1a228e800f83f workloads/mixed-uniform/traces/mixed-uniform/trace.json -583fc0619a8ab7335411a9e68ae3bf397fbd3a4a9a2e174b4d47af68c2866e1a workloads/mixed-uniform/validation.json -b481dd233729c74e493bdd7494358e3cf86cd6eb2f87cb4f5ad50e7c8bd306c6 workloads/mixed-uniform/workload.json -4cc191dc98c1926739bb4c28b43b7c72d304fd2b10069f0480f3102009ce567b workloads/mixed-update-hot/groundtruth/initial.bin -62dae8c05c6fd5c080108876b5dd4909e6e5481bb0ced297f696b5ade9156770 workloads/mixed-update-hot/plan.json -a1595bbeca15b20f2d450d28699745e172d7621fdde731d625dd4bb6feb77f04 workloads/mixed-update-hot/profile.json -fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 workloads/mixed-update-hot/queries/queries.fbin -c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 workloads/mixed-update-hot/queries/query_refs.u32 -6702d3b84f24295b58de2e2c787676a06dc4f67df394fb62b524b61edd84f088 workloads/mixed-update-hot/spec.json -e100d8bde88c333332d452d54ce45fe11ffb2ebfa7ac0b9ca1927efa060f0d22 workloads/mixed-update-hot/streams/delete_ids.u32 -e7f9407e6db8cda2586ce8837561cdfdee3b2df59299cc75eb04dd5129481c1c workloads/mixed-update-hot/streams/insert_ids.u32 -524dd65d2597536409230995f0dc9db2676085cf8420649e3f820b30aef48202 workloads/mixed-update-hot/streams/insert_refs.u32 -bd8fdb8db21b35923e6454d0cd1dc47679a805d46da34f810ec2f8cd65915ef6 workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0001.json -1b6fee9d4d78f39baf6e7970721364fe84382bdf725ba9f4bd49c68427b114cd workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0002.json -096dabd915fc7b222567fd1d76b003150b2e57332aaa9d0d1733e7acb54eccc7 workloads/mixed-update-hot/traces/mixed-update-hot/batches/batch_0003.json -689d4eceee9abdb03b2ad15b0d5cb3fae619b5b1b1b13633782ef8a37bc121bd workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0001.bin -24d40d4367109eb5b1c8760518e46bc62bfc2d162b64d1df3ff240c4e73af623 workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0002.bin -ed74a258093ac6c8e17af6c92bed512ec728b1ae18fbf0f679a53019be9987c1 workloads/mixed-update-hot/traces/mixed-update-hot/groundtruth/checkpoint_0003.bin -79ba8d5424a3689b5fe6bbf668a3301db70a8a3d72357b1f8037c4484478e188 workloads/mixed-update-hot/traces/mixed-update-hot/trace.json -c55ee0452c57f96078656f3a0289070fc57581014e2d0cdc6870bcf2f775de43 workloads/mixed-update-hot/validation.json -fdeaf645db887856ab9c91e9ee5283eda6451ee150a7c7ec2d1d25336c0ea48f workloads/mixed-update-hot/workload.json -1a851806c69474054b0c0cdc20297e686280f1606b368ed83c5870e954fc9a7f workloads/query-hot/groundtruth/initial.bin -341ad34db11c474b8a75889c3e0899d7cabe0f6500b1402533c9269d6dd851bc workloads/query-hot/plan.json -c7584185831d610f4a378bf0e796f071462c3abd9873c1aee1e2d5b690153dfe workloads/query-hot/profile.json -02faddd953193940ce5ac1891b728cb6723081c52ec469e3bc120b2dde90c267 workloads/query-hot/queries/queries.fbin -d2cabea8772e5d9f8c17eda6ea2347882a9d297fff8c1ce7d8f45f941929ffd6 workloads/query-hot/queries/query_refs.u32 -6f9cdfbb75c1a8da8ede369006e2779b113da1be5b51f061473da56dc393aadc workloads/query-hot/spec.json -bffe9c94733e4607b21e361675ed51a04a50d31ddbe6b0d96991937c03976852 workloads/query-hot/validation.json -23ecf08523b50728398358055263167541a4671f46705664b6b591a364645fc3 workloads/query-hot/workload.json -2f2f35ca838119f8753d11216e691d885c7e4e4e385e7eb1c88b031a19f60097 workloads/query-uniform/groundtruth/initial.bin -13075df6e6211d8087a6ff53b3aa402883facfcd7dbfe3e3790184f3133bce61 workloads/query-uniform/plan.json -e4c60a42de88de2ad8070cf50312782c717c703238c464f1c77ae81bd77144ae workloads/query-uniform/profile.json -fcc5402274a5679f9cbbb65d9aa77e6bf5aa1b2512dccbcbcd51bcf2308cb8d3 workloads/query-uniform/queries/queries.fbin -c8b36454e30ae5167377b9723ed1eb1f8dffe6db680d66862dd10429d13a14f9 workloads/query-uniform/queries/query_refs.u32 -df6c4ef44152c293f4d0aa89f0c576b84a4b23d62a9a0fb662e967f2b604ee57 workloads/query-uniform/spec.json -bdd37876dca3b256834e2534e57811e298ca9a3b743d261199a23765f50ac6c7 workloads/query-uniform/validation.json -b6a5bdd4692bbf15149d700d706e5a4b5562d2133c99a0e18566313fd933ac1b workloads/query-uniform/workload.json diff --git a/spatial-workloads/v1/code-provenance.json b/spatial-workloads/v1/code-provenance.json deleted file mode 100644 index cdb9276295d36515103ce5cf54ea8e3055165756..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/code-provenance.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "files": { - "requirements.txt": "f5adf71ee42604d49b0eaa261b64a575b5971b4271eaefefbb9918939efe790a", - "tools/cxl/derive_concurrent_manifest.py": "81ef6ebf171e1148d6550b3d20f99b78952e65eceb327246051731cd6ee730b8", - "tools/cxl/materialize_concurrent_batch_update.py": "284572d32ec143b7f51e6716dfe4b01669a576d99c9198e030ef5efa8e51458e", - "tools/evaluation_runners/configs/deep100.json": "55c326ae4f71e63a402851fc744e2a287b5d031a87f246567286b4d956f2818b", - "tools/evaluation_runners/e1.py": "9342db9244643ca971d84e405435117579e4b0204e6a9bd875cff393965bcdca", - "tools/evaluation_runners/e2.py": "0b9b4e8143f608773bf687a09553a18377d11495168ae357ae62dddaf5ac7270", - "tools/evaluation_runners/e6.py": "b12e15b00f867267b357de7db578656f1c2811fc6e81e66272c8fbce0c7d2e4f", - "tools/evaluation_runners/prepare_spatial_config.py": "349a77a32a74506c00cc43a4b4007706055330889395541a6dbc2c3084b8def6", - "tools/evaluation_runners/runner.py": "03a69485ce73254352436ff51cada5c9a78880a35a52e240ccb4aba0b9206fcb", - "tools/generator/spatial_common.py": "cbd4040c3ea1b87823805d96b49e973f761aca37584ea5189a87ddb08545f749", - "tools/generator/spatial_groundtruth.py": "0693e91d18389442fd98d76a7438bd2e959200eea6a780c74077c36156a002b0", - "tools/generator/spatial_partition.py": "d4763d5918ed4b0630d9f013b4269de2746e237f53a4eedbdc65aca8ce7c8b02", - "tools/generator/spatial_workload.py": "86e39bd83b69ee8fa0fc10428dc48371b62e3538ec1d674686288f3ecb052f6c", - "tools/generator/stage_release.py": "4cc0af40a2ce20eb2cd0a18954d647640800301ce220e3218b200295ba9a005e", - "tools/generator/verify_spatial_consumers.py": "3c32551ce6c98009bc94b81fe287f9c94ed736d78950443de6140e156d473eff" - }, - "repositories": { - "vectordb-cxl": { - "baseline": "6cfd5a0de9b79aac38a6a4afa796e91fe2b297f4", - "branch": "feat/static-hotspot-workloads" - }, - "vectordb-eval": { - "baseline": "bcab614ecf90514ccba696312c01408a06d3e1e4", - "branch": "feat/static-hotspot-workloads" - } - }, - "schema": "spatial-code-provenance.v1", - "source_state": "reviewed feature worktree snapshot" -} diff --git a/spatial-workloads/v1/generation-spec.json b/spatial-workloads/v1/generation-spec.json deleted file mode 100644 index 1d00155072894771400d324b6a6f9d56e7001da7..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/generation-spec.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "dataset": "deep", - "hotspot": { - "seed": 42, - "target_mass": 0.05 - }, - "partition": { - "clusters": 128, - "iterations": 20, - "metric": "l2", - "seed": 42, - "training_rows": 262144 - }, - "profiles": [ - { - "deletes": 0, - "id": "query-uniform", - "initial_state": "static-100m", - "inserts": 0, - "kind": "query", - "queries": 500000, - "query_rows": 500000 - }, - { - "control": "query-uniform", - "deletes": 0, - "id": "query-hot", - "initial_state": "static-100m", - "inserts": 0, - "kind": "query", - "queries": 500000, - "query_hot_fraction": 0.8, - "query_rows": 500000 - }, - { - "batch_size": 500000, - "deletes": 0, - "id": "insert-uniform", - "initial_state": "initial-80m", - "inserts": 500000, - "kind": "insert", - "queries": 500000, - "query_rows": 10000 - }, - { - "batch_size": 500000, - "control": "insert-uniform", - "deletes": 0, - "id": "insert-hot", - "initial_state": "initial-80m", - "insert_hot_fraction": 0.8, - "inserts": 500000, - "kind": "insert", - "queries": 500000, - "query_rows": 10000 - }, - { - "batch_size": 1000000, - "deletes": 1000000, - "id": "delete-uniform", - "initial_state": "static-100m", - "inserts": 0, - "kind": "delete", - "queries": 500000, - "query_rows": 10000 - }, - { - "batch_size": 1000000, - "control": "delete-uniform", - "delete_hot_fraction": 0.8, - "deletes": 1000000, - "id": "delete-hot", - "initial_state": "static-100m", - "inserts": 0, - "kind": "delete", - "queries": 500000, - "query_rows": 10000 - }, - { - "batch_size": 200000, - "deletes": 600000, - "id": "mixed-uniform", - "initial_state": "initial-80m", - "inserts": 600000, - "kind": "mixed", - "queries": 21600000, - "query_rows": 500000, - "update_stream": "mixed-uniform" - }, - { - "batch_size": 200000, - "control": "mixed-uniform", - "delete_hot_fraction": 0.8, - "deletes": 600000, - "id": "mixed-update-hot", - "initial_state": "initial-80m", - "insert_hot_fraction": 0.8, - "inserts": 600000, - "kind": "mixed", - "queries": 21600000, - "query_rows": 500000, - "update_stream": "mixed-hot" - }, - { - "batch_size": 200000, - "control": "mixed-uniform", - "delete_hot_fraction": 0.8, - "deletes": 600000, - "id": "mixed-shared-hot", - "initial_state": "initial-80m", - "insert_hot_fraction": 0.8, - "inserts": 600000, - "kind": "mixed", - "queries": 21600000, - "query_hot_fraction": 0.8, - "query_rows": 500000, - "update_stream": "mixed-hot" - } - ], - "sampling_seed": 20261001, - "schema": "spatial-workload-spec.v1", - "source": { - "base": "base.fbin", - "base_count": 100000000, - "dtype": "float32", - "groundtruth": "groundtruth.bin", - "initial_count": 80000000, - "insert_vector_order": "permuted", - "insert_vectors": "base_permuted.fbin", - "metric": "l2", - "queries": "orig_query_10k.fbin", - "static_hf": { - "repo": "Odeinjul/deep-100m-static-search-eval", - "revision": "567847cb68fa512676e77aa84a977311593560a9" - }, - "update_hf": { - "repo": "Odeinjul/deep-100m-batch-update-eval", - "revision": "9956c8a4aa36f58f9607222fc8fc261591fe32b2" - }, - "update_order": "update_order.u32" - }, - "top_k": 10 -} diff --git a/spatial-workloads/v1/partitions/k128-seed42/assignments.u32 b/spatial-workloads/v1/partitions/k128-seed42/assignments.u32 deleted file mode 100644 index 8a0496e52e1f3199fc1cc04472628f16b0bf3c8a..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/partitions/k128-seed42/assignments.u32 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6 -size 400000000 diff --git a/spatial-workloads/v1/partitions/k128-seed42/centroids.fbin b/spatial-workloads/v1/partitions/k128-seed42/centroids.fbin deleted file mode 100644 index f0afa858762b204a94fc140b189b78814457f9e4..0000000000000000000000000000000000000000 Binary files a/spatial-workloads/v1/partitions/k128-seed42/centroids.fbin and /dev/null differ diff --git a/spatial-workloads/v1/partitions/k128-seed42/partition.json b/spatial-workloads/v1/partitions/k128-seed42/partition.json deleted file mode 100644 index 00e4c4c2c31c34af187dfb11170190f465a70b03..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/partitions/k128-seed42/partition.json +++ /dev/null @@ -1,315 +0,0 @@ -{ - "assignment_order": "original source vector ID; not HNSW internal ID or update_order row", - "counts": [ - 1324263, - 517046, - 691524, - 882738, - 444113, - 947564, - 626518, - 473321, - 1963984, - 889554, - 755082, - 472499, - 865262, - 921513, - 841876, - 1187506, - 997698, - 290217, - 648656, - 757617, - 1042960, - 543354, - 933054, - 903705, - 661841, - 850115, - 403632, - 745813, - 644752, - 803814, - 589949, - 465493, - 1040583, - 855269, - 728156, - 451711, - 629170, - 637292, - 533185, - 637181, - 816864, - 1126588, - 538625, - 453188, - 828798, - 946818, - 891839, - 793412, - 863527, - 705164, - 717673, - 957005, - 702061, - 1056973, - 587031, - 505741, - 676903, - 688886, - 650943, - 742777, - 641521, - 746534, - 908990, - 790635, - 605461, - 701390, - 516954, - 1084129, - 561293, - 727610, - 866969, - 763664, - 1201926, - 586091, - 982296, - 1052665, - 760859, - 710634, - 810397, - 550894, - 562967, - 630497, - 623958, - 1000811, - 909607, - 847262, - 922736, - 579122, - 726866, - 637125, - 888092, - 695013, - 1039939, - 893423, - 692661, - 628537, - 1208071, - 1022288, - 868183, - 915985, - 869514, - 845619, - 937462, - 961121, - 672204, - 642625, - 636483, - 732944, - 510099, - 793751, - 569509, - 593971, - 1338957, - 967123, - 645606, - 852451, - 1261371, - 552425, - 752667, - 976949, - 695018, - 632044, - 640696, - 906746, - 1072280, - 919201, - 784621, - 522092 - ], - "dimension": 96, - "elapsed_seconds": 253.89, - "files": { - "assignments.u32": { - "bytes": 400000000, - "sha256": "3b68f5446a7d407c09514e8081f7e09411d1271cbbe415556025a640708518f6" - }, - "centroids.fbin": { - "bytes": 49160, - "sha256": "8b918c8e00600ec03e565c5e1ce9b7a324d21ebcc0d129f4e5e2075660c7d877" - }, - "query_assignments.u32": { - "bytes": 40000, - "sha256": "49a52421492b803544f01575b7c9a96c76a7ed39271ab9353558b9b5028b606c" - }, - "training_source_ids.u32": { - "bytes": 1048576, - "sha256": "73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe" - } - }, - "parameters": { - "clusters": 128, - "iterations": 20, - "metric": "l2", - "seed": 42, - "training_rows": 262144 - }, - "query_counts": [ - 149, - 41, - 69, - 95, - 37, - 87, - 56, - 51, - 194, - 98, - 71, - 54, - 98, - 92, - 94, - 122, - 99, - 23, - 67, - 66, - 86, - 48, - 98, - 87, - 86, - 88, - 38, - 75, - 61, - 75, - 51, - 39, - 112, - 79, - 81, - 51, - 64, - 55, - 57, - 56, - 78, - 154, - 47, - 58, - 90, - 82, - 72, - 84, - 86, - 68, - 82, - 102, - 79, - 105, - 47, - 53, - 82, - 61, - 61, - 69, - 74, - 72, - 109, - 79, - 58, - 71, - 55, - 101, - 54, - 70, - 87, - 95, - 109, - 51, - 93, - 113, - 79, - 94, - 76, - 48, - 60, - 59, - 70, - 93, - 92, - 78, - 91, - 64, - 78, - 67, - 85, - 56, - 108, - 68, - 65, - 60, - 137, - 119, - 61, - 106, - 82, - 79, - 106, - 87, - 52, - 65, - 70, - 68, - 54, - 58, - 44, - 61, - 144, - 90, - 74, - 83, - 123, - 71, - 66, - 116, - 75, - 65, - 65, - 83, - 110, - 71, - 73, - 50 - ], - "query_rows": 10000, - "schema": "spatial-partition.v1", - "signature": "d50c5b5fb5f26e04b333ac70b3c2443167b17f1c7bd11198b8496aa5751063b0", - "software": { - "faiss": "1.15.1", - "numpy": "2.2.6", - "threads": 16 - }, - "source": { - "base": { - "bytes": 38400000008, - "file": "base.fbin", - "package_sha256": "162cef480f030deead496c745b4214abc3fcbd9849c2561ab1251e84b6904ba4", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "bfb8d14cd9320dd206e9e165bf10ff5d70285beb9a6380622010a01abfee4094" - }, - "queries": { - "bytes": 3840008, - "file": "orig_query_10k.fbin", - "package_sha256": "8438fc763f14e0f9741fda15b3e11215aef089ce17d1ad47d53b52a7c9fda5bb", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "a7afbec60a892eaf16eda71baca8f099e364eac84e27818a75bfe2f462e454c8" - } - }, - "source_rows": 100000000 -} diff --git a/spatial-workloads/v1/partitions/k128-seed42/query_assignments.u32 b/spatial-workloads/v1/partitions/k128-seed42/query_assignments.u32 deleted file mode 100644 index 8c521179b3fb7a44cae344760771c7ba9dc05692..0000000000000000000000000000000000000000 Binary files a/spatial-workloads/v1/partitions/k128-seed42/query_assignments.u32 and /dev/null differ diff --git a/spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 b/spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 deleted file mode 100644 index 9d046395829becc55eeb2e3c0863b96d17c84a0b..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/partitions/k128-seed42/training_source_ids.u32 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:73850d5d4beffa66fcb331c407a9ac64703a403b659e56887795570195b7d0fe -size 1048576 diff --git a/spatial-workloads/v1/plan.json b/spatial-workloads/v1/plan.json deleted file mode 100644 index 7ef6bead439e54d0cb57f376dafcd39e41b6bd1b..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/plan.json +++ /dev/null @@ -1,589 +0,0 @@ -{ - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "partition_signature": "d50c5b5fb5f26e04b333ac70b3c2443167b17f1c7bd11198b8496aa5751063b0", - "profiles": [ - { - "batch_count": 0, - "capacities": { - "delete": { - "cold_eligible": 94611103, - "eligible": 100000000, - "hot_eligible": 5388897, - "hot_quota": null, - "requested": 0 - }, - "insert": { - "cold_eligible": 0, - "eligible": 0, - "hot_eligible": 0, - "hot_quota": null, - "requested": 0 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": null, - "requested": 500000 - } - }, - "final_live_count": 100000000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 100000000, - "profile": { - "deletes": 0, - "id": "query-uniform", - "initial_state": "static-100m", - "inserts": 0, - "kind": "query", - "queries": 500000, - "query_rows": 500000 - } - }, - { - "batch_count": 0, - "capacities": { - "delete": { - "cold_eligible": 94611103, - "eligible": 100000000, - "hot_eligible": 5388897, - "hot_quota": null, - "requested": 0 - }, - "insert": { - "cold_eligible": 0, - "eligible": 0, - "hot_eligible": 0, - "hot_quota": null, - "requested": 0 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": 400000, - "requested": 500000 - } - }, - "final_live_count": 100000000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 100000000, - "profile": { - "control": "query-uniform", - "deletes": 0, - "id": "query-hot", - "initial_state": "static-100m", - "inserts": 0, - "kind": "query", - "queries": 500000, - "query_hot_fraction": 0.8, - "query_rows": 500000 - } - }, - { - "batch_count": 1, - "capacities": { - "delete": { - "cold_eligible": 75689174, - "eligible": 80000000, - "hot_eligible": 4310826, - "hot_quota": null, - "requested": 0 - }, - "insert": { - "cold_eligible": 18921929, - "eligible": 20000000, - "hot_eligible": 1078071, - "hot_quota": null, - "requested": 500000 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": null, - "requested": 10000 - } - }, - "final_live_count": 80500000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 80000000, - "profile": { - "batch_size": 500000, - "deletes": 0, - "id": "insert-uniform", - "initial_state": "initial-80m", - "inserts": 500000, - "kind": "insert", - "queries": 500000, - "query_rows": 10000 - } - }, - { - "batch_count": 1, - "capacities": { - "delete": { - "cold_eligible": 75689174, - "eligible": 80000000, - "hot_eligible": 4310826, - "hot_quota": null, - "requested": 0 - }, - "insert": { - "cold_eligible": 18921929, - "eligible": 20000000, - "hot_eligible": 1078071, - "hot_quota": 400000, - "requested": 500000 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": null, - "requested": 10000 - } - }, - "final_live_count": 80500000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 80000000, - "profile": { - "batch_size": 500000, - "control": "insert-uniform", - "deletes": 0, - "id": "insert-hot", - "initial_state": "initial-80m", - "insert_hot_fraction": 0.8, - "inserts": 500000, - "kind": "insert", - "queries": 500000, - "query_rows": 10000 - } - }, - { - "batch_count": 1, - "capacities": { - "delete": { - "cold_eligible": 94611103, - "eligible": 100000000, - "hot_eligible": 5388897, - "hot_quota": null, - "requested": 1000000 - }, - "insert": { - "cold_eligible": 0, - "eligible": 0, - "hot_eligible": 0, - "hot_quota": null, - "requested": 0 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": null, - "requested": 10000 - } - }, - "final_live_count": 99000000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 100000000, - "profile": { - "batch_size": 1000000, - "deletes": 1000000, - "id": "delete-uniform", - "initial_state": "static-100m", - "inserts": 0, - "kind": "delete", - "queries": 500000, - "query_rows": 10000 - } - }, - { - "batch_count": 1, - "capacities": { - "delete": { - "cold_eligible": 94611103, - "eligible": 100000000, - "hot_eligible": 5388897, - "hot_quota": 800000, - "requested": 1000000 - }, - "insert": { - "cold_eligible": 0, - "eligible": 0, - "hot_eligible": 0, - "hot_quota": null, - "requested": 0 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": null, - "requested": 10000 - } - }, - "final_live_count": 99000000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 100000000, - "profile": { - "batch_size": 1000000, - "control": "delete-uniform", - "delete_hot_fraction": 0.8, - "deletes": 1000000, - "id": "delete-hot", - "initial_state": "static-100m", - "inserts": 0, - "kind": "delete", - "queries": 500000, - "query_rows": 10000 - } - }, - { - "batch_count": 3, - "capacities": { - "delete": { - "cold_eligible": 75689174, - "eligible": 80000000, - "hot_eligible": 4310826, - "hot_quota": null, - "requested": 600000 - }, - "insert": { - "cold_eligible": 18921929, - "eligible": 20000000, - "hot_eligible": 1078071, - "hot_quota": null, - "requested": 600000 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": null, - "requested": 500000 - } - }, - "final_live_count": 80000000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 80000000, - "profile": { - "batch_size": 200000, - "deletes": 600000, - "id": "mixed-uniform", - "initial_state": "initial-80m", - "inserts": 600000, - "kind": "mixed", - "queries": 21600000, - "query_rows": 500000, - "update_stream": "mixed-uniform" - } - }, - { - "batch_count": 3, - "capacities": { - "delete": { - "cold_eligible": 75689174, - "eligible": 80000000, - "hot_eligible": 4310826, - "hot_quota": 480000, - "requested": 600000 - }, - "insert": { - "cold_eligible": 18921929, - "eligible": 20000000, - "hot_eligible": 1078071, - "hot_quota": 480000, - "requested": 600000 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": null, - "requested": 500000 - } - }, - "final_live_count": 80000000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 80000000, - "profile": { - "batch_size": 200000, - "control": "mixed-uniform", - "delete_hot_fraction": 0.8, - "deletes": 600000, - "id": "mixed-update-hot", - "initial_state": "initial-80m", - "insert_hot_fraction": 0.8, - "inserts": 600000, - "kind": "mixed", - "queries": 21600000, - "query_rows": 500000, - "update_stream": "mixed-hot" - } - }, - { - "batch_count": 3, - "capacities": { - "delete": { - "cold_eligible": 75689174, - "eligible": 80000000, - "hot_eligible": 4310826, - "hot_quota": 480000, - "requested": 600000 - }, - "insert": { - "cold_eligible": 18921929, - "eligible": 20000000, - "hot_eligible": 1078071, - "hot_quota": 480000, - "requested": 600000 - }, - "query": { - "cold_eligible": 9443, - "eligible": 10000, - "hot_eligible": 557, - "hot_quota": 400000, - "requested": 500000 - } - }, - "final_live_count": 80000000, - "hotspot": { - "actual_mass": 0.05388897, - "clusters": [ - 22, - 0, - 111, - 59, - 122, - 121, - 127 - ], - "fresh_vectors": 1078071, - "initial_live_vectors": 4310826, - "query_vectors": 557, - "root_cluster": 22, - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "source_vectors": 5388897, - "target_mass": 0.05 - }, - "initial_live_count": 80000000, - "profile": { - "batch_size": 200000, - "control": "mixed-uniform", - "delete_hot_fraction": 0.8, - "deletes": 600000, - "id": "mixed-shared-hot", - "initial_state": "initial-80m", - "insert_hot_fraction": 0.8, - "inserts": 600000, - "kind": "mixed", - "queries": 21600000, - "query_hot_fraction": 0.8, - "query_rows": 500000, - "update_stream": "mixed-hot" - } - } - ], - "schema": "spatial-workload-plan.v1", - "source_identities": { - "base": { - "bytes": 38400000008, - "file": "base.fbin", - "package_sha256": "162cef480f030deead496c745b4214abc3fcbd9849c2561ab1251e84b6904ba4", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "bfb8d14cd9320dd206e9e165bf10ff5d70285beb9a6380622010a01abfee4094" - }, - "groundtruth": { - "bytes": 8000008, - "file": "groundtruth.bin", - "package_sha256": "766d7e0e2ff81796f44adfc46e2cab98809c8e802b952063d7b8fa647697066f", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "5dd3bce8290ae748784916e9d62ec7bf4f0c19cfe40c652697d0ed807fcda761" - }, - "insert_vectors": { - "bytes": 38400000008, - "file": "base_permuted.fbin", - "package_sha256": "1c8bf71f320a52e763ba1fa1168d88dbd45f5b36ce74cf2fa71d7bdc399eba93", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "648534790d99934dd9cbb697f299c36a698f80263c2d344180b786890305227f" - }, - "queries": { - "bytes": 3840008, - "file": "orig_query_10k.fbin", - "package_sha256": "8438fc763f14e0f9741fda15b3e11215aef089ce17d1ad47d53b52a7c9fda5bb", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "a7afbec60a892eaf16eda71baca8f099e364eac84e27818a75bfe2f462e454c8" - }, - "update_order": { - "bytes": 400000000, - "file": "update_order.u32", - "package_sha256": "88332fcfc0662b21c7283197570e8957baf89275e06b635b84a9647da71cdcad", - "package_sha256_status": "trusted source record; not rehashed", - "sample_sha256": "5e8fa93c166c6c34714dc5a97d969a5d1b3895bb3fd50f8fdf66fde2190ac37f" - } - } -} diff --git a/spatial-workloads/v1/requirements.txt b/spatial-workloads/v1/requirements.txt deleted file mode 100644 index bd3362bd54e07bcbdb5f5797be04afdbeaf8e536..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Versions used to generate and validate the DEEP100M v1 release. -numpy==2.2.6 -faiss-cpu==1.15.1 -threadpoolctl==3.7.0 diff --git a/spatial-workloads/v1/tools/cxl/derive_concurrent_manifest.py b/spatial-workloads/v1/tools/cxl/derive_concurrent_manifest.py deleted file mode 100644 index f96d4caa240a8f59a3a926905a09f546bc645dfc..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/cxl/derive_concurrent_manifest.py +++ /dev/null @@ -1,555 +0,0 @@ -#!/usr/bin/env python3 - -from __future__ import annotations - -import argparse -import copy -import json -import tempfile -from pathlib import Path - - -DEFAULT_MIXED_STEADY_SEARCH_THREADS = 26 -DEFAULT_MIXED_STEADY_INSERT_THREADS = 4 -DEFAULT_MIXED_STEADY_MARK_DELETE_THREADS = 1 -DEFAULT_MIXED_STEADY_MERGE_DELETE_THREADS = 0 - - -def nonnegative_int(value: str) -> int: - parsed = int(value) - if parsed < 0: - raise argparse.ArgumentTypeError("value must be non-negative") - return parsed - - -def nonnegative_float(value: str) -> float: - parsed = float(value) - if parsed < 0.0: - raise argparse.ArgumentTypeError("value must be non-negative") - return parsed - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description=( - "Derive a concurrent benchmark manifest from an existing " - "materialized manifest without copying query, ground-truth, or id " - "streams." - ) - ) - parser.add_argument("--base-manifest", type=Path) - parser.add_argument("--output-manifest", type=Path) - parser.add_argument("--workload-id", default="") - parser.add_argument( - "--workload-mode", - choices=["final_full_overlap", "continuous_uniform", "decomposition", "smoke", "debug"], - default=None, - help="Defaults to the base mode for exact-count checkpoints, otherwise decomposition.", - ) - parser.add_argument("--target-query-count", type=nonnegative_int) - parser.add_argument("--target-insert-count", type=nonnegative_int) - parser.add_argument("--target-mark-delete-count", type=nonnegative_int) - parser.add_argument("--duration-seconds", type=nonnegative_float) - parser.add_argument("--query-rate-qps", type=nonnegative_float) - parser.add_argument("--insert-rate-ops", type=nonnegative_float) - parser.add_argument("--mark-delete-rate-ops", type=nonnegative_float) - for prefix in ("search", "insert", "mark-delete"): - parser.add_argument( - f"--{prefix}-arrival-mode", - choices=["fixed-rate", "saturating-backlog"], - ) - parser.add_argument(f"--{prefix}-low-watermark", type=nonnegative_int) - parser.add_argument(f"--{prefix}-high-watermark", type=nonnegative_int) - parser.add_argument(f"--{prefix}-poll-interval-us", type=nonnegative_int) - parser.add_argument("--search-threads", type=nonnegative_int) - parser.add_argument("--insert-threads", type=nonnegative_int) - parser.add_argument("--mark-delete-threads", type=nonnegative_int) - parser.add_argument("--merge-delete-threads", type=nonnegative_int) - parser.add_argument( - "--overflow-policy", - choices=["reject_new", "wait_for_capacity"], - ) - parser.add_argument( - "--keep-merge-delete", - action="store_true", - help=( - "Preserve base merge-delete schedules. By default decomposition, " - "smoke, and debug derivatives clear merge-delete schedules." - ), - ) - parser.add_argument("--self-test", action="store_true") - return parser.parse_args() - - -def require_args(args: argparse.Namespace) -> None: - missing = [] - if args.base_manifest is None: - missing.append("--base-manifest") - if args.output_manifest is None: - missing.append("--output-manifest") - if missing: - raise ValueError("missing required arguments: " + ", ".join(missing)) - if args.duration_seconds is not None and args.duration_seconds <= 0.0: - raise ValueError("--duration-seconds must be greater than zero") - if args.base_manifest.resolve() == args.output_manifest.resolve(): - raise ValueError("--output-manifest must be separate from --base-manifest") - - -def derived_rate(explicit: float | None, count: int, duration: float) -> float: - if explicit is not None: - return explicit - if count == 0: - return 0.0 - return count / duration - - -def maybe_set(window: dict, field: str, value: object | None) -> object: - if value is None: - return window[field] - window[field] = value - return value - - -def apply_arrival_override(window: dict, prefix: str, args: argparse.Namespace) -> None: - mode = getattr(args, f"{prefix}_arrival_mode") - low = getattr(args, f"{prefix}_low_watermark") - high = getattr(args, f"{prefix}_high_watermark") - poll = getattr(args, f"{prefix}_poll_interval_us") - if mode is None and low is None and high is None and poll is None: - return - field = f"{prefix}_arrival" - control = dict( - window.get( - field, - { - "mode": "fixed-rate", - "low_watermark": 0, - "high_watermark": 0, - "poll_interval_us": 100, - }, - ) - ) - if mode is not None: - control["mode"] = mode - if low is not None: - control["low_watermark"] = low - if high is not None: - control["high_watermark"] = high - if poll is not None: - if poll <= 0: - raise ValueError(f"--{prefix.replace('_', '-')}-poll-interval-us must be positive") - control["poll_interval_us"] = poll - window[field] = control - - -def should_clear_merge_delete(args: argparse.Namespace) -> bool: - return not args.keep_merge_delete and args.workload_mode not in ( - "final_full_overlap", "continuous_uniform" - ) - - -def should_apply_default_mixed_steady_threads( - args: argparse.Namespace, - clear_merge_delete: bool, - query_count: int, - insert_count: int, - mark_count: int, -) -> bool: - return ( - clear_merge_delete - and query_count > 0 - and insert_count > 0 - and mark_count > 0 - and args.search_threads is None - and args.insert_threads is None - and args.mark_delete_threads is None - and args.merge_delete_threads is None - ) - - -def derive_manifest(base: dict, args: argparse.Namespace) -> dict: - manifest = copy.deepcopy(base) - checkpoint_contract = manifest.get("checkpoint_contract") - if checkpoint_contract not in (None, "exact-update-counts.v1"): - raise ValueError(f"unsupported checkpoint contract: {checkpoint_contract!r}") - args = argparse.Namespace(**vars(args)) - args.workload_mode = args.workload_mode or ( - manifest["workload_mode"] if checkpoint_contract else "decomposition" - ) - if checkpoint_contract and ( - (args.workload_mode == "continuous_uniform") - != (manifest.get("window_lifecycle") == "continuous_logical_windows") - ): - raise ValueError("exact-count checkpoint derivatives must preserve the window lifecycle") - manifest["workload_mode"] = args.workload_mode - if args.workload_id: - manifest["workload_id"] = args.workload_id - - clear_merge_delete = should_clear_merge_delete(args) - for window in manifest.get("windows", []): - duration = float(maybe_set(window, "duration_seconds", args.duration_seconds)) - if duration <= 0.0: - raise ValueError("duration_seconds must be greater than zero") - - query_count = int(maybe_set(window, "target_query_count", args.target_query_count)) - insert_count = int(maybe_set(window, "target_insert_count", args.target_insert_count)) - mark_count = int(maybe_set(window, "target_mark_delete_count", args.target_mark_delete_count)) - if query_count < 0 or insert_count < 0 or mark_count < 0: - raise ValueError("target counts must be non-negative") - if checkpoint_contract: - bound = window.get("checkpoint_update_counts") - if not isinstance(bound, dict) or ( - bound.get("insert") != insert_count - or bound.get("mark_delete") != mark_count - ): - raise ValueError( - "exact-update-counts.v1 forbids changing update counts while " - "retaining checkpoint ground truth; generate a new workload" - ) - - window["query_rate_qps"] = derived_rate( - args.query_rate_qps, - query_count, - duration, - ) - window["insert_rate_ops"] = derived_rate( - args.insert_rate_ops, - insert_count, - duration, - ) - window["mark_delete_rate_ops"] = derived_rate( - args.mark_delete_rate_ops, - mark_count, - duration, - ) - apply_arrival_override(window, "search", args) - apply_arrival_override(window, "insert", args) - apply_arrival_override(window, "mark_delete", args) - if args.overflow_policy is not None: - window["overflow_policy"] = args.overflow_policy - - if should_apply_default_mixed_steady_threads( - args, - clear_merge_delete, - query_count, - insert_count, - mark_count, - ): - window["search_threads"] = DEFAULT_MIXED_STEADY_SEARCH_THREADS - window["insert_threads"] = DEFAULT_MIXED_STEADY_INSERT_THREADS - window["mark_delete_threads"] = DEFAULT_MIXED_STEADY_MARK_DELETE_THREADS - else: - maybe_set(window, "search_threads", args.search_threads) - maybe_set(window, "insert_threads", args.insert_threads) - maybe_set(window, "mark_delete_threads", args.mark_delete_threads) - maybe_set(window, "merge_delete_threads", args.merge_delete_threads) - - if clear_merge_delete: - window["merge_delete_mode"] = "disabled" - window["merge_delete_schedule"] = [] - if args.merge_delete_threads is None: - window["merge_delete_threads"] = DEFAULT_MIXED_STEADY_MERGE_DELETE_THREADS - - return manifest - - -def load_manifest(path: Path) -> dict: - with path.open("r", encoding="utf-8") as inp: - return json.load(inp) - - -def write_manifest(path: Path, manifest: dict) -> None: - path.parent.mkdir(parents=True, exist_ok=True) - path.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8") - - -def run_self_test() -> None: - base = { - "version": 1, - "workload_id": "base", - "workload_mode": "final_full_overlap", - "window_lifecycle": "one_active_window", - "windows": [ - { - "window_id": 1, - "query_path": "/remote/query.fbin", - "pre_update_checkpoint_groundtruth_path": "/remote/gt.bin", - "insert_ids_path": "/remote/insert.u32", - "mark_delete_ids_path": "/remote/delete.u32", - "target_query_count": 900000, - "target_insert_count": 50000, - "target_mark_delete_count": 50000, - "duration_seconds": 60.0, - "query_rate_qps": 15000.0, - "insert_rate_ops": 833.333333, - "mark_delete_rate_ops": 833.333333, - "search_arrival": { - "mode": "fixed-rate", - "low_watermark": 0, - "high_watermark": 0, - "poll_interval_us": 100, - }, - "insert_arrival": { - "mode": "fixed-rate", - "low_watermark": 0, - "high_watermark": 0, - "poll_interval_us": 100, - }, - "mark_delete_arrival": { - "mode": "fixed-rate", - "low_watermark": 0, - "high_watermark": 0, - "poll_interval_us": 100, - }, - "warmup_seconds": 0.0, - "stop_policy": "drain_after_duration", - "allocation_scope": "uniform_all_cns", - "search_threads": 5, - "insert_threads": 1, - "mark_delete_threads": 1, - "merge_delete_threads": 1, - "merge_delete_mode": "concurrent", - "merge_delete_trigger": { - "kind": "deleted_node_fraction", - "threshold": 0.05, - "semantics": "offline_generator_emits_deterministic_schedule", - }, - "merge_delete_schedule": [ - { - "task_class": "merge_delete_repair", - "start_after_seconds": 60.0, - "repeat_interval_seconds": 0, - "max_runs": 1, - } - ], - "max_queue_depth": { - "search": 10000, - "insert": 5000, - "mark_delete": 5000, - "merge_delete_repair": 1000, - "merge_delete_gc": 1000, - }, - "max_inflight": { - "search": 10000, - "insert": 5000, - "mark_delete": 5000, - "merge_delete_repair": 1000, - "merge_delete_gc": 1000, - }, - "overflow_policy": "reject_new", - "source": { - "kind": "converted_batch", - "batch_workload_root": "/remote/source", - "batch_index": 1, - "batch_json_path": "/remote/source/batches/batch_0001.json", - "query_path": "/remote/source/queries/q.fbin", - "pre_update_checkpoint_groundtruth_path": "/remote/source/groundtruth/g.bin", - "insert_count": 100000, - "delete_count": 100000, - "active_begin": 0, - "active_end_exclusive": 8000000, - "active_count": 8000000, - }, - } - ], - } - - with tempfile.TemporaryDirectory(prefix="vectordb_derive_manifest_") as tmp: - root = Path(tmp) - base_path = root / "base.json" - out_path = root / "search_only.json" - write_manifest(base_path, base) - args = argparse.Namespace( - base_manifest=base_path, - output_manifest=out_path, - workload_id="search-only", - workload_mode="decomposition", - target_query_count=100, - target_insert_count=0, - target_mark_delete_count=0, - duration_seconds=10.0, - query_rate_qps=None, - insert_rate_ops=None, - mark_delete_rate_ops=None, - search_arrival_mode=None, - search_low_watermark=None, - search_high_watermark=None, - search_poll_interval_us=None, - insert_arrival_mode=None, - insert_low_watermark=None, - insert_high_watermark=None, - insert_poll_interval_us=None, - mark_delete_arrival_mode=None, - mark_delete_low_watermark=None, - mark_delete_high_watermark=None, - mark_delete_poll_interval_us=None, - search_threads=3, - insert_threads=0, - mark_delete_threads=0, - merge_delete_threads=None, - overflow_policy=None, - keep_merge_delete=False, - self_test=False, - ) - same_path_args = argparse.Namespace(**vars(args)) - same_path_args.output_manifest = base_path - try: - require_args(same_path_args) - except ValueError as exc: - if "separate from --base-manifest" not in str(exc): - raise - else: - raise AssertionError("derive should reject in-place manifest output") - - derived = derive_manifest(load_manifest(base_path), args) - write_manifest(out_path, derived) - reread = load_manifest(out_path) - window = reread["windows"][0] - if reread["workload_id"] != "search-only": - raise AssertionError("workload id was not updated") - if window["target_query_count"] != 100 or window["query_rate_qps"] != 10.0: - raise AssertionError("query count/rate derivation failed") - if window["target_insert_count"] != 0 or window["insert_rate_ops"] != 0.0: - raise AssertionError("insert stream was not disabled") - if window["target_mark_delete_count"] != 0 or window["mark_delete_rate_ops"] != 0.0: - raise AssertionError("mark-delete stream was not disabled") - if ( - window["search_threads"] != 3 - or window["insert_threads"] != 0 - or window["mark_delete_threads"] != 0 - or window["merge_delete_threads"] != 0 - ): - raise AssertionError("thread override failed") - if window["merge_delete_mode"] != "disabled" or window["merge_delete_schedule"]: - raise AssertionError("decomposition should clear merge-delete by default") - if window["query_path"] != "/remote/query.fbin": - raise AssertionError("derived manifest should reuse materialized paths") - if window["source"]["insert_count"] != 100000: - raise AssertionError("source metadata should preserve original batch counts") - if window["search_arrival"]["mode"] != "fixed-rate": - raise AssertionError("derive should preserve arrival controls by default") - - mixed_path = root / "mixed_default.json" - mixed_args = argparse.Namespace(**vars(args)) - mixed_args.output_manifest = mixed_path - mixed_args.workload_id = "mixed-default" - mixed_args.target_query_count = None - mixed_args.target_insert_count = None - mixed_args.target_mark_delete_count = None - mixed_args.search_threads = None - mixed_args.insert_threads = None - mixed_args.mark_delete_threads = None - mixed_args.merge_delete_threads = None - mixed = derive_manifest(load_manifest(base_path), mixed_args) - mixed_window = mixed["windows"][0] - if ( - mixed_window["search_threads"] != DEFAULT_MIXED_STEADY_SEARCH_THREADS - or mixed_window["insert_threads"] != DEFAULT_MIXED_STEADY_INSERT_THREADS - or mixed_window["mark_delete_threads"] - != DEFAULT_MIXED_STEADY_MARK_DELETE_THREADS - or mixed_window["merge_delete_threads"] - != DEFAULT_MIXED_STEADY_MERGE_DELETE_THREADS - ): - raise AssertionError("mixed decomposition should default to 26/4/1/0") - - keep_args = argparse.Namespace(**vars(args)) - keep_args.workload_mode = "final_full_overlap" - keep_args.keep_merge_delete = True - keep_args.merge_delete_threads = 1 - kept = derive_manifest(load_manifest(base_path), keep_args) - kept_window = kept["windows"][0] - if kept_window["merge_delete_mode"] != "concurrent" or not kept_window["merge_delete_schedule"]: - raise AssertionError("keep-merge-delete should preserve schedules") - - arrival_args = argparse.Namespace(**vars(args)) - arrival_args.insert_arrival_mode = "saturating-backlog" - arrival_args.insert_low_watermark = 100 - arrival_args.insert_high_watermark = 500 - arrival_args.insert_poll_interval_us = 25 - arrival = derive_manifest(load_manifest(base_path), arrival_args) - insert_arrival = arrival["windows"][0]["insert_arrival"] - if insert_arrival["mode"] != "saturating-backlog": - raise AssertionError("arrival mode override failed") - if insert_arrival["low_watermark"] != 100 or insert_arrival["high_watermark"] != 500: - raise AssertionError("arrival watermark override failed") - wait_args = argparse.Namespace(**vars(args)) - wait_args.overflow_policy = "wait_for_capacity" - wait = derive_manifest(load_manifest(base_path), wait_args) - if wait["windows"][0]["overflow_policy"] != "wait_for_capacity": - raise AssertionError("overflow policy override failed") - - exact_base = copy.deepcopy(base) - exact_base["checkpoint_contract"] = "exact-update-counts.v1" - exact_base["workload_mode"] = "continuous_uniform" - exact_base["window_lifecycle"] = "continuous_logical_windows" - exact_base["windows"][0]["checkpoint_update_counts"] = { - "insert": 50000, - "mark_delete": 50000, - } - exact_args = argparse.Namespace( - **{ - **vars(mixed_args), - "workload_mode": None, - "duration_seconds": 30.0, - } - ) - exact = derive_manifest(exact_base, exact_args) - if exact["workload_mode"] != "continuous_uniform": - raise AssertionError("exact checkpoint default should preserve the runtime mode") - if exact["windows"][0]["merge_delete_mode"] != "concurrent": - raise AssertionError("continuous derivatives must preserve the merge trigger") - if exact["windows"][0]["checkpoint_update_counts"] != ( - exact_base["windows"][0]["checkpoint_update_counts"] - ): - raise AssertionError("exact checkpoint binding was not preserved") - if exact["windows"][0]["duration_seconds"] != 30.0: - raise AssertionError("exact checkpoint should allow duration changes") - for field in ("target_insert_count", "target_mark_delete_count"): - changed_args = argparse.Namespace(**{**vars(exact_args), field: 0}) - try: - derive_manifest(exact_base, changed_args) - except ValueError as exc: - if "forbids changing update counts" not in str(exc): - raise - else: - raise AssertionError(f"exact checkpoint accepted changed {field}") - missing_binding = copy.deepcopy(exact_base) - del missing_binding["windows"][0]["checkpoint_update_counts"] - try: - derive_manifest(missing_binding, exact_args) - except ValueError as exc: - if "forbids changing update counts" not in str(exc): - raise - else: - raise AssertionError("exact checkpoint accepted a missing count binding") - changed_mode_args = argparse.Namespace( - **{**vars(exact_args), "workload_mode": "decomposition"} - ) - try: - derive_manifest(exact_base, changed_mode_args) - except ValueError as exc: - if "preserve the window lifecycle" not in str(exc): - raise - else: - raise AssertionError("exact checkpoint accepted an incompatible lifecycle") - legacy_default = derive_manifest(base, exact_args) - if legacy_default["workload_mode"] != "decomposition": - raise AssertionError("legacy default must remain decomposition") - - print("self-test: OK") - - -def main() -> int: - args = parse_args() - if args.self_test: - run_self_test() - return 0 - require_args(args) - manifest = derive_manifest(load_manifest(args.base_manifest), args) - write_manifest(args.output_manifest, manifest) - print(args.output_manifest) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/spatial-workloads/v1/tools/cxl/materialize_concurrent_batch_update.py b/spatial-workloads/v1/tools/cxl/materialize_concurrent_batch_update.py deleted file mode 100644 index f29a217b7544e2d160bd5eae35cdec85b9f9112c..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/cxl/materialize_concurrent_batch_update.py +++ /dev/null @@ -1,1392 +0,0 @@ -#!/usr/bin/env python3 - -from __future__ import annotations - -import argparse -import json -import struct -import sys -import tempfile -from array import array -from pathlib import Path - - -UINT32_SPACE = 1 << 32 -DEFAULT_UNIFORM_DATA_WORKERS = 7 -DEFAULT_UNIFORM_MERGE_WORKERS = 2 -DEFAULT_UNIFORM_QUERY_RATIO = 18 -DEFAULT_UNIFORM_INSERT_RATIO = 1 -DEFAULT_UNIFORM_MARK_DELETE_RATIO = 1 -DEFAULT_UNIFORM_RATIO_WINDOW_MULTIPLIER = 20 - - -def positive_int(value: str) -> int: - parsed = int(value) - if parsed <= 0: - raise argparse.ArgumentTypeError("value must be positive") - return parsed - - -def positive_float(value: str) -> float: - parsed = float(value) - if parsed <= 0.0: - raise argparse.ArgumentTypeError("value must be positive") - return parsed - - -def nonnegative_float(value: str) -> float: - parsed = float(value) - if parsed < 0.0: - raise argparse.ArgumentTypeError("value must be non-negative") - return parsed - - -def fraction(value: str) -> float: - parsed = float(value) - if not 0.0 < parsed <= 1.0: - raise argparse.ArgumentTypeError("value must be in (0, 1]") - return parsed - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser( - description=( - "Materialize compact batch-update-eval descriptors as paired " - "concurrent ID/vector-ref streams without copying vectors." - ), - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - ) - parser.add_argument("--batch-workload-root", type=Path) - parser.add_argument( - "--insert-vector-source-root", - type=Path, - help="Existing shared base_permuted vector directory; defaults to the workload root.", - ) - parser.add_argument( - "--runtime-insert-vector-source-root", - type=Path, - help=( - "Cluster directory for shared vectors; defaults to an explicit local " - "source root, otherwise the runtime workload root." - ), - ) - parser.add_argument("--trace-id", default="mixed-replace-100") - parser.add_argument("--output-dir", type=Path) - parser.add_argument( - "--query-path", - type=Path, - help="Existing query matrix referenced by every generated window.", - ) - parser.add_argument( - "--initial-groundtruth-path", - type=Path, - help=( - "Override the first pre-update checkpoint ground truth. Required " - "when the selected initial-state object has no local path." - ), - ) - parser.add_argument( - "--runtime-output-dir", - type=Path, - help="Cluster path for generated files; defaults to --output-dir.", - ) - parser.add_argument( - "--runtime-batch-workload-root", - type=Path, - help="Cluster path for the canonical package; defaults to its local path.", - ) - parser.add_argument( - "--runtime-query-path", - type=Path, - help="Cluster path for --query-path; defaults to its local path.", - ) - parser.add_argument( - "--runtime-initial-groundtruth-path", - type=Path, - help="Cluster path for an explicit initial ground-truth override.", - ) - parser.add_argument("--start-batch-index", type=positive_int, default=1) - parser.add_argument("--window-count", type=positive_int, default=1) - parser.add_argument( - "--target-query-count", - type=positive_int, - help=( - "Defaults to the row count in --query-path, or the configured " - "uniform ratio with --uniform-e6." - ), - ) - parser.add_argument( - "--target-insert-count", - type=positive_int, - help="Defaults to each source batch's full insert count.", - ) - parser.add_argument( - "--target-mark-delete-count", - type=positive_int, - help="Defaults to each source batch's full delete count.", - ) - parser.add_argument("--duration-seconds", type=positive_float, default=60.0) - parser.add_argument("--warmup-seconds", type=nonnegative_float, default=0.0) - parser.add_argument( - "--query-rate-qps", - type=nonnegative_float, - default=0.0, - help="Zero derives target_query_count / duration_seconds.", - ) - parser.add_argument( - "--insert-rate-ops", - type=nonnegative_float, - default=0.0, - help="Zero derives target_insert_count / duration_seconds.", - ) - parser.add_argument( - "--mark-delete-rate-ops", - type=nonnegative_float, - default=0.0, - help="Zero derives target_mark_delete_count / duration_seconds.", - ) - parser.add_argument("--search-threads", type=positive_int) - parser.add_argument("--insert-threads", type=positive_int) - parser.add_argument("--mark-delete-threads", type=positive_int) - parser.add_argument( - "--merge-delete-threads", - type=positive_int, - help="Legacy manifest hint; incompatible with --uniform-e6.", - ) - parser.add_argument("--search-max-queue-depth", type=positive_int, default=10000) - parser.add_argument("--insert-max-queue-depth", type=positive_int, default=5000) - parser.add_argument( - "--mark-delete-max-queue-depth", type=positive_int, default=5000 - ) - parser.add_argument( - "--merge-delete-max-queue-depth", type=positive_int, default=1000 - ) - parser.add_argument("--search-max-inflight", type=positive_int, default=10000) - parser.add_argument("--insert-max-inflight", type=positive_int, default=5000) - parser.add_argument( - "--mark-delete-max-inflight", type=positive_int, default=5000 - ) - parser.add_argument("--merge-delete-max-inflight", type=positive_int, default=1000) - parser.add_argument( - "--overflow-policy", - choices=("reject_new", "wait_for_capacity"), - default="wait_for_capacity", - ) - parser.add_argument("--workload-id", default="batch-update-concurrent") - parser.add_argument( - "--uniform-e6", - action="store_true", - help=( - "Emit one continuous cyclic ratio-controlled E6 workload. Source " - "windows remain logical input/progress segments only: they do not " - "drain or synchronize the runtime. MergeDelete epochs are sealed " - "at successful all-CN MarkDelete ACK thresholds." - ), - ) - parser.add_argument( - "--uniform-skip-final-merge-delete", - action="store_true", - help=( - "With --uniform-e6, keep the final source segment's foreground mix " - "active but disable its MergeDelete trigger. Tombstones accumulated " - "since the preceding frozen epoch remain unmerged; that group may " - "span multiple source segments." - ), - ) - parser.add_argument( - "--uniform-data-workers", - type=positive_int, - default=DEFAULT_UNIFORM_DATA_WORKERS, - ) - parser.add_argument( - "--uniform-merge-workers", - type=positive_int, - default=DEFAULT_UNIFORM_MERGE_WORKERS, - ) - parser.add_argument( - "--uniform-query-ratio", - type=positive_int, - default=DEFAULT_UNIFORM_QUERY_RATIO, - ) - parser.add_argument( - "--uniform-insert-ratio", - type=positive_int, - default=DEFAULT_UNIFORM_INSERT_RATIO, - ) - parser.add_argument( - "--uniform-mark-delete-ratio", - type=positive_int, - default=DEFAULT_UNIFORM_MARK_DELETE_RATIO, - ) - parser.add_argument( - "--uniform-ratio-window-multiplier", - type=positive_int, - default=DEFAULT_UNIFORM_RATIO_WINDOW_MULTIPLIER, - help=( - "Per-CN admission-window multiplier W; each full local window " - "admits QW/IW/DW tickets." - ), - ) - parser.add_argument( - "--acknowledged-tombstone-fraction", - type=fraction, - default=0.05, - help="Active-set fraction of successful all-CN ACKs per repair epoch.", - ) - parser.add_argument( - "--workload-mode", - choices=("decomposition", "smoke", "debug"), - default="decomposition", - help=( - "Used for legacy materialization. --uniform-e6 emits " - "continuous_uniform." - ), - ) - parser.add_argument( - "--source-snapshot", - default="", - help="Optional dataset snapshot/commit recorded in metadata.json.", - ) - parser.add_argument("--self-test", action="store_true") - return parser.parse_args() - - -def require_path(value: Path | None, flag: str) -> Path: - if value is None: - raise ValueError(f"{flag} is required") - return value - - -def checked_child(raw: str, base: Path, root: Path, name: str) -> Path: - if not raw: - raise ValueError(f"{name} path must not be empty") - relative = Path(raw) - if relative.is_absolute(): - raise ValueError(f"{name} path must be relative: {relative}") - try: - resolved = (base / relative).resolve(strict=True) - except FileNotFoundError as exc: - raise FileNotFoundError(f"missing {name}: {base / relative}") from exc - try: - resolved.relative_to(root) - except ValueError as exc: - raise ValueError(f"{name} escapes workload package: {relative}") from exc - return resolved - - -def runtime_path(local_path: Path, local_root: Path, runtime_root: Path) -> Path: - return runtime_root / local_path.relative_to(local_root) - - -def load_json(path: Path) -> dict: - try: - loaded = json.loads(path.read_text(encoding="utf-8")) - except FileNotFoundError as exc: - raise FileNotFoundError(f"missing JSON file: {path}") from exc - if not isinstance(loaded, dict): - raise ValueError(f"expected JSON object: {path}") - return loaded - - -def matrix_rows(path: Path, name: str) -> int: - with path.open("rb") as inp: - header = inp.read(8) - if len(header) != 8: - raise ValueError(f"missing {name} matrix header: {path}") - rows, columns = struct.unpack(" array: - if sys.byteorder != "little": - raise RuntimeError("u32 descriptors require a little-endian host") - with path.open("rb") as inp: - inp.seek(offset * 4) - raw = inp.read(count * 4) - if len(raw) != count * 4: - raise ValueError(f"truncated u32 sequence file: {path}") - values = array("I") - values.frombytes(raw) - return values - - -def decode_sequence(descriptor: object, batch_path: Path, package_root: Path) -> array: - if not isinstance(descriptor, dict): - raise ValueError(f"expected sequence descriptor in {batch_path}") - encoding = descriptor.get("encoding") - count = int(descriptor.get("count", -1)) - if count < 0: - raise ValueError(f"invalid sequence count in {batch_path}") - if encoding == "range": - begin = int(descriptor.get("begin", -1)) - if begin < 0 or begin > UINT32_SPACE or count > UINT32_SPACE - begin: - raise ValueError(f"range sequence exceeds uint32 space in {batch_path}") - return array("I", range(begin, begin + count)) - if encoding not in ("u32_slice", "u32_cyclic_slice"): - raise ValueError(f"unsupported sequence encoding {encoding!r} in {batch_path}") - - sequence_path = checked_child( - str(descriptor.get("path", "")), - batch_path.parent, - package_root, - "sequence descriptor", - ) - file_bytes = sequence_path.stat().st_size - if file_bytes % 4: - raise ValueError(f"unaligned u32 sequence file: {sequence_path}") - file_items = file_bytes // 4 - offset = int(descriptor.get("offset_items", -1)) - if offset < 0: - raise ValueError(f"invalid sequence offset in {batch_path}") - if encoding == "u32_slice": - if offset > file_items or count > file_items - offset: - raise ValueError(f"u32_slice exceeds sequence file: {sequence_path}") - return read_u32(sequence_path, offset, count) - - wrap = int(descriptor.get("wrap_at_items", 0)) - if wrap <= 0 or wrap > file_items: - raise ValueError(f"invalid cyclic wrap in {batch_path}") - values = array("I") - cursor = offset % wrap - remaining = count - while remaining: - chunk_count = min(remaining, wrap - cursor) - values.extend(read_u32(sequence_path, cursor, chunk_count)) - remaining -= chunk_count - cursor = 0 - return values - - -def validate_unique(values: array, name: str) -> None: - if len(set(values)) != len(values): - raise ValueError(f"duplicate values in {name}") - - -def resolve_batch( - batch_path: Path, package_root: Path, trace_id: str, vector_count: int -) -> tuple[array, array, array, dict]: - batch = load_json(batch_path) - if batch.get("schema") != "batch-update-eval-batch.v1": - raise ValueError(f"unsupported batch schema: {batch_path}") - if batch.get("trace_id") != trace_id: - raise ValueError(f"batch trace ID mismatch: {batch_path}") - expected_index = int(batch_path.stem.removeprefix("batch_")) - if int(batch.get("batch_index", -1)) != expected_index: - raise ValueError(f"batch index mismatch: {batch_path}") - - insert_ids = None - insert_refs = None - delete_ids = None - operations = batch.get("operations") - if not isinstance(operations, list): - raise ValueError(f"missing batch operations: {batch_path}") - for operation in operations: - if not isinstance(operation, dict): - raise ValueError(f"invalid batch operation: {batch_path}") - operation_type = operation.get("type") - ids = decode_sequence(operation.get("external_ids"), batch_path, package_root) - if len(ids) != int(operation.get("count", -1)): - raise ValueError(f"operation count mismatch: {batch_path}") - validate_unique(ids, f"{operation_type}.external_ids") - if operation_type == "insert": - if insert_ids is not None: - raise ValueError(f"multiple insert operations: {batch_path}") - refs = decode_sequence(operation.get("vector_refs"), batch_path, package_root) - if len(refs) != len(ids): - raise ValueError(f"insert ID/vector-ref count mismatch: {batch_path}") - validate_unique(refs, "insert.vector_refs") - if any(ref >= vector_count for ref in refs): - raise ValueError(f"insert vector ref exceeds source count: {batch_path}") - insert_ids, insert_refs = ids, refs - elif operation_type == "delete": - if delete_ids is not None: - raise ValueError(f"multiple delete operations: {batch_path}") - delete_ids = ids - else: - raise ValueError(f"unsupported operation type {operation_type!r}: {batch_path}") - if insert_ids is None or insert_refs is None or delete_ids is None: - raise ValueError(f"concurrent materialization requires insert and delete: {batch_path}") - return insert_ids, insert_refs, delete_ids, batch - - -def write_u32(path: Path, values: array) -> None: - if sys.byteorder != "little": - raise RuntimeError("u32 streams require a little-endian host") - with path.open("xb") as out: - values.tofile(out) - - -def write_json(path: Path, value: dict) -> None: - with path.open("x", encoding="utf-8") as out: - json.dump(value, out, indent=2) - out.write("\n") - - -def resolve_package(args: argparse.Namespace) -> tuple[Path, dict, Path, dict]: - root = require_path(args.batch_workload_root, "--batch-workload-root").resolve( - strict=True - ) - workload = load_json(root / "workload.json") - if workload.get("schema") != "batch-update-eval-workload.v1": - raise ValueError(f"unsupported workload schema: {root / 'workload.json'}") - trace_entry = next( - ( - item - for item in workload.get("traces", []) - if isinstance(item, dict) and item.get("id") == args.trace_id - ), - None, - ) - if trace_entry is None: - raise ValueError(f"unknown trace {args.trace_id!r}") - batch_dir = checked_child( - str(trace_entry.get("batches", "")), root, root, "trace batch directory" - ) - trace = load_json(batch_dir.parent / "trace.json") - if trace.get("schema") != "batch-update-eval-trace.v1": - raise ValueError(f"unsupported trace schema: {batch_dir.parent / 'trace.json'}") - if trace.get("trace_id") != args.trace_id: - raise ValueError(f"trace ID mismatch: {batch_dir.parent / 'trace.json'}") - last_batch = args.start_batch_index + args.window_count - 1 - if last_batch > int(trace.get("batch_count", 0)): - raise ValueError("requested windows exceed trace batch_count") - return root, workload, batch_dir, trace - - -def pre_update_groundtruth( - *, - args: argparse.Namespace, - root: Path, - runtime_root: Path, - initial_state: dict, - batch_dir: Path, - batch_index: int, -) -> tuple[Path, Path, int]: - if batch_index == 1: - if args.initial_groundtruth_path is not None: - local = args.initial_groundtruth_path.resolve(strict=True) - runtime = ( - args.runtime_initial_groundtruth_path - or args.initial_groundtruth_path.resolve() - ) - else: - raw_groundtruth = initial_state.get("groundtruth") - if not raw_groundtruth: - raise ValueError( - "trace needs --initial-groundtruth-path because its initial " - "state has no local groundtruth path" - ) - local = checked_child( - str(raw_groundtruth), root, root, "initial ground truth" - ) - runtime = runtime_path(local, root, runtime_root) - live_count = int(initial_state.get("live_count", 0)) - else: - previous_path = batch_dir / f"batch_{batch_index - 1:04d}.json" - previous = load_json(previous_path) - checkpoint = previous.get("checkpoint") - if not isinstance(checkpoint, dict): - raise ValueError(f"missing checkpoint: {previous_path}") - local = checked_child( - str(checkpoint.get("groundtruth", checkpoint.get("groundtruth_path", ""))), - batch_dir.parent, - root, - "checkpoint ground truth", - ) - runtime = runtime_path(local, root, runtime_root) - live_count = int(checkpoint.get("live_count", checkpoint.get("active_count", 0))) - if live_count <= 0 or live_count >= UINT32_SPACE: - raise ValueError(f"invalid pre-update live count for batch {batch_index}") - return local, Path(runtime), live_count - - -def materialize(args: argparse.Namespace) -> Path: - if args.uniform_skip_final_merge_delete and not args.uniform_e6: - raise ValueError( - "--uniform-skip-final-merge-delete requires --uniform-e6" - ) - if args.uniform_e6: - if any( - value is not None - for value in ( - args.search_threads, - args.insert_threads, - args.mark_delete_threads, - args.merge_delete_threads, - ) - ): - raise ValueError( - "--uniform-e6 cannot be combined with legacy per-class thread hints" - ) - if args.uniform_merge_workers > args.uniform_data_workers: - raise ValueError( - "--uniform-merge-workers must not exceed --uniform-data-workers" - ) - if args.overflow_policy != "wait_for_capacity": - raise ValueError( - "--uniform-e6 requires --overflow-policy=wait_for_capacity" - ) - root, workload, batch_dir, trace = resolve_package(args) - checkpoint_contract = workload.get("checkpoint_contract") - if checkpoint_contract not in (None, "exact-update-counts.v1"): - raise ValueError(f"unsupported checkpoint contract: {checkpoint_contract!r}") - if checkpoint_contract and args.start_batch_index != 1: - raise ValueError( - "exact-update-counts.v1 requires --start-batch-index=1; " - "later batches need a separately generated initial-state package" - ) - output = require_path(args.output_dir, "--output-dir").resolve() - try: - output.relative_to(root) - except ValueError: - pass - else: - raise ValueError("--output-dir must not be inside --batch-workload-root") - output.mkdir(parents=True, exist_ok=True) - if any(output.iterdir()): - raise ValueError(f"--output-dir must be empty: {output}") - - query = require_path(args.query_path, "--query-path").resolve(strict=True) - runtime_output = (args.runtime_output_dir or output).resolve() - runtime_root = (args.runtime_batch_workload_root or root).resolve() - runtime_query = Path(args.runtime_query_path or query) - query_rows = matrix_rows(query, "query") - - vector_source = workload.get("insert_vector_source") - if not isinstance(vector_source, dict): - raise ValueError("workload is missing insert_vector_source") - vector_count = int(vector_source.get("row_count", workload.get("base_count", 0))) - explicit_vector_root = getattr(args, "insert_vector_source_root", None) - explicit_runtime_vector_root = getattr(args, "runtime_insert_vector_source_root", None) - local_vector_root = ( - Path(explicit_vector_root).resolve(strict=True) if explicit_vector_root else root - ) - runtime_vector_root = Path(explicit_runtime_vector_root or runtime_root).resolve() - if explicit_vector_root and not explicit_runtime_vector_root: - runtime_vector_root = local_vector_root - if explicit_vector_root or explicit_runtime_vector_root: - if vector_source.get("path") not in ( - "base_permuted.fbin", "base_permuted.u8bin", "base_permuted.i8bin" - ): - raise ValueError( - "shared insert vector source must use the runtime filename " - "base_permuted.fbin, base_permuted.u8bin, or base_permuted.i8bin" - ) - local_vector_path = checked_child( - str(vector_source.get("path", "")), - local_vector_root, - local_vector_root, - "insert vector source", - ) - runtime_vector_path = runtime_path(local_vector_path, local_vector_root, runtime_vector_root) - initial_state_id = trace.get("initial_state") - initial_state = workload.get("initial", {}) - if initial_state_id: - initial_state = next( - ( - value - for value in workload.values() - if isinstance(value, dict) - and value.get("state_id") == initial_state_id - ), - {}, - ) - if not isinstance(initial_state, dict) or not initial_state: - raise ValueError(f"missing initial-state metadata for trace {args.trace_id!r}") - - windows = [] - generated = [] - for window_offset in range(args.window_count): - batch_index = args.start_batch_index + window_offset - batch_path = batch_dir / f"batch_{batch_index:04d}.json" - insert_ids, insert_refs, delete_ids, batch = resolve_batch( - batch_path, root, args.trace_id, vector_count - ) - source_insert_count = len(insert_ids) - source_delete_count = len(delete_ids) - if checkpoint_contract and ( - args.target_insert_count not in (None, source_insert_count) - or args.target_mark_delete_count not in (None, source_delete_count) - ): - raise ValueError( - "exact-update-counts.v1 forbids changing update counts while " - "retaining checkpoint ground truth; generate a new workload" - ) - insert_count = args.target_insert_count or len(insert_ids) - delete_count = args.target_mark_delete_count or len(delete_ids) - if insert_count > len(insert_ids) or delete_count > len(delete_ids): - raise ValueError(f"target operation count exceeds source batch {batch_index}") - insert_ids = insert_ids[:insert_count] - insert_refs = insert_refs[:insert_count] - delete_ids = delete_ids[:delete_count] - ratio_units = 0 - if args.uniform_e6: - if ( - insert_count == 0 - or insert_count % args.uniform_insert_ratio != 0 - or delete_count % args.uniform_mark_delete_ratio != 0 - or insert_count // args.uniform_insert_ratio - != delete_count // args.uniform_mark_delete_ratio - ): - raise ValueError( - "--uniform-e6 update counts must match the configured " - "insert:mark-delete ratio" - ) - ratio_units = insert_count // args.uniform_insert_ratio - e6_target_queries = args.uniform_query_ratio * ratio_units - if ( - args.uniform_e6 - and args.target_query_count is not None - and args.target_query_count != e6_target_queries - ): - raise ValueError( - "--uniform-e6 target_query_count does not match the configured ratio" - ) - target_queries = ( - e6_target_queries - if args.uniform_e6 - else (args.target_query_count or query_rows) - ) - if not args.uniform_e6 and target_queries > query_rows: - raise ValueError( - "--target-query-count exceeds --query-path rows; use " - "--uniform-e6 for cyclic canonical queries" - ) - - window_id = window_offset + 1 - insert_name = f"window_{window_id:04d}_insert_external_ids.u32" - refs_name = f"window_{window_id:04d}_insert_vector_refs.u32" - delete_name = f"window_{window_id:04d}_mark_delete_external_ids.u32" - write_u32(output / insert_name, insert_ids) - write_u32(output / refs_name, insert_refs) - write_u32(output / delete_name, delete_ids) - - local_gt, runtime_gt, live_count = pre_update_groundtruth( - args=args, - root=root, - runtime_root=runtime_root, - initial_state=initial_state, - batch_dir=batch_dir, - batch_index=batch_index, - ) - post_update_runtime_gt = None - checkpoint = batch.get("checkpoint") - if isinstance(checkpoint, dict): - checkpoint_path = checkpoint.get( - "groundtruth", checkpoint.get("groundtruth_path", "") - ) - if checkpoint_path: - post_update_local_gt = checked_child( - str(checkpoint_path), - batch_dir.parent, - root, - "post-update checkpoint ground truth", - ) - post_update_runtime_gt = runtime_path( - post_update_local_gt, root, runtime_root - ) - if ( - args.uniform_e6 - and matrix_rows(post_update_local_gt, "ground-truth") - != query_rows - ): - raise ValueError( - "--uniform-e6 requires query and post-update checkpoint " - "ground-truth row counts to match" - ) - if args.uniform_e6 and post_update_runtime_gt is None: - raise ValueError( - "--uniform-e6 requires post-update checkpoint ground truth" - ) - if not args.uniform_e6 and target_queries > matrix_rows( - local_gt, "ground-truth" - ): - raise ValueError( - f"target query count exceeds pre-update ground-truth rows: {local_gt}" - ) - if args.uniform_e6 and matrix_rows(local_gt, "ground-truth") != query_rows: - raise ValueError( - "--uniform-e6 requires query and checkpoint ground-truth row " - f"counts to match: query={query_rows} groundtruth={local_gt}" - ) - query_rate = args.query_rate_qps or target_queries / args.duration_seconds - insert_rate = args.insert_rate_ops or insert_count / args.duration_seconds - delete_rate = ( - args.mark_delete_rate_ops or delete_count / args.duration_seconds - ) - legacy_thread_hints = { - "search": args.search_threads or 26, - "insert": args.insert_threads or 4, - "mark_delete": args.mark_delete_threads or 1, - "merge_delete": args.merge_delete_threads or 0, - } - skip_merge_delete = ( - args.uniform_e6 - and args.uniform_skip_final_merge_delete - and window_offset + 1 == args.window_count - ) - merge_delete_mode = "disabled" - merge_delete_schedule: list[dict] = [] - merge_delete_trigger = None - if args.uniform_e6: - legacy_thread_hints = { - "search": 1, - "insert": 1, - "mark_delete": 1, - "merge_delete": 1, - } - if not skip_merge_delete: - merge_delete_mode = "concurrent" - merge_delete_trigger = { - "kind": "acknowledged_tombstone_fraction", - "threshold": args.acknowledged_tombstone_fraction, - "semantics": ( - "successful_all_cn_acks_since_previous_frozen_epoch" - ), - "reference_node_count": vector_count, - } - - windows.append( - { - "window_id": window_id, - "query_path": str(runtime_query), - "pre_update_checkpoint_groundtruth_path": str(runtime_gt), - "insert_ids_path": str(runtime_output / insert_name), - "insert_vector_refs_path": str(runtime_output / refs_name), - "mark_delete_ids_path": str(runtime_output / delete_name), - "target_query_count": target_queries, - "target_insert_count": insert_count, - "target_mark_delete_count": delete_count, - "duration_seconds": args.duration_seconds, - "query_rate_qps": query_rate, - "insert_rate_ops": insert_rate, - "mark_delete_rate_ops": delete_rate, - "search_arrival": { - "mode": "fixed-rate", - "low_watermark": 0, - "high_watermark": 0, - "poll_interval_us": 100, - }, - "insert_arrival": { - "mode": "fixed-rate", - "low_watermark": 0, - "high_watermark": 0, - "poll_interval_us": 100, - }, - "mark_delete_arrival": { - "mode": "fixed-rate", - "low_watermark": 0, - "high_watermark": 0, - "poll_interval_us": 100, - }, - "warmup_seconds": args.warmup_seconds, - "stop_policy": "drain_after_duration", - "allocation_scope": "uniform_all_cns", - "search_threads": legacy_thread_hints["search"], - "insert_threads": legacy_thread_hints["insert"], - "mark_delete_threads": legacy_thread_hints["mark_delete"], - "merge_delete_threads": legacy_thread_hints["merge_delete"], - "merge_delete_mode": merge_delete_mode, - "merge_delete_schedule": merge_delete_schedule, - "max_queue_depth": { - "search": args.search_max_queue_depth, - "insert": args.insert_max_queue_depth, - "mark_delete": args.mark_delete_max_queue_depth, - "merge_delete_repair": ( - args.merge_delete_max_queue_depth if args.uniform_e6 else 1 - ), - "merge_delete_gc": ( - args.merge_delete_max_queue_depth if args.uniform_e6 else 1 - ), - }, - "max_inflight": { - "search": args.search_max_inflight, - "insert": args.insert_max_inflight, - "mark_delete": args.mark_delete_max_inflight, - "merge_delete_repair": ( - args.merge_delete_max_inflight if args.uniform_e6 else 1 - ), - "merge_delete_gc": ( - args.merge_delete_max_inflight if args.uniform_e6 else 1 - ), - }, - "overflow_policy": args.overflow_policy, - "source": { - "kind": "converted_batch", - "batch_workload_root": str(runtime_vector_root), - "batch_index": batch_index, - "batch_json_path": str( - runtime_path(batch_path, root, runtime_root) - ), - "query_path": str(runtime_query), - "pre_update_checkpoint_groundtruth_path": str(runtime_gt), - "insert_count": source_insert_count, - "delete_count": source_delete_count, - "active_begin": 0, - "active_end_exclusive": live_count, - "active_count": live_count, - }, - } - ) - if checkpoint_contract: - windows[-1]["checkpoint_update_counts"] = { - "insert": source_insert_count, - "mark_delete": source_delete_count, - } - if args.uniform_e6: - windows[-1]["query_repetition"] = "cyclic" - if merge_delete_trigger is not None: - windows[-1]["merge_delete_trigger"] = merge_delete_trigger - if post_update_runtime_gt is not None and ( - not args.uniform_e6 or window_offset + 1 == args.window_count - ): - windows[-1]["post_update_checkpoint_groundtruth_path"] = str( - post_update_runtime_gt - ) - generated.append( - { - "window_id": window_id, - "batch_index": batch_index, - "source_batch_json": str(batch_path), - "insert_external_ids": insert_name, - "insert_vector_refs": refs_name, - "mark_delete_external_ids": delete_name, - "insert_count": insert_count, - "mark_delete_count": delete_count, - "checkpoint": batch.get("checkpoint"), - } - ) - - manifest = { - "version": 1, - "workload_id": args.workload_id, - "workload_mode": "continuous_uniform" if args.uniform_e6 else args.workload_mode, - "window_lifecycle": ( - "continuous_logical_windows" - if args.uniform_e6 - else "one_active_window" - ), - "windows": windows, - } - metadata = { - "schema": "concurrent-batch-materialization.v1", - "source_snapshot": args.source_snapshot or None, - "source_workload_root": str(root), - "runtime_batch_workload_root": str(runtime_root), - "trace_id": args.trace_id, - "insert_vector_source": { - "local_root": str(local_vector_root), - "runtime_root": str(runtime_vector_root), - "local_path": str(local_vector_path), - "runtime_path": str(runtime_vector_path), - "row_count": vector_count, - "copied": False, - }, - "query": { - "local_path": str(query), - "runtime_path": str(runtime_query), - "copied": False, - }, - "generated": generated, - } - if checkpoint_contract: - manifest["checkpoint_contract"] = checkpoint_contract - metadata["checkpoint_contract"] = checkpoint_contract - if args.uniform_e6: - metadata["runtime_contract"] = { - "task_runtime": "uniform", - "execution_model": "continuous_total_admission", - "legacy_thread_fields": "schema_validation_only", - "query_repetition": "cyclic", - "merge_trigger": "successful_all_cn_delete_ack_threshold", - "repair_partition": "striped_by_sorted_tombstone_index", - "final_window_merge_delete": ( - "disabled" - if args.uniform_skip_final_merge_delete - else "trigger_enabled" - ), - "uniform_profile": { - "total_threads": args.uniform_data_workers + 1, - "control_workers": 1, - "data_workers": args.uniform_data_workers, - "merge_workers": args.uniform_merge_workers, - "admission_ratio": { - "query": args.uniform_query_ratio, - "insert": args.uniform_insert_ratio, - "mark_delete": args.uniform_mark_delete_ratio, - }, - "ratio_window_multiplier": args.uniform_ratio_window_multiplier, - "ratio_window_scope": "per_cn", - "logical_windows": "input_and_progress_only", - "merge_trigger": "successful_all_cn_delete_ack_threshold", - "repair_partition": "striped_by_sorted_tombstone_index", - }, - "final_safepoint": "query_insert_quiescence_recorded", - } - write_json(output / "metadata.json", metadata) - manifest_path = output / "manifest.json" - write_json(manifest_path, manifest) - return manifest_path - - -def write_matrix_header(path: Path, rows: int, columns: int) -> None: - path.parent.mkdir(parents=True, exist_ok=True) - path.write_bytes(struct.pack(" None: - path.parent.mkdir(parents=True, exist_ok=True) - payload = { - "schema": "batch-update-eval-batch.v1", - "trace_id": "mixed", - "batch_index": index, - "operations": operations, - } - if include_checkpoint: - payload["checkpoint"] = { - "index": index, - "groundtruth": f"groundtruth/checkpoint_{index:04d}.bin", - "live_count": 8, - } - write_json(path, payload) - - -def run_self_test() -> None: - with tempfile.TemporaryDirectory(prefix="vectordb_concurrent_batch_") as tmp: - temp_root = Path(tmp) - root = temp_root / "package" - output = temp_root / "output" - trace_root = root / "traces/mixed" - batch_dir = trace_root / "batches" - batch_dir.mkdir(parents=True) - write_json( - root / "workload.json", - { - "schema": "batch-update-eval-workload.v1", - "base_count": 8, - "initial_count": 8, - "initial": { - "state_id": "initial-8", - "groundtruth": "groundtruth/initial.bin", - "live_count": 8, - }, - "insert_vector_source": { - "path": "base_permuted.fbin", - "row_count": 8, - }, - "traces": [ - { - "id": "mixed", - "batches": "traces/mixed/batches", - "batch_count": 6, - } - ], - }, - ) - write_json( - trace_root / "trace.json", - { - "schema": "batch-update-eval-trace.v1", - "trace_id": "mixed", - "batch_count": 6, - }, - ) - write_matrix_header(root / "groundtruth/initial.bin", 4, 10) - for checkpoint_index in range(1, 7): - write_matrix_header( - trace_root - / f"groundtruth/checkpoint_{checkpoint_index:04d}.bin", - 4, - 10, - ) - write_matrix_header(root / "query.fbin", 4, 2) - write_matrix_header(root / "base_permuted.fbin", 8, 2) - order = array("I", [7, 2, 6, 1, 5, 0, 4, 3]) - write_u32(root / "update_order.u32", order) - write_test_batch( - batch_dir / "batch_0001.json", - 1, - [ - { - "type": "delete", - "count": 2, - "external_ids": { - "encoding": "u32_cyclic_slice", - "path": "../../../update_order.u32", - "offset_items": 7, - "count": 2, - "wrap_at_items": 8, - }, - }, - { - "type": "insert", - "count": 2, - "external_ids": { - "encoding": "u32_slice", - "path": "../../../update_order.u32", - "offset_items": 2, - "count": 2, - }, - "vector_refs": { - "encoding": "range", - "begin": 4, - "count": 2, - }, - }, - ], - ) - for batch_index in range(2, 7): - write_test_batch( - batch_dir / f"batch_{batch_index:04d}.json", - batch_index, - load_json(batch_dir / "batch_0001.json")["operations"], - ) - args = argparse.Namespace( - batch_workload_root=root, - trace_id="mixed", - output_dir=output, - query_path=root / "query.fbin", - initial_groundtruth_path=None, - runtime_output_dir=Path("/runtime/output"), - runtime_batch_workload_root=Path("/runtime/package"), - runtime_query_path=Path("/runtime/query.fbin"), - runtime_initial_groundtruth_path=None, - start_batch_index=1, - window_count=1, - target_query_count=4, - target_insert_count=None, - target_mark_delete_count=None, - duration_seconds=2.0, - warmup_seconds=0.0, - query_rate_qps=0.0, - insert_rate_ops=0.0, - mark_delete_rate_ops=0.0, - search_threads=26, - insert_threads=4, - mark_delete_threads=1, - merge_delete_threads=8, - search_max_queue_depth=100, - insert_max_queue_depth=20, - mark_delete_max_queue_depth=20, - merge_delete_max_queue_depth=10, - search_max_inflight=100, - insert_max_inflight=20, - mark_delete_max_inflight=20, - merge_delete_max_inflight=10, - overflow_policy="wait_for_capacity", - workload_id="self-test", - uniform_e6=False, - uniform_skip_final_merge_delete=False, - uniform_data_workers=7, - uniform_merge_workers=2, - uniform_query_ratio=18, - uniform_insert_ratio=1, - uniform_mark_delete_ratio=1, - uniform_ratio_window_multiplier=20, - acknowledged_tombstone_fraction=0.05, - workload_mode="smoke", - source_snapshot="test-snapshot", - self_test=False, - ) - manifest_path = materialize(args) - manifest = load_json(manifest_path) - metadata = load_json(output / "metadata.json") - window = manifest["windows"][0] - if list(read_u32(output / "window_0001_insert_external_ids.u32", 0, 2)) != [6, 1]: - raise AssertionError("u32_slice external IDs were not materialized") - if list(read_u32(output / "window_0001_insert_vector_refs.u32", 0, 2)) != [4, 5]: - raise AssertionError("range vector refs were not materialized") - if list(read_u32(output / "window_0001_mark_delete_external_ids.u32", 0, 2)) != [3, 7]: - raise AssertionError("cyclic delete IDs were not materialized") - expected_refs_path = "/runtime/output/window_0001_insert_vector_refs.u32" - if window["insert_vector_refs_path"] != expected_refs_path: - raise AssertionError("runtime vector-ref path was not emitted") - if "query_repetition" in window or window["merge_delete_mode"] != "disabled": - raise AssertionError("legacy output should remain single-pass and repair-free") - if window["merge_delete_threads"] != 8: - raise AssertionError("legacy MergeDelete thread hint was not preserved") - if metadata["insert_vector_source"]["copied"] is not False: - raise AssertionError("vector source should only be referenced") - if (output / "base_permuted.fbin").exists(): - raise AssertionError("materializer copied the vector source") - - e6_output = temp_root / "e6-output" - e6_args = argparse.Namespace( - **{ - **vars(args), - "output_dir": e6_output, - "window_count": 6, - "target_query_count": None, - "uniform_e6": True, - "uniform_skip_final_merge_delete": True, - "search_threads": None, - "insert_threads": None, - "mark_delete_threads": None, - "merge_delete_threads": None, - "uniform_data_workers": 7, - "uniform_merge_workers": 2, - "uniform_query_ratio": 3, - "uniform_ratio_window_multiplier": 20, - } - ) - e6_manifest = load_json(materialize(e6_args)) - e6_metadata = load_json(e6_output / "metadata.json") - e6_window = e6_manifest["windows"][0] - e6_final_window = e6_manifest["windows"][-1] - if ( - e6_manifest["workload_mode"] != "continuous_uniform" - or e6_manifest["window_lifecycle"] - != "continuous_logical_windows" - or e6_window["target_query_count"] != 6 - or e6_window["target_insert_count"] != 2 - or e6_window["target_mark_delete_count"] != 2 - or e6_window["query_repetition"] != "cyclic" - or e6_window["merge_delete_mode"] != "concurrent" - or e6_window["merge_delete_schedule"] - ): - raise AssertionError("uniform E6 counts and modes were not emitted") - if e6_window["merge_delete_trigger"] != { - "kind": "acknowledged_tombstone_fraction", - "threshold": 0.05, - "semantics": "successful_all_cn_acks_since_previous_frozen_epoch", - "reference_node_count": 8, - }: - raise AssertionError("uniform E6 ACK trigger was not emitted") - if any( - "post_update_checkpoint_groundtruth_path" in window - for window in e6_manifest["windows"][:-1] - ): - raise AssertionError( - "uniform E6 must not drain for a checkpoint before window 6" - ) - if e6_final_window["post_update_checkpoint_groundtruth_path"] != ( - "/runtime/package/traces/mixed/groundtruth/checkpoint_0006.bin" - ): - raise AssertionError( - "uniform E6 final post-update checkpoint was not emitted" - ) - if ( - e6_final_window["merge_delete_mode"] != "disabled" - or "merge_delete_trigger" in e6_final_window - or any( - window["merge_delete_mode"] != "concurrent" - or "merge_delete_trigger" not in window - for window in e6_manifest["windows"][:-1] - ) - ): - raise AssertionError( - "uniform E6 final-no-merge policy was not emitted" - ) - if [ - e6_window["search_threads"], - e6_window["insert_threads"], - e6_window["mark_delete_threads"], - e6_window["merge_delete_threads"], - ] != [1, 1, 1, 1]: - raise AssertionError("uniform E6 compatibility thread hints are invalid") - if e6_metadata["runtime_contract"] != { - "task_runtime": "uniform", - "execution_model": "continuous_total_admission", - "legacy_thread_fields": "schema_validation_only", - "query_repetition": "cyclic", - "merge_trigger": "successful_all_cn_delete_ack_threshold", - "repair_partition": "striped_by_sorted_tombstone_index", - "final_window_merge_delete": "disabled", - "uniform_profile": { - "total_threads": 8, - "control_workers": 1, - "data_workers": 7, - "merge_workers": 2, - "admission_ratio": { - "query": 3, - "insert": 1, - "mark_delete": 1, - }, - "ratio_window_multiplier": 20, - "ratio_window_scope": "per_cn", - "logical_windows": "input_and_progress_only", - "merge_trigger": "successful_all_cn_delete_ack_threshold", - "repair_partition": "striped_by_sorted_tombstone_index", - }, - "final_safepoint": "query_insert_quiescence_recorded", - }: - raise AssertionError("uniform E6 runtime contract is ambiguous") - - missing_gt_output = temp_root / "missing-gt-output" - (trace_root / "groundtruth/checkpoint_0002.bin").rename( - temp_root / "checkpoint_0002.missing" - ) - missing_gt_args = argparse.Namespace( - **{ - **vars(e6_args), - "output_dir": missing_gt_output, - "start_batch_index": 2, - "window_count": 1, - } - ) - try: - materialize(missing_gt_args) - except (FileNotFoundError, ValueError) as exc: - if "post-update checkpoint ground truth" not in str(exc): - raise - else: - raise AssertionError( - "uniform E6 should require post-update checkpoint ground truth" - ) - - mismatched_output = temp_root / "mismatched-output" - mismatched_args = argparse.Namespace( - **{ - **vars(e6_args), - "output_dir": mismatched_output, - "target_mark_delete_count": 1, - } - ) - try: - materialize(mismatched_args) - except ValueError as exc: - if "configured insert:mark-delete ratio" not in str(exc): - raise - else: - raise AssertionError("uniform E6 should reject unpaired mixed counts") - - legacy_hint_output = temp_root / "legacy-hint-output" - legacy_hint_args = argparse.Namespace( - **{ - **vars(e6_args), - "output_dir": legacy_hint_output, - "search_threads": 1, - } - ) - try: - materialize(legacy_hint_args) - except ValueError as exc: - if "legacy per-class thread hints" not in str(exc): - raise - else: - raise AssertionError("uniform E6 should reject legacy thread hints") - - escaped = temp_root / "outside.u32" - write_u32(escaped, array("I", [1])) - try: - decode_sequence( - { - "encoding": "u32_slice", - "path": "../../../../outside.u32", - "offset_items": 0, - "count": 1, - }, - batch_dir / "batch_0001.json", - root.resolve(), - ) - except ValueError as exc: - if "escapes workload package" not in str(exc): - raise - else: - raise AssertionError("descriptor path escape should fail") - - shared_root = temp_root / "shared-vectors" - shared_root.mkdir() - (root / "base_permuted.fbin").rename(shared_root / "base_permuted.fbin") - exact_workload = load_json(root / "workload.json") - exact_workload["checkpoint_contract"] = "exact-update-counts.v1" - (root / "workload.json").write_text(json.dumps(exact_workload), encoding="utf-8") - write_u32(root / "selected_refs.u32", array("I", [7, 4])) - exact_batch = load_json(batch_dir / "batch_0001.json") - exact_batch["operations"][1]["vector_refs"] = { - "encoding": "u32_slice", - "path": "../../../selected_refs.u32", - "offset_items": 0, - "count": 2, - } - (batch_dir / "batch_0001.json").write_text(json.dumps(exact_batch), encoding="utf-8") - exact_args = argparse.Namespace( - **{ - **vars(e6_args), - "output_dir": temp_root / "shared-output", - "window_count": 1, - "uniform_skip_final_merge_delete": False, - "insert_vector_source_root": shared_root, - "runtime_insert_vector_source_root": Path("/runtime/shared-vectors"), - "target_insert_count": 2, - "target_mark_delete_count": 2, - } - ) - exact_manifest = load_json(materialize(exact_args)) - exact_window = exact_manifest["windows"][0] - if exact_manifest.get("checkpoint_contract") != "exact-update-counts.v1": - raise AssertionError("checkpoint count contract was not preserved") - if exact_window["checkpoint_update_counts"] != {"insert": 2, "mark_delete": 2}: - raise AssertionError("checkpoint update counts were not bound") - if list(read_u32(exact_args.output_dir / "window_0001_insert_vector_refs.u32", 0, 2)) != [7, 4]: - raise AssertionError("arbitrary selected vector refs were not preserved") - if exact_window["source"]["batch_workload_root"] != "/runtime/shared-vectors": - raise AssertionError("runtime did not receive the shared vector root") - if exact_window["source"]["batch_json_path"] != ( - "/runtime/package/traces/mixed/batches/batch_0001.json" - ): - raise AssertionError("shared vectors changed the workload artifact root") - exact_metadata = load_json(exact_args.output_dir / "metadata.json") - if exact_metadata["insert_vector_source"]["runtime_path"] != ( - "/runtime/shared-vectors/base_permuted.fbin" - ): - raise AssertionError("shared vector metadata does not match runtime source") - if (exact_args.output_dir / "base_permuted.fbin").exists(): - raise AssertionError("shared vector source was copied") - - for field, value, message in ( - ("target_insert_count", 1, "forbids changing update counts"), - ("target_mark_delete_count", 1, "forbids changing update counts"), - ("start_batch_index", 2, "requires --start-batch-index=1"), - ): - rejected_args = argparse.Namespace( - **{**vars(exact_args), field: value, "output_dir": temp_root / field} - ) - try: - materialize(rejected_args) - except ValueError as exc: - if message not in str(exc): - raise - else: - raise AssertionError(f"exact checkpoint accepted invalid {field}") - - linked_root = temp_root / "escaped-vectors" - linked_root.mkdir() - (linked_root / "base_permuted.fbin").symlink_to(shared_root / "base_permuted.fbin") - escaped_args = argparse.Namespace( - **{ - **vars(exact_args), - "insert_vector_source_root": linked_root, - "output_dir": temp_root / "escaped-vector-output", - } - ) - try: - materialize(escaped_args) - except ValueError as exc: - if "escapes workload package" not in str(exc): - raise - else: - raise AssertionError("shared vector source escaped its explicit root") - print("self-test: OK") - - -def main() -> int: - args = parse_args() - if args.self_test: - run_self_test() - return 0 - manifest_path = materialize(args) - print(manifest_path) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/spatial-workloads/v1/tools/evaluation_runners/configs/deep100.json b/spatial-workloads/v1/tools/evaluation_runners/configs/deep100.json deleted file mode 100644 index 87b13e17161e4e04030a1b9e6000456e4e62e1c4..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/evaluation_runners/configs/deep100.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "schema_version": 1, - "dataset_id": "deep100", - "dataset_label": "DEEP-100M", - "path_variables": { - "data_root": "/data/vectordb-cxl/data", - "dataset_prefix": "deep-100m" - }, - "source_snapshot": "", - "dtype": "float32", - "distance": "l2", - "dimension": 96, - "k": 10, - "topology": { - "compute_nodes": ["node-0", "node-1", "node-2", "node-3", "node-4"], - "storage_nodes": ["node-5", "node-6", "node-7"], - "num_cns": 5, - "num_mns": 3, - "workers_per_cn": 31, - "memory_bytes_per_mn": 42949672960, - "storage_max_node_capacity": 100000000, - "hash_directory_load_factor": 0.5, - "cache_capacity_bytes_per_cn": 20000000000 - }, - "query": { - "path": "{data_root}/{dataset_prefix}-static-search-eval/orig_query_10k.fbin", - "source_count": 10000, - "logical_count": 500000, - "checkpoint_count": 10000, - "ef_search": 100, - "ef_sweep": [75, 120, 150, 225, 300, 500, 800], - "worker_sweep": [1, 4, 8, 16, 24, 31], - "cn_sweep": [1, 3, 5] - }, - "pq": { - "meta": "{data_root}/{dataset_prefix}-static-search-eval/pq_m48.pqmeta", - "codebook": "{data_root}/{dataset_prefix}-static-search-eval/pq_m48.pqcodebook" - }, - "static_snapshot": { - "index": "{data_root}/{dataset_prefix}-static-search-eval/index_m_32_ef_500", - "groundtruth": "{data_root}/{dataset_prefix}-static-search-eval/groundtruth.bin", - "pq_codes": "{data_root}/{dataset_prefix}-static-search-eval/pq_m48.pqcodes", - "sidecar": "{data_root}/{dataset_prefix}-static-search-eval/layout-sidecar/index_m_32_ef_500.layout.json" - }, - "initial_snapshot": { - "index": "{data_root}/{dataset_prefix}-batch-update-eval/initial/index_80m_m32_efc500", - "groundtruth": "{data_root}/{dataset_prefix}-batch-update-eval/groundtruth/active_80m.bin", - "pq_codes": "{data_root}/{dataset_prefix}-batch-update-eval/initial/pq/pq_m48.pqcodes", - "sidecar": "{data_root}/{dataset_prefix}-batch-update-eval/initial/layout-sidecar/index_80m_m32_efc500.layout.json" - }, - "batch": { - "root": "{data_root}/{dataset_prefix}-batch-update-eval", - "insert_vector_path": "{data_root}/{dataset_prefix}-batch-update-eval/base_permuted.fbin", - "insert_trace": "insert-20", - "delete_trace": "delete-20", - "replacement_trace": "mixed-replace-100", - "start_index": 1, - "batch_count": 1, - "e6_window_count": 4, - "e6_source_segments_per_window": 3, - "e6_source_segment_update_count": 1000000, - "e6_skip_final_merge_delete": true, - "e8_batch_count": 50, - "e8_merge_every_batches": 5 - }, - "runtime": { - "runtime_id_mode": "internal-array", - "record_concurrency_control": "relaxed-snapshot", - "coroutines_per_thread": 1, - "reranking_factor": 20, - "rerank_parallelism": 1, - "l0_beam_width": 1, - "l0_pipe_width": 32, - "l0_pipe_initial_width": 4, - "l0_pipe_max_waste_ratio": 0.1, - "query_idle_timeout_seconds": 1800, - "update_idle_timeout_seconds": 21600 - }, - "repair": { - "algorithm": "ipdiskann-alg5", - "driver": "tombstone-driven", - "prune_mode": "ipdiskann-pq", - "alpha": 1.2, - "l": 128, - "search_k": 75, - "c": 3, - "per_deleted_expansion": 3, - "pq_window_l0": 64, - "pq_window_upper": 32, - "chunk_buckets": 64 - }, - "uniform": { - "execution_model": "continuous_total_admission", - "merge_trigger": "successful_all_cn_delete_ack_threshold", - "repair_partition": "striped_by_sorted_tombstone_index", - "final_safepoint": "query_insert_quiescence_recorded", - "merge_workers": 8, - "query_ratio": 36, - "insert_ratio": 1, - "mark_delete_ratio": 1, - "ratio_window_multiplier": 20, - "acknowledged_tombstone_fraction": 0.03, - "search_queue_depth": 10000, - "insert_queue_depth": 5000, - "mark_delete_queue_depth": 5000, - "merge_delete_queue_depth": 1000, - "search_max_inflight": 10000, - "insert_max_inflight": 5000, - "mark_delete_max_inflight": 5000, - "merge_delete_max_inflight": 1000 - }, - "repetitions": { - "E1": 3, - "E2": 3, - "E3": 3, - "E4": 3, - "E5": 3, - "E6": 3, - "E7": 3, - "E8": 1, - "E9": 1 - } -} diff --git a/spatial-workloads/v1/tools/evaluation_runners/e1.py b/spatial-workloads/v1/tools/evaluation_runners/e1.py deleted file mode 100644 index 516ff00e767e45d962c8f32166e4dd12a183ef6b..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/evaluation_runners/e1.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python3 -from runner import main - -raise SystemExit(main("E1")) diff --git a/spatial-workloads/v1/tools/evaluation_runners/e2.py b/spatial-workloads/v1/tools/evaluation_runners/e2.py deleted file mode 100644 index 8f91eb34a6ec080ddef530b9331cd60ace1c3fcf..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/evaluation_runners/e2.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python3 -from runner import main - -raise SystemExit(main("E2")) diff --git a/spatial-workloads/v1/tools/evaluation_runners/e6.py b/spatial-workloads/v1/tools/evaluation_runners/e6.py deleted file mode 100644 index 9d98698fa944b7083503a0c6b0685476bdcad7a9..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/evaluation_runners/e6.py +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python3 -from runner import main - -raise SystemExit(main("E6")) diff --git a/spatial-workloads/v1/tools/evaluation_runners/prepare_spatial_config.py b/spatial-workloads/v1/tools/evaluation_runners/prepare_spatial_config.py deleted file mode 100644 index 40c82433528a5510e23f9e9fdae2188da9b22b94..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/evaluation_runners/prepare_spatial_config.py +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env python3 -"""Bind one portable spatial workload profile to installed dataset snapshots.""" - -from __future__ import annotations - -import argparse -from copy import deepcopy -import json -from pathlib import Path -import re -import struct - -if __package__: - from .runner import ( - DEFAULT_CONFIG, batch_payload_paths, file_sha256, load_config, - read_json, require_mapping, validate_profile_status, write_json, - ) -else: - from runner import ( - DEFAULT_CONFIG, batch_payload_paths, file_sha256, load_config, - read_json, require_mapping, validate_profile_status, write_json, - ) - - -def matrix_shape(path: Path) -> tuple[int, int]: - with path.open("rb") as handle: - header = handle.read(8) - if len(header) != 8: - raise ValueError(f"truncated matrix header: {path}") - return struct.unpack(" Path: - if not isinstance(value, str) or not value or Path(value).is_absolute(): - raise ValueError(f"profile paths must be nonempty relative paths: {value!r}") - result = (root / value).resolve() - if not result.is_relative_to(root.resolve()): - raise ValueError(f"profile artifact escapes its instance: {value}") - if not result.exists(): - raise FileNotFoundError(result) - return result - - -def relocate(value: object, old_root: Path, new_root: Path) -> str: - try: - relative = Path(str(value)).relative_to(old_root) - except ValueError as exc: - raise ValueError( - f"base config asset {value!r} is outside its dataset root {old_root}" - ) from exc - return str(new_root / relative) - - -def derive( - profile_path_value: Path, - base_config: Path, - static_root: Path, - update_root: Path, -) -> dict[str, object]: - profile_file = profile_path_value.resolve() - profile = read_json(profile_file) - validate_profile_status(profile_file) - bindings = require_mapping(profile, "runner_bindings") - kind = str(bindings["kind"]) - if kind not in {"query", "insert", "delete", "mixed"}: - raise ValueError("profile kind must be query, insert, delete, or mixed") - config = deepcopy(load_config(base_config)) - old_static = Path(str(require_mapping(config, "static_snapshot")["index"])).parent - old_update = Path(str(require_mapping(config, "initial_snapshot")["index"])).parent.parent - static_root, update_root = static_root.resolve(), update_root.resolve() - for name, old, new in ( - ("static_snapshot", old_static, static_root), - ("initial_snapshot", old_update, update_root), - ): - selected = require_mapping(config, name) - for key in ("index", "groundtruth", "pq_codes", "sidecar", "compute_pq_codes", "storage_pq_codes"): - if selected.get(key): - selected[key] = relocate(selected[key], old, new) - pq = require_mapping(config, "pq") - for key in ("meta", "codebook"): - pq[key] = relocate(pq[key], old_static, static_root) - - root = profile_file.parent - query_file = profile_path(root, bindings["query_path"]) - initial_gt = profile_path(root, bindings["initial_groundtruth"]) - query_rows, query_dim = matrix_shape(query_file) - if query_rows != int(bindings["query_source_count"]) or query_dim != int(config["dimension"]): - raise ValueError("profile query header does not match its binding or base config") - if matrix_shape(initial_gt)[0] != query_rows: - raise ValueError("profile initial GT rows must match query rows") - initial_state = str(bindings["initial_state"]) - if not initial_state.startswith(("static-", "initial-")): - raise ValueError("profile initial_state must identify a static or initial snapshot") - expected_state = "static-" if kind in {"query", "delete"} else "initial-" - if not initial_state.startswith(expected_state): - raise ValueError(f"{kind} profile has an incompatible initial state") - selected_snapshot = require_mapping( - config, "static_snapshot" if initial_state.startswith("static-") else "initial_snapshot" - ) - selected_snapshot["groundtruth"] = str(initial_gt) - counts_raw = require_mapping(bindings, "operation_counts") - counts = {name: int(counts_raw[name]) for name in ("query", "insert", "delete")} - if any(value < 0 for value in counts.values()): - raise ValueError("profile operation counts must be nonnegative") - update_kinds = {name for name in ("insert", "delete") if counts[name] > 0} - expected_updates = { - "query": set(), "insert": {"insert"}, "delete": {"delete"}, - "mixed": {"insert", "delete"}, - }[kind] - if update_kinds != expected_updates or (kind in {"query", "mixed"} and counts["query"] <= 0): - raise ValueError("profile operation counts do not match its kind") - query = require_mapping(config, "query") - logical_queries = int(bindings["query_logical_count"]) - if logical_queries <= 0: - raise ValueError("query_logical_count must be positive") - query.update({ - "path": str(query_file), "source_count": query_rows, - "logical_count": logical_queries, - "checkpoint_count": logical_queries if kind in {"insert", "delete"} else query_rows, - "manifest": str(profile_file), - }) - if kind == "query" and int(query["logical_count"]) != counts["query"]: - raise ValueError("query logical count must match profile operation counts") - - batch = require_mapping(config, "batch") - # Query-only profiles still retain a valid shared vector binding in the full config. - vector_path = Path(str(batch["insert_vector_path"])) - source_old, source_new = ( - (old_update, update_root) if vector_path.is_relative_to(old_update) - else (old_static, static_root) - ) - batch["insert_vector_path"] = relocate(vector_path, source_old, source_new) - batch_count = int(bindings.get("batch_count", 0)) - trace_id = str(bindings.get("trace_id", "")) - if kind != "query": - if batch_count <= 0 or re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9._-]*", trace_id) is None: - raise ValueError("update profiles need a positive batch_count and one-component trace_id") - workload_root = profile_path(root, bindings.get("workload_root", ".")) - workload = read_json(workload_root / "workload.json") - if workload.get("checkpoint_contract") != "exact-update-counts.v1": - raise ValueError("prepared update package must bind exact checkpoint update counts") - trace_root = workload_root / "traces" / trace_id - trace = read_json(trace_root / "trace.json") - if trace.get("initial_state") != initial_state: - raise ValueError("trace initial state differs from profile binding") - totals = {"insert": 0, "delete": 0} - segment_counts = [] - for index in range(1, batch_count + 1): - batch_file = trace_root / "batches" / f"batch_{index:04d}.json" - document = read_json(batch_file) - current = {"insert": 0, "delete": 0} - for operation in document["operations"]: - operation_kind = str(operation["type"]) - if operation_kind not in totals: - raise ValueError(f"unsupported prepared operation: {operation_kind}") - count = int(operation["count"]) - if count < 0: - raise ValueError("negative prepared operation count") - for field in ("external_ids", "vector_refs"): - descriptor = operation.get(field) - if descriptor is not None and int(descriptor["count"]) != count: - raise ValueError("prepared descriptor count differs from operation count") - current[operation_kind] += count - totals[operation_kind] += count - dependencies = batch_payload_paths(workload_root, batch_file) - for dependency in dependencies: - if not Path(dependency).is_file(): - raise FileNotFoundError(dependency) - if matrix_shape(Path(dependencies[-1]))[0] != query_rows: - raise ValueError("prepared checkpoint GT rows must match query rows") - segment_counts.append(current) - if totals != {name: counts[name] for name in totals}: - raise ValueError("prepared batch operations differ from profile counts") - batch.update({ - "root": str(workload_root), "start_index": 1, "batch_count": batch_count, - {"insert": "insert_trace", "delete": "delete_trace", "mixed": "replacement_trace"}[kind]: trace_id, - }) - if kind == "mixed": - segment_count = int(bindings["source_segment_update_count"]) - if segment_count <= 0 or any( - segment != {"insert": segment_count, "delete": segment_count} - for segment in segment_counts - ): - raise ValueError("mixed profile must have equal declared update counts per segment") - uniform = require_mapping(config, "uniform") - pair_count = counts["insert"] - ratio, remainder = divmod(counts["query"], pair_count) - if remainder or ratio <= 0: - raise ValueError("mixed query count must be a positive integer multiple of pairs") - uniform.update({ - "query_ratio": ratio, "insert_ratio": 1, "mark_delete_ratio": 1, - "acknowledged_tombstone_fraction": segment_count / int(require_mapping(config, "topology")["storage_max_node_capacity"]), - }) - batch.update({ - "e6_window_count": batch_count, "e6_source_segments_per_window": 1, - "e6_source_segment_update_count": segment_count, - "e6_skip_final_merge_delete": bool(bindings.get("skip_final_merge_delete", False)), - }) - config["prepared_workload"] = { - "profile": str(profile_file), "profile_sha256": file_sha256(profile_file), - "kind": kind, "initial_state": initial_state, "batch_count": batch_count, - "trace_id": trace_id, "operation_counts": counts, - "query_source_count": query_rows, - "query_role": profile.get("query_role", "foreground" if kind in {"query", "mixed"} else "recall checkpoints"), - } - config["source_snapshot"] = str(profile.get("workload_id", profile.get("profile_id", profile_file.parent.name))) - return config - - -def main() -> int: - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("--profile", type=Path, required=True) - parser.add_argument("--base-config", type=Path, default=DEFAULT_CONFIG) - parser.add_argument("--static-root", type=Path, required=True) - parser.add_argument("--update-root", type=Path, required=True) - parser.add_argument("--output", type=Path, required=True) - args = parser.parse_args() - if args.output.exists(): - parser.error(f"refusing to overwrite {args.output}") - try: - config = derive(args.profile, args.base_config, args.static_root, args.update_root) - write_json(args.output, config) - except (KeyError, ValueError, OSError) as exc: - parser.error(str(exc)) - print(json.dumps({"config": str(args.output.resolve()), "kind": config["prepared_workload"]["kind"]})) - return 0 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/spatial-workloads/v1/tools/evaluation_runners/runner.py b/spatial-workloads/v1/tools/evaluation_runners/runner.py deleted file mode 100644 index c37527a3cabefe2d2f7790c5310da760cd7d98d6..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/evaluation_runners/runner.py +++ /dev/null @@ -1,2556 +0,0 @@ -#!/usr/bin/env python3 -"""Plan and run compact E1-E9 evaluation campaigns.""" - -from __future__ import annotations - -import argparse -from dataclasses import asdict, dataclass, replace -from datetime import datetime, timezone -import hashlib -import json -import os -from pathlib import Path -import re -import shlex -import subprocess -import sys -import threading -import time -from typing import Callable, Iterable - -try: - from tqdm import tqdm -except ImportError: # pragma: no cover - the runner retains a text fallback. - tqdm = None - - -EVAL_ROOT = Path(__file__).resolve().parents[1] -CXL_ROOT = Path( - os.environ.get("VECTORDB_CXL_ROOT", EVAL_ROOT.parent / "vectordb-cxl") -).resolve() -DEFAULT_CONFIG = Path(__file__).resolve().parent / "configs/deep100.json" -PYTHON = CXL_ROOT / "venv/bin/python" -LAUNCHER = CXL_ROOT / "scripts/e2e/run_compute_search.py" -READINESS = CXL_ROOT / "scripts/e2e/check_readiness.py" -KILL_ALL = CXL_ROOT / "scripts/e2e/kill_all.py" -MATERIALIZER = ( - CXL_ROOT / "scripts/datasets/general/materialize_concurrent_batch_update.py" -) -M1_PREPARER = Path(__file__).resolve().parent / "prepare_m1.py" -REMOTE_COMPUTE_BINARY = "/data/vectordb-cxl/build/src/compute/vectordb_compute_node" -REMOTE_STORAGE_BINARY = "/data/vectordb-cxl/build/src/storage/vectordb_storage_node" -DEFAULT_RECORD_MODES = ("strict-mcas", "relaxed-reread", "relaxed-snapshot") -RECORD_MODES = ( - "read-rmw-atomic", - "read-write-atomic", - "relaxed", - "mn-linearizable", - *DEFAULT_RECORD_MODES, -) -ATOMIC_RECORD_MODES = ("read-rmw-atomic", "read-write-atomic", "strict-mcas") -RMW_ATOMIC_RECORD_MODES = ("read-rmw-atomic", "strict-mcas") -E9_CACHE_VARIANTS = ("no-cache", "pq", "upper-only", "both") -E6_RUNTIME_CONTRACT = { - "execution_model": "continuous_total_admission", - "merge_trigger": "successful_all_cn_delete_ack_threshold", - "repair_partition": "striped_by_sorted_tombstone_index", - "final_safepoint": "query_insert_quiescence_recorded", -} - - -@dataclass(frozen=True) -class RunSpec: - run_id: str - experiment: str - repetition: int - kind: str - workload: str - snapshot: str - num_cns: int - num_mns: int - workers_per_cn: int - ef_search: int - reranking_factor: float - record_mode: str - query_limit: int - mutation_snapshot: bool | None = None - merge_workers: int = 0 - batch_count: int = 0 - merge_every_batches: int = 0 - sweep_axis: str = "" - checkpoint_phase: str = "" - cache_variant: str = "" - - -def utc_now() -> str: - return datetime.now(timezone.utc).isoformat() - - -def read_json(path: Path) -> dict[str, object]: - document = json.loads(path.read_text(encoding="utf-8")) - if not isinstance(document, dict): - raise ValueError(f"JSON root must be an object: {path}") - return document - - -def write_json(path: Path, value: object) -> None: - path.parent.mkdir(parents=True, exist_ok=True) - path.write_text(json.dumps(value, indent=2, sort_keys=True) + "\n") - - -def file_sha256(path: Path) -> str: - digest = hashlib.sha256() - with path.open("rb") as handle: - for block in iter(lambda: handle.read(1024 * 1024), b""): - digest.update(block) - return digest.hexdigest() - - -def binary_sha( - explicit: str | None, relative_path: str, label: str -) -> str: - if explicit: - if len(explicit) != 64 or any(char not in "0123456789abcdef" for char in explicit): - raise ValueError(f"--{label}-sha256 must be 64 lowercase hex characters") - return explicit - path = CXL_ROOT / relative_path - if not path.is_file(): - raise ValueError( - f"{label} binary is missing at {path}; build it or pass " - f"--{label}-sha256" - ) - return file_sha256(path) - - -def require_mapping(document: dict[str, object], key: str) -> dict[str, object]: - value = document.get(key) - if not isinstance(value, dict): - raise ValueError(f"configuration field {key!r} must be an object") - return value - - -def expand_templates(value: object, variables: dict[str, str]) -> object: - if isinstance(value, str): - try: - return value.format_map(variables) - except KeyError as exc: - raise ValueError( - f"unknown path variable {exc.args[0]!r} in {value!r}" - ) from exc - if isinstance(value, list): - return [expand_templates(item, variables) for item in value] - if isinstance(value, dict): - return { - key: expand_templates(item, variables) - for key, item in value.items() - } - return value - - -def dataset_id(prefix: str) -> str: - return re.sub(r"[^a-z0-9]+", "-", prefix.lower()).strip("-") - - -def load_config( - path: Path, - *, - data_root: Path | None = None, - dataset_prefix: str | None = None, - selected_dataset_id: str | None = None, - dataset_label: str | None = None, -) -> dict[str, object]: - config = read_json(path) - if config.get("schema_version") != 1: - raise ValueError("configuration schema_version must be 1") - configured_variables = require_mapping(config, "path_variables") - variables = { - key: str(value) for key, value in configured_variables.items() - } - if data_root is not None: - variables["data_root"] = str(data_root) - if dataset_prefix is not None: - if not dataset_prefix or "/" in dataset_prefix: - raise ValueError("--dataset-prefix must be one non-empty path component") - variables["dataset_prefix"] = dataset_prefix - config["dataset_id"] = selected_dataset_id or dataset_id(dataset_prefix) - config["dataset_label"] = dataset_label or dataset_prefix.upper() - elif selected_dataset_id is not None: - config["dataset_id"] = selected_dataset_id - if dataset_label is not None: - config["dataset_label"] = dataset_label - if not Path(variables.get("data_root", "")).is_absolute(): - raise ValueError("path variable data_root must be absolute") - if not variables.get("dataset_prefix"): - raise ValueError("path variable dataset_prefix must be non-empty") - if re.fullmatch(r"[A-Za-z0-9._-]+", str(config.get("dataset_id", ""))) is None: - raise ValueError("dataset_id must use only letters, digits, '.', '_', or '-'") - if not config.get("dataset_label"): - raise ValueError("dataset_label must be non-empty") - config["path_variables"] = variables - config = expand_templates(config, variables) - for key in ( - "topology", - "query", - "pq", - "static_snapshot", - "initial_snapshot", - "batch", - "runtime", - "repair", - "uniform", - "repetitions", - ): - require_mapping(config, key) - return config - - -def values(override: list[int] | None, configured: object) -> list[int]: - selected = override if override is not None else list(configured) - if not selected or any(value <= 0 for value in selected): - raise ValueError("sweep values must be positive") - return list(dict.fromkeys(selected)) - - -def nonnegative_float(value: str) -> float: - parsed = float(value) - if parsed < 0.0: - raise argparse.ArgumentTypeError("value must be non-negative") - return parsed - - -def fixed_value(override: list[int] | None, configured: object, name: str) -> int: - selected = values(override, [int(configured)]) - if len(selected) != 1: - raise ValueError(f"{name} accepts one value for this experiment") - return selected[0] - - -def selected_workloads( - requested: list[str] | None, allowed: tuple[str, ...] -) -> tuple[str, ...]: - if requested is None: - return allowed - invalid = sorted(set(requested) - set(allowed)) - if invalid: - raise ValueError(f"unsupported workload(s): {','.join(invalid)}") - return tuple(item for item in allowed if item in requested) - - -def effective_mutation_snapshot( - mode: str, requested: str | None -) -> bool | None: - if mode not in RECORD_MODES: - raise ValueError(f"unsupported record mode: {mode}") - if requested not in (None, "true", "false"): - raise ValueError("--mutation-snapshot must be true or false") - if mode in {"read-rmw-atomic", "strict-mcas", "mn-linearizable"}: - if requested is not None: - raise ValueError( - "--mutation-snapshot requires relaxed or read-write-atomic" - ) - return None - alias_snapshot = { - "relaxed-snapshot": True, - "relaxed-reread": False, - }.get(mode) - if alias_snapshot is not None: - if requested is not None and (requested == "true") != alias_snapshot: - raise ValueError( - "--mutation-snapshot conflicts with the selected relaxed alias" - ) - return alias_snapshot - return requested != "false" - - -def build_specs( - experiment: str, config: dict[str, object], args: argparse.Namespace -) -> list[RunSpec]: - topology = require_mapping(config, "topology") - query = require_mapping(config, "query") - batch = require_mapping(config, "batch") - runtime = require_mapping(config, "runtime") - uniform = require_mapping(config, "uniform") - repetitions_config = require_mapping(config, "repetitions") - repetitions = ( - args.repetitions - if args.repetitions is not None - else int(repetitions_config[experiment]) - ) - if repetitions <= 0: - raise ValueError("--repetitions must be positive") - if experiment == "E9" and repetitions != 1: - raise ValueError("E9 requires exactly one repetition") - if args.cache_variant and experiment not in {"E7", "E9"}: - raise ValueError("--cache-variant is only supported by E7 and E9") - if args.repetition_start <= 0: - raise ValueError("--repetition-start must be positive") - fixed_cns = ( - int(topology["num_cns"]) - if experiment in {"E4", "E5"} - else fixed_value(args.num_cns, topology["num_cns"], "--num-cns") - ) - fixed_workers = fixed_value( - args.workers_per_cn, - topology["workers_per_cn"], - "--workers-per-cn", - ) - num_mns = ( - args.num_mns - if args.num_mns is not None - else int(topology["num_mns"]) - ) - if num_mns <= 0: - raise ValueError("--num-mns must be positive") - selected_ef = ( - int(query["ef_search"]) - if experiment in {"E1", "EX1"} - else fixed_value(args.ef_search, query["ef_search"], "--ef-search") - ) - query_limit = ( - args.query_limit - if args.query_limit is not None - else int(query["logical_count"]) - ) - checkpoint_limit = ( - args.checkpoint_query_limit - if args.checkpoint_query_limit is not None - else int(query["checkpoint_count"]) - ) - if query_limit <= 0 or checkpoint_limit <= 0: - raise ValueError("query limits must be positive") - batch_count = ( - args.batch_count - if args.batch_count is not None - else int(batch["batch_count"]) - ) - if batch_count <= 0: - raise ValueError("--batch-count must be positive") - if experiment != "E7" and args.record_mode and len(args.record_mode) != 1: - raise ValueError("--record-mode accepts one value outside E7") - record_mode = ( - args.record_mode[0] - if experiment != "E7" and args.record_mode - else str(runtime["record_concurrency_control"]) - ) - workloads = selected_workloads( - args.workload, - { - "E1": ("query",), - "EX1": ("query",), - "M1": ("replacement",), - "E2": ("insert", "delete"), - "E3": ("replacement",), - "E4": ("query",), - "E5": ("insert", "delete"), - "E6": ("replacement",), - "E7": ("query", "insert", "delete"), - "E8": ("replacement",), - "E9": ("query", "insert", "delete"), - }[experiment], - ) - if args.merge_workers is not None and experiment not in {"E6", "M1"}: - raise ValueError("--merge-workers applies only to E6 and M1") - if args.merge_every_batches is not None and experiment in {"E1", "EX1", "E4", "E6", "M1"}: - raise ValueError( - "--merge-every-batches applies only to batch update experiments" - ) - if args.merge_every_batches is not None and not any( - workload in {"delete", "replacement"} for workload in workloads - ): - raise ValueError( - "--merge-every-batches requires a delete or replacement workload" - ) - specs: list[RunSpec] = [] - - def merge_interval(batches: int, *, default: int | None = None) -> int: - interval = batches if default is None else default - if args.merge_every_batches is not None: - interval = args.merge_every_batches - if not 0 <= interval <= batches: - raise ValueError( - "--merge-every-batches must be between zero and --batch-count" - ) - return interval - - def add( - repetition: int, - *, - kind: str, - workload: str, - snapshot: str, - num_cns: int = fixed_cns, - workers: int = fixed_workers, - ef_search: int = selected_ef, - reranking_factor: float | None = None, - mode: str = record_mode, - queries: int = checkpoint_limit, - merge_workers: int = 0, - batches: int = 0, - merge_every_batches: int = 0, - sweep_axis: str = "", - checkpoint_phase: str = "", - cache_variant: str = "", - ) -> None: - mutation_snapshot = effective_mutation_snapshot(mode, args.mutation_snapshot) - selected_reranking_factor = ( - float(runtime["reranking_factor"]) - if reranking_factor is None - else reranking_factor - ) - if selected_reranking_factor <= 0: - raise ValueError("reranking factor must be positive") - reranking_suffix = ( - f"-rr{selected_reranking_factor:g}" - if "reranking_factor_divisor" in query - else "" - ) - snapshot_suffix = ( - f"-ms-{str(mutation_snapshot).lower()}" - if mutation_snapshot is not None - else "" - ) - suffix = ( - f"{workload}-ef{ef_search}-cn{num_cns}-mn{num_mns}-w{workers}" - f"{reranking_suffix}" - f"{f'-cache-{cache_variant}' if cache_variant else ''}" - f"{snapshot_suffix}" - f"-cc-{mode}-r{repetition}" - ) - specs.append( - RunSpec( - run_id=f"{experiment.lower()}-{config['dataset_id']}-{suffix}", - experiment=experiment, - repetition=repetition, - kind=kind, - workload=workload, - snapshot=snapshot, - num_cns=num_cns, - num_mns=num_mns, - workers_per_cn=workers, - ef_search=ef_search, - reranking_factor=selected_reranking_factor, - record_mode=mode, - query_limit=queries, - mutation_snapshot=mutation_snapshot, - merge_workers=merge_workers, - batch_count=batches, - merge_every_batches=merge_every_batches, - sweep_axis=sweep_axis, - checkpoint_phase=checkpoint_phase, - cache_variant=cache_variant, - ) - ) - - for repetition in range( - args.repetition_start, args.repetition_start + repetitions - ): - if experiment in {"E1", "EX1"}: - reranking_divisor = query.get("reranking_factor_divisor") - if reranking_divisor is not None and ( - isinstance(reranking_divisor, bool) - or not isinstance(reranking_divisor, (int, float)) - or reranking_divisor <= 0 - ): - raise ValueError("query.reranking_factor_divisor must be positive") - for ef_search in values(args.ef_search, query["ef_sweep"]): - add( - repetition, - kind="query", - workload="query", - snapshot="static", - ef_search=ef_search, - reranking_factor=( - ef_search / float(reranking_divisor) - if reranking_divisor is not None - else None - ), - queries=query_limit, - sweep_axis="ef_search", - ) - elif experiment == "E2": - for workload in workloads: - add( - repetition, - kind="batch", - workload=workload, - snapshot="initial" if workload == "insert" else "static", - batches=batch_count, - merge_every_batches=( - 0 if workload == "insert" else merge_interval(batch_count) - ), - ) - elif experiment == "E3": - add( - repetition, - kind="batch", - workload="replacement", - snapshot="initial", - batches=batch_count, - merge_every_batches=merge_interval(batch_count), - ) - elif experiment == "E4": - for num_cns in values(args.num_cns, query["cn_sweep"]): - add( - repetition, - kind="query", - workload="query", - snapshot="static", - num_cns=num_cns, - queries=query_limit, - sweep_axis="num_cns", - ) - elif experiment == "E5": - for num_cns in values(args.num_cns, query["cn_sweep"]): - for workload in workloads: - add( - repetition, - kind="batch", - workload=workload, - snapshot="initial" if workload == "insert" else "static", - num_cns=num_cns, - batches=batch_count, - merge_every_batches=( - 0 - if workload == "insert" - else merge_interval(batch_count) - ), - sweep_axis="num_cns", - ) - elif experiment == "E6": - selected_merge_workers = ( - args.merge_workers - if args.merge_workers is not None - else int(uniform["merge_workers"]) - ) - if not 1 <= selected_merge_workers <= fixed_workers: - raise ValueError( - "E6 requires 1 <= --merge-workers <= --workers-per-cn" - ) - add( - repetition, - kind="concurrent", - workload="replacement", - snapshot="initial", - merge_workers=selected_merge_workers, - batches=( - args.batch_count - if args.batch_count is not None - else int(batch["e6_window_count"]) - ), - ) - elif experiment == "M1": - selected_merge_workers = ( - args.merge_workers - if args.merge_workers is not None - else int(uniform["merge_workers"]) - ) - if not 1 <= selected_merge_workers < fixed_workers: - raise ValueError( - "M1 requires 1 <= --merge-workers < --workers-per-cn" - ) - add( - repetition, - kind="concurrent", - workload="replacement", - snapshot="initial", - merge_workers=selected_merge_workers, - batches=int(batch["m1_measurement_batches"]), - mode="strict-mcas", - ) - elif experiment == "E7": - modes = args.record_mode or list(DEFAULT_RECORD_MODES) - cache_variants = args.cache_variant or (None,) - for mode in modes: - if mode not in RECORD_MODES: - raise ValueError(f"unsupported record mode: {mode}") - for cache_variant in cache_variants: - for workload in workloads: - add( - repetition, - kind="query" if workload == "query" else "batch", - workload=workload, - snapshot=( - "initial" if workload == "insert" else "static" - ), - mode=mode, - queries=query_limit if workload == "query" else checkpoint_limit, - batches=0 if workload == "query" else batch_count, - merge_every_batches=( - 0 - if workload in {"query", "insert"} - else merge_interval(batch_count) - ), - cache_variant=cache_variant, - ) - elif experiment == "E8": - e8_batches = ( - args.batch_count - if args.batch_count is not None - else int(batch["e8_batch_count"]) - ) - if e8_batches <= 0: - raise ValueError("E8 --batch-count must be positive") - add( - repetition, - kind="query", - workload="query", - snapshot="initial", - queries=checkpoint_limit, - checkpoint_phase="pre_update", - ) - add( - repetition, - kind="batch", - workload="replacement", - snapshot="initial", - batches=e8_batches, - merge_every_batches=merge_interval( - e8_batches, - default=int(batch["e8_merge_every_batches"]), - ), - ) - elif experiment == "E9": - if config["dataset_id"] != "bigann100": - raise ValueError("E9 supports BIGANN-100M only") - e9 = require_mapping(config, "e9") - cache_variants = ( - E9_CACHE_VARIANTS - if args.cache_variant is None - else tuple( - variant - for variant in E9_CACHE_VARIANTS - if variant in args.cache_variant - ) - ) - for cache_variant in cache_variants: - for workload in workloads: - add( - repetition, - kind="query" if workload == "query" else "batch", - workload=workload, - snapshot=( - "initial" if workload == "insert" else "static" - ), - ef_search=int(e9["ef_search"]), - reranking_factor=float(e9["reranking_factor"]), - queries=( - query_limit - if workload == "query" - else checkpoint_limit - ), - batches=0 if workload == "query" else batch_count, - merge_every_batches=( - 0 - if workload in {"query", "insert"} - else merge_interval(batch_count) - ), - cache_variant=cache_variant, - ) - else: - raise ValueError(f"unsupported experiment: {experiment}") - - unique: dict[str, RunSpec] = {} - for spec in specs: - existing = unique.get(spec.run_id) - if existing is None: - unique[spec.run_id] = spec - elif existing.sweep_axis != spec.sweep_axis: - unique[spec.run_id] = replace(existing, sweep_axis="shared") - compute_nodes = topology.get("compute_nodes") - storage_nodes = topology.get("storage_nodes") - if not isinstance(compute_nodes, list) or not isinstance(storage_nodes, list): - raise ValueError("topology node lists must be arrays") - for spec in unique.values(): - validate_prepared_workload(config, spec) - if spec.num_cns > len(compute_nodes): - raise ValueError( - f"{spec.run_id} needs {spec.num_cns} CNs, " - f"but only {len(compute_nodes)} are configured" - ) - if spec.num_mns > len(storage_nodes): - raise ValueError( - f"{spec.run_id} needs {spec.num_mns} MNs, " - f"but only {len(storage_nodes)} are configured" - ) - return list(unique.values()) - - -def validate_prepared_workload( - config: dict[str, object], spec: RunSpec -) -> None: - """Keep generated traces and their exact checkpoint ground truth together.""" - prepared = config.get("prepared_workload") - if prepared is None: - return - if not isinstance(prepared, dict): - raise ValueError("prepared_workload must be an object") - profile_file = Path(str(prepared["profile"])) - if file_sha256(profile_file) != prepared["profile_sha256"]: - raise ValueError("prepared profile changed after config generation") - validate_profile_status(profile_file) - kind = str(prepared["kind"]) - workload = "replacement" if kind == "mixed" else kind - if spec.workload != workload: - raise ValueError( - f"prepared {kind} profile requires --workload {workload}; " - f"got {spec.workload}" - ) - expected_snapshot = ( - "static" if str(prepared["initial_state"]).startswith("static-") - else "initial" - ) - if spec.snapshot != expected_snapshot: - raise ValueError("prepared workload initial state does not match this run") - counts = require_mapping(prepared, "operation_counts") - if kind == "query": - if spec.query_limit != int(counts["query"]): - raise ValueError("prepared query count cannot be overridden") - return - batch = require_mapping(config, "batch") - if int(batch["start_index"]) != 1: - raise ValueError("prepared exact checkpoints require batch start index 1") - if kind == "mixed": - if spec.experiment != "E6": - raise ValueError("prepared mixed profiles require the E6 runner") - contract = e6_materialization_contract(config, spec) - actual = { - "query": contract["total_query_count"], - "insert": contract["total_insert_count"], - "delete": contract["total_mark_delete_count"], - } - if actual != counts: - raise ValueError("prepared mixed operation counts cannot be overridden") - elif spec.batch_count != int(prepared["batch_count"]): - raise ValueError("prepared checkpoint batch count cannot be overridden") - expected_checkpoint_queries = ( - int(prepared["query_source_count"]) if kind == "mixed" - else int(counts["query"]) - ) - if expected_checkpoint_queries > 0 and spec.query_limit != expected_checkpoint_queries: - raise ValueError("prepared checkpoint query count cannot be overridden") - - -def validate_profile_status(profile_file: Path) -> Path | None: - validation_file = profile_file.parent / "validation.json" - if validation_file.exists(): - result = read_json(validation_file) - if result.get("status") != "passed": - raise ValueError( - "prepared profile validation must be passed; " - f"got {result.get('status')!r} in {validation_file}" - ) - return validation_file - return None - - -def sidecar_files(path: str) -> list[str]: - suffix = ".layout.json" - if not path.endswith(suffix): - raise ValueError(f"sidecar manifest must end with {suffix}: {path}") - prefix = path[: -len(suffix)] - return [path, prefix + ".levels.u16", prefix + ".id_mapping.u32"] - - -def snapshot(config: dict[str, object], name: str) -> dict[str, object]: - return require_mapping( - config, "static_snapshot" if name == "static" else "initial_snapshot" - ) - - -def snapshot_pq_codes( - selected_snapshot: dict[str, object], role: str -) -> str: - role_key = f"{role}_pq_codes" - return str( - selected_snapshot.get(role_key, selected_snapshot["pq_codes"]) - ) - - -def common_command( - config: dict[str, object], spec: RunSpec, port: int -) -> list[str]: - topology = require_mapping(config, "topology") - query = require_mapping(config, "query") - pq = require_mapping(config, "pq") - runtime = require_mapping(config, "runtime") - selected_snapshot = snapshot(config, spec.snapshot) - read_qp_pool_size = int( - topology.get("read_qp_pool_size", spec.workers_per_cn) - ) - if read_qp_pool_size <= 0: - raise ValueError("topology.read_qp_pool_size must be positive") - memory_bytes = ",".join( - [str(topology["memory_bytes_per_mn"])] * spec.num_mns - ) - command = [ - str(PYTHON), - str(LAUNCHER), - "--num-cns", - str(spec.num_cns), - "--num-sns", - str(spec.num_mns), - "--port", - str(port), - "--ib-port", - "1", - "--max-poll-cqes", - "16", - "--max-send-wrs", - "1024", - "--max-receive-wrs", - "1024", - "--server-wait-seconds", - "5", - "--storage-exit-timeout-seconds", - "300", - "--idle-timeout-seconds", - str( - runtime[ - "query_idle_timeout_seconds" - if spec.kind == "query" - else "update_idle_timeout_seconds" - ] - ), - "--storage-max-node-capacity", - str(topology["storage_max_node_capacity"]), - "--storage-hash-directory-load-factor", - str(topology["hash_directory_load_factor"]), - "--cluster-memory-node-bytes", - memory_bytes, - "--num-threads", - str(spec.workers_per_cn + 1), - "--read-qp-pool-size", - str(read_qp_pool_size), - "--coroutines-per-thread", - str(runtime["coroutines_per_thread"]), - "--k", - str(config["k"]), - "--ef-search", - str(spec.ef_search), - "--distance", - str(config["distance"]), - "--query-limit", - str(spec.query_limit), - "--progress-interval", - "1000", - "--storage-index-path", - str(selected_snapshot["index"]), - "--hnsw-layout-sidecar-manifest-path", - str(selected_snapshot["sidecar"]), - "--storage-data-type", - str(config["dtype"]), - "--compute-query-data-type", - str(config["dtype"]), - "--compute-query-path", - str(query["path"]), - "--compute-groundtruth-path", - str(selected_snapshot["groundtruth"]), - "--use-pq", - "--storage-pq-codes-path", - snapshot_pq_codes(selected_snapshot, "storage"), - "--storage-pq-meta-path", - str(pq["meta"]), - "--compute-pq-meta-path", - str(pq["meta"]), - "--compute-pq-codebook-path", - str(pq["codebook"]), - "--runtime-id-mode", - str(runtime["runtime_id_mode"]), - "--record-concurrency-control", - spec.record_mode, - "--compute-pq-cache-mode", - "uniform-paged", - "--compute-cache-capacity-bytes", - str(topology["cache_capacity_bytes_per_cn"]), - "--reranking-factor", - str(spec.reranking_factor), - "--rerank-parallelism", - str(runtime["rerank_parallelism"]), - "--l0-beam-width", - str(runtime["l0_beam_width"]), - "--l0-pipe-width", - str(runtime["l0_pipe_width"]), - "--l0-pipe-initial-width", - str(runtime["l0_pipe_initial_width"]), - "--l0-pipe-max-waste-ratio", - str(runtime["l0_pipe_max_waste_ratio"]), - ] - if not (spec.experiment == "E6" and spec.record_mode in RMW_ATOMIC_RECORD_MODES): - command.extend(["--l0-pipe-search", "--l0-pipe-adaptive"]) - if spec.mutation_snapshot is not None: - command.extend( - ["--mutation-snapshot", str(spec.mutation_snapshot).lower()] - ) - if spec.cache_variant in {"no-cache", "upper-only"}: - command.extend( - ["--compute-pq-residency", "mn"] - ) - if spec.cache_variant == "no-cache": - command.append("--disable-upper-cache") - elif spec.cache_variant in {"pq", "both"}: - command.extend( - [ - "--compute-pq-residency", - "cn", - "--compute-pq-codes-path", - snapshot_pq_codes(selected_snapshot, "compute"), - ] - ) - if spec.cache_variant == "pq": - command.append("--disable-upper-cache") - else: - command.extend( - [ - "--compute-pq-codes-path", - snapshot_pq_codes(selected_snapshot, "compute"), - ] - ) - if topology.get("storage_low_memory_bootstrap", False): - command.append("--storage-low-memory-bootstrap") - if topology.get("storage_skip_initial_pq_codes", False): - command.append("--storage-skip-initial-pq-codes") - if ( - spec.kind == "query" - or spec.query_limit > int(query["source_count"]) - ): - command.append("--repeat-queries") - return command - - -def repair_arguments(config: dict[str, object]) -> list[str]: - repair = require_mapping(config, "repair") - return [ - "--batchdelete-chunk-buckets", - str(repair["chunk_buckets"]), - "--batchdelete-repair-algorithm", - str(repair["algorithm"]), - "--batchdelete-alpha", - str(repair["alpha"]), - "--batchdelete-repair-driver", - str(repair["driver"]), - "--batchdelete-repair-prune-mode", - str(repair["prune_mode"]), - "--batchdelete-per-deleted-expansion", - str(repair["per_deleted_expansion"]), - "--batchdelete-pq-window-l0", - str(repair["pq_window_l0"]), - "--batchdelete-pq-window-upper", - str(repair["pq_window_upper"]), - "--batchdelete-delete-search-l", - str(repair["l"]), - "--batchdelete-delete-search-k", - str(repair["search_k"]), - "--batchdelete-delete-repair-c", - str(repair["c"]), - "--batchdelete-delete-search-full-rerank-window", - "0", - ] - - -def batch_command( - config: dict[str, object], spec: RunSpec, port: int -) -> list[str]: - batch = require_mapping(config, "batch") - trace = { - "insert": batch["insert_trace"], - "delete": batch["delete_trace"], - "replacement": batch["replacement_trace"], - }[spec.workload] - command = common_command(config, spec, port) - command.extend( - [ - "--insert-search-ef", - str(spec.ef_search), - "--batch-workload-root", - str(batch["root"]), - "--batch-workload-trace", - str(trace), - "--batch-start-index", - str(batch["start_index"]), - "--batch-count", - str(spec.batch_count), - "--batchdelete-every-batches", - str(spec.merge_every_batches), - "--insert-vector-data-type", - str(config["dtype"]), - "--insert-vector-path", - str(batch["insert_vector_path"]), - "--insert-l0-pipe-search", - "--insert-l0-pipe-adaptive", - "--insert-l0-pipe-width", - "32", - "--insert-l0-pipe-initial-width", - "4", - "--insert-l0-pipe-max-waste-ratio", - "0.1", - *repair_arguments(config), - ] - ) - if spec.experiment == "E8": - command.append("--batch-read-before-merge-delete") - return command - - -def e6_prepare_command( - config: dict[str, object], spec: RunSpec, output: Path -) -> list[str]: - batch = require_mapping(config, "batch") - query = require_mapping(config, "query") - uniform = require_mapping(config, "uniform") - e6_runtime_contract(config) - materialization_contract = e6_materialization_contract(config, spec) - initial = snapshot(config, "initial") - command = [ - str(PYTHON), - str(MATERIALIZER), - "--batch-workload-root", - str(batch["root"]), - "--trace-id", - str(batch["replacement_trace"]), - "--output-dir", - str(output), - "--runtime-output-dir", - str(output), - "--runtime-batch-workload-root", - str(batch["root"]), - "--query-path", - str(query["path"]), - "--runtime-query-path", - str(query["path"]), - "--initial-groundtruth-path", - str(initial["groundtruth"]), - "--runtime-initial-groundtruth-path", - str(initial["groundtruth"]), - "--start-batch-index", - str(batch["start_index"]), - "--window-count", - str(materialization_contract["source_segment_count"]), - "--uniform-e6", - "--uniform-data-workers", - str(spec.workers_per_cn), - "--uniform-merge-workers", - str(spec.merge_workers), - "--uniform-query-ratio", - str(uniform["query_ratio"]), - "--uniform-insert-ratio", - str(uniform["insert_ratio"]), - "--uniform-mark-delete-ratio", - str(uniform["mark_delete_ratio"]), - "--uniform-ratio-window-multiplier", - str(uniform["ratio_window_multiplier"]), - "--acknowledged-tombstone-fraction", - str(uniform["acknowledged_tombstone_fraction"]), - "--search-max-queue-depth", - str(uniform["search_queue_depth"]), - "--insert-max-queue-depth", - str(uniform["insert_queue_depth"]), - "--mark-delete-max-queue-depth", - str(uniform["mark_delete_queue_depth"]), - "--merge-delete-max-queue-depth", - str(uniform["merge_delete_queue_depth"]), - "--search-max-inflight", - str(uniform["search_max_inflight"]), - "--insert-max-inflight", - str(uniform["insert_max_inflight"]), - "--mark-delete-max-inflight", - str(uniform["mark_delete_max_inflight"]), - "--merge-delete-max-inflight", - str(uniform["merge_delete_max_inflight"]), - "--overflow-policy", - "wait_for_capacity", - "--workload-id", - spec.run_id, - "--source-snapshot", - str(config.get("source_snapshot", "")), - ] - vector_root = Path(str(batch["insert_vector_path"])).parent - if config.get("prepared_workload") or vector_root.resolve() != Path(str(batch["root"])).resolve(): - command.extend([ - "--insert-vector-source-root", str(vector_root), - "--runtime-insert-vector-source-root", str(vector_root), - ]) - if bool(batch.get("e6_skip_final_merge_delete", False)): - command.append("--uniform-skip-final-merge-delete") - return command - - -def m1_prepare_command( - config: dict[str, object], spec: RunSpec, output: Path -) -> list[str]: - batch = require_mapping(config, "batch") - query = require_mapping(config, "query") - uniform = require_mapping(config, "uniform") - topology = require_mapping(config, "topology") - initial = snapshot(config, "initial") - return [ - str(PYTHON), - str(M1_PREPARER), - "--batch-workload-root", - str(batch["root"]), - "--trace-id", - str(batch["replacement_trace"]), - "--output-dir", - str(output), - "--runtime-output-dir", - str(output), - "--query-path", - str(query["path"]), - "--initial-groundtruth-path", - str(initial["groundtruth"]), - "--start-batch-index", - str(batch["start_index"]), - "--prepare-batches", - str(batch["m1_prepare_batches"]), - "--measurement-batches", - str(batch["m1_measurement_batches"]), - "--reference-node-count", - str(topology["storage_max_node_capacity"]), - "--acknowledged-tombstone-fraction", - str(uniform["acknowledged_tombstone_fraction"]), - "--uniform-data-workers", - str(spec.workers_per_cn), - "--uniform-merge-workers", - str(spec.merge_workers), - "--ratio-window-multiplier", - str(uniform["ratio_window_multiplier"]), - "--search-max-queue-depth", - str(uniform["search_queue_depth"]), - "--insert-max-queue-depth", - str(uniform["insert_queue_depth"]), - "--mark-delete-max-queue-depth", - str(uniform["mark_delete_queue_depth"]), - "--merge-delete-max-queue-depth", - str(uniform["merge_delete_queue_depth"]), - "--search-max-inflight", - str(uniform["search_max_inflight"]), - "--insert-max-inflight", - str(uniform["insert_max_inflight"]), - "--mark-delete-max-inflight", - str(uniform["mark_delete_max_inflight"]), - "--merge-delete-max-inflight", - str(uniform["merge_delete_max_inflight"]), - "--workload-id", - spec.run_id, - "--source-snapshot", - str(config.get("source_snapshot", "")), - ] - - -def validate_m1_materialization(materialized: Path) -> None: - manifest = read_json(materialized / "manifest.json") - metadata = read_json(materialized / "metadata.json") - if ( - manifest.get("workload_mode") != "m1_access_overlap" - or manifest.get("window_lifecycle") != "continuous_logical_windows" - ): - raise ValueError("M1 manifest has the wrong runtime mode") - windows = manifest.get("windows") - if not isinstance(windows, list) or len(windows) != 2: - raise ValueError("M1 manifest must contain setup and measurement windows") - setup, measurement = windows - if ( - setup.get("target_mark_delete_count", 0) <= 0 - or setup.get("target_query_count") != 0 - or setup.get("target_insert_count") != 0 - or setup.get("merge_delete_mode") != "concurrent" - or "merge_delete_trigger" not in setup - ): - raise ValueError( - "M1 setup window must be MarkDelete-only and trigger repair" - ) - if ( - measurement.get("target_mark_delete_count") != 0 - or measurement.get("target_query_count") - != measurement.get("target_insert_count") - or measurement.get("duration_seconds") != 60.0 - or measurement.get("merge_delete_mode") != "disabled" - ): - raise ValueError("M1 measurement window must be 60-second Query/Insert 1:1") - if not isinstance(metadata.get("m1"), dict): - raise ValueError("M1 metadata is missing its experiment contract") - - -def e6_runtime_contract(config: dict[str, object]) -> dict[str, str]: - uniform = require_mapping(config, "uniform") - expected = dict(E6_RUNTIME_CONTRACT) - for field, value in expected.items(): - if uniform.get(field) != value: - raise ValueError( - f"E6 uniform.{field} must be {value!r}, " - f"got {uniform.get(field)!r}" - ) - return expected - - -def e6_materialization_contract( - config: dict[str, object], spec: RunSpec -) -> dict[str, int | bool]: - batch = require_mapping(config, "batch") - topology = require_mapping(config, "topology") - uniform = require_mapping(config, "uniform") - evaluation_windows = spec.batch_count - source_segments_per_window = int( - batch.get("e6_source_segments_per_window", 1) - ) - source_insert_count = int( - batch.get("e6_source_segment_update_count", 0) - ) - if evaluation_windows <= 0: - raise ValueError("E6 evaluation window count must be positive") - if source_segments_per_window <= 0: - raise ValueError("E6 source segments per window must be positive") - if source_insert_count <= 0: - raise ValueError("E6 source segment update count must be positive") - - query_ratio = int(uniform["query_ratio"]) - insert_ratio = int(uniform["insert_ratio"]) - mark_delete_ratio = int(uniform["mark_delete_ratio"]) - if min(query_ratio, insert_ratio, mark_delete_ratio) <= 0: - raise ValueError("E6 operation ratios must be positive") - ratio_units, remainder = divmod(source_insert_count, insert_ratio) - if remainder: - raise ValueError( - "E6 source segment update count must be divisible by insert ratio" - ) - source_query_count = ratio_units * query_ratio - source_mark_delete_count = ratio_units * mark_delete_ratio - evaluation_insert_count = ( - source_insert_count * source_segments_per_window - ) - evaluation_query_count = ( - source_query_count * source_segments_per_window - ) - evaluation_mark_delete_count = ( - source_mark_delete_count * source_segments_per_window - ) - - reference_count = int(topology["storage_max_node_capacity"]) - threshold_fraction = float( - uniform["acknowledged_tombstone_fraction"] - ) - threshold_value = threshold_fraction * reference_count - threshold_count = round(threshold_value) - if abs(threshold_value - threshold_count) > 1e-6: - raise ValueError( - "E6 acknowledged tombstone fraction must produce an integer count" - ) - if threshold_count != evaluation_mark_delete_count: - raise ValueError( - "E6 acknowledged tombstone threshold must equal one evaluation " - f"window: threshold={threshold_count} " - f"window_mark_deletes={evaluation_mark_delete_count}" - ) - - source_segment_count = ( - evaluation_windows * source_segments_per_window - ) - skip_final_merge = bool( - batch.get("e6_skip_final_merge_delete", False) - ) - return { - "evaluation_window_count": evaluation_windows, - "source_segments_per_evaluation_window": ( - source_segments_per_window - ), - "source_segment_count": source_segment_count, - "source_query_count": source_query_count, - "source_insert_count": source_insert_count, - "source_mark_delete_count": source_mark_delete_count, - "evaluation_window_query_count": evaluation_query_count, - "evaluation_window_insert_count": evaluation_insert_count, - "evaluation_window_mark_delete_count": ( - evaluation_mark_delete_count - ), - "total_query_count": evaluation_query_count * evaluation_windows, - "total_insert_count": evaluation_insert_count * evaluation_windows, - "total_mark_delete_count": ( - evaluation_mark_delete_count * evaluation_windows - ), - "merge_threshold_mark_delete_count": threshold_count, - "expected_merge_epoch_count": ( - evaluation_windows - int(skip_final_merge) - ), - "skip_final_merge_delete": skip_final_merge, - } - - -def validate_e6_materialization( - materialized: Path, - contract: dict[str, object], - materialization_contract: dict[str, object] | None = None, -) -> None: - expected_contract = contract or E6_RUNTIME_CONTRACT - manifest = read_json(materialized / "manifest.json") - metadata = read_json(materialized / "metadata.json") - if manifest.get("workload_mode") != "continuous_uniform": - raise ValueError("E6 manifest must use continuous_uniform workload mode") - if manifest.get("window_lifecycle") != "continuous_logical_windows": - raise ValueError( - "E6 manifest windows must be logical input/progress segments" - ) - windows = manifest.get("windows") - if not isinstance(windows, list) or not windows: - raise ValueError("E6 manifest must contain logical workload segments") - skip_final_merge = ( - bool( - materialization_contract.get( - "skip_final_merge_delete", True - ) - ) - if materialization_contract - else True - ) - expected_final_mode = ( - "disabled" if skip_final_merge else "concurrent" - ) - if ( - not isinstance(windows[-1], dict) - or windows[-1].get("merge_delete_mode") != expected_final_mode - ): - raise ValueError( - "E6 final logical segment must use " - f"merge_delete_mode={expected_final_mode}" - ) - if not any( - isinstance(window, dict) - and window.get("merge_delete_mode") == "concurrent" - for window in windows - ): - raise ValueError("E6 requires at least one acknowledged-delete trigger") - materialized_contract = metadata.get("runtime_contract") - if not isinstance(materialized_contract, dict): - raise ValueError("E6 metadata is missing runtime_contract") - for field, expected in expected_contract.items(): - if materialized_contract.get(field) != expected: - raise ValueError( - f"E6 materialized runtime_contract.{field} must be " - f"{expected!r}, got {materialized_contract.get(field)!r}" - ) - if materialization_contract: - expected_segments = int( - materialization_contract["source_segment_count"] - ) - if len(windows) != expected_segments: - raise ValueError( - "E6 materialized source segment count must be " - f"{expected_segments}, got {len(windows)}" - ) - expected_query = int( - materialization_contract["source_query_count"] - ) - expected_insert = int( - materialization_contract["source_insert_count"] - ) - expected_delete = int( - materialization_contract["source_mark_delete_count"] - ) - expected_threshold = int( - materialization_contract[ - "merge_threshold_mark_delete_count" - ] - ) - for index, window in enumerate(windows, start=1): - if not isinstance(window, dict): - raise ValueError( - f"E6 materialized source segment {index} is invalid" - ) - counts = ( - int(window.get("target_query_count", -1)), - int(window.get("target_insert_count", -1)), - int(window.get("target_mark_delete_count", -1)), - ) - if counts != (expected_query, expected_insert, expected_delete): - raise ValueError( - f"E6 materialized source segment {index} has counts " - f"{counts}, expected " - f"{(expected_query, expected_insert, expected_delete)}" - ) - expected_mode = ( - "disabled" - if skip_final_merge and index == expected_segments - else "concurrent" - ) - if window.get("merge_delete_mode") != expected_mode: - raise ValueError( - f"E6 materialized source segment {index} must use " - f"merge_delete_mode={expected_mode}" - ) - trigger = window.get("merge_delete_trigger") - if expected_mode == "disabled": - if trigger is not None: - raise ValueError( - "E6 final source segment must omit its merge trigger" - ) - continue - if not isinstance(trigger, dict): - raise ValueError( - f"E6 materialized source segment {index} is missing " - "its merge trigger" - ) - reference_count = int( - trigger.get("reference_node_count", 0) - ) - threshold_count = round( - float(trigger.get("threshold", 0.0)) * reference_count - ) - if threshold_count != expected_threshold: - raise ValueError( - f"E6 materialized source segment {index} has " - f"merge threshold {threshold_count}, expected " - f"{expected_threshold}" - ) - - -def concurrent_command( - config: dict[str, object], spec: RunSpec, port: int, manifest: Path -) -> list[str]: - uniform = require_mapping(config, "uniform") - command = common_command(config, spec, port) - command.extend( - [ - "--concurrent-mode", - "--concurrent-workload-manifest", - str(manifest), - "--task-runtime", - "uniform", - "--uniform-data-workers", - str(spec.workers_per_cn), - "--uniform-merge-workers", - str(spec.merge_workers), - "--uniform-query-ratio", - str(uniform["query_ratio"]), - "--uniform-insert-ratio", - str(uniform["insert_ratio"]), - "--uniform-mark-delete-ratio", - str(uniform["mark_delete_ratio"]), - "--uniform-ratio-window-multiplier", - str(uniform["ratio_window_multiplier"]), - "--search-max-queue-depth", - str(uniform["search_queue_depth"]), - "--insert-max-queue-depth", - str(uniform["insert_queue_depth"]), - "--mark-delete-max-queue-depth", - str(uniform["mark_delete_queue_depth"]), - "--merge-delete-max-queue-depth", - str(uniform["merge_delete_queue_depth"]), - "--search-max-inflight", - str(uniform["search_max_inflight"]), - "--insert-max-inflight", - str(uniform["insert_max_inflight"]), - "--mark-delete-max-inflight", - str(uniform["mark_delete_max_inflight"]), - "--merge-delete-max-inflight", - str(uniform["merge_delete_max_inflight"]), - "--overflow-policy", - "wait_for_capacity", - "--insert-search-ef", - str(spec.ef_search), - *repair_arguments(config), - ] - ) - return command - - -def trace_for(config: dict[str, object], workload: str) -> str: - batch = require_mapping(config, "batch") - return str( - { - "insert": batch["insert_trace"], - "delete": batch["delete_trace"], - "replacement": batch["replacement_trace"], - }[workload] - ) - - -def run_artifacts( - config: dict[str, object], spec: RunSpec -) -> tuple[list[str], list[str]]: - selected_snapshot = snapshot(config, spec.snapshot) - pq = require_mapping(config, "pq") - query = require_mapping(config, "query") - compute = [ - str(selected_snapshot["index"]), - str(query["path"]), - str(selected_snapshot["groundtruth"]), - str(pq["meta"]), - str(pq["codebook"]), - snapshot_pq_codes(selected_snapshot, "compute"), - *sidecar_files(str(selected_snapshot["sidecar"])), - ] - if query.get("manifest"): - compute.append(str(query["manifest"])) - storage = [ - str(selected_snapshot["index"]), - str(pq["meta"]), - snapshot_pq_codes(selected_snapshot, "storage"), - *sidecar_files(str(selected_snapshot["sidecar"])), - ] - if spec.kind in {"batch", "concurrent"}: - batch = require_mapping(config, "batch") - root = Path(str(batch["root"])) - trace = trace_for(config, spec.workload) - if spec.experiment == "E6": - source_batch_count = int( - e6_materialization_contract(config, spec)[ - "source_segment_count" - ] - ) - elif spec.experiment == "M1": - source_batch_count = int(batch["m1_prepare_batches"]) + int( - batch["m1_measurement_batches"] - ) - else: - source_batch_count = spec.batch_count - compute.extend( - [ - str(root / "workload.json"), - str(root / "traces" / trace / "trace.json"), - str(batch["insert_vector_path"]), - ] - ) - for index in range( - int(batch["start_index"]), - int(batch["start_index"]) + source_batch_count, - ): - batch_path = root / "traces" / trace / "batches" / f"batch_{index:04d}.json" - compute.append(str(batch_path)) - if batch_path.is_file(): - compute.extend(batch_payload_paths(root, batch_path)) - else: - compute.append(str( - root / "traces" / trace / "groundtruth" / f"checkpoint_{index:04d}.bin" - )) - prepared = config.get("prepared_workload") - if isinstance(prepared, dict) and prepared.get("profile"): - compute.append(str(prepared["profile"])) - validation = Path(str(prepared["profile"])).parent / "validation.json" - if validation.is_file(): - compute.append(str(validation)) - return list(dict.fromkeys(compute)), list(dict.fromkeys(storage)) - - -def batch_payload_paths(root: Path, batch_path: Path) -> list[str]: - """Include the actual u32 streams and checkpoint selected by compact JSON.""" - document = read_json(batch_path) - package_root = root.resolve() - trace_root = batch_path.parent.parent.resolve() - - def contained_path(raw: object, relative_to: Path, boundary: Path) -> str: - if not isinstance(raw, str) or not raw or Path(raw).is_absolute(): - raise ValueError(f"batch artifact path must be relative: {raw!r}") - resolved = (relative_to / raw).resolve() - if not resolved.is_relative_to(boundary): - raise ValueError(f"batch artifact escapes its package: {raw}") - return str(resolved) - - paths = [] - for operation in document.get("operations", []): - for field in ("external_ids", "vector_refs"): - descriptor = operation.get(field) - if isinstance(descriptor, dict) and descriptor.get("encoding") in { - "u32_slice", "u32_cyclic_slice" - }: - paths.append(contained_path( - descriptor.get("path"), batch_path.parent, package_root - )) - checkpoint = require_mapping(document, "checkpoint") - paths.append(contained_path( - checkpoint.get("groundtruth", checkpoint.get("groundtruth_path")), - trace_root, - trace_root, - )) - return list(dict.fromkeys(paths)) - - -def readiness_command( - config: dict[str, object], - spec: RunSpec, - port: int, - compute_sha256: str, - storage_sha256: str, -) -> list[str]: - topology = require_mapping(config, "topology") - compute_artifacts, storage_artifacts = run_artifacts(config, spec) - command = [ - str(PYTHON), - str(READINESS), - "--num-cns", - str(spec.num_cns), - "--num-sns", - str(spec.num_mns), - "--port", - str(port), - "--storage-bytes-per-node", - str(topology["memory_bytes_per_mn"]), - "--compute-sha256", - compute_sha256, - "--storage-sha256", - storage_sha256, - ] - for path in compute_artifacts: - command.extend(["--compute-artifact", path]) - for path in storage_artifacts: - command.extend(["--storage-artifact", path]) - return command - - -def query_storage_key( - config: dict[str, object], - spec: RunSpec, - storage_sha256: str, -) -> dict[str, object]: - topology = require_mapping(config, "topology") - runtime = require_mapping(config, "runtime") - pq = require_mapping(config, "pq") - selected_snapshot = snapshot(config, spec.snapshot) - storage_nodes = list(topology["storage_nodes"])[: spec.num_mns] - return { - "dataset_id": config["dataset_id"], - "storage_nodes": storage_nodes, - "memory_node_ids": [7] if spec.num_mns == 1 else list(range(spec.num_mns)), - "num_mns": spec.num_mns, - "storage_binary_path": REMOTE_STORAGE_BINARY, - "storage_binary_sha256": storage_sha256, - "mn_linearizable": spec.record_mode == "mn-linearizable", - "runtime_id_mode": runtime["runtime_id_mode"], - "index_path": selected_snapshot["index"], - "data_type": config["dtype"], - "pq_codes_path": snapshot_pq_codes(selected_snapshot, "storage"), - "skip_initial_pq_codes": bool( - topology.get("storage_skip_initial_pq_codes", False) - ), - "pq_meta_path": pq["meta"], - "sidecar_manifest_path": selected_snapshot["sidecar"], - "max_node_capacity": topology["storage_max_node_capacity"], - "hash_directory_load_factor": topology["hash_directory_load_factor"], - "registered_bytes_per_mn": topology["memory_bytes_per_mn"], - } - - -def shell_script(path: Path, command: list[str], config: dict[str, object]) -> None: - topology = require_mapping(config, "topology") - content = ( - "#!/usr/bin/env bash\n" - "set -euo pipefail\n" - f"export VECTORDB_CXL_COMPUTE_NODES={','.join(topology['compute_nodes'])}\n" - f"export VECTORDB_CXL_STORAGE_NODES={','.join(topology['storage_nodes'])}\n" - f"exec {shlex.join(command)}\n" - ) - path.parent.mkdir(parents=True, exist_ok=True) - path.write_text(content, encoding="utf-8") - path.chmod(0o755) - - -def create_query_cohorts( - config: dict[str, object], - root: Path, - specs: list[RunSpec], - rows: list[dict[str, object]], - port_base: int, - compute_sha256: str, - storage_sha256: str, - inter_run_wait_seconds: float, -) -> list[dict[str, object]]: - topology = require_mapping(config, "topology") - read_qp_pool_size = int( - topology.get("read_qp_pool_size", topology["workers_per_cn"]) - ) - if read_qp_pool_size <= 0: - raise ValueError("topology.read_qp_pool_size must be positive") - grouped: dict[tuple[object, ...], list[RunSpec]] = {} - for spec in specs: - if spec.kind != "query": - continue - key = ( - spec.snapshot, - spec.num_mns, - spec.record_mode, - ) - grouped.setdefault(key, []).append(spec) - row_by_id = {str(row["run_id"]): row for row in rows} - cohorts = [] - for offset, group in enumerate(grouped.values()): - cohort_id = ( - f"{group[0].experiment.lower()}-{config['dataset_id']}-" - f"{group[0].record_mode}-q{offset + 1}" - ) - manifest_path = (root / "artifacts" / f"{cohort_id}.session.json").resolve() - sessions = [] - for spec in group: - run_root = (root / "runs" / spec.run_id).resolve() - sessions.append( - { - "run_id": spec.run_id, - "num_cns": spec.num_cns, - "num_threads": spec.workers_per_cn + 1, - "read_qp_pool_size": read_qp_pool_size, - "ef_search": spec.ef_search, - "reranking_factor": spec.reranking_factor, - "query_limit": spec.query_limit, - "progress_interval": 1000, - "compute_pq_residency": ( - "mn" - if spec.cache_variant in {"no-cache", "upper-only"} - else "cn" - ), - "compute_pq_codes_path": ( - "" - if spec.cache_variant in {"no-cache", "upper-only"} - else snapshot_pq_codes(snapshot(config, spec.snapshot), "compute") - ), - "disable_upper_cache": spec.cache_variant - in {"no-cache", "pq"}, - "compute_hosts": list(topology["compute_nodes"])[: spec.num_cns], - "stdout_path": str(run_root / "stdout.log"), - "stderr_path": str(run_root / "stderr.log"), - "result_path": str(run_root / "session_result.json"), - } - ) - row_by_id[spec.run_id]["cohort_id"] = cohort_id - manifest = { - "schema_version": 1, - "storage_lifecycle": "reuse", - "inter_session_wait_seconds": inter_run_wait_seconds, - "cohort_id": cohort_id, - "storage_key": query_storage_key(config, group[0], storage_sha256), - "result_path": str((root / "artifacts" / f"{cohort_id}.result.json").resolve()), - "storage_stdout_path": str( - (root / "logs" / f"{cohort_id}.storage.stdout.log").resolve() - ), - "storage_stderr_path": str( - (root / "logs" / f"{cohort_id}.storage.stderr.log").resolve() - ), - "sessions": sessions, - } - write_json(manifest_path, manifest) - command_spec = max( - group, key=lambda item: (item.num_cns, item.workers_per_cn) - ) - port = port_base + offset - command = common_command(config, command_spec, port) - if command_spec.record_mode in ATOMIC_RECORD_MODES: - command.append("--query-session-requires-atomics") - command.extend(["--query-session-manifest", str(manifest_path)]) - readiness = readiness_command( - config, - command_spec, - port, - compute_sha256, - storage_sha256, - ) - command_path = root / "commands" / f"{cohort_id}.sh" - shell_script(command_path, command, config) - cohorts.append( - { - "cohort_id": cohort_id, - "run_ids": [spec.run_id for spec in group], - "manifest_path": str(manifest_path), - "command": command, - "command_path": str(command_path), - "readiness_command": readiness, - "port": port, - "num_cns": command_spec.num_cns, - "num_mns": command_spec.num_mns, - } - ) - return cohorts - - -def git_text(*args: str) -> str: - result = subprocess.run( - ["git", *args], - cwd=CXL_ROOT, - text=True, - capture_output=True, - check=True, - ) - return result.stdout.strip() - - -def create_campaign( - experiment: str, - config_path: Path, - root: Path, - args: argparse.Namespace, -) -> dict[str, object]: - if (root / "campaign.json").exists(): - raise ValueError( - f"campaign already exists: {root}; use run/status or a new directory" - ) - config = load_config( - config_path, - data_root=args.data_root, - dataset_prefix=args.dataset_prefix, - selected_dataset_id=args.dataset_id, - dataset_label=args.dataset_label, - ) - specs = build_specs(experiment, config, args) - compute_sha256 = binary_sha( - args.compute_sha256, - "build/src/compute/vectordb_compute_node", - "compute", - ) - storage_sha256 = binary_sha( - args.storage_sha256, - "build/src/storage/vectordb_storage_node", - "storage", - ) - root.mkdir(parents=True, exist_ok=True) - rows: list[dict[str, object]] = [] - for index, spec in enumerate(specs): - run_root = (root / "runs" / spec.run_id).resolve() - run_root.mkdir(parents=True, exist_ok=True) - row = asdict(spec) | { - "run_root": str(run_root), - "cohort_id": "", - "status": "pending", - "port": args.port_base + 100 + index, - } - rows.append(row) - write_json(run_root / "spec.json", row) - - cohorts = create_query_cohorts( - config, - root.resolve(), - specs, - rows, - args.port_base, - compute_sha256, - storage_sha256, - args.inter_run_wait_seconds, - ) - standalone = [] - for index, spec in enumerate(item for item in specs if item.kind != "query"): - row = next(item for item in rows if item["run_id"] == spec.run_id) - port = int(row["port"]) - prepare_command: list[str] = [] - materialized_dir = (Path(str(row["run_root"])) / "materialized").resolve() - if spec.kind == "batch": - command = batch_command(config, spec, port) - else: - prepare_command = ( - m1_prepare_command(config, spec, materialized_dir) - if spec.experiment == "M1" - else e6_prepare_command(config, spec, materialized_dir) - ) - command = concurrent_command( - config, spec, port, materialized_dir / "manifest.json" - ) - readiness = readiness_command( - config, spec, port, compute_sha256, storage_sha256 - ) - command_path = root / "commands" / f"{spec.run_id}.sh" - shell_script(command_path, command, config) - if prepare_command: - shell_script( - root / "commands" / f"{spec.run_id}.prepare.sh", - prepare_command, - config, - ) - standalone.append( - { - "run_id": spec.run_id, - "kind": spec.kind, - "command": command, - "command_path": str(command_path), - "prepare_command": prepare_command, - "readiness_command": readiness, - "materialized_dir": ( - str(materialized_dir) if prepare_command else "" - ), - "runtime_contract": ( - e6_runtime_contract(config) - if spec.experiment == "E6" - else {} - ), - "materialization_contract": ( - e6_materialization_contract(config, spec) - if spec.experiment == "E6" - else {} - ), - "port": port, - "num_cns": spec.num_cns, - "num_mns": spec.num_mns, - } - ) - - campaign = { - "schema_version": 1, - "created_utc": utc_now(), - "experiment": experiment, - "dataset_id": config["dataset_id"], - "dataset_label": config["dataset_label"], - "config_path": str(config_path.resolve()), - "config_sha256": file_sha256(config_path), - "source_branch": git_text("branch", "--show-current"), - "source_commit": git_text("rev-parse", "HEAD"), - "dirty_paths": git_text("status", "--short").splitlines(), - "compute_binary_sha256": compute_sha256, - "storage_binary_sha256": storage_sha256, - "inter_run_wait_seconds": args.inter_run_wait_seconds, - "compute_nodes": require_mapping(config, "topology")["compute_nodes"], - "storage_nodes": require_mapping(config, "topology")["storage_nodes"], - "runs": rows, - "query_cohorts": cohorts, - "standalone_runs": standalone, - } - write_json(root / "campaign.json", campaign) - return campaign - - -def load_campaign(root: Path) -> dict[str, object]: - path = root / "campaign.json" - if not path.is_file(): - raise ValueError(f"campaign is not planned: {path}") - return read_json(path) - - -def campaign_env(campaign: dict[str, object]) -> dict[str, str]: - env = os.environ.copy() - if env.get("VECTORDB_EVAL_PRESERVE_SSH_AUTH_SOCK") != "1": - env.pop("SSH_AUTH_SOCK", None) - env["VECTORDB_CXL_COMPUTE_NODES"] = ",".join(campaign["compute_nodes"]) - env["VECTORDB_CXL_STORAGE_NODES"] = ",".join(campaign["storage_nodes"]) - return env - - -def run_logged( - command: list[str], - *, - stdout_path: Path, - stderr_path: Path, - env: dict[str, str], - heartbeat: Callable[[], None] | None = None, -) -> int: - stdout_path.parent.mkdir(parents=True, exist_ok=True) - stop_heartbeat = threading.Event() - heartbeat_thread: threading.Thread | None = None - if heartbeat is not None: - def pulse() -> None: - while not stop_heartbeat.wait(5.0): - heartbeat() - - heartbeat_thread = threading.Thread(target=pulse, daemon=True) - heartbeat_thread.start() - with stdout_path.open("w", encoding="utf-8") as stdout, stderr_path.open( - "w", encoding="utf-8" - ) as stderr: - try: - return subprocess.run( - command, - cwd=CXL_ROOT, - env=env, - stdout=stdout, - stderr=stderr, - check=False, - ).returncode - finally: - stop_heartbeat.set() - if heartbeat_thread is not None: - heartbeat_thread.join() - - -def run_checked( - command: list[str], - *, - env: dict[str, str], - label: str, -) -> None: - result = subprocess.run(command, cwd=CXL_ROOT, env=env, check=False) - if result.returncode != 0: - raise RuntimeError(f"{label} failed with return code {result.returncode}") - - -def kill_command(num_cns: int, num_mns: int) -> list[str]: - return [ - str(PYTHON), - str(KILL_ALL), - "--num-cns", - str(num_cns), - "--num-sns", - str(num_mns), - ] - - -def completion_path(root: Path, run_id: str) -> Path: - return root / "runs" / run_id / "completed.json" - - -def pending_run_ids( - root: Path, run_ids: Iterable[str], resume: bool -) -> list[str]: - if resume: - for run_id in run_ids: - completed_path = completion_path(root, run_id) - if completed_path.exists(): - continue - session_result_path = root / "runs" / run_id / "session_result.json" - try: - session_result = read_json(session_result_path) - except (OSError, ValueError, json.JSONDecodeError): - continue - if session_result.get("status") == "completed": - write_json( - completed_path, - { - "finished_utc": utc_now(), - "returncode": 0, - "status": "completed", - "recovered_from": "session_result.json", - }, - ) - completed = [ - run_id for run_id in run_ids if completion_path(root, run_id).exists() - ] - if completed and not resume: - raise ValueError( - "campaign has completed runs; pass --resume or use a new campaign root" - ) - return [run_id for run_id in run_ids if run_id not in completed] - - -def resume_query_manifest( - root: Path, - cohort: dict[str, object], - pending: list[str], -) -> Path: - original = read_json(Path(str(cohort["manifest_path"]))) - if pending == list(cohort["run_ids"]): - return Path(str(cohort["manifest_path"])) - attempt = 1 - while True: - path = root / "artifacts" / f"{cohort['cohort_id']}.resume{attempt}.session.json" - if not path.exists(): - break - attempt += 1 - original["cohort_id"] = f"{cohort['cohort_id']}-resume{attempt}" - original["result_path"] = str( - (root / "artifacts" / f"{cohort['cohort_id']}.resume{attempt}.result.json").resolve() - ) - original["storage_stdout_path"] = str( - (root / "logs" / f"{cohort['cohort_id']}.resume{attempt}.storage.stdout.log").resolve() - ) - original["storage_stderr_path"] = str( - (root / "logs" / f"{cohort['cohort_id']}.resume{attempt}.storage.stderr.log").resolve() - ) - original["sessions"] = [ - session - for session in original["sessions"] - if session["run_id"] in pending - ] - write_json(path, original) - return path - - -def append_compute_artifacts( - readiness: list[str], paths: Iterable[Path] -) -> list[str]: - result = list(readiness) - for path in paths: - result.extend(["--compute-artifact", str(path)]) - return result - - -def sync_generated( - campaign: dict[str, object], - source: Path, - num_cns: int, - env: dict[str, str], -) -> None: - for host in list(campaign["compute_nodes"])[:num_cns]: - subprocess.run( - ["ssh", "-n", host, "mkdir", "-p", str(source)], - check=True, - env=env, - ) - subprocess.run( - ["rsync", "-a", f"{source}/", f"{host}:{source}/"], - check=True, - env=env, - ) - - -def prepare_generated_unit( - campaign: dict[str, object], - unit: dict[str, object], - env: dict[str, str], -) -> list[str]: - readiness = list(unit["readiness_command"]) - prepare = list(unit["prepare_command"]) - if not prepare: - return readiness - run_id = str(unit["run_id"]) - materialized = Path(str(unit["materialized_dir"])) - manifest = materialized / "manifest.json" - if not manifest.exists(): - if materialized.exists() and any(materialized.iterdir()): - raise ValueError(f"partial materialization exists: {materialized}") - run_checked(prepare, env=env, label=f"{run_id} materialization") - if campaign["experiment"] == "M1": - validate_m1_materialization(materialized) - else: - validate_e6_materialization( - materialized, - dict(unit.get("runtime_contract", {})), - dict(unit.get("materialization_contract", {})), - ) - sync_generated( - campaign, - materialized, - int(unit["num_cns"]), - env, - ) - return generated_unit_readiness(unit) - - -def generated_unit_readiness(unit: dict[str, object]) -> list[str]: - readiness = list(unit["readiness_command"]) - materialized = Path(str(unit["materialized_dir"])) - manifest = materialized / "manifest.json" - return append_compute_artifacts( - readiness, - [ - manifest, - materialized / "metadata.json", - *sorted(materialized.glob("*.u32")), - ], - ) - - -def prepare_campaign(root: Path) -> None: - campaign = load_campaign(root) - env = campaign_env(campaign) - prepared = 0 - for unit in campaign["standalone_runs"]: - if not unit["prepare_command"]: - continue - prepare_generated_unit(campaign, unit, env) - prepared += 1 - print(f"prepared_generated_units={prepared}", flush=True) - - -def execute_campaign(root: Path, resume: bool) -> None: - campaign = load_campaign(root) - if campaign["experiment"] == "EX1": - verify_ex1_query_views(campaign) - env = campaign_env(campaign) - inter_run_wait_seconds = float(campaign.get("inter_run_wait_seconds", 0.0)) - initial_pending = { - str(run["run_id"]) - for run in campaign["runs"] - if pending_run_ids(root, [str(run["run_id"])], resume) - } - total = len(initial_pending) - completed_count = 0 - started_at = time.monotonic() - progress_bar = ( - tqdm( - total=total, - desc=f"{campaign['experiment']} {campaign['dataset_id']}", - unit="run", - dynamic_ncols=True, - ) - if tqdm is not None - else None - ) - - def refresh_progress(active: str) -> None: - if progress_bar is not None: - progress_bar.set_postfix_str(f"active={active}", refresh=True) - - def progress(label: str) -> None: - nonlocal completed_count - completed_count += 1 - elapsed = time.monotonic() - started_at - rate = completed_count / elapsed if elapsed > 0 else 0.0 - eta = (total - completed_count) / rate if rate > 0 else 0.0 - message = ( - f"progress={completed_count}/{total} elapsed_s={elapsed:.1f} " - f"eta_s={eta:.1f} completed_run={label}" - ) - if progress_bar is not None: - progress_bar.update(1) - progress_bar.set_postfix_str(f"completed={label}", refresh=True) - progress_bar.write(message) - else: - print(message, flush=True) - - print(f"campaign_pending_runs={total}", flush=True) - for cohort in campaign["query_cohorts"]: - pending = pending_run_ids(root, cohort["run_ids"], resume) - if not pending: - continue - manifest = resume_query_manifest(root, cohort, pending) - command = list(cohort["command"]) - command[-1] = str(manifest) - kill = kill_command(int(cohort["num_cns"]), int(cohort["num_mns"])) - refresh_progress(str(cohort["cohort_id"])) - run_checked(kill, env=env, label="pre-run cleanup") - run_checked( - list(cohort["readiness_command"]), - env=env, - label=f"{cohort['cohort_id']} readiness", - ) - reported: set[str] = set() - launched_at = time.time() - - def query_heartbeat() -> None: - refresh_progress(str(cohort["cohort_id"])) - for run_id in pending: - if run_id in reported: - continue - result_path = root / "runs" / run_id / "session_result.json" - try: - fresh = result_path.stat().st_mtime >= launched_at - completed = ( - fresh - and read_json(result_path).get("status") == "completed" - ) - except (OSError, ValueError, json.JSONDecodeError): - continue - if completed: - reported.add(run_id) - progress(run_id) - - try: - returncode = run_logged( - command, - stdout_path=root / "logs" / f"{cohort['cohort_id']}.launcher.stdout.log", - stderr_path=root / "logs" / f"{cohort['cohort_id']}.launcher.stderr.log", - env=env, - heartbeat=query_heartbeat, - ) - finally: - run_checked(kill, env=env, label="post-run cleanup") - for run_id in pending: - result_path = root / "runs" / run_id / "session_result.json" - run_completed = ( - result_path.is_file() - and read_json(result_path).get("status") == "completed" - ) - write_json( - root - / "runs" - / run_id - / ("completed.json" if run_completed else "failed.json"), - { - "finished_utc": utc_now(), - "returncode": returncode, - "status": "completed" if run_completed else "failed", - }, - ) - if run_completed and run_id not in reported: - progress(run_id) - run_checked( - list(cohort["readiness_command"]), - env=env, - label=f"{cohort['cohort_id']} post-cleanup readiness", - ) - if returncode != 0: - raise RuntimeError(f"{cohort['cohort_id']} failed: {returncode}") - if completed_count < total and inter_run_wait_seconds > 0.0: - refresh_progress(f"inter-run wait {inter_run_wait_seconds:g}s") - time.sleep(inter_run_wait_seconds) - - for unit in campaign["standalone_runs"]: - run_id = str(unit["run_id"]) - if not pending_run_ids(root, [run_id], resume): - continue - run_root = root / "runs" / run_id - readiness = prepare_generated_unit(campaign, unit, env) - kill = kill_command(int(unit["num_cns"]), int(unit["num_mns"])) - refresh_progress(run_id) - run_checked(kill, env=env, label="pre-run cleanup") - run_checked(readiness, env=env, label=f"{run_id} readiness") - started = utc_now() - try: - returncode = run_logged( - list(unit["command"]), - stdout_path=run_root / "stdout.log", - stderr_path=run_root / "stderr.log", - env=env, - heartbeat=lambda: refresh_progress(run_id), - ) - finally: - run_checked(kill, env=env, label="post-run cleanup") - write_json( - run_root / ("completed.json" if returncode == 0 else "failed.json"), - { - "started_utc": started, - "finished_utc": utc_now(), - "returncode": returncode, - "status": "completed" if returncode == 0 else "failed", - }, - ) - if returncode == 0: - progress(run_id) - run_checked(readiness, env=env, label=f"{run_id} post-cleanup readiness") - if returncode != 0: - raise RuntimeError(f"{run_id} failed: {returncode}") - if completed_count < total and inter_run_wait_seconds > 0.0: - refresh_progress(f"inter-run wait {inter_run_wait_seconds:g}s") - time.sleep(inter_run_wait_seconds) - if progress_bar is not None: - progress_bar.close() - - -def check_campaign(root: Path) -> None: - campaign = load_campaign(root) - env = campaign_env(campaign) - for cohort in campaign["query_cohorts"]: - run_checked( - list(cohort["readiness_command"]), - env=env, - label=f"{cohort['cohort_id']} readiness", - ) - for unit in campaign["standalone_runs"]: - if unit["prepare_command"]: - manifest = Path(str(unit["materialized_dir"])) / "manifest.json" - if manifest.exists(): - readiness = generated_unit_readiness(unit) - else: - readiness = list(unit["readiness_command"]) - print( - f"{unit['run_id']}: source readiness only; run prepare " - "before the final generated-artifact check" - ) - else: - readiness = list(unit["readiness_command"]) - run_checked( - readiness, - env=env, - label=f"{unit['run_id']} readiness", - ) - if campaign["experiment"] == "EX1": - verify_ex1_query_views(campaign) - - -def verify_ex1_query_views(campaign: dict[str, object]) -> None: - config_path = Path(str(campaign["config_path"])) - if file_sha256(config_path) != campaign["config_sha256"]: - raise ValueError("EX1 configuration changed after planning") - config = load_config(config_path) - query = require_mapping(config, "query") - manifest = str(query["manifest"]) - verification = """\ -import hashlib,json,pathlib,sys -p=pathlib.Path(sys.argv[1]) -m=json.loads(p.read_text()) -def h(path): - d=hashlib.sha256() - with path.open('rb') as f: - for b in iter(lambda:f.read(1048576),b''): d.update(b) - return d.hexdigest() -assert h(pathlib.Path(m['query_source']))==m['query_source_sha256'] -assert h(pathlib.Path(m['groundtruth_source']))==m['groundtruth_source_sha256'] -for name,meta in m['outputs'].items(): - q=p.parent/name - assert q.stat().st_size==meta['bytes'] - assert h(q)==meta['sha256'] -print(json.dumps(m['outputs'],sort_keys=True)) -""" - identities = {} - for host in campaign["compute_nodes"]: - command = ( - f"python3 -c {shlex.quote(verification)} " - f"{shlex.quote(manifest)}" - ) - result = subprocess.run( - [ - "ssh", - "-o", - "BatchMode=yes", - "-o", - "ConnectTimeout=10", - str(host), - command, - ], - text=True, - capture_output=True, - check=False, - ) - if result.returncode != 0: - raise RuntimeError( - f"EX1 query manifest verification failed on {host}: " - f"{result.stderr.strip()}" - ) - identities[str(host)] = json.loads(result.stdout) - serialized = {json.dumps(value, sort_keys=True) for value in identities.values()} - if len(serialized) != 1: - raise ValueError("EX1 query-view hashes differ across compute nodes") - - -def status(root: Path) -> int: - campaign = load_campaign(root) - rows = [] - for row in campaign["runs"]: - run_id = str(row["run_id"]) - state = "pending" - if completion_path(root, run_id).exists(): - state = "completed" - elif (root / "runs" / run_id / "failed.json").exists(): - state = "failed" - rows.append({"run_id": run_id, "status": state}) - print(json.dumps(rows, indent=2)) - return 0 if all(row["status"] == "completed" for row in rows) else 1 - - -def parser_for(experiment: str) -> argparse.ArgumentParser: - default_config = ( - Path(__file__).resolve().parent / "configs/bigann100.json" - if experiment == "E9" - else DEFAULT_CONFIG - ) - parser = argparse.ArgumentParser( - description=( - f"Plan or run {experiment}; defaults come from " - f"{'BIGANN-100M' if experiment == 'E9' else 'DEEP-100M'}." - ), - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - ) - parser.add_argument( - "action", - choices=("plan", "prepare", "check", "run", "collect", "status", "plot"), - ) - parser.add_argument("--config", type=Path, default=default_config) - parser.add_argument( - "--data-root", - type=Path, - help="Override the {data_root} path variable", - ) - parser.add_argument( - "--dataset-prefix", - help="Override the shared dataset package-name prefix", - ) - parser.add_argument("--dataset-id", help="Short ID used in run IDs") - parser.add_argument("--dataset-label", help="Dataset name used in figures") - parser.add_argument("--campaign-root", type=Path) - parser.add_argument("--repetitions", type=int) - parser.add_argument( - "--repetition-start", - type=int, - default=1, - help="First repetition number, useful for phased campaigns", - ) - parser.add_argument("--ef-search", type=int, action="append") - parser.add_argument("--num-cns", type=int, action="append") - parser.add_argument("--num-mns", type=int) - parser.add_argument("--workers-per-cn", type=int, action="append") - parser.add_argument("--merge-workers", type=int, help="E6 merge-only workers") - parser.add_argument("--query-limit", type=int) - parser.add_argument("--checkpoint-query-limit", type=int) - parser.add_argument( - "--batch-count", - type=int, - help=( - "E6 evaluation-window count; each window contains the configured " - "number of continuous 1M source segments" - if experiment == "E6" - else "Batch count for this experiment" - ), - ) - parser.add_argument("--merge-every-batches", type=int) - parser.add_argument( - "--workload", - choices=("query", "insert", "delete", "replacement"), - action="append", - ) - parser.add_argument( - "--record-mode", choices=RECORD_MODES, action="append" - ) - parser.add_argument("--mutation-snapshot", choices=("true", "false")) - parser.add_argument( - "--cache-variant", - choices=E9_CACHE_VARIANTS, - action="append", - help="Select one or more E7/E9 cache variants", - ) - parser.add_argument("--port-base", type=int, default=17000) - parser.add_argument("--compute-sha256") - parser.add_argument("--storage-sha256") - parser.add_argument( - "--inter-run-wait-seconds", - type=nonnegative_float, - default=0.0, - help=( - "Wait between logical runs; query cohorts keep MNs resident while " - "waiting between sessions" - ), - ) - parser.add_argument("--resume", action="store_true") - parser.add_argument( - "--approved-run-plan", - action="store_true", - help="Required for EX1 remote prepare/run after plan approval", - ) - parser.add_argument("--results", type=Path, help="Normalized CSV for plot") - parser.add_argument("--output", type=Path, help="Figure output path") - return parser - - -def main(experiment: str) -> int: - parser = parser_for(experiment) - args = parser.parse_args() - try: - config = load_config( - args.config, - data_root=args.data_root, - dataset_prefix=args.dataset_prefix, - selected_dataset_id=args.dataset_id, - dataset_label=args.dataset_label, - ) - root = ( - args.campaign_root - or Path( - f"/tmp/vectordb-evaluation/" - f"{experiment.lower()}-{config['dataset_id']}" - ) - ).resolve() - if args.action == "plan": - campaign = create_campaign(experiment, args.config, root, args) - print( - f"planned_runs={len(campaign['runs'])} " - f"campaign={root / 'campaign.json'}" - ) - return 0 - if args.action == "check": - check_campaign(root) - return 0 - if args.action == "prepare": - if experiment == "EX1" and not args.approved_run_plan: - raise ValueError("EX1 prepare requires --approved-run-plan") - prepare_campaign(root) - return 0 - if args.action == "run": - if experiment == "EX1" and not args.approved_run_plan: - raise ValueError("EX1 run requires --approved-run-plan") - execute_campaign(root, args.resume) - from collect import collect_campaign - - paths = collect_campaign(root) - print("collected=" + ",".join(str(path) for path in paths)) - return status(root) - if args.action == "collect": - from collect import collect_campaign - - paths = collect_campaign(root) - print("collected=" + ",".join(str(path) for path in paths)) - return 0 - if args.action == "status": - return status(root) - if args.results is None: - parser.error("plot requires --results") - from plot import plot_results - - output = args.output or root / "figures" / f"{experiment.lower()}.png" - plot_results(experiment, args.results, output) - print(output) - return 0 - except ( - OSError, - RuntimeError, - subprocess.CalledProcessError, - ValueError, - ) as exc: - print(exc, file=sys.stderr) - return 2 diff --git a/spatial-workloads/v1/tools/generator/spatial_common.py b/spatial-workloads/v1/tools/generator/spatial_common.py deleted file mode 100644 index 70372369653dda43f4ebe7c1eec4ea0b858d9ea4..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/generator/spatial_common.py +++ /dev/null @@ -1,109 +0,0 @@ -"""Binary formats and reproducible metadata for spatial workload preparation.""" - -from __future__ import annotations - -import hashlib -import json -import os -import struct -from pathlib import Path - -import numpy as np - - -def read_json(path): - return json.loads(Path(path).read_text(encoding="utf-8")) - - -def write_json(path, value): - path = Path(path) - path.parent.mkdir(parents=True, exist_ok=True) - temporary = path.with_name(path.name + ".tmp") - temporary.write_text(json.dumps(value, indent=2, sort_keys=True) + "\n", encoding="utf-8") - os.replace(temporary, path) - - -def digest_json(value): - return hashlib.sha256(json.dumps(value, sort_keys=True, separators=(",", ":")).encode()).hexdigest() - - -def sha256(path): - h = hashlib.sha256() - with Path(path).open("rb") as stream: - for block in iter(lambda: stream.read(8 * 1024 * 1024), b""): - h.update(block) - return h.hexdigest() - - -def file_identity(path): - """Record trusted package checksums plus a cheap, independently read fingerprint.""" - path = Path(path) - size = path.stat().st_size - h = hashlib.sha256(struct.pack(" tuple[int, int]: - with path.open("rb") as handle: - header = handle.read(8) - if len(header) != 8: - raise ValueError(f"truncated matrix header: {path}") - rows, columns = struct.unpack(" np.memmap: - rows, dimensions = _matrix_header(path) - element_type = np.dtype(dtype).newbyteorder("<") - if element_type.kind not in "fiu" or element_type.itemsize > 8: - raise ValueError(f"unsupported vector dtype: {dtype}") - expected = 8 + rows * dimensions * element_type.itemsize - if path.stat().st_size != expected: - raise ValueError(f"vector payload size does not match header/dtype: {path}") - return np.memmap( - path, mode="r", dtype=element_type, offset=8, shape=(rows, dimensions) - ) - - -def _source_ids(path: Path, universe_size: int) -> np.memmap: - rows, depth = _matrix_header(path) - ids_bytes = rows * depth * 4 - if path.stat().st_size not in (8 + ids_bytes, 8 + 2 * ids_bytes): - raise ValueError(f"GT must contain u32 IDs and optional f32 distances: {path}") - ids = np.memmap(path, mode="r", dtype="= universe_size): - raise ValueError("source GT contains an ID outside the source universe") - ordered = np.sort(chunk, axis=1) - if depth > 1 and np.any(ordered[:, 1:] == ordered[:, :-1]): - raise ValueError("source GT contains duplicate IDs within a query row") - return ids - - -def _select_topk( - scores: np.ndarray, external_ids: np.ndarray, k: int -) -> tuple[np.ndarray, np.ndarray]: - """Select smallest scores, breaking every boundary tie by external ID.""" - count = min(k, scores.size) - if scores.size > count: - provisional = np.argpartition(scores, count - 1)[:count] - cutoff = np.max(scores[provisional]) - smaller = np.flatnonzero(scores < cutoff) - equal = np.flatnonzero(scores == cutoff) - remaining = count - smaller.size - if equal.size > remaining: - tie_order = np.argpartition(external_ids[equal], remaining - 1) - equal = equal[tie_order[:remaining]] - chosen = np.concatenate((smaller, equal)) - else: - chosen = np.arange(scores.size) - order = np.lexsort((external_ids[chosen], scores[chosen])) - chosen = chosen[order] - return scores[chosen], external_ids[chosen] - - -def _exact_fallback( - base: np.ndarray, - queries: np.ndarray, - live: np.ndarray, - base_external_ids: np.ndarray | None, - *, - k: int, - metric: str, - block_rows: int, - query_batch_size: int, - progress: Callable[[dict], None] | None, -) -> np.ndarray: - """Exhaustive scan; L2 uses direct differences to avoid cancellation.""" - query_count = queries.shape[0] - best_scores = [np.empty(0, dtype=np.float64) for _ in range(query_count)] - best_ids = [np.empty(0, dtype=np.uint32) for _ in range(query_count)] - # A permuted base must still represent every external source ID once. - seen = np.zeros(live.size, dtype=np.bool_) if base_external_ids is not None else None - for begin in range(0, base.shape[0], block_rows): - end = min(begin + block_rows, base.shape[0]) - ids = ( - np.arange(begin, end, dtype=np.uint32) - if base_external_ids is None - else np.asarray(base_external_ids[begin:end]) - ) - if seen is not None: - if np.any(ids < 0) or np.any(ids >= live.size): - raise ValueError("base_external_ids contains an out-of-range ID") - if np.unique(ids).size != ids.size or np.any(seen[ids]): - raise ValueError("base_external_ids must be a permutation of source IDs") - seen[ids] = True - keep = live[ids] - ids = ids[keep].astype(np.uint32, copy=False) - if not ids.size: - continue - vectors = np.asarray(base[begin:end][keep], dtype=np.float64) - if not np.all(np.isfinite(vectors)): - raise ValueError("live base vectors contain non-finite values") - for query_begin in range(0, query_count, query_batch_size): - query_end = min(query_begin + query_batch_size, query_count) - if metric == "ip": - # Negate inner products so both metrics select smallest scores. - scores_batch = -(queries[query_begin:query_end] @ vectors.T) - if not np.all(np.isfinite(scores_batch)): - raise ValueError("inner-product scores overflowed") - for index in range(query_begin, query_end): - if metric == "l2": - differences = vectors - queries[index] - scores = np.einsum("ij,ij->i", differences, differences) - if not np.all(np.isfinite(scores)): - raise ValueError("squared-L2 scores overflowed") - else: - scores = scores_batch[index - query_begin] - local_scores, local_ids = _select_topk(scores, ids, k) - best_scores[index], best_ids[index] = _select_topk( - np.concatenate((best_scores[index], local_scores)), - np.concatenate((best_ids[index], local_ids)), - k, - ) - if progress is not None: - progress({"event": "exact_gt_scan", "source_rows_scanned": end, - "source_rows": base.shape[0], "fallback_queries": query_count}) - if any(ids.size != k for ids in best_ids): - raise ValueError("exact fallback found fewer than k live vectors") - return np.stack(best_ids) - - -def write_checkpoint_groundtruth( - *, - source_groundtruth_path: str | Path, - query_path: str | Path, - base_path: str | Path, - output_path: str | Path, - live_mask: np.ndarray, - k: int = 10, - metric: str = "l2", - base_dtype: str | np.dtype = "float32", - query_dtype: str | np.dtype = "float32", - base_external_ids: np.ndarray | None = None, - block_rows: int = 250_000, - query_batch_size: int = 32, - threads: int = 32, - progress: Callable[[dict], None] | None = None, -) -> dict: - """Write IDs-only checkpoint GT and return JSON-serializable audit stats. - -``live_mask`` is indexed by original source ID. The base contains the complete -source universe in original row order, or ``base_external_ids`` supplies the -per-row mapping (for example update_order.u32 for base_permuted). Fallback -uses float64 arithmetic without approximate indexes. The source GT ordering -is trusted; optional source distances are not reinterpreted or recomputed. -The thread limit applies to BLAS if threadpoolctl is installed; direct L2 -differences intentionally avoid the cancellation of norm/dot-product L2. -""" - if metric not in ("l2", "ip"): - raise ValueError("metric must be l2 or ip") - if min(k, block_rows, query_batch_size, threads) <= 0: - raise ValueError("k, block_rows, query_batch_size, and threads must be positive") - live = np.asarray(live_mask) - if live.ndim != 1 or live.dtype != np.bool_ or live.size == 0: - raise ValueError("live_mask must be a nonempty one-dimensional boolean array") - if live.size > np.iinfo(np.uint32).max + 1: - raise ValueError("source universe exceeds uint32 ID space") - live_count = int(np.count_nonzero(live)) - if live_count < k: - raise ValueError("checkpoint contains fewer than k live vectors") - base = _vector_matrix(Path(base_path), base_dtype) - query_matrix = _vector_matrix(Path(query_path), query_dtype) - source = _source_ids(Path(source_groundtruth_path), live.size) - if base.shape[0] != live.size: - raise ValueError("base must contain the complete source universe") - if query_matrix.shape[1] != base.shape[1] or query_matrix.shape[0] != source.shape[0]: - raise ValueError("query dimensions/count do not match base and source GT") - queries = np.asarray(query_matrix, dtype=np.float64) - if not np.all(np.isfinite(queries)): - raise ValueError("query vectors contain non-finite values") - if base_external_ids is not None: - base_external_ids = np.asarray(base_external_ids) - if (base_external_ids.ndim != 1 or base_external_ids.size != live.size - or base_external_ids.dtype.kind not in "iu"): - raise ValueError("base_external_ids must have one integer ID per source row") - - result = np.empty((source.shape[0], k), dtype="= k: - result[query_index] = surviving[:k] - else: - missing.append(query_index) - if missing: - try: - from threadpoolctl import threadpool_limits - except ImportError: - limits = nullcontext() - else: - limits = threadpool_limits(limits=threads) - with limits: - result[missing] = _exact_fallback( - base, queries[missing], live, base_external_ids, k=k, metric=metric, - block_rows=block_rows, query_batch_size=query_batch_size, progress=progress, - ) - - output = Path(output_path) - inputs = [Path(source_groundtruth_path), Path(query_path), Path(base_path)] - if any(output.resolve() == path.resolve() for path in inputs): - raise ValueError("output_path must not overwrite an input artifact") - output.parent.mkdir(parents=True, exist_ok=True) - temporary_path = None - try: - with tempfile.NamedTemporaryFile(dir=output.parent, prefix=output.name + ".", - suffix=".tmp", delete=False) as handle: - temporary_path = Path(handle.name) - handle.write(struct.pack("= 2**32: - raise ValueError("v1 requires source IDs to fit uint32") - clusters = int(parameters["clusters"]) - sample_count = min(int(parameters["training_rows"]), len(base)) - if not 2 <= clusters <= sample_count or threads < 1 or chunk_rows < 1: - raise ValueError("Invalid cluster/sample/thread/chunk counts") - partition_metric = parameters.get("metric", "l2") - if partition_metric not in ("l2", "cosine"): - raise ValueError("Partition metric must be l2 or cosine") - inputs = {"base": file_identity(base_path), "queries": file_identity(query_path)} - signature_inputs = {"parameters": parameters, "source": inputs, "dtype": source["dtype"]} - if source.get("query_dtype", source["dtype"]) != source["dtype"]: - signature_inputs["query_dtype"] = source["query_dtype"] - signature = digest_json(signature_inputs) - manifest_path = output / "partition.json" - if manifest_path.exists(): - manifest = read_json(manifest_path) - if manifest["signature"] != signature: - raise ValueError("Existing partition uses different source/parameters; choose a new output directory") - for rel, identity in manifest["files"].items(): - if (output / rel).stat().st_size != identity["bytes"] or sha256(output / rel) != identity["sha256"]: - raise ValueError(f"Corrupted existing partition artifact: {rel}") - return manifest - output.mkdir(parents=True, exist_ok=True) - faiss.omp_set_num_threads(threads) - rng = np.random.default_rng(parameters["seed"]) - sample_ids = np.sort(rng.choice(len(base), sample_count, replace=False)).astype("= clusters): - raise ValueError("Clustering produced invalid source assignments") - labels = labels[:, 0].astype("= clusters): - raise ValueError("Clustering produced invalid query assignments") - write_u32(output / "query_assignments.u32", query_labels[:, 0]) - manifest = { - "schema": "spatial-partition.v1", "signature": signature, - "parameters": parameters, "source": inputs, "source_rows": len(base), - "dimension": base.shape[1], "query_rows": len(queries), - "assignment_order": "original source vector ID; not HNSW internal ID or update_order row", - "counts": counts.tolist(), - "query_counts": np.bincount(query_labels[:, 0], minlength=clusters).tolist(), - "software": {"numpy": np.__version__, "faiss": faiss.__version__, "threads": threads}, - "elapsed_seconds": round(time.monotonic() - start, 3), - "files": {}, - } - for name in ("centroids.fbin", "training_source_ids.u32", "assignments.u32", "query_assignments.u32"): - path = output / name - manifest["files"][name] = {"bytes": path.stat().st_size, "sha256": sha256(path)} - write_json(manifest_path, manifest) - return manifest - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("--config", required=True, type=Path) - parser.add_argument("--static-root", required=True, type=Path) - parser.add_argument("--output", required=True, type=Path) - parser.add_argument("--threads", type=int, default=16) - parser.add_argument("--chunk-rows", type=int, default=250000) - args = parser.parse_args() - prepare_partition(read_json(args.config), args.static_root, args.output, args.threads, args.chunk_rows) diff --git a/spatial-workloads/v1/tools/generator/spatial_workload.py b/spatial-workloads/v1/tools/generator/spatial_workload.py deleted file mode 100644 index 3c55b228c3efa369d5bf4c8fcbe2d568d3699e84..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/generator/spatial_workload.py +++ /dev/null @@ -1,683 +0,0 @@ -#!/usr/bin/env python3 -"""Generate fixed spatial hotspots using existing static and dynamic ANN datasets.""" - -from __future__ import annotations - -import argparse -import hashlib -import math -import os -from pathlib import Path - -import numpy as np - -from spatial_common import (digest_json, file_identity, matrix, read_json, safe_child, - seeded_rng, sha256, write_json, write_matrix, write_u32) -from spatial_groundtruth import write_checkpoint_groundtruth -from spatial_partition import prepare_partition - - -class Dataset: - def __init__(self, config, static_root, update_root, partition_root): - self.config = config - self.source = config["source"] - self.static = Path(static_root) - self.update = Path(update_root) - self.partition = Path(partition_root) - self.partition_info = read_json(self.partition / "partition.json") - self.base = matrix(self.static / self.source["base"], self.source["dtype"]) - self.queries = matrix(self.static / self.source["queries"], self.source.get("query_dtype", self.source["dtype"])) - self.n, self.dim = self.base.shape - self.initial_count = int(self.source["initial_count"]) - if self.n != self.source["base_count"] or not 0 < self.initial_count < self.n: - raise ValueError("Invalid base/initial source counts") - if self.partition_info["source_rows"] != self.n or self.partition_info["query_rows"] != len(self.queries): - raise ValueError("Partition source/query row count mismatch") - if self.partition_info["parameters"] != config["partition"]: - raise ValueError("Partition parameters differ from requested configuration") - for key, path in (("base", self.static / self.source["base"]), ("queries", self.static / self.source["queries"])): - identity = file_identity(path) - expected = self.partition_info["source"][key] - if (identity["bytes"], identity["sample_sha256"]) != (expected["bytes"], expected["sample_sha256"]): - raise ValueError(f"Partition was generated from different {key}") - signature_inputs = {"parameters": config["partition"], "source": self.partition_info["source"], - "dtype": self.source["dtype"]} - if self.source.get("query_dtype", self.source["dtype"]) != self.source["dtype"]: - signature_inputs["query_dtype"] = self.source["query_dtype"] - if digest_json(signature_inputs) != self.partition_info["signature"]: - raise ValueError("Partition dtype semantics/signature mismatch") - for name, expected in self.partition_info["files"].items(): - path = safe_child(self.partition, name) - if path.stat().st_size != expected["bytes"] or sha256(path) != expected["sha256"]: - raise ValueError(f"Corrupted partition file: {name}") - self.assignments = np.memmap(self.partition / "assignments.u32", dtype="= self.n) or seen[ids].any() or len(np.unique(ids)) != len(ids): - raise ValueError("update_order is not a permutation of original source IDs") - seen[ids] = True - if not seen.all(): - raise ValueError("update_order omits source IDs") - self.initial_live = np.zeros(self.n, dtype=bool) - self.initial_live[self.order[:self.initial_count]] = True - self.inverse_order = np.empty(self.n, dtype="= len(counts): - raise ValueError("Invalid explicit hotspot cluster IDs") - root = selected[0] - else: - mass = float(parameters["target_mass"]) - if not 0 < mass < 1: - raise ValueError("Hotspot target_mass must be between 0 and 1") - rng = seeded_rng(int(parameters["seed"]), "hotspot-root") - root = int(rng.choice(np.flatnonzero(counts))) - distances = np.sum((centroids.astype(np.float64) - centroids[root]) ** 2, axis=1) - nearest = np.lexsort((np.arange(len(counts)), distances)) - selected, total = [], 0 - for label in nearest: - if not counts[label]: - continue - selected.append(int(label)) - total += int(counts[label]) - if total >= math.ceil(mass * dataset.n): - break - flags = np.zeros(dataset.clusters, dtype=bool) - flags[selected] = True - if np.any(dataset.assignments >= dataset.clusters) or np.any(dataset.query_assignments >= dataset.clusters): - raise ValueError("Invalid cluster assignment") - hot = flags[dataset.assignments] - query_hot = flags[dataset.query_assignments] - actual_counts = np.bincount(dataset.assignments, minlength=dataset.clusters) - if not np.array_equal(actual_counts, counts): - raise ValueError("Partition counts disagree with actual assignments") - info = { - "scope": "one fixed hotspot for the entire run, shared by all CNs", - "root_cluster": root, "clusters": selected, - "target_mass": parameters.get("target_mass"), - "actual_mass": float(hot.mean()), "source_vectors": int(hot.sum()), - "initial_live_vectors": int(np.count_nonzero(hot & dataset.initial_live)), - "fresh_vectors": int(np.count_nonzero(hot & ~dataset.initial_live)), - "query_vectors": int(query_hot.sum()), - } - return info, hot, query_hot - - -def quota(count, fraction): - if fraction is None: - return None - if not 0 <= float(fraction) <= 1: - raise ValueError("Hot operation fraction must be in [0,1]") - return int(math.floor(count * float(fraction) + 0.5)) - - -def profile_plan(dataset, profile, hotspot, hot, query_hot): - kind = profile["kind"] - if kind not in ("query", "insert", "delete", "mixed"): - raise ValueError(f"Unknown profile kind: {kind}") - for key in ("inserts", "deletes", "queries", "query_rows"): - if int(profile[key]) != profile[key] or profile[key] < 0: - raise ValueError(f"Invalid {key}") - if not profile["query_rows"] or not profile["queries"]: - raise ValueError("Query count and stored query rows must be positive") - inserts, deletes = profile["inserts"], profile["deletes"] - if ((kind == "query" and (inserts or deletes)) or - (kind == "insert" and (not inserts or deletes)) or - (kind == "delete" and (inserts or not deletes)) or - (kind == "mixed" and (not inserts or inserts != deletes))): - raise ValueError("Profile kind and operation counts disagree") - if inserts and profile["initial_state"] != "initial-80m": - raise ValueError("Fresh inserts require the initial update snapshot") - live = dataset.live(profile["initial_state"]) - capacities = {} - for name, count, eligible in (("insert", inserts, ~live), ("delete", deletes, live), ("query", profile["query_rows"], None)): - mask = query_hot if name == "query" else hot - total = len(mask) if eligible is None else int(eligible.sum()) - hot_count = int(mask.sum()) if eligible is None else int(np.count_nonzero(mask & eligible)) - required = quota(count, profile.get(f"{name}_hot_fraction")) - if name != "query": - if count > total or (required is not None and (required > hot_count or count - required > total - hot_count)): - raise ValueError(f"{profile['id']}: insufficient {name} pool; no spill or ID reuse is permitted") - elif required is not None and ((required and not hot_count) or (count - required and total == hot_count)): - raise ValueError("Requested query region has no official queries") - capacities[name] = {"eligible": total, "hot_eligible": hot_count, "cold_eligible": total - hot_count, - "requested": count, "hot_quota": required} - batch_size = int(profile.get("batch_size", 0)) - if batch_size != profile.get("batch_size", 0): - raise ValueError("batch_size must be an integer") - if kind != "query" and (batch_size < 1 or max(inserts, deletes) % batch_size): - raise ValueError("Updates must consist of complete, equal-size batches") - if kind == "mixed" and profile["queries"] != 36 * inserts: - raise ValueError("v1 mixed profiles use the existing 36:1:1 concurrent ratio") - return {"profile": profile, "hotspot": hotspot, "capacities": capacities, - "batch_count": max(inserts, deletes) // batch_size if batch_size else 0, - "initial_live_count": int(live.sum()), "final_live_count": int(live.sum()) + inserts - deletes} - - -def sample_ids(eligible, hot, count, fraction, rng): - if not count: - return np.empty(0, dtype=" len(pool): - raise ValueError("Insufficient eligible pool") - pieces.append(rng.choice(pool, requested, replace=False)) - selected = np.concatenate(pieces).astype("= dataset.n) or len(np.unique(ids)) != len(ids): - raise ValueError(f"Invalid or repeated {name} source IDs") - if (name == "insert" and live[ids].any()) or (name == "delete" and not live[ids].all()): - raise ValueError(f"Illegal {name} lifecycle") - expected_hot = quota(count, profile.get(f"{name}_hot_fraction")) - if expected_hot is not None and int(hot[ids].sum()) != expected_hot: - raise ValueError(f"Incorrect {name} hotspot quota") - streams[name] = ids - if len(streams["insert"]): - refs = np.fromfile(root / "streams/insert_refs.u32", dtype="= len(dataset.queries)): - raise ValueError("Invalid query references") - expected_hot = quota(len(query_refs), profile.get("query_hot_fraction")) - if expected_hot is not None and int(query_hot[query_refs].sum()) != expected_hot: - raise ValueError("Incorrect query hotspot quota") - runtime_queries = matrix(safe_child(root, bindings["query_path"]), dataset.source.get("query_dtype", dataset.source["dtype"])) - if runtime_queries.shape != (len(query_refs), dataset.dim): - raise ValueError("Runtime query matrix shape mismatch") - for offset in range(0, len(query_refs), 10000): - if not np.array_equal(runtime_queries[offset:offset + 10000], dataset.queries[query_refs[offset:offset + 10000]]): - raise ValueError("Runtime queries do not match query_refs") - source_gt = matrix(dataset.static / dataset.source["groundtruth"], "uint32", allow_distances=True) - k = dataset.config["top_k"] - trace_root = root / "traces" / profile["id"] - checkpoint_results = [] - for b in range(plan["batch_count"] + 1): - if b: - batch = read_json(trace_root / f"batches/batch_{b:04d}.json") - size = profile["batch_size"] - offset = (b - 1) * size - expected_ops = [] - for name in ("delete", "insert"): - if len(streams[name]): - op = {"type": name, "count": size, - "external_ids": descriptor(f"{name}_ids.u32", offset, size)} - if name == "insert": - op["vector_refs"] = descriptor("insert_refs.u32", offset, size) - expected_ops.append(op) - live[streams[name][offset:offset + size]] = name == "insert" - if batch["operations"] != expected_ops or batch["checkpoint"]["live_count"] != int(live.sum()): - raise ValueError("Batch descriptors/checkpoint live count disagree with selected streams") - runtime_gt = matrix(safe_child(trace_root, batch["checkpoint"]["groundtruth"]), "uint32") - else: - runtime_gt = matrix(safe_child(root, bindings["initial_groundtruth"]), "uint32") - if runtime_gt.shape != (len(query_refs), k): - raise ValueError("Runtime GT shape does not match query rows/top-k") - expected = np.empty((len(dataset.queries), k), dtype="= k: - expected[q] = survivors[:k] - else: - insufficient.append(q) - if insufficient: - # Recompute exhausted prefixes, never trust a previous invalid/padded GT. - temporary = output_root / "cache/validation-fallback.bin" - write_checkpoint_groundtruth( - source_groundtruth_path=dataset.static / dataset.source["groundtruth"], - query_path=dataset.static / dataset.source["queries"], - base_path=dataset.static / dataset.source["base"], output_path=temporary, - live_mask=live, k=k, metric=dataset.source["metric"], - base_dtype=dataset.source["dtype"], query_dtype=dataset.source.get("query_dtype", dataset.source["dtype"]), - ) - expected = matrix(temporary, "uint32") - for offset in range(0, len(query_refs), 10000): - if not np.array_equal(runtime_gt[offset:offset + 10000], expected[query_refs[offset:offset + 10000]]): - raise ValueError(f"Checkpoint {b} GT is wrong for its live set or query order") - checkpoint_results.append({"batch_index": b, "live_count": int(live.sum()), - "queries_verified": len(query_refs), "exact_fallback_queries": len(insufficient)}) - result = { - "schema": "spatial-workload-validation.v1", "status": "passed", "profile": profile["id"], - "checks": {"id_lifecycle": True, "vector_refs": True, "insert_payloads": verify_vectors, - "query_payloads": True, "hot_quotas": True, "exact_groundtruth": True}, - "hotspot": current_hotspot, "checkpoints": checkpoint_results, - "operations": {}, - "query_count_scope": "stored query rows; logical runtime executions can include a partial cycle", - "logical_query_count": profile["queries"], - } - for name, ids in (("insert", streams["insert"]), ("delete", streams["delete"]), ("query", query_refs)): - assignments = dataset.query_assignments if name == "query" else dataset.assignments - mask = query_hot if name == "query" else hot - result["operations"][name] = { - "count": len(ids), "unique": len(np.unique(ids)), - "hot_count": int(mask[ids].sum()), - "hot_fraction": float(mask[ids].mean()) if len(ids) else None, - "cluster_counts": np.bincount(assignments[ids], minlength=dataset.clusters).tolist(), - } - write_json(root / "validation.json", result) - return result - - -def seal_catalog(output_root, catalog): - """Seal portable generated files; runtime configs/logs stay outside this tree.""" - root = Path(output_root) - write_json(root / "catalog.json", catalog) - names = sorted(path for path in root.rglob("*") if path.is_file() - and path.name != "checksums.sha256" and not path.name.endswith((".tmp", ".log"))) - lines = [f"{sha256(path)} {path.relative_to(root).as_posix()}" for path in names] - (root / "checksums.sha256").write_text("\n".join(lines) + "\n") - return len(names) - - -def retained_catalog_profiles(output_root, config, dataset, hotspot, catalog_context, - selected_ids, hot, query_hot): - """Keep completed instances when a CLI call selects only part of a catalog.""" - output_root = Path(output_root) - config_path = output_root / "generation-spec.json" - if config_path.exists() and read_json(config_path) != config: - raise ValueError("Existing catalog uses a different full config; choose a new output/catalog") - catalog_path = output_root / "catalog.json" - if catalog_path.exists(): - if not config_path.exists(): - raise ValueError("Existing catalog has no full generation spec; choose a new output/catalog") - previous = read_json(catalog_path) - if any(previous.get(key) != value for key, value in catalog_context.items()): - raise ValueError("Existing catalog source/partition/hotspot differs; choose a new output/catalog") - sealed = {} - checksum_path = output_root / "checksums.sha256" - if checksum_path.exists() and len(selected_ids) < len(config["profiles"]): - for line in checksum_path.read_text().splitlines(): - value, separator, name = line.partition(" ") - if (not separator or len(value) != 64 or - any(c not in "0123456789abcdef" for c in value) or name in sealed): - raise ValueError("Invalid previous catalog checksum manifest") - safe_child(output_root, name) - sealed[name] = value - results = {} - for profile in config["profiles"]: - # Selected profiles will be regenerated/revalidated by this invocation. - if profile["id"] in selected_ids: - continue - root = output_root / "workloads" / profile["id"] - if not all((root / name).is_file() for name in ("spec.json", "profile.json", "validation.json")): - continue - expected_spec = {"schema": "spatial-workload-instance.v1", "profile": profile, - "hotspot": hotspot, "partition_signature": dataset.partition_info["signature"], - "sampling_seed": config["sampling_seed"], "source": config["source"], - "source_identities": dataset.source_identities, "top_k": config["top_k"]} - info, validation = read_json(root / "profile.json"), read_json(root / "validation.json") - if (read_json(root / "spec.json") != expected_spec or - info.get("spec_sha256") != digest_json(expected_spec) or - info.get("id") != profile["id"] or - validation.get("status") != "passed" or validation.get("profile") != profile["id"]): - continue - prefix = f"workloads/{profile['id']}/" - expected_files = {name: value for name, value in sealed.items() if name.startswith(prefix)} - if expected_files: - actual_files = {str(path.relative_to(output_root)) for path in root.rglob("*") - if path.is_file() and path.name != "checksums.sha256" - and not path.name.endswith((".tmp", ".log"))} - if actual_files != set(expected_files): - raise ValueError(f"Retained profile file inventory differs from its seal: {profile['id']}") - for name, expected in expected_files.items(): - path = safe_child(root, name[len(prefix):]) - if sha256(path) != expected: - raise ValueError(f"Retained profile checksum mismatch: {name}; validate or regenerate it explicitly") - else: - # An interrupted run may have completed this profile before sealing. - # A passed marker alone does not establish integrity of its payloads. - print(f"Revalidating unsealed retained profile: {profile['id']}", flush=True) - validate_profile(dataset, root, hot, query_hot, output_root) - results[profile["id"]] = {"id": profile["id"], "kind": profile["kind"], - "path": str((root / "profile.json").relative_to(output_root)), - "validation": "passed", "control": profile.get("control")} - return results - - -def main(): - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("command", choices=("partition", "plan", "generate", "validate")) - parser.add_argument("--config", type=Path, required=True) - parser.add_argument("--static-root", type=Path, required=True) - parser.add_argument("--update-root", type=Path) - parser.add_argument("--output", type=Path, required=True, help="Catalog root outside the Git repository") - parser.add_argument("--partition-id", default="k128-seed42") - parser.add_argument("--threads", type=int, default=16) - parser.add_argument("--chunk-rows", type=int, default=250000) - parser.add_argument("--profile", action="append", help="Select named profiles; default all") - args = parser.parse_args() - config = read_json(args.config) - if config.get("schema") != "spatial-workload-spec.v1": - raise ValueError("Unsupported spatial workload configuration schema") - partition_root = safe_child(args.output / "partitions", args.partition_id) - if args.command == "partition": - prepare_partition(config, args.static_root, partition_root, args.threads, args.chunk_rows) - return - if args.update_root is None: - parser.error("--update-root is required for plan/generate/validate") - print("Checking source mappings and partition metadata", flush=True) - dataset = Dataset(config, args.static_root, args.update_root, partition_root) - hotspot, hot, query_hot = select_hotspot(dataset) - print(f"Fixed hotspot: {hotspot}", flush=True) - profiles = config["profiles"] - ids = [p["id"] for p in profiles] - if len(ids) != len(set(ids)) or any(Path(i).name != i or i in (".", "..") for i in ids): - raise ValueError("Profile IDs must be unique simple directory names") - catalog_context = {"schema": "spatial-workload-catalog.v1", "dataset": config["dataset"], - "partition": str((partition_root / "partition.json").relative_to(args.output)), - "hotspot": hotspot, "source": config["source"], - "source_identities": dataset.source_identities} - if args.profile: - if set(args.profile) - set(ids): - raise ValueError("Unknown profile requested") - profiles = [p for p in profiles if p["id"] in args.profile] - selected_ids = set(ids) if args.command == "plan" else {p["id"] for p in profiles} - results = retained_catalog_profiles(args.output, config, dataset, hotspot, catalog_context, - selected_ids, hot, query_hot) - plans = [profile_plan(dataset, p, hotspot, hot, query_hot) for p in profiles] - retained_plans = {} - plan_context = {"schema": "spatial-workload-plan.v1", "hotspot": hotspot, - "source_identities": dataset.source_identities, - "partition_signature": dataset.partition_info["signature"]} - previous_plan_path = args.output / "plan.json" - if previous_plan_path.exists(): - previous_plan = read_json(previous_plan_path) - configured = {profile["id"]: profile for profile in config["profiles"]} - matching_context = all(previous_plan.get(key) == value for key, value in plan_context.items()) - if previous_plan.get("hotspot") == hotspot: - for plan in previous_plan.get("profiles", []): - profile = plan.get("profile", {}) - if (profile == configured.get(profile.get("id")) and - (matching_context or profile.get("id") in results)): - retained_plans[profile["id"]] = plan - retained_plans.update({plan["profile"]["id"]: plan for plan in plans}) - # Pin the complete configuration before work so interrupted partial runs can resume. - write_json(args.output / "generation-spec.json", config) - write_json(args.output / "plan.json", {**plan_context, - "profiles": [retained_plans[i] for i in ids if i in retained_plans]}) - if args.command == "plan": - print(f"Validated capacity for {len(plans)} profiles", flush=True) - return - for plan in plans: - profile = plan["profile"] - print(f"{args.command}: {profile['id']}", flush=True) - root = args.output / "workloads" / profile["id"] - if args.command == "generate": - root = generate_profile(dataset, plan, hot, query_hot, args.output, args.threads) - result = validate_profile(dataset, root, hot, query_hot, args.output) - results[profile["id"]] = {"id": profile["id"], "kind": profile["kind"], - "path": str((root / "profile.json").relative_to(args.output)), - "validation": result["status"], "control": profile.get("control")} - print(f"Validated {profile['id']}: {result['operations']['query']['unique']} distinct queries", flush=True) - catalog = {**catalog_context, "profiles": [results[i] for i in ids if i in results], - "limitations": ["Spatial input concentration does not guarantee graph-access conflicts.", - "Queries can repeat; report unique query counts and workload-weighted recall.", - "All profiles reuse existing shared HNSW/PQ artifacts; clustering only controls sampling."]} - count = seal_catalog(args.output, catalog) - print(f"Sealed {count} files in {args.output}", flush=True) - - -if __name__ == "__main__": - main() diff --git a/spatial-workloads/v1/tools/generator/stage_release.py b/spatial-workloads/v1/tools/generator/stage_release.py deleted file mode 100644 index 64c2d22453de14dde4c94bba1291ad7a42ab8d46..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/generator/stage_release.py +++ /dev/null @@ -1,274 +0,0 @@ -#!/usr/bin/env python3 -"""Stage a validated additive HF release, preserving the upstream dataset files.""" - -from __future__ import annotations - -import argparse -import os -import shutil -import subprocess -from pathlib import Path, PurePosixPath - -from spatial_common import read_json, safe_child, sha256, write_json - - -def checksum_entries(path): - result = {} - for line in Path(path).read_text().splitlines(): - digest, name = line.split(maxsplit=1) - name = name.lstrip(" *") - if len(digest) != 64 or name in result: - raise ValueError(f"Invalid/duplicate checksum entry: {name}") - result[name] = digest - return result - - -def tree_checksums(root): - root = Path(root) - return {p.relative_to(root).as_posix(): sha256(p) - for p in sorted(root.rglob("*")) if p.is_file() and p.name != "checksums.sha256"} - - -def save_checksums(path, entries): - Path(path).write_text("".join(f"{value} {name}\n" for name, value in sorted(entries.items()))) - - -def validate_catalog_coverage(root, catalog, profiles, entries): - """Require checksummed metadata and every referenced generated payload.""" - root = Path(root).resolve() - for name in entries: - safe_child(root, name) - if str(PurePosixPath(name)) != name or PurePosixPath(name).is_absolute(): - raise ValueError(f"Catalog checksum paths must be canonical and relative: {name}") - - def covered(path): - path = safe_child(root, path) - relative = path.relative_to(root).as_posix() - if not path.is_file(): - raise ValueError(f"Missing required release artifact: {relative}") - if relative not in entries: - raise ValueError(f"Required release artifact lacks checksum coverage: {relative}") - return path - - covered("catalog.json") - covered("generation-spec.json") - if "partition" not in catalog: - raise ValueError("Catalog must reference its partition metadata") - partition_path = covered(catalog["partition"]) - for name in read_json(partition_path).get("files", {}): - covered(safe_child(partition_path.parent, name)) - # A missing checksum must not silently omit a generated stream, checkpoint, - # or mapping. Logs outside these artifact directories remain optional. - for directory in ("workloads", "partitions", "cache"): - for path in (root / directory).rglob("*"): - if path.is_file() or path.is_symlink(): - covered(path) - for entry, profile in zip(catalog["profiles"], profiles): - profile_path = covered(entry["path"]) - profile_root = profile_path.parent - for name in ("spec.json", "plan.json", "workload.json", "validation.json"): - covered(profile_root / name) - bindings = profile["runner_bindings"] - for key in ("query_path", "initial_groundtruth"): - covered(safe_child(profile_root, bindings[key])) - covered(profile_root / "queries/query_refs.u32") - for checkpoint in profile.get("groundtruth_checkpoints", []): - canonical = covered(checkpoint["canonical"]) - covered(canonical.with_suffix(".json")) - workload = read_json(profile_root / "workload.json") - for trace in workload.get("traces", []): - batches = safe_child(profile_root, trace["batches"]) - trace_root = batches.parent - covered(trace_root / "trace.json") - for batch_index in range(1, int(trace["batch_count"]) + 1): - batch_path = covered(batches / f"batch_{batch_index:04d}.json") - batch = read_json(batch_path) - covered(safe_child(trace_root, batch["checkpoint"]["groundtruth"])) - for operation in batch["operations"]: - for field in ("external_ids", "vector_refs"): - descriptor = operation.get(field, {}) - if "path" in descriptor: - relative = batch_path.parent.relative_to(profile_root) / descriptor["path"] - covered(safe_child(profile_root, relative)) - - -def release_readme(catalog, profiles): - hot = catalog["hotspot"] - lines = [ - "# DEEP100M fixed spatial hotspot workloads (v1)", "", - "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.", "", - f"The hotspot contains **{hot['source_vectors']:,} vectors " - f"({100*hot['actual_mass']:.6f}%)**, **{hot['fresh_vectors']:,} fresh insert " - f"candidates**, and **{hot['query_vectors']:,} official query vectors**. " - f"Its cluster IDs are `{hot['clusters']}`.", "", - "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.", "", - "| Profile | Initial state | Logical queries | Inserts | Deletes |", "| --- | --- | ---: | ---: | ---: |", - ] - for p in profiles: - b = p["runner_bindings"] - counts = b["operation_counts"] - role = " (checkpoints)" if p["query_role"] == "recall checkpoints" else "" - lines.append(f"| [{p['id']}](workloads/{p['id']}/profile.json) | {b['initial_state']} | " - f"{counts['query']:,}{role} | {counts['insert']:,} | {counts['delete']:,} |") - lines += ["", "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.", "", - "## Inputs and identity", ""] - for name in ("static", "update"): - ref = catalog["source"][name + "_hf"] - lines.append(f"- {name.title()}: [{ref['repo']}](https://huggingface.co/datasets/{ref['repo']}/tree/{ref['revision']}) (`{ref['revision']}`).") - lines += ["", "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.", "", - "## Use and reproduce", "", - "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.", "", - "From this directory, with the original static/update packages installed:", "", - "```bash", - "python tools/generator/spatial_workload.py validate --config generation-spec.json \\", - " --static-root /path/to/static --update-root /path/to/update --output .", - "python tools/evaluation_runners/prepare_spatial_config.py \\", - " --profile workloads/mixed-shared-hot/profile.json \\", - " --base-config tools/evaluation_runners/configs/deep100.json \\", - " --static-root /path/to/static --update-root /path/to/update \\", - " --output /tmp/deep100-mixed-shared-hot.json", - "```", "", - "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:", "", - "```bash", - "export VECTORDB_CXL_ROOT=/path/to/vectordb-cxl", - "python tools/evaluation_runners/e6.py plan \\", - " --config /tmp/deep100-mixed-shared-hot.json \\", - " --campaign-root /tmp/deep100-spatial-campaign", - "```", "", - "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.", "", - "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.", "", - "## Validation and limits", "", - "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.", "", - "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.", "", - "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.", "", - "Original DEEP vectors are credited to Yandex under the source dataset's " - "[CC BY 4.0 license](../../LICENSE).", ""] - return "\n".join(lines) - - -def stage(catalog_root, output, eval_root, cxl_root, upstream_readme, upstream_checksums, prefix): - catalog_root, output = Path(catalog_root).resolve(), Path(output).resolve() - if output.is_relative_to(catalog_root) or catalog_root.is_relative_to(output): - raise ValueError("Release staging and generated catalog must be separate directories") - prefix_path = PurePosixPath(prefix) - if prefix_path.is_absolute() or ".." in prefix_path.parts or str(prefix_path) in (".", ""): - raise ValueError("Release prefix must be a nonempty relative path") - if output.exists() and any(output.iterdir()): - raise ValueError("Release staging directory must be empty") - catalog = read_json(catalog_root / "catalog.json") - profiles = [] - for entry in catalog["profiles"]: - path = safe_child(catalog_root, entry["path"]) - if entry["validation"] != "passed" or read_json(path.parent / "validation.json")["status"] != "passed": - raise ValueError(f"Unvalidated profile: {entry['id']}") - profiles.append(read_json(path)) - if not profiles: - raise ValueError("No validated profiles to publish") - entries = checksum_entries(catalog_root / "checksums.sha256") - validate_catalog_coverage(catalog_root, catalog, profiles, entries) - for name, expected in entries.items(): - if sha256(safe_child(catalog_root, name)) != expected: - raise ValueError(f"Checksum mismatch before publication: {name}") - upstream = Path(upstream_readme).read_text() - if prefix in upstream: - raise ValueError("Upstream README already references this release; use a new version") - root_hashes = checksum_entries(upstream_checksums) - if any(name.startswith(prefix + "/") for name in root_hashes): - raise ValueError("Release prefix already exists in upstream checksums") - eval_root, cxl_root = Path(eval_root).resolve(), Path(cxl_root).resolve() - source_root = eval_root / "workload_preparation/spatial-workload-prep" - sources = [(p, Path("tools/generator") / p.name) for p in sorted((source_root / "scripts").glob("*.py"))] - sources += [(source_root / "requirements.txt", Path("requirements.txt"))] - sources += [(eval_root / "evaluation_runners" / p, Path("tools/evaluation_runners") / p) - for p in ("runner.py", "e1.py", "e2.py", "e6.py", "prepare_spatial_config.py", "configs/deep100.json")] - sources += [(cxl_root / "scripts/datasets/general" / p, Path("tools/cxl") / p) - for p in ("materialize_concurrent_batch_update.py", "derive_concurrent_manifest.py")] - for src, relative in sources: - repository = cxl_root if relative.parts[:2] == ("tools", "cxl") else eval_root - safe_child(repository, src) - if not src.is_file(): - raise ValueError(f"Missing source snapshot file: {src}") - provenance = {"schema": "spatial-code-provenance.v1", "source_state": "reviewed feature worktree snapshot", - "repositories": {}, "files": {str(relative): sha256(src) for src, relative in sources}} - for name, root in (("vectordb-eval", eval_root), ("vectordb-cxl", cxl_root)): - provenance["repositories"][name] = { - "baseline": subprocess.check_output(["git", "-C", str(root), "rev-parse", "HEAD"], text=True).strip(), - "branch": subprocess.check_output(["git", "-C", str(root), "branch", "--show-current"], text=True).strip(), - } - release = output / prefix_path - release.mkdir(parents=True) - for name in entries: - if name in {"README.md", "code-provenance.json", "requirements.txt"} or name.startswith("tools/"): - continue # Regenerated below; never mutate a hard-linked source copy. - src, dst = safe_child(catalog_root, name), safe_child(release, name) - dst.parent.mkdir(parents=True, exist_ok=True) - try: - os.link(src, dst) - except OSError: - shutil.copyfile(src, dst) - for src, relative in sources: - target = release / relative - target.parent.mkdir(parents=True, exist_ok=True) - shutil.copyfile(src, target) - write_json(release / "code-provenance.json", provenance) - (release / "README.md").write_text(release_readme(catalog, profiles)) - release_hashes = tree_checksums(release) - save_checksums(release / "checksums.sha256", release_hashes) - (output / "README.md").write_text(upstream.rstrip() + "\n\n## Fixed spatial hotspot workloads\n\n" - f"See [{prefix}]({prefix}/README.md) for {len(profiles)} validated query/update profiles, " - f"including uniform controls and a fixed {100 * catalog['hotspot']['actual_mass']:.2f}% hotspot. These workloads reuse " - "the existing static and initial-80M indexes and vector/PQ assets. " - "The original traces above remain available.\n") - root_hashes["README.md"] = sha256(output / "README.md") - root_hashes.update({f"{prefix}/{name}": value for name, value in release_hashes.items()}) - root_hashes[f"{prefix}/checksums.sha256"] = sha256(release / "checksums.sha256") - save_checksums(output / "checksums.sha256", root_hashes) - return {"staging": str(output), "prefix": prefix, "profiles": len(profiles), - "new_payload_files": len(release_hashes), - "new_payload_bytes": sum(p.stat().st_size for p in release.rglob("*") if p.is_file())} - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description=__doc__) - for name in ("catalog", "output", "eval-root", "cxl-root", "upstream-readme", "upstream-checksums"): - parser.add_argument("--" + name, required=True, type=Path) - parser.add_argument("--prefix", default="spatial-workloads/v1") - args = parser.parse_args() - result = stage(args.catalog, args.output, args.eval_root, args.cxl_root, - args.upstream_readme, args.upstream_checksums, args.prefix) - print(result) diff --git a/spatial-workloads/v1/tools/generator/verify_spatial_consumers.py b/spatial-workloads/v1/tools/generator/verify_spatial_consumers.py deleted file mode 100644 index 3d733bbba13e1e78d8128563a193824c3e0dc182..0000000000000000000000000000000000000000 --- a/spatial-workloads/v1/tools/generator/verify_spatial_consumers.py +++ /dev/null @@ -1,325 +0,0 @@ -#!/usr/bin/env python3 -"""Check generated profiles with the unchanged CXL batch/concurrent C++ parsers. - -This local artifact check does not load vectors or an HNSW graph, execute RDMA, -or recompute nearest neighbors. Run spatial_workload.py validate first for the -independent source-payload and exact-ground-truth checks. The largest input held -in memory here is the uint32 update permutation (400 MB for DEEP100M). -""" - -from __future__ import annotations - -import argparse -import hashlib -import json -from pathlib import Path -import shlex -import struct -import subprocess -import sys -import tempfile - - -HARNESS = r''' -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "compute/batch/batch_artifact_resolver.h" -#include "compute/concurrent/concurrent_workload_manifest.h" -namespace fs = std::filesystem; -using namespace vectordb::compute; -void require(bool condition, const std::string& message) { - if (!condition) throw std::runtime_error(message); -} -std::vector read_u32(const fs::path& path) { - const auto bytes = fs::file_size(path); - require(bytes % 4 == 0, "unaligned uint32 file: " + path.string()); - std::vector values(bytes / 4); - std::ifstream stream(path, std::ios::binary); - stream.read(reinterpret_cast(values.data()), bytes); - require(static_cast(stream), "cannot read: " + path.string()); - return values; -} -void check_gt(const fs::path& path, std::uint64_t query_rows, std::uint64_t k, - const std::vector& live) { - const auto values = read_u32(path); - require(values.size() == 2 + query_rows * k, "GT file size mismatch"); - require(values[0] == query_rows && values[1] == k, "GT header mismatch"); - for (std::size_t i = 2; i < values.size(); ++i) - require(values[i] < live.size() && live[values[i]], "GT contains a nonlive ID"); -} -void check_slice(const std::vector& actual, - const std::vector& expected, std::size_t offset) { - require(offset + actual.size() <= expected.size(), "resolved stream too long"); - require(std::equal(actual.begin(), actual.end(), expected.begin() + offset), - "C++ resolver and generated stream disagree"); -} -int main(int argc, char** argv) { - try { - require(argc == 14, "invalid harness arguments"); - const fs::path root = argv[1], update = argv[10]; - const std::string trace = argv[2]; - const auto batches = std::stoull(argv[3]), n = std::stoull(argv[4]); - const auto initial = std::stoull(argv[5]), queries = std::stoull(argv[8]); - const auto k = std::stoull(argv[9]); - const bool permuted = std::string(argv[12]) == "permuted"; - require(initial <= n, "initial population exceeds source"); - const auto stream = root / "streams"; - const auto inserts = fs::exists(stream / "insert_ids.u32") - ? read_u32(stream / "insert_ids.u32") : std::vector{}; - const auto refs = fs::exists(stream / "insert_refs.u32") - ? read_u32(stream / "insert_refs.u32") : std::vector{}; - const auto deletes = fs::exists(stream / "delete_ids.u32") - ? read_u32(stream / "delete_ids.u32") : std::vector{}; - require(inserts.size() == refs.size(), "insert/ref stream sizes differ"); - std::vector order; - if (initial != n || (!inserts.empty() && permuted)) { - order = read_u32(update / argv[11]); - require(order.size() == n, "update permutation length mismatch"); - } - std::vector initial_live(n, initial == n); - if (initial != n) { - for (std::size_t i = 0; i < initial; ++i) { - require(order[i] < n && !initial_live[order[i]], "invalid initial mapping"); - initial_live[order[i]] = true; - } - } - auto live = initial_live; - std::uint64_t live_count = initial; - check_gt(argv[6], queries, k, live); - std::optional manifest; - if (std::string(argv[13]) != "-") { - manifest = load_concurrent_workload_manifest(argv[13]); - validate_atomic_concurrent_merge_delete_schedules(*manifest); - require(manifest->windows.size() == batches, "manifest window count mismatch"); - require(manifest->workload_mode == "continuous_uniform", "wrong mixed mode"); - } - std::size_t insert_offset = 0, delete_offset = 0; - if (batches) { - BatchArtifactResolver resolver(root, trace); - fs::path previous_gt = argv[6]; - for (std::uint32_t b = 1; b <= batches; ++b) { - const auto artifacts = resolver.resolve(b); - require(artifacts.batch_index == b, "wrong resolved batch index"); - check_slice(artifacts.insert_ids, inserts, insert_offset); - check_slice(artifacts.insert_vector_refs, refs, insert_offset); - check_slice(artifacts.delete_ids, deletes, delete_offset); - if (manifest) { - const auto& window = manifest->windows[b - 1]; - require(artifacts.insert_ids == read_u32(window.insert_ids_path) && - window.insert_vector_refs_path && - artifacts.insert_vector_refs == read_u32(*window.insert_vector_refs_path) && - artifacts.delete_ids == read_u32(window.mark_delete_ids_path), - "materialized and batch-resolved streams disagree"); - require(window.target_insert_count == artifacts.insert_ids.size() && - window.target_mark_delete_count == artifacts.delete_ids.size() && - window.target_query_count == 36 * artifacts.insert_ids.size(), - "materialized operation counts disagree"); - require(window.query_repetition == ConcurrentQueryRepetition::kCyclic, - "mixed query repetition must be cyclic"); - require(fs::equivalent(window.query_path, argv[7]) && - fs::equivalent(window.pre_update_checkpoint_groundtruth_path, previous_gt), - "query/pre-update GT path mismatch"); - // Continuous mode emits only the final post-update recall checkpoint. - require(b != batches || window.post_update_checkpoint_groundtruth_path, - "missing final post-update GT"); - if (window.post_update_checkpoint_groundtruth_path) - require(fs::equivalent(*window.post_update_checkpoint_groundtruth_path, - artifacts.groundtruth_path), "post-update GT path mismatch"); - require(window.source_batch_workload_root && - fs::equivalent(*window.source_batch_workload_root, update), - "shared insert source root mismatch"); - require(window.source_batch_json_path && - fs::equivalent(*window.source_batch_json_path, artifacts.batch_json_path), - "source batch path mismatch"); - require(window.source_active_count == live_count, "pre-update population mismatch"); - } - for (const auto id : artifacts.delete_ids) { - require(id < n && initial_live[id] && live[id], "illegal/repeated deletion"); - live[id] = false; - --live_count; - } - require(artifacts.insert_ids.size() == artifacts.insert_vector_refs.size(), - "resolved insert/ref sizes differ"); - for (std::size_t i = 0; i < artifacts.insert_ids.size(); ++i) { - const auto id = artifacts.insert_ids[i], ref = artifacts.insert_vector_refs[i]; - require(id < n && !initial_live[id] && !live[id], "illegal/repeated insertion"); - require(ref < n && (permuted ? order[ref] == id : ref == id), - "insert vector ref resolves to a different original source ID"); - live[id] = true; - ++live_count; - } - require(artifacts.active_begin == 0 && artifacts.active_end_exclusive == live_count, - "checkpoint population mismatch"); - check_gt(artifacts.groundtruth_path, queries, k, live); - previous_gt = artifacts.groundtruth_path; - insert_offset += artifacts.insert_ids.size(); - delete_offset += artifacts.delete_ids.size(); - } - } - require(insert_offset == inserts.size() && delete_offset == deletes.size(), - "unconsumed generated update stream"); - std::cout << "{\"batch_count\":" << batches << ",\"inserts\":" << insert_offset - << ",\"deletes\":" << delete_offset << ",\"query_rows\":" << queries - << ",\"groundtruth_k\":" << k << ",\"final_live_count\":" << live_count - << ",\"concurrent_parser\":" << (manifest ? "true" : "false") << "}\n"; - return 0; - } catch (const std::exception& error) { - std::cerr << error.what() << '\n'; - return 1; - } -} -''' - - -def read_json(path): - return json.loads(path.read_text()) - - -def sha256(path): - value = hashlib.sha256() - with path.open("rb") as stream: - for chunk in iter(lambda: stream.read(1024 * 1024), b""): - value.update(chunk) - return value.hexdigest() - - -def child(root, relative): - path = (root / relative).resolve() - if not path.is_relative_to(root.resolve()): - raise ValueError(f"Path escapes its artifact root: {relative}") - return path - - -def matrix_shape(path, item_bytes): - with path.open("rb") as stream: - header = stream.read(8) - if len(header) != 8: - raise ValueError(f"Truncated matrix header: {path}") - rows, columns = struct.unpack("