rusty-haystack 0.6.3__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/Cargo.lock +35 -5
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/Cargo.toml +1 -1
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/PKG-INFO +1 -1
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/Cargo.toml +1 -1
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/Cargo.toml +2 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/benches/benchmarks.rs +235 -0
- rusty_haystack-0.7.1/haystack-core/src/graph/bitmap.rs +228 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/csr.rs +87 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/entity_graph.rs +372 -24
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/mod.rs +4 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/query_planner.rs +18 -56
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/snapshot.rs +34 -25
- rusty_haystack-0.7.1/haystack-core/src/graph/structural.rs +351 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/value_index.rs +0 -2
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/Cargo.toml +2 -2
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/Cargo.toml +3 -3
- rusty_haystack-0.6.3/haystack-core/src/graph/bitmap.rs +0 -315
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/README.md +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/auth.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/client.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/error.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/lib.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/tls.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/transport/http.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/transport/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-client/src/transport/ws.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/defs.trio +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/tz_map.txt +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/units.txt +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/ph.attrs.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/ph.equips.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/ph.examples.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/ph.points.elec.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/ph.points.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/ph.protocols.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/ph.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/sys.api.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/sys.comp.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/sys.files.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/sys.template.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/data/xeto/sys.xeto +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/auth.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/arrow_ipc.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/csv.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/hbf/de.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/hbf/error.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/hbf/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/hbf/ser.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/hbf/varint.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/json/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/json/v3.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/json/v4.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/rdf.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/shared.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/trio/encoder.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/trio/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/trio/parser.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/zinc/encoder.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/zinc/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/codecs/zinc/parser.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/data/dict.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/data/grid.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/data/list.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/data/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/expr/ast.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/expr/eval.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/expr/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/expr/parser.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/filter/ast.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/filter/eval.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/filter/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/filter/parser.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/adjacency.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/changelog.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/columnar.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/shared.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/graph/subscriber.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/coord.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/datetime.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/kind.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/number.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/ref_.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/singletons.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/symbol.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/tz.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/units.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/uri.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/kinds/xstr.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/lib.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/conjunct.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/def.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/graph_validation.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/lib.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/namespace.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/taxonomy.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/trio_loader.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/ontology/validation.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/serde_impls.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/ast.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/bundled.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/export.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/fitting.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/lexer.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/loader.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/parser.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/resolver.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/src/xeto/spec.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/tests/e2e.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/tests/graph_integration.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-core/tests/ontology_integration.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/benches/benchmarks.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/benches/federation.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/actions.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/app.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/auth/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/auth/users.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/connector.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/content.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/demo.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/domain_scope.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/error.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/federation.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/his_store.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/lib.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/about.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/changes.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/data.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/defs.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/federation.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/formats.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/graph.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/his.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/invoke.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/libs.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/nav.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/ops_handler.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/point_write.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/rdf.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/read.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/system.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ops/watch.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/session/affinity.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/session/mod.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/session/peek.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/session/profile.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/session/working_set.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/state.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/src/ws.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/haystack-server/tests/federation_integration.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/pyproject.toml +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/README.md +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/rusty_haystack.pyi +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/auth.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/client.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/codecs.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/convert.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/data.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/exceptions.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/expr.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/filter.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/graph.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/kinds.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/lib.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/ontology.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/server.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/src/units.rs +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/__init__.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/conftest.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_auth.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_codecs.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_data.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_exceptions.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_filter.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_graph.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_kinds.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_ontology.py +0 -0
- {rusty_haystack-0.6.3 → rusty_haystack-0.7.1}/rusty-haystack/tests/test_server.py +0 -0
|
@@ -623,6 +623,18 @@ version = "3.20.2"
|
|
|
623
623
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
624
624
|
checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
|
|
625
625
|
|
|
626
|
+
[[package]]
|
|
627
|
+
name = "bytemuck"
|
|
628
|
+
version = "1.25.0"
|
|
629
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
630
|
+
checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec"
|
|
631
|
+
|
|
632
|
+
[[package]]
|
|
633
|
+
name = "byteorder"
|
|
634
|
+
version = "1.5.0"
|
|
635
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
636
|
+
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
|
637
|
+
|
|
626
638
|
[[package]]
|
|
627
639
|
name = "bytes"
|
|
628
640
|
version = "1.11.1"
|
|
@@ -2372,6 +2384,22 @@ dependencies = [
|
|
|
2372
2384
|
"windows-sys 0.52.0",
|
|
2373
2385
|
]
|
|
2374
2386
|
|
|
2387
|
+
[[package]]
|
|
2388
|
+
name = "roaring"
|
|
2389
|
+
version = "0.10.12"
|
|
2390
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2391
|
+
checksum = "19e8d2cfa184d94d0726d650a9f4a1be7f9b76ac9fdb954219878dc00c1c1e7b"
|
|
2392
|
+
dependencies = [
|
|
2393
|
+
"bytemuck",
|
|
2394
|
+
"byteorder",
|
|
2395
|
+
]
|
|
2396
|
+
|
|
2397
|
+
[[package]]
|
|
2398
|
+
name = "rustc-hash"
|
|
2399
|
+
version = "2.1.1"
|
|
2400
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2401
|
+
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
|
|
2402
|
+
|
|
2375
2403
|
[[package]]
|
|
2376
2404
|
name = "rustc_version"
|
|
2377
2405
|
version = "0.4.1"
|
|
@@ -2487,7 +2515,7 @@ dependencies = [
|
|
|
2487
2515
|
|
|
2488
2516
|
[[package]]
|
|
2489
2517
|
name = "rusty-haystack"
|
|
2490
|
-
version = "0.
|
|
2518
|
+
version = "0.7.1"
|
|
2491
2519
|
dependencies = [
|
|
2492
2520
|
"chrono",
|
|
2493
2521
|
"pyo3",
|
|
@@ -2499,7 +2527,7 @@ dependencies = [
|
|
|
2499
2527
|
|
|
2500
2528
|
[[package]]
|
|
2501
2529
|
name = "rusty-haystack-cli"
|
|
2502
|
-
version = "0.
|
|
2530
|
+
version = "0.7.1"
|
|
2503
2531
|
dependencies = [
|
|
2504
2532
|
"clap",
|
|
2505
2533
|
"env_logger",
|
|
@@ -2513,7 +2541,7 @@ dependencies = [
|
|
|
2513
2541
|
|
|
2514
2542
|
[[package]]
|
|
2515
2543
|
name = "rusty-haystack-client"
|
|
2516
|
-
version = "0.
|
|
2544
|
+
version = "0.7.1"
|
|
2517
2545
|
dependencies = [
|
|
2518
2546
|
"base64",
|
|
2519
2547
|
"dashmap",
|
|
@@ -2535,7 +2563,7 @@ dependencies = [
|
|
|
2535
2563
|
|
|
2536
2564
|
[[package]]
|
|
2537
2565
|
name = "rusty-haystack-core"
|
|
2538
|
-
version = "0.
|
|
2566
|
+
version = "0.7.1"
|
|
2539
2567
|
dependencies = [
|
|
2540
2568
|
"arrow",
|
|
2541
2569
|
"base64",
|
|
@@ -2551,6 +2579,8 @@ dependencies = [
|
|
|
2551
2579
|
"rand 0.10.0",
|
|
2552
2580
|
"rayon",
|
|
2553
2581
|
"regex",
|
|
2582
|
+
"roaring",
|
|
2583
|
+
"rustc-hash",
|
|
2554
2584
|
"serde",
|
|
2555
2585
|
"serde_json",
|
|
2556
2586
|
"sha2",
|
|
@@ -2567,7 +2597,7 @@ dependencies = [
|
|
|
2567
2597
|
|
|
2568
2598
|
[[package]]
|
|
2569
2599
|
name = "rusty-haystack-server"
|
|
2570
|
-
version = "0.
|
|
2600
|
+
version = "0.7.1"
|
|
2571
2601
|
dependencies = [
|
|
2572
2602
|
"actix-http",
|
|
2573
2603
|
"actix-rt",
|
|
@@ -13,7 +13,7 @@ categories.workspace = true
|
|
|
13
13
|
name = "haystack_client"
|
|
14
14
|
|
|
15
15
|
[dependencies]
|
|
16
|
-
haystack-core = { package = "rusty-haystack-core", version = "0.
|
|
16
|
+
haystack-core = { package = "rusty-haystack-core", version = "0.7.1", path = "../haystack-core", features = ["haystack-serde"] }
|
|
17
17
|
reqwest = { version = "0.13", features = ["rustls-no-provider"], default-features = false }
|
|
18
18
|
rustls = { version = "0.23", features = ["ring", "tls12", "std"], default-features = false }
|
|
19
19
|
tokio-tungstenite = { version = "0.28", features = ["rustls-tls-webpki-roots"] }
|
|
@@ -690,6 +690,239 @@ fn hbf_benchmarks(c: &mut Criterion) {
|
|
|
690
690
|
);
|
|
691
691
|
}
|
|
692
692
|
|
|
693
|
+
/// Build a realistic Haystack graph with diverse entity types.
|
|
694
|
+
///
|
|
695
|
+
/// Structure per "campus" (repeats to reach target count):
|
|
696
|
+
/// 1 site, 3 AHUs, 2 VAVs, 1 boiler, 1 meter, 1 weather station,
|
|
697
|
+
/// then ~10 points per equip with varying kinds (temp, pressure, flow, occ, cmd).
|
|
698
|
+
/// Total per campus ≈ 80 entities (8 parents + ~72 points).
|
|
699
|
+
fn build_realistic_graph(target: usize) -> EntityGraph {
|
|
700
|
+
let mut graph = EntityGraph::new();
|
|
701
|
+
let campuses = (target / 80).max(1);
|
|
702
|
+
|
|
703
|
+
for c in 0..campuses {
|
|
704
|
+
// Site
|
|
705
|
+
let site_id = format!("site-{c}");
|
|
706
|
+
let mut s = HDict::new();
|
|
707
|
+
s.set("id", Kind::Ref(HRef::from_val(&site_id)));
|
|
708
|
+
s.set("site", Kind::Marker);
|
|
709
|
+
s.set("dis", Kind::Str(format!("Campus {c}")));
|
|
710
|
+
s.set("geoCity", Kind::Str("Portland".into()));
|
|
711
|
+
s.set(
|
|
712
|
+
"area",
|
|
713
|
+
Kind::Number(Number::new(
|
|
714
|
+
50_000.0 + c as f64 * 1000.0,
|
|
715
|
+
Some("ft²".into()),
|
|
716
|
+
)),
|
|
717
|
+
);
|
|
718
|
+
graph.add(s).unwrap();
|
|
719
|
+
|
|
720
|
+
// Equips: 3 AHU, 2 VAV, 1 boiler, 1 meter, 1 weather
|
|
721
|
+
let equip_defs: Vec<(&str, &[&str])> = vec![
|
|
722
|
+
("ahu", &["equip", "ahu", "hvac"][..]),
|
|
723
|
+
("ahu", &["equip", "ahu", "hvac"]),
|
|
724
|
+
("ahu", &["equip", "ahu", "hvac"]),
|
|
725
|
+
("vav", &["equip", "vav", "hvac"]),
|
|
726
|
+
("vav", &["equip", "vav", "hvac"]),
|
|
727
|
+
("boiler", &["equip", "boiler", "hotWaterHeating"]),
|
|
728
|
+
("meter", &["equip", "meter", "elecMeter"]),
|
|
729
|
+
("weather", &["equip", "weatherStation"]),
|
|
730
|
+
];
|
|
731
|
+
|
|
732
|
+
let mut equip_ids = Vec::new();
|
|
733
|
+
for (ei, (prefix, tags)) in equip_defs.iter().enumerate() {
|
|
734
|
+
let eid = format!("{prefix}-{c}-{ei}");
|
|
735
|
+
let mut e = HDict::new();
|
|
736
|
+
e.set("id", Kind::Ref(HRef::from_val(&eid)));
|
|
737
|
+
for tag in *tags {
|
|
738
|
+
e.set(*tag, Kind::Marker);
|
|
739
|
+
}
|
|
740
|
+
e.set("siteRef", Kind::Ref(HRef::from_val(&site_id)));
|
|
741
|
+
e.set("dis", Kind::Str(format!("{prefix} {c}-{ei}")));
|
|
742
|
+
graph.add(e).unwrap();
|
|
743
|
+
equip_ids.push(eid);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
// Points: ~9 per equip with varying kinds
|
|
747
|
+
let point_kinds: &[(&str, &[&str], &str, f64)] = &[
|
|
748
|
+
("temp", &["sensor", "temp", "air"], "°F", 72.0),
|
|
749
|
+
("pressure", &["sensor", "pressure", "air"], "inH₂O", 1.2),
|
|
750
|
+
("flow", &["sensor", "flow", "air"], "cfm", 1500.0),
|
|
751
|
+
("occ", &["sensor", "occ"], "%", 85.0),
|
|
752
|
+
("damper", &["cmd", "damper"], "%", 50.0),
|
|
753
|
+
("speed", &["cmd", "speed", "fan"], "%", 75.0),
|
|
754
|
+
("sp", &["sp", "temp", "air"], "°F", 72.0),
|
|
755
|
+
("enable", &["cmd", "enable"], "", 1.0),
|
|
756
|
+
("alarm", &["sensor", "alarm"], "", 0.0),
|
|
757
|
+
];
|
|
758
|
+
|
|
759
|
+
for (ei, eq_id) in equip_ids.iter().enumerate() {
|
|
760
|
+
for (pi, (kind, tags, unit, base_val)) in point_kinds.iter().enumerate() {
|
|
761
|
+
let pid = format!("pt-{c}-{ei}-{kind}-{pi}");
|
|
762
|
+
let mut p = HDict::new();
|
|
763
|
+
p.set("id", Kind::Ref(HRef::from_val(&pid)));
|
|
764
|
+
p.set("point", Kind::Marker);
|
|
765
|
+
for tag in *tags {
|
|
766
|
+
p.set(*tag, Kind::Marker);
|
|
767
|
+
}
|
|
768
|
+
p.set("kind", Kind::Str("Number".into()));
|
|
769
|
+
p.set("equipRef", Kind::Ref(HRef::from_val(eq_id)));
|
|
770
|
+
p.set("siteRef", Kind::Ref(HRef::from_val(&site_id)));
|
|
771
|
+
let val = base_val + (pi as f64 * 0.5) + (c as f64 * 0.1);
|
|
772
|
+
if unit.is_empty() {
|
|
773
|
+
p.set("curVal", Kind::Number(Number::unitless(val)));
|
|
774
|
+
} else {
|
|
775
|
+
p.set(
|
|
776
|
+
"curVal",
|
|
777
|
+
Kind::Number(Number::new(val, Some((*unit).into()))),
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
graph.add(p).unwrap();
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
graph
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
fn graph_optimization_benchmarks(c: &mut Criterion) {
|
|
788
|
+
// ── Bulk Add vs Incremental Add ──
|
|
789
|
+
|
|
790
|
+
// Incremental add (existing bench uses add(), this uses add_bulk())
|
|
791
|
+
c.bench_function("graph_bulk_add_10000", |b| {
|
|
792
|
+
b.iter(|| {
|
|
793
|
+
let mut g = EntityGraph::new();
|
|
794
|
+
for i in 0..10_000 {
|
|
795
|
+
let mut d = HDict::new();
|
|
796
|
+
d.set("id", Kind::Ref(HRef::from_val(format!("b-{i}"))));
|
|
797
|
+
d.set("point", Kind::Marker);
|
|
798
|
+
d.set("siteRef", Kind::Ref(HRef::from_val("site-0")));
|
|
799
|
+
g.add_bulk(d).unwrap();
|
|
800
|
+
}
|
|
801
|
+
g.finalize_bulk(1);
|
|
802
|
+
g
|
|
803
|
+
});
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
// ── Delta Update (few tags changed on large graph) ──
|
|
807
|
+
|
|
808
|
+
let mut g10k = build_realistic_graph(10_000);
|
|
809
|
+
// Ensure CSR is built so updates exercise the patch path
|
|
810
|
+
g10k.rebuild_csr();
|
|
811
|
+
|
|
812
|
+
c.bench_function("graph_update_delta_10000", |b| {
|
|
813
|
+
b.iter(|| {
|
|
814
|
+
let mut changes = HDict::new();
|
|
815
|
+
changes.set("dis", Kind::Str("Updated".into()));
|
|
816
|
+
changes.set("curVal", Kind::Number(Number::new(99.0, Some("°F".into()))));
|
|
817
|
+
// Update a point in the middle of the graph
|
|
818
|
+
let _ = g10k.update(black_box("pt-60-2-temp-0"), changes);
|
|
819
|
+
});
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
// ── Filter Queries on Realistic Data ──
|
|
823
|
+
|
|
824
|
+
c.bench_function("graph_filter_realistic_10000", |b| {
|
|
825
|
+
b.iter(|| g10k.read(black_box("point and sensor and temp"), 0));
|
|
826
|
+
});
|
|
827
|
+
|
|
828
|
+
c.bench_function("graph_filter_compound_10000", |b| {
|
|
829
|
+
b.iter(|| {
|
|
830
|
+
g10k.read(
|
|
831
|
+
black_box("point and sensor and (temp or pressure) and siteRef == @site-0"),
|
|
832
|
+
0,
|
|
833
|
+
)
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
c.bench_function("graph_filter_range_10000", |b| {
|
|
838
|
+
b.iter(|| g10k.read(black_box("point and curVal > 73°F"), 0));
|
|
839
|
+
});
|
|
840
|
+
|
|
841
|
+
// ── CSR Rebuild ──
|
|
842
|
+
|
|
843
|
+
c.bench_function("graph_csr_rebuild_10000", |b| {
|
|
844
|
+
let mut g = build_realistic_graph(10_000);
|
|
845
|
+
b.iter(|| g.rebuild_csr());
|
|
846
|
+
});
|
|
847
|
+
|
|
848
|
+
// ── ID Freelist Recycle ──
|
|
849
|
+
|
|
850
|
+
c.bench_function("graph_freelist_recycle_1000", |b| {
|
|
851
|
+
let mut g = EntityGraph::new();
|
|
852
|
+
for i in 0..2000 {
|
|
853
|
+
let mut d = HDict::new();
|
|
854
|
+
d.set("id", Kind::Ref(HRef::from_val(format!("r-{i}"))));
|
|
855
|
+
d.set("point", Kind::Marker);
|
|
856
|
+
g.add(d).unwrap();
|
|
857
|
+
}
|
|
858
|
+
// Remove 1000 to populate freelist
|
|
859
|
+
for i in 0..1000 {
|
|
860
|
+
g.remove(&format!("r-{i}")).unwrap();
|
|
861
|
+
}
|
|
862
|
+
b.iter(|| {
|
|
863
|
+
// Re-add using recycled IDs
|
|
864
|
+
for i in 0..1000 {
|
|
865
|
+
let mut d = HDict::new();
|
|
866
|
+
d.set("id", Kind::Ref(HRef::from_val(format!("r-{i}"))));
|
|
867
|
+
d.set("point", Kind::Marker);
|
|
868
|
+
g.add(d).unwrap();
|
|
869
|
+
}
|
|
870
|
+
// Remove again to reset
|
|
871
|
+
for i in 0..1000 {
|
|
872
|
+
g.remove(&format!("r-{i}")).unwrap();
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
});
|
|
876
|
+
|
|
877
|
+
// ── Snapshot at Scale ──
|
|
878
|
+
|
|
879
|
+
{
|
|
880
|
+
use haystack_core::graph::{SnapshotReader, SnapshotWriter};
|
|
881
|
+
let tmp = tempfile::tempdir().unwrap();
|
|
882
|
+
let sg = SharedGraph::new(build_realistic_graph(10_000));
|
|
883
|
+
let writer = SnapshotWriter::new(tmp.path().to_path_buf(), 10);
|
|
884
|
+
|
|
885
|
+
c.bench_function("snapshot_write_10000_realistic", |b| {
|
|
886
|
+
b.iter(|| writer.write(black_box(&sg)));
|
|
887
|
+
});
|
|
888
|
+
|
|
889
|
+
let snap_path = writer.write(&sg).unwrap();
|
|
890
|
+
c.bench_function("snapshot_read_10000_realistic", |b| {
|
|
891
|
+
b.iter(|| {
|
|
892
|
+
let g = SharedGraph::new(EntityGraph::new());
|
|
893
|
+
SnapshotReader::load(black_box(&snap_path), &g)
|
|
894
|
+
});
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
fn structural_benchmarks(c: &mut Criterion) {
|
|
900
|
+
// Build a realistic graph for structural index benchmarks
|
|
901
|
+
let mut graph = build_realistic_graph(5_000);
|
|
902
|
+
|
|
903
|
+
c.bench_function("structural_compute_5000", |b| {
|
|
904
|
+
b.iter(|| {
|
|
905
|
+
graph.recompute_structural();
|
|
906
|
+
});
|
|
907
|
+
});
|
|
908
|
+
|
|
909
|
+
// Ensure structural index is computed for query benchmarks
|
|
910
|
+
graph.recompute_structural();
|
|
911
|
+
let si = graph.structural_index().expect("just computed");
|
|
912
|
+
|
|
913
|
+
c.bench_function("structural_fingerprint_lookup", |b| {
|
|
914
|
+
b.iter(|| si.fingerprint(black_box("pt-30-0-temp-0")));
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
c.bench_function("structural_partitions_with_tags", |b| {
|
|
918
|
+
b.iter(|| si.partitions_with_tags(black_box(&["point", "sensor", "temp"])));
|
|
919
|
+
});
|
|
920
|
+
|
|
921
|
+
c.bench_function("structural_histogram", |b| {
|
|
922
|
+
b.iter(|| si.histogram());
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
|
|
693
926
|
criterion_group!(
|
|
694
927
|
benches,
|
|
695
928
|
codec_benchmarks,
|
|
@@ -702,6 +935,8 @@ criterion_group!(
|
|
|
702
935
|
traversal_benchmarks,
|
|
703
936
|
snapshot_benchmarks,
|
|
704
937
|
validation_benchmarks,
|
|
938
|
+
graph_optimization_benchmarks,
|
|
939
|
+
structural_benchmarks,
|
|
705
940
|
);
|
|
706
941
|
|
|
707
942
|
#[cfg(feature = "haystack-serde")]
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// Tag bitmap index — roaring bitmap-based tag-presence queries.
|
|
2
|
+
|
|
3
|
+
use roaring::RoaringBitmap;
|
|
4
|
+
use std::collections::HashMap;
|
|
5
|
+
|
|
6
|
+
/// Tag-presence bitmap index.
|
|
7
|
+
///
|
|
8
|
+
/// Maps tag names to compressed roaring bitmaps. Each entity is assigned
|
|
9
|
+
/// a numeric id; the bit at position `id` is set in every bitmap for every
|
|
10
|
+
/// tag the entity carries.
|
|
11
|
+
pub struct TagBitmapIndex {
|
|
12
|
+
bitmaps: HashMap<String, RoaringBitmap>,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl TagBitmapIndex {
|
|
16
|
+
pub fn new() -> Self {
|
|
17
|
+
Self {
|
|
18
|
+
bitmaps: HashMap::new(),
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// Add an entity's tags to the index.
|
|
23
|
+
pub fn add(&mut self, entity_id: usize, tags: &[String]) {
|
|
24
|
+
let eid = entity_id as u32;
|
|
25
|
+
for tag in tags {
|
|
26
|
+
self.bitmaps.entry(tag.clone()).or_default().insert(eid);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/// Remove an entity from the given tag bitmaps.
|
|
31
|
+
pub fn remove(&mut self, entity_id: usize, tags: &[String]) {
|
|
32
|
+
let eid = entity_id as u32;
|
|
33
|
+
for tag in tags {
|
|
34
|
+
if let Some(bm) = self.bitmaps.get_mut(tag.as_str()) {
|
|
35
|
+
bm.remove(eid);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// Get the bitmap for a tag, if it exists.
|
|
41
|
+
pub fn has_tag(&self, tag: &str) -> Option<&RoaringBitmap> {
|
|
42
|
+
self.bitmaps.get(tag)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// Bitwise AND of multiple bitmaps.
|
|
46
|
+
pub fn intersect(bitmaps: &[&RoaringBitmap]) -> RoaringBitmap {
|
|
47
|
+
if bitmaps.is_empty() {
|
|
48
|
+
return RoaringBitmap::new();
|
|
49
|
+
}
|
|
50
|
+
let mut result = bitmaps[0].clone();
|
|
51
|
+
for bm in &bitmaps[1..] {
|
|
52
|
+
result &= *bm;
|
|
53
|
+
}
|
|
54
|
+
result
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// Bitwise OR of multiple bitmaps.
|
|
58
|
+
pub fn union(bitmaps: &[&RoaringBitmap]) -> RoaringBitmap {
|
|
59
|
+
let mut result = RoaringBitmap::new();
|
|
60
|
+
for bm in bitmaps {
|
|
61
|
+
result |= *bm;
|
|
62
|
+
}
|
|
63
|
+
result
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/// Bitwise NOT of a bitmap, limited to max_id bits.
|
|
67
|
+
pub fn negate(bitmap: &RoaringBitmap, max_id: usize) -> RoaringBitmap {
|
|
68
|
+
if max_id == 0 {
|
|
69
|
+
return RoaringBitmap::new();
|
|
70
|
+
}
|
|
71
|
+
let mut all = RoaringBitmap::from_iter(0..max_id as u32);
|
|
72
|
+
all -= bitmap;
|
|
73
|
+
all
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/// Iterate over set bit positions.
|
|
77
|
+
pub fn iter_set_bits(bitmap: &RoaringBitmap) -> impl Iterator<Item = usize> + '_ {
|
|
78
|
+
bitmap.iter().map(|x| x as usize)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/// Count the number of set bits.
|
|
82
|
+
pub fn count_ones(bitmap: &RoaringBitmap) -> usize {
|
|
83
|
+
bitmap.len() as usize
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
impl Default for TagBitmapIndex {
|
|
88
|
+
fn default() -> Self {
|
|
89
|
+
Self::new()
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#[cfg(test)]
|
|
94
|
+
mod tests {
|
|
95
|
+
use super::*;
|
|
96
|
+
|
|
97
|
+
#[test]
|
|
98
|
+
fn set_and_check_individual_bits() {
|
|
99
|
+
let mut idx = TagBitmapIndex::new();
|
|
100
|
+
idx.add(0, &["site".into()]);
|
|
101
|
+
idx.add(5, &["site".into()]);
|
|
102
|
+
idx.add(63, &["site".into()]);
|
|
103
|
+
idx.add(64, &["site".into()]);
|
|
104
|
+
|
|
105
|
+
let bm = idx.has_tag("site").unwrap();
|
|
106
|
+
assert!(bm.contains(0));
|
|
107
|
+
assert!(bm.contains(5));
|
|
108
|
+
assert!(bm.contains(63));
|
|
109
|
+
assert!(bm.contains(64));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#[test]
|
|
113
|
+
fn add_remove_tag_tracking() {
|
|
114
|
+
let mut idx = TagBitmapIndex::new();
|
|
115
|
+
idx.add(3, &["equip".into(), "ahu".into()]);
|
|
116
|
+
assert!(idx.has_tag("equip").is_some());
|
|
117
|
+
assert!(idx.has_tag("ahu").is_some());
|
|
118
|
+
|
|
119
|
+
idx.remove(3, &["equip".into(), "ahu".into()]);
|
|
120
|
+
let bm = idx.has_tag("equip").unwrap();
|
|
121
|
+
assert_eq!(TagBitmapIndex::count_ones(bm), 0);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
#[test]
|
|
125
|
+
fn intersect_multiple_bitmaps() {
|
|
126
|
+
let mut idx = TagBitmapIndex::new();
|
|
127
|
+
idx.add(1, &["site".into(), "equip".into()]);
|
|
128
|
+
idx.add(2, &["site".into()]);
|
|
129
|
+
idx.add(3, &["equip".into()]);
|
|
130
|
+
|
|
131
|
+
let site_bm = idx.has_tag("site").unwrap();
|
|
132
|
+
let equip_bm = idx.has_tag("equip").unwrap();
|
|
133
|
+
let result = TagBitmapIndex::intersect(&[site_bm, equip_bm]);
|
|
134
|
+
|
|
135
|
+
let bits: Vec<usize> = TagBitmapIndex::iter_set_bits(&result).collect();
|
|
136
|
+
assert_eq!(bits, vec![1]);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
#[test]
|
|
140
|
+
fn union_multiple_bitmaps() {
|
|
141
|
+
let mut idx = TagBitmapIndex::new();
|
|
142
|
+
idx.add(1, &["site".into()]);
|
|
143
|
+
idx.add(3, &["equip".into()]);
|
|
144
|
+
|
|
145
|
+
let site_bm = idx.has_tag("site").unwrap();
|
|
146
|
+
let equip_bm = idx.has_tag("equip").unwrap();
|
|
147
|
+
let result = TagBitmapIndex::union(&[site_bm, equip_bm]);
|
|
148
|
+
|
|
149
|
+
let bits: Vec<usize> = TagBitmapIndex::iter_set_bits(&result).collect();
|
|
150
|
+
assert_eq!(bits, vec![1, 3]);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
#[test]
|
|
154
|
+
fn negate_bitmap() {
|
|
155
|
+
let mut bm = RoaringBitmap::new();
|
|
156
|
+
bm.insert(1);
|
|
157
|
+
bm.insert(3);
|
|
158
|
+
let negated = TagBitmapIndex::negate(&bm, 5);
|
|
159
|
+
let bits: Vec<usize> = TagBitmapIndex::iter_set_bits(&negated).collect();
|
|
160
|
+
assert_eq!(bits, vec![0, 2, 4]);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
#[test]
|
|
164
|
+
fn iterate_set_bits() {
|
|
165
|
+
let mut bm = RoaringBitmap::new();
|
|
166
|
+
bm.insert(0);
|
|
167
|
+
bm.insert(2);
|
|
168
|
+
bm.insert(4);
|
|
169
|
+
bm.insert(128);
|
|
170
|
+
let bits: Vec<usize> = TagBitmapIndex::iter_set_bits(&bm).collect();
|
|
171
|
+
assert_eq!(bits, vec![0, 2, 4, 128]);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
#[test]
|
|
175
|
+
fn auto_grow_capacity() {
|
|
176
|
+
let mut idx = TagBitmapIndex::new();
|
|
177
|
+
idx.add(2000, &["far_away".into()]);
|
|
178
|
+
let bm = idx.has_tag("far_away").unwrap();
|
|
179
|
+
let bits: Vec<usize> = TagBitmapIndex::iter_set_bits(bm).collect();
|
|
180
|
+
assert_eq!(bits, vec![2000]);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
#[test]
|
|
184
|
+
fn count_ones_popcount() {
|
|
185
|
+
let mut bm = RoaringBitmap::new();
|
|
186
|
+
for i in [0, 2, 3, 4, 64, 65] {
|
|
187
|
+
bm.insert(i);
|
|
188
|
+
}
|
|
189
|
+
assert_eq!(TagBitmapIndex::count_ones(&bm), 6);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
#[test]
|
|
193
|
+
fn empty_bitmap_operations() {
|
|
194
|
+
assert_eq!(TagBitmapIndex::intersect(&[]).len(), 0);
|
|
195
|
+
assert_eq!(TagBitmapIndex::union(&[]).len(), 0);
|
|
196
|
+
assert_eq!(TagBitmapIndex::negate(&RoaringBitmap::new(), 0).len(), 0);
|
|
197
|
+
assert_eq!(TagBitmapIndex::count_ones(&RoaringBitmap::new()), 0);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
#[test]
|
|
201
|
+
fn unknown_tag_returns_none() {
|
|
202
|
+
let idx = TagBitmapIndex::new();
|
|
203
|
+
assert!(idx.has_tag("nonexistent").is_none());
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
#[test]
|
|
207
|
+
fn remove_nonexistent_entity_is_noop() {
|
|
208
|
+
let mut idx = TagBitmapIndex::new();
|
|
209
|
+
idx.remove(999, &["site".into()]);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
#[test]
|
|
213
|
+
fn intersect_single_bitmap() {
|
|
214
|
+
let mut bm = RoaringBitmap::new();
|
|
215
|
+
bm.insert(0);
|
|
216
|
+
bm.insert(1);
|
|
217
|
+
bm.insert(2);
|
|
218
|
+
let result = TagBitmapIndex::intersect(&[&bm]);
|
|
219
|
+
assert_eq!(result.len(), 3);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
#[test]
|
|
223
|
+
fn negate_exact_word_boundary() {
|
|
224
|
+
let bm = RoaringBitmap::from_iter(0..64u32);
|
|
225
|
+
let negated = TagBitmapIndex::negate(&bm, 64);
|
|
226
|
+
assert_eq!(TagBitmapIndex::count_ones(&negated), 0);
|
|
227
|
+
}
|
|
228
|
+
}
|