Commit graph

15 commits

Author SHA1 Message Date
9e7979931c
♻️🍱 config, cli, vanth, vanth_derive, varo: Reformatted code and added editor configuration files
- Added `.zed/settings.json` to configure rust-analyzer with `leptosfmt`.
- Created `rustfmt.toml` with max width 120 and comment wrapping settings.
- Applied consistent formatting across all modified crates using rustfmt.
- Reorganized import statements and improved code style in multiple modules.
2025-08-07 12:49:33 +03:00
87957bfbf8
♻️📝 vanth, varo: Refactor storage backend, fix distribution sampling, and enhance type handling
- Refactored `Store` to use a trait-based backend with type-specific tables, replacing the previous enum approach.
- Implemented `Sqlite` and `Memory` backends with proper table management and type-aware operations.
- Added serialization/deserialization handling in `Store` using `serde_json`.
- Implemented `ToString` for `Ty` and improved equality comparisons using string representation.
- Fixed `Distribution::sample` in `varo` to correctly handle 0, 1, and 2+ moments cases.
- Updated store integration tests to verify type-specific storage operations including write, read, and deletion.
- Commented out unfinished `EntityContents` and related structs pending future implementation.
2025-08-07 12:05:55 +03:00
db531c8c73
🧪 workspace, varo: Implement RNG with ChaCha8 and add optimization function
- Updated `Cargo.toml` and `Cargo.lock` to downgrade `rand_core` to 0.6.4 and add `rand_chacha` dependency with `serde1` feature.
- Implemented `Rng` struct wrapping `ChaCha8Rng` with seed initialization, stream selection, and number generation methods.
- Added `rng_new`, `rng_from_seed`, `rng_set_stream`, `rng_next_u32`, `rng_next_u64`, `rng_fill_bytes`, `rng_gen_f32`, and `rng_gen_gaussian` functions.
- Made `value` field in `Score` and `values` field in `OptimizationResult` public.
- Implemented `Distribution::sample` method that generates Gaussian numbers when moments are available.
- Added `From<f32>` implementation for `Score`.
- Implemented `optimize` function that evaluates candidates using cloned RNG streams and returns sorted results.
- Added integration test `test_optimize` that verifies optimization sorting behavior.
2025-08-06 16:46:58 +03:00
5614cfe95f
🧪💩 workspace, vanth, varo: Add varo crate and Root struct, update dependencies
- Replaced `bitcode` crate with `bincode` in workspace dependencies.
- Added new crate `varo` for random optimization with `Varo` trait, `Distribution`, and `optimize` function.
- Defined `Root` world struct placeholder in `vanth` crate.
- Created `reference.rs` test module in `vanth` with custom components and events.
- Added TODOs in `varo` for RNG implementation and `optimize` function.
2025-08-06 16:20:05 +03:00
a1cc9b6e04
vanth/store, tests: Add persistent SQLite and in-memory store backends with CRUD operations
- Added `rusqlite` and `sqlx` dependencies to support SQLite backend functionality for the store.
- Implemented `Store` struct with backend switching between in-memory (`HashMap`) and SQLite-based storage.
- Added CRUD operations (`read`, `write`, `delete`) to the `Store` API with error handling.
- Created integration tests for SQLite store persistence and basic operations.
2025-08-05 18:26:08 +03:00
b36f178999
🧪♻️ vanth, vanth_derive: Add derive macro for Vanth trait implementation
- Added `vanth_derive` crate with a procedural macro to automatically implement the `Vanth` trait for structs, including generics.
- Refactored `vanth` crate by removing obsolete `vanth.rs` file.
- Implemented `PartialEq` for `Ty` to enable comparisons with string values and another `Ty`.
- Added integration tests for deriving `Vanth` with generic parameters.
- Updated dependencies: added `quote`, `syn`, and `proc-macro2` crates.
2025-08-05 14:51:29 +03:00
94105daca1
♻️🧪 vanth: Add From impl, make struct public, refactor tests
- Implemented `From<Value>` for `HashedValue`
- Made `ReferenceRetrievalTask` struct public
- Removed extraneous space in `#[derive]` attribute for `ReferenceValue`
- Consolidated integration tests into `tests/integration` directory
- Added new `test_derive` function with debug output
- Deleted obsolete test files: `main.rs`, `store.rs`, and `test_node.rs`
2025-08-05 11:40:56 +03:00
8b76fcb659
♻️💩 cli, vanth, Cargo.toml, Cargo.lock: Add CLI framework and refactor vanth crate structure
- Added a new `vanth_cli` crate with `clap` command structure for `vanth fs open/save` commands.
- Removed `main.rs` from `vanth` crate as it is now a library without a binary target.
- Added `fs.rs` module and new structs `HashedValue`, `Value`, `Ty` with `Vanth` trait to support serialization.
- Updated `Cargo.toml` to include `clap` as a workspace dependency and added `vanth_cli` as a new crate.
- Added multiple dependencies (`anstream`, `anstyle`, `clap`, `heck`, etc.) in `Cargo.lock` to support the CLI.
- Created placeholder test files `tests/fs/mod.rs` and `tests/main.rs` in `vanth` crate for future use.
- Marked CLI command implementations with TODOs as functionality is not yet implemented.
2025-08-04 21:36:25 +03:00
45a68865b6
♻️🍱💩👷 crates/vanth, project: Refactor entity system and setup; migrate to Nix flakes
- Add `.cargo/config.toml` with target directory and rustflags configuration.
- Remove devenv files and set up Nix flake configuration with `flake.nix` and `flake.lock`.
- Add dependencies on `blake3`, `digest`, and hashing-related crates for content hashing functionality.
- Implement `EntityId` as hashed representation and `ContentHash` component using Blake3.
- Add `hashing_serializer` module for serializing and hashing components.
- Remove unused `parser` module and restructure lib.rs with new `Reference` type and storage interfaces.
- Add test files for `store` and `reference` functionality with TODOs for implementation.
- Introduce `VanthPlugin` skeleton and entity save/load interfaces with placeholder implementations.
- Add `Reference` type with retrieval state machine and async handling stubs.
2025-08-04 21:03:15 +03:00
be75844fdd
vanth, workspace: Add entity ID system and serialization dependencies
- Added new modules `entity` and `store` to `vanth` crate for ECS foundations
- Implemented generic `Id` type with serialization/deserialization support
- Introduced `serde` and `serde_json` dependencies in workspace and vanth crate
- Defined `Vanth` struct and `ContentHash` component in `lib.rs`
- Added placeholder `Store` component in new module
- Updated workspace configuration with `resolver = "3"` and dependency versions
2025-07-23 10:40:23 +03:00
93e114a23a
Implement entity_count and remove the todo macro
The `entity_count` method in the `Node` struct now correctly returns the
number of entities in the world by querying for all entities. I've removed
the `todo!()` macro which was preventing proper compilation and execution.
2025-07-13 23:39:58 +03:00
11a87bcf5e
Move to crates 2025-07-13 00:21:46 +03:00
ccad41ab9e
Refactor: Convert project to a Bevy-based workspace and node
This commit refactors the Vanth project to utilize a `Cargo.toml` workspace,
encapsulating the core logic within a `vanth` library crate. The existing
`src` files are moved into the new `vanth/src` directory.

The primary change is the integration of the Bevy game engine as the
underlying framework for the Vanth node, shifting from the previous
`whirlwind` dependency. This transition is reflected in `Cargo.toml`
updates, adding `bevy_app` and `bevy_ecs` as dependencies and removing
`whirlwind`.

A new test file `vanth/tests/test_node.rs` is introduced to cover the
initial functionality of the `Node` struct. The `LICENSE` year range is
also updated.

This refactoring sets the stage for Vanth's evolution into a distributed
ECS-based database model, leveraging Bevy's robust ECS capabilities.
2025-07-12 22:59:41 +03:00
5bd3a07a61
Add object override idea 2024-11-14 23:41:13 +00:00
f7d089e64d
Init commit 2024-11-14 23:24:15 +00:00