Skip to content

Commit

Permalink
Merge dev into dev-solver
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfierrog committed Apr 11, 2024
2 parents 0efcf49 + 287fc01 commit e69ef6d
Show file tree
Hide file tree
Showing 47 changed files with 1,395 additions and 655 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
toolchain: stable
- name: Test
run: cargo test --verbose
run: TEST_SETTING=0 cargo test --verbose

# Push formatting commit even if compilation/testing fails. This does not
# push a commit if no formatting is required.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
toolchain: stable
- name: Test
run: cargo test --verbose
run: TEST_SETTING=0 cargo test --verbose

check_format:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ flamegraph.svg

# MacOS desktop attributes file
.DS_Store

# Development data
/dev
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "doc"]
path = doc
url = [email protected]:GamesCrafters/GamesmanNova.wiki.git
27 changes: 27 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/GamesCrafters/GamesmanNova"
keywords = ["game", "solver", "strong-solver", "research"]
edition = "2021"
readme = "README.md"
exclude = ["/.github", "/data"]
exclude = ["/.github", "/dev"]

[[bin]]
path = "src/main.rs"
Expand All @@ -25,9 +25,13 @@ lto = "fat"
clap = { version = "^4", features = ["derive"] }
serde_json = "^1"
exitcode = "^1"
petgraph = "^0"
nalgebra = "^0"
colored = "^2"
anyhow = "^1"
bitvec = "^1"
regex = "^1"

[dev-dependencies]
strum_macros = "0.26"
petgraph = "^0"
strum = "0.26"
1 change: 1 addition & 0 deletions doc
Submodule doc added at 2f08ba
2 changes: 1 addition & 1 deletion src/database/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//! under which all database implementations' errors can be grouped into).
//!
//! #### Authorship
//!
//! - Max Fierro, 2/24/2024 ([email protected])
use std::{error::Error, fmt};
Expand Down Expand Up @@ -106,6 +105,7 @@ impl fmt::Display for DatabaseError {
table,
} => {
let rule = match data {
Datatype::BOOL => "of exactly 1 bit",
Datatype::DPFP => "of exactly 64 bits",
Datatype::SPFP => "of exactly 32 bits",
Datatype::SINT => "greater than 1 bit",
Expand Down
22 changes: 9 additions & 13 deletions src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//! solution set data, hopefully in an efficient and scalable way.
//!
//! #### Authorship
//!
//! - Max Fierro, 4/14/2023 ([email protected])
use anyhow::Result;
Expand All @@ -14,6 +13,10 @@ use std::path::Path;

use crate::{model::State, solver::RecordType};

/* RE-EXPORTS */

pub use util::SchemaBuilder;

/* UTILITY MODULES */

#[cfg(test)]
Expand Down Expand Up @@ -45,15 +48,6 @@ pub struct Schema {
size: usize,
}

/// Builder pattern intermediary for constructing a schema declaratively out of
/// provided attributes. This is here to help ensure schemas are not changed
/// accidentally after being instantiated.
pub struct SchemaBuilder {
attributes: Vec<Attribute>,
record: Option<RecordType>,
size: usize,
}

/// Represents a triad of a name string, a size in bits corresponding to an
/// "attribute" or "feature" associated with a database record, and the type
/// of the data it represents.
Expand All @@ -67,6 +61,7 @@ pub struct Attribute {
/// Specifies the type of data being stored within a record within a specific
/// contiguous subset of bits. This is used for interpretation. Here is the
/// meaning of each variant, with its possible sizes in bits:
/// - `BOOL`: Boolean of size exactly 1.
/// - `ENUM`: Enumeration of arbitrary size.
/// - `UINT`: Unsigned integer of arbitrary size.
/// - `SINT`: Signed integer of size greater than 1.
Expand All @@ -75,6 +70,7 @@ pub struct Attribute {
/// - `CSTR`: C-style string (ASCII character array) of a size divisible by 8.
#[derive(Debug, Copy, Clone)]
pub enum Datatype {
BOOL,
ENUM,
UINT,
SINT,
Expand All @@ -87,10 +83,10 @@ pub enum Datatype {

/// Represents the behavior of a Key-Value Store. No assumptions are made about
/// the size of the records being used, but keys are taken to be fixed-length.
pub trait KVStore<R: Record> {
fn put(&mut self, key: State, record: &R);
pub trait KVStore {
fn put<R: Record>(&mut self, key: State, record: &R);
fn get(&self, key: State) -> Option<&BitSlice<u8, Msb0>>;
fn del(&self, key: State);
fn del(&mut self, key: State);
}

/// Allows a database to be evicted to persistent media. Implementing this trait
Expand Down
3 changes: 1 addition & 2 deletions src/database/test.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! # Database Test Module
//! # Database Test Utilities Module
//!
//! This module provides integration tests for the database module.
//!
//! #### Authorship
//!
//! - Benjamin Riley Zimmerman, 3/8/2024 ([email protected])
// #[test]
Expand Down
Loading

0 comments on commit e69ef6d

Please sign in to comment.