Skip to content

Commit f24e76f

Browse files
Merge pull request #304 from marvin-hansen/main
Renamed dcl_data_structure crate to deep_causality_d...
2 parents 177ebff + 0484021 commit f24e76f

File tree

99 files changed

+306
-294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+306
-294
lines changed

Cargo.lock

Lines changed: 11 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ members = [
77
"dcl_data_structures",
88
"deep_causality",
99
"examples/*",
10+
"deep_causality_data_structures",
1011
"deep_causality_macros",
1112
"deep_causality_uncertain",
1213
]

dcl_data_structures/Cargo.toml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,3 @@ categories = ["data-structures", "science"]
1515
keywords = ["data-structures", "sliding-window", "grid-array"]
1616
# Exclude all bazel files as these conflict with Bazel workspace when vendored.
1717
exclude = ["*.bazel", "*/*.bazel", "*.bazel.*", "BUILD", "BUILD.bazel", "MODULE.bazel", ".bazelignore",".bazelrc", "tests/**/*"]
18-
19-
[[example]]
20-
name = "array_grid"
21-
path = "examples/array_grid/array_grid.rs"
22-
23-
[[example]]
24-
name = "window_type_array_storage"
25-
path = "examples/window_type/array_storage.rs"
26-
27-
#[[example]]
28-
#name = "window_type_unsafe_array_storage"
29-
#path = "examples/window_type/unsafe_array_storage.rs"
30-
31-
[[example]]
32-
name = "window_type_vector_storage"
33-
path = "examples/window_type/vector_storage.rs"
34-
35-
#[[example]]
36-
#name = "window_type_unsafe_vector_storage"
37-
#path = "examples/window_type/unsafe_vector_storage.rs"
38-
39-
[features]
40-
default = []
41-
unsafe = [] # Enable unsafe implementations
42-
43-
[dev-dependencies]
44-
criterion = { version = "0.7", features = ["html_reports"] }
45-
rand = { version = "0.9", features = ["small_rng"] }
46-
47-
[[bench]]
48-
name = "bench_dcl_data_structures"
49-
harness = false

dcl_data_structures/README.md

Lines changed: 1 addition & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,2 @@
1-
[//]: # (---)
21

3-
[//]: # (SPDX-License-Identifier: MIT)
4-
5-
[//]: # (---)
6-
7-
# 🏁 Data structures 🏁
8-
9-
[![Crates.io][crates-badge]][crates-url]
10-
[![Docs.rs][docs-badge]][docs-url]
11-
[![MIT licensed][mit-badge]][mit-url]
12-
![Tests][test-url]
13-
14-
[crates-badge]: https://img.shields.io/badge/Crates.io-Latest-blue
15-
16-
[crates-url]: https://crates.io/crates/dcl_data_structures
17-
18-
[docs-badge]: https://img.shields.io/badge/Docs.rs-Latest-blue
19-
20-
[docs-url]: https://docs.rs/dcl_data_structures/latest/dcl_data_structures/
21-
22-
[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg
23-
24-
[mit-url]: https://github.com/deepcausality-rs/deep_causality/blob/main/LICENSE
25-
26-
[test-url]: https://github.com/deepcausality-rs/deep_causality/actions/workflows/run_tests.yml/badge.svg
27-
28-
High performance datastructures used in [DeepCausality](https://github.com/deepcausality-rs/deep_causality).
29-
30-
ArrayGrid is an abstraction over scalars, vectors, and low dimensional matrices similar to a tensor.
31-
In contrast to a tensor, an ArrayGrid is limited to low dimensions (1 to 4), only allowing a scalar,
32-
vector, or matrix type. Still, all of them are represented as a static fixed-size const generic array.
33-
Fixed-sized arrays allow for several compiler optimizations, including a cache-aligned data layout and the removal of
34-
runtime array boundary checks because all structural parameters are known upfront, providing a significant performance
35-
boost over tensors.
36-
37-
The sliding window implementation over-allocates to trade space (memory) for time complexity by delaying the rewind
38-
operation when hitting the end of the underlying data structure.
39-
Specifically, a sliding window of size N can hold, without any array copy, approximately C-1 elements,
40-
where C is the total capacity defined as NxM with N as the window size and M as a multiple.
41-
This crate has two implementations, one over vector and the second over a const generic array. The const generic
42-
implementation is significantly faster than the vector-based version.
43-
44-
45-
## 🤔 Why?
46-
47-
1) Zero dependencies.
48-
2) Zero cost abstraction.
49-
3) Zero unsafe by default. Unsafe implementations are available through the `unsafe` feature flag.
50-
51-
# Performance:
52-
53-
## ArrayGrid
54-
55-
**Set value:**
56-
57-
| Dimension | Safe Implementation | Unsafe Implementation | Improvement |
58-
|-----------|-------------------|---------------------|-------------|
59-
| 1D Grid | 604.71 ps | 271.38 ps | 55.1% |
60-
| 2D Grid | 581.33 ps | 417.39 ps | 28.2% |
61-
| 3D Grid | 862.16 ps | 577.04 ps | 33.0% |
62-
| 4D Grid | 1.137 ns | 812.62 ps | 28.5% |
63-
64-
More details on performance can be found in the [Performance](README_ArrayGrid.md#performance) section
65-
of the [ArrayGrid document](README_ArrayGrid.md).
66-
67-
## Sliding Window
68-
69-
**Single Push:**
70-
71-
| Implementation | Single Push Time | Notes |
72-
|--------------------- |------------------ |------------------------------------------------------ |
73-
| ArrayStorage | ~2.08ns | Optimized for continuous access patterns |
74-
| VectorStorage | ~2.5ns | Good for dynamic sizing |
75-
| UnsafeVectorStorage | ~2.3ns | Better performance than safe vector |
76-
| UnsafeArrayStorage | ~1.9ns | Best performance for sequential and batch operations |
77-
78-
79-
**Sequential Operations:**
80-
81-
| Implementation | Operation Time | Notes |
82-
|----------------|----------------|--------------------------|
83-
| UnsafeArrayStorage | ~550ps | Best cache utilization |
84-
| ArrayStorage | ~605ps | Excellent cache locality |
85-
| UnsafeVectorStorage | ~750ps | Good for mixed workloads |
86-
| VectorStorage | ~850ps | Most predictable |
87-
88-
More details on performance can be found in the [Performance](README_SlidingWindow.md#performance) section
89-
of the [SlidingWindow document](README_SlidingWindow.md).
90-
91-
92-
## 🚀 Install
93-
94-
Just run:
95-
96-
```bash
97-
cargo add dcl_data_structures
98-
```
99-
100-
## 📚 Docs
101-
102-
* [API Docs](https://docs.rs/dcl_data_structures/0.4.3/dcl_data_structures/)
103-
104-
* [SlidingWindow Summary](README_SlidingWindow)
105-
106-
## ⭐ Usage
107-
108-
**ArrayGrid:**
109-
* [Design & Details](README_ArrayGrid)
110-
* [Benchmark](benches/benchmarks)
111-
* [Examples](examples/array_grid)
112-
* [Test](tests/grid_type)
113-
114-
**SlidingWindow:**
115-
* [Design & Details](README_SlidingWindow.md)
116-
* [Benchmark](benches/benchmarks)
117-
* [Examples](examples/window_type)
118-
* [Test](tests/window_type)
119-
120-
## 🙏 Prior Art
121-
122-
The project took inspiration from:
123-
124-
* [sliding_features](https://crates.io/crates/sliding_features)
125-
* [sliding-window-aggregation](https://crates.io/crates/sliding-window-aggregation)
126-
* [sliding_window_alt](https://crates.io/crates/sliding_window_alt)
127-
* [sliding_windows](https://crates.io/crates/sliding_windows)
128-
129-
## 👨‍💻👩‍💻 Contribution
130-
131-
Contributions are welcomed especially related to documentation, example code, and fixes.
132-
If unsure where to start, just open an issue and ask.
133-
134-
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in deep_causality by you,
135-
shall be licensed under the MIT licence, without any additional terms or conditions.
136-
137-
## 📜 Licence
138-
139-
This project is licensed under the [MIT license](LICENSE).
140-
141-
## 👮️ Security
142-
143-
For details about security, please read
144-
the [security policy](https://github.com/deepcausality-rs/deep_causality/blob/main/SECURITY.md).
145-
146-
## 💻 Author
147-
148-
* [Marvin Hansen](https://github.com/marvin-hansen).
149-
* Github GPG key ID: 369D5A0B210D39BC
150-
* GPG Fingerprint: 4B18 F7B2 04B9 7A72 967E 663E 369D 5A0B 210D 39BC
2+
**MOVED TO https://crates.io/crates/deep_causality_data_structures**

dcl_data_structures/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
* SPDX-License-Identifier: MIT
33
* Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
44
*/
5-
6-
pub mod grid_type;
7-
pub mod prelude;
8-
pub mod window_type;

deep_causality/Cargo.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[package]
55
name = "deep_causality"
6-
version = "0.9.0"
6+
version = "0.9.1"
77
edition = "2021"
88
rust-version = "1.80"
99
readme = "../deep_causality_uncertain/README.md"
@@ -19,19 +19,24 @@ authors = ["Marvin Hansen <[email protected]>", ]
1919
exclude = ["*.bazel", "*/*.bazel", "*.bazel.*", "BUILD", "BUILD.bazel", "MODULE.bazel", ".bazelignore",".bazelrc", "tests/**/*"]
2020

2121

22-
[dependencies.dcl_data_structures]
23-
path = "../dcl_data_structures"
22+
[dependencies.deep_causality_data_structures]
23+
path = "../deep_causality_data_structures"
2424
version = "0.9"
2525

2626

2727
[dependencies.deep_causality_macros]
2828
path = "../deep_causality_macros"
29-
version = "0.8.2"
29+
version = "0.8"
30+
31+
32+
#[dependencies.deep_causality_uncertain]
33+
#path = "../deep_causality_uncertain"
34+
#version = "0.1"
3035

3136

3237
[dependencies.ultragraph]
3338
path = "../ultragraph"
34-
version = "0.8.3"
39+
version = "0.8"
3540

3641

3742
[dev-dependencies]

deep_causality/src/traits/adjustable/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
44
*/
55

6-
use dcl_data_structures::prelude::ArrayGrid;
6+
use deep_causality_data_structures::ArrayGrid;
77

88
use crate::errors::{AdjustmentError, UpdateError};
99

deep_causality/src/types/context_node_types/data/adjustable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* Copyright (c) "2025" . The DeepCausality Authors and Contributors. All Rights Reserved.
44
*/
55

6-
use dcl_data_structures::grid_type::ArrayGrid;
7-
use dcl_data_structures::prelude::PointIndex;
6+
use deep_causality_data_structures::{ArrayGrid, PointIndex};
87
use std::hash::Hash;
98
use std::ops::{Add, Mul, Sub};
109

deep_causality/src/types/context_node_types/space/ecef_space/adjustable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
use crate::errors::{AdjustmentError, UpdateError};
77
use crate::{Adjustable, EcefSpace};
8-
use dcl_data_structures::grid_type::ArrayGrid;
9-
use dcl_data_structures::prelude::PointIndex;
8+
use deep_causality_data_structures::{ArrayGrid, PointIndex};
109
use std::f64;
1110

1211
impl Adjustable<f64> for EcefSpace {

deep_causality/src/types/context_node_types/space/euclidean_space/adjustable.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
use crate::errors::{AdjustmentError, UpdateError};
77
use crate::{Adjustable, EuclideanSpace};
8-
use dcl_data_structures::grid_type::ArrayGrid;
9-
use dcl_data_structures::prelude::PointIndex;
8+
use deep_causality_data_structures::{ArrayGrid, PointIndex};
109

1110
impl Adjustable<f64> for EuclideanSpace {
1211
fn update<const WIDTH: usize, const HEIGHT: usize, const DEPTH: usize, const TIME: usize>(

0 commit comments

Comments
 (0)