diff --git a/crates/synor-bridge/src/ethereum.rs b/crates/synor-bridge/src/ethereum.rs index 82b3015..5509edb 100644 --- a/crates/synor-bridge/src/ethereum.rs +++ b/crates/synor-bridge/src/ethereum.rs @@ -642,6 +642,7 @@ impl Bridge for EthereumBridge { #[cfg(test)] mod tests { use super::*; + use crate::TransferDirection; // ==================== Helper Functions ==================== diff --git a/crates/synor-compute/src/device/mod.rs b/crates/synor-compute/src/device/mod.rs index cb56bbd..01c98fe 100644 --- a/crates/synor-compute/src/device/mod.rs +++ b/crates/synor-compute/src/device/mod.rs @@ -9,7 +9,7 @@ //! - IoT devices use crate::error::ComputeError; -use crate::processor::{GenericProcessor, Processor, ProcessorCapabilities, ProcessorId, ProcessorType}; +use crate::processor::{GenericProcessor, Processor, ProcessorId, ProcessorType}; use crate::{NodeId, ProcessorInfo}; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; diff --git a/crates/synor-compute/src/market/mod.rs b/crates/synor-compute/src/market/mod.rs index d7300b2..74801fb 100644 --- a/crates/synor-compute/src/market/mod.rs +++ b/crates/synor-compute/src/market/mod.rs @@ -5,7 +5,7 @@ use crate::error::ComputeError; use crate::processor::ProcessorType; -use crate::{NodeId, ProcessorId}; +use crate::NodeId; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::collections::{BinaryHeap, HashMap}; diff --git a/crates/synor-compute/src/memory/mod.rs b/crates/synor-compute/src/memory/mod.rs index ef0dd6b..32786e3 100644 --- a/crates/synor-compute/src/memory/mod.rs +++ b/crates/synor-compute/src/memory/mod.rs @@ -5,7 +5,6 @@ use crate::processor::ProcessorType; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::collections::HashMap; -use std::sync::Arc; /// Tensor handle for memory management. #[derive(Clone, Debug)] diff --git a/crates/synor-compute/src/model/mod.rs b/crates/synor-compute/src/model/mod.rs index 4c1b9cd..38d8636 100644 --- a/crates/synor-compute/src/model/mod.rs +++ b/crates/synor-compute/src/model/mod.rs @@ -8,7 +8,6 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; -use std::sync::Arc; use parking_lot::RwLock; diff --git a/crates/synor-compute/src/processor/capabilities.rs b/crates/synor-compute/src/processor/capabilities.rs index bedb6aa..0fa9d4d 100644 --- a/crates/synor-compute/src/processor/capabilities.rs +++ b/crates/synor-compute/src/processor/capabilities.rs @@ -116,7 +116,7 @@ impl ProcessorCapabilities { /// Creates NVIDIA GPU capabilities. pub fn nvidia_gpu( cuda_cores: u32, - tensor_cores: u32, + _tensor_cores: u32, vram_gb: u32, bandwidth_gbps: u32, compute_capability: (u8, u8), diff --git a/crates/synor-compute/src/scheduler/load_balancer.rs b/crates/synor-compute/src/scheduler/load_balancer.rs index 17a695e..b9d34b5 100644 --- a/crates/synor-compute/src/scheduler/load_balancer.rs +++ b/crates/synor-compute/src/scheduler/load_balancer.rs @@ -6,7 +6,7 @@ //! - Latency-aware scheduling //! - Real-time utilization metrics -use crate::device::{DeviceInfo, DeviceRegistry}; +use crate::device::DeviceRegistry; use crate::processor::{Operation, OperationType, ProcessorId, ProcessorType}; use crate::task::{Task, TaskId, TaskPriority}; use super::TaskAssignment; @@ -425,7 +425,7 @@ impl LoadBalancer { let efficiency = 1.0 / power.max(1.0); let load_factor = 1.0 - utilization; - (speed * 0.4 + efficiency * 0.3 + load_factor * 0.3) + speed * 0.4 + efficiency * 0.3 + load_factor * 0.3 } BalancingStrategy::Cost => { @@ -475,7 +475,7 @@ impl LoadBalancer { &self, task: &Task, suggested_processor: ProcessorId, - current_assignment: &TaskAssignment, + _current_assignment: &TaskAssignment, ) -> ProcessorId { // Get all registered processors let processor_types = self.processor_types.read(); diff --git a/crates/synor-compute/src/scheduler/mod.rs b/crates/synor-compute/src/scheduler/mod.rs index aaf6b5e..bd8b50c 100644 --- a/crates/synor-compute/src/scheduler/mod.rs +++ b/crates/synor-compute/src/scheduler/mod.rs @@ -14,8 +14,8 @@ pub use work_queue::WorkQueue; use crate::device::DeviceRegistry; use crate::error::ComputeError; -use crate::processor::{Operation, Processor, ProcessorId, ProcessorType}; -use crate::task::{Task, TaskId, TaskPriority}; +use crate::processor::{Processor, ProcessorId, ProcessorType}; +use crate::task::{Task, TaskId}; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -250,7 +250,7 @@ impl HeterogeneousScheduler { &self, tasks: &[Task], assignment: &TaskAssignment, - deps: &DependencyGraph, + _deps: &DependencyGraph, ) -> Result { let mut stages = Vec::new(); let mut scheduled = std::collections::HashSet::new(); diff --git a/crates/synor-compute/src/scheduler/work_queue.rs b/crates/synor-compute/src/scheduler/work_queue.rs index fba13d1..a961066 100644 --- a/crates/synor-compute/src/scheduler/work_queue.rs +++ b/crates/synor-compute/src/scheduler/work_queue.rs @@ -1,7 +1,7 @@ //! Work queue with thread-safe task management. use crate::processor::ProcessorType; -use crate::task::{Task, TaskId, TaskPriority}; +use crate::task::{Task, TaskPriority}; use crossbeam_channel::{bounded, Receiver, Sender, TryRecvError}; use std::collections::HashMap; use std::sync::atomic::{AtomicU64, Ordering}; diff --git a/crates/synor-compute/src/task/mod.rs b/crates/synor-compute/src/task/mod.rs index a51b3f9..3c7abc7 100644 --- a/crates/synor-compute/src/task/mod.rs +++ b/crates/synor-compute/src/task/mod.rs @@ -256,7 +256,7 @@ impl TaskDecomposer { let mut tasks = Vec::new(); if let JobType::Training { - epochs, + epochs: _, batch_size, .. } = &job.job_type diff --git a/crates/synor-database/src/document.rs b/crates/synor-database/src/document.rs index e5d198d..8b6db67 100644 --- a/crates/synor-database/src/document.rs +++ b/crates/synor-database/src/document.rs @@ -528,6 +528,33 @@ impl DocumentStore { .ok_or_else(|| DatabaseError::CollectionNotFound(collection.to_string()))?; Ok(coll.find_one(filter)) } + + /// Finds a document by ID. + pub fn find_by_id(&self, collection: &str, id: &DocumentId) -> Result, DatabaseError> { + let collections = self.collections.read(); + let coll = collections + .get(collection) + .ok_or_else(|| DatabaseError::CollectionNotFound(collection.to_string()))?; + Ok(coll.find_by_id(id)) + } + + /// Updates a document by ID. + pub fn update_by_id(&self, collection: &str, id: &DocumentId, update: JsonValue) -> Result { + let collections = self.collections.read(); + let coll = collections + .get(collection) + .ok_or_else(|| DatabaseError::CollectionNotFound(collection.to_string()))?; + coll.update_by_id(id, update) + } + + /// Deletes a document by ID. + pub fn delete_by_id(&self, collection: &str, id: &DocumentId) -> Result { + let collections = self.collections.read(); + let coll = collections + .get(collection) + .ok_or_else(|| DatabaseError::CollectionNotFound(collection.to_string()))?; + coll.delete_by_id(id) + } } impl Default for DocumentStore { diff --git a/crates/synor-database/src/gateway/handlers.rs b/crates/synor-database/src/gateway/handlers.rs index 7d4da0e..d52b28f 100644 --- a/crates/synor-database/src/gateway/handlers.rs +++ b/crates/synor-database/src/gateway/handlers.rs @@ -1,17 +1,14 @@ //! HTTP request handlers for Database Gateway. -use crate::document::{Document, DocumentFilter, DocumentId}; -use crate::error::DatabaseError; -use crate::gateway::{ApiResponse, Pagination}; +use crate::document::Document; +use crate::gateway::ApiResponse; use crate::keyvalue::KeyValueStore; -use crate::query::{Filter, Query, QueryResult, SortOrder}; -use crate::timeseries::{Aggregation, DataPoint}; -use crate::vector::{Embedding, VectorSearchResult}; -use crate::{Database, DatabaseManager}; +use crate::query::{Filter, QueryResult}; +use crate::timeseries::DataPoint; +use crate::vector::VectorSearchResult; use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue; -use std::sync::Arc; // ============================================================================ // Key-Value Handlers diff --git a/crates/synor-database/src/gateway/router.rs b/crates/synor-database/src/gateway/router.rs index bda359b..8aef32d 100644 --- a/crates/synor-database/src/gateway/router.rs +++ b/crates/synor-database/src/gateway/router.rs @@ -1,23 +1,22 @@ //! HTTP router for Database Gateway using Axum. use crate::document::DocumentId; -use crate::gateway::auth::{ApiKey, AuthError, AuthMiddleware, Operation}; +use crate::gateway::auth::{ApiKey, AuthError, AuthMiddleware}; use crate::gateway::handlers::*; use crate::gateway::{ApiResponse, UsageMetrics}; -use crate::query::{Filter, Query, SortOrder}; +use crate::query::{Query, SortOrder}; use crate::timeseries::DataPoint; use crate::vector::Embedding; -use crate::{Database, DatabaseConfig, DatabaseManager}; +use crate::{DatabaseConfig, DatabaseManager}; use axum::{ - extract::{Path, Query as AxumQuery, State}, + extract::{Path, State}, http::{HeaderMap, StatusCode}, response::IntoResponse, routing::{delete, get, post, put}, Json, Router, }; use parking_lot::RwLock; -use serde_json::Value as JsonValue; use std::sync::Arc; /// Application state shared across handlers. @@ -132,7 +131,7 @@ async fn get_stats(State(state): State>) -> impl IntoResponse { async fn kv_get( State(state): State>, - headers: HeaderMap, + _headers: HeaderMap, Path(key): Path, ) -> impl IntoResponse { // For demo, use a default database @@ -148,7 +147,7 @@ async fn kv_get( async fn kv_set( State(state): State>, - headers: HeaderMap, + _headers: HeaderMap, Path(key): Path, Json(req): Json, ) -> impl IntoResponse { @@ -164,7 +163,7 @@ async fn kv_set( async fn kv_delete( State(state): State>, - headers: HeaderMap, + _headers: HeaderMap, Path(key): Path, ) -> impl IntoResponse { let db = match get_default_database(&state) { @@ -178,7 +177,7 @@ async fn kv_delete( async fn kv_batch( State(state): State>, - headers: HeaderMap, + _headers: HeaderMap, Json(req): Json, ) -> impl IntoResponse { let db = match get_default_database(&state) { @@ -196,7 +195,7 @@ async fn kv_batch( async fn list_databases( State(state): State>, - headers: HeaderMap, + _headers: HeaderMap, ) -> impl IntoResponse { // List all databases (would filter by owner in production) let owner = [0u8; 32]; // Default owner @@ -223,7 +222,7 @@ async fn list_databases( async fn create_database( State(state): State>, - headers: HeaderMap, + _headers: HeaderMap, Json(req): Json, ) -> impl IntoResponse { let config = DatabaseConfig { @@ -329,7 +328,7 @@ async fn drop_collection( async fn list_documents( State(state): State>, - Path((db_name, coll_name)): Path<(String, String)>, + Path((db_name, _coll_name)): Path<(String, String)>, ) -> impl IntoResponse { let db = match get_database(&state, &db_name) { Some(db) => db, @@ -450,8 +449,17 @@ async fn get_document( Err(e) => return Json(ApiResponse::error(e.to_string())), }; - // Would need to query by ID - Json(ApiResponse::error("Get by ID not yet implemented")) + match db.documents().find_by_id(&coll_name, &id) { + Ok(Some(doc)) => Json(ApiResponse::ok(DocumentResponse { + id: doc.id.to_hex(), + data: doc.data, + created_at: doc.created_at, + updated_at: doc.updated_at, + version: doc.version, + })), + Ok(None) => Json(ApiResponse::error("Document not found")), + Err(e) => Json(ApiResponse::error(e.to_string())), + } } async fn update_document( @@ -469,15 +477,35 @@ async fn update_document( Err(e) => return Json(ApiResponse::error(e.to_string())), }; - state.record_write(0); - Json(ApiResponse::error("Update not yet implemented")) + let update_size = serde_json::to_vec(&req.update).map(|v| v.len()).unwrap_or(0); + state.record_write(update_size as u64); + + match db.documents().update_by_id(&coll_name, &id, req.update) { + Ok(true) => Json(ApiResponse::ok(true)), + Ok(false) => Json(ApiResponse::error("Document not found")), + Err(e) => Json(ApiResponse::error(e.to_string())), + } } async fn delete_document( State(state): State>, Path((db_name, coll_name, doc_id)): Path<(String, String, String)>, ) -> impl IntoResponse { - Json(ApiResponse::::error("Delete not yet implemented")) + let db = match get_database(&state, &db_name) { + Some(db) => db, + None => return Json(ApiResponse::::error("Database not found")), + }; + + let id = match DocumentId::from_hex(&doc_id) { + Ok(id) => id, + Err(e) => return Json(ApiResponse::error(e.to_string())), + }; + + match db.documents().delete_by_id(&coll_name, &id) { + Ok(true) => Json(ApiResponse::ok(true)), + Ok(false) => Json(ApiResponse::error("Document not found")), + Err(e) => Json(ApiResponse::error(e.to_string())), + } } // ============================================================================ diff --git a/crates/synor-database/src/graph/path.rs b/crates/synor-database/src/graph/path.rs index 15df44d..16e3508 100644 --- a/crates/synor-database/src/graph/path.rs +++ b/crates/synor-database/src/graph/path.rs @@ -1,7 +1,7 @@ //! Path finding algorithms for graphs. use super::edge::Edge; -use super::node::{Node, NodeId}; +use super::node::NodeId; use super::store::{Direction, GraphStore}; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; diff --git a/crates/synor-database/src/graph/query.rs b/crates/synor-database/src/graph/query.rs index dbc9dc3..44f0be1 100644 --- a/crates/synor-database/src/graph/query.rs +++ b/crates/synor-database/src/graph/query.rs @@ -1,8 +1,8 @@ //! Simplified Cypher-like query language for graphs. use super::edge::Edge; -use super::node::{Node, NodeId}; -use super::store::{Direction, GraphError, GraphStore}; +use super::node::Node; +use super::store::{GraphError, GraphStore}; use super::traversal::{TraversalDirection, TraversalQuery, Traverser}; use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue; diff --git a/crates/synor-database/src/index.rs b/crates/synor-database/src/index.rs index 5675c7e..b42a135 100644 --- a/crates/synor-database/src/index.rs +++ b/crates/synor-database/src/index.rs @@ -362,9 +362,16 @@ impl IndexManager { } /// Gets an index by name. + /// Note: Returns None as the current implementation stores Index directly. + /// A production implementation would store Arc to enable sharing. pub fn get_index(&self, name: &str) -> Option> { - // Simplified - real impl would use Arc - None + // Check if index exists, but can't return Arc without storing Arc internally + if self.indexes.read().contains_key(name) { + // TODO: Store indexes as Arc to enable retrieval + None + } else { + None + } } /// Gets indexes for a collection. diff --git a/crates/synor-database/src/replication/raft.rs b/crates/synor-database/src/replication/raft.rs index 2a9adcb..adce4ad 100644 --- a/crates/synor-database/src/replication/raft.rs +++ b/crates/synor-database/src/replication/raft.rs @@ -7,7 +7,7 @@ use super::rpc::{ AppendEntries, AppendEntriesResponse, InstallSnapshot, InstallSnapshotResponse, RequestVote, RequestVoteResponse, RpcMessage, }; -use super::snapshot::{Snapshot, SnapshotConfig, SnapshotManager}; +use super::snapshot::{SnapshotConfig, SnapshotManager}; use super::state::{Command, LeaderState, NodeRole, RaftState}; use serde::{Deserialize, Serialize}; use std::time::{Duration, Instant}; diff --git a/crates/synor-database/src/sql/executor.rs b/crates/synor-database/src/sql/executor.rs index e6ae516..ac5847e 100644 --- a/crates/synor-database/src/sql/executor.rs +++ b/crates/synor-database/src/sql/executor.rs @@ -1,13 +1,13 @@ //! SQL query executor. use super::parser::{ - BinaryOp, JoinType, ParsedExpr, ParsedOrderBy, ParsedSelect, ParsedSelectItem, + BinaryOp, ParsedExpr, ParsedSelect, ParsedSelectItem, ParsedStatement, SqlParser, }; -use super::row::{Row, RowBuilder, RowId}; +use super::row::{Row, RowId}; use super::table::{ColumnDef, Table, TableDef}; -use super::transaction::{IsolationLevel, TransactionId, TransactionManager, TransactionOp}; -use super::types::{SqlError, SqlType, SqlValue}; +use super::transaction::{IsolationLevel, TransactionId, TransactionManager}; +use super::types::{SqlError, SqlValue}; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -280,7 +280,7 @@ impl SqlEngine { &self, select: &ParsedSelect, rows: &[Row], - table: &Table, + _table: &Table, ) -> Result { let mut result_columns = Vec::new(); let mut result_values = Vec::new(); @@ -536,7 +536,7 @@ impl SqlEngine { /// Matches a LIKE pattern. fn match_like(&self, text: &str, pattern: &str) -> bool { // Simple LIKE implementation: % = any chars, _ = single char - let regex_pattern = pattern + let _regex_pattern = pattern .replace('%', ".*") .replace('_', "."); // For simplicity, just do case-insensitive contains for now @@ -681,7 +681,7 @@ impl SqlEngine { } /// Drops an index. - fn execute_drop_index(&self, name: &str) -> Result { + fn execute_drop_index(&self, _name: &str) -> Result { // Would need to find which table has this index // For now, return success Ok(QueryResult::empty()) diff --git a/crates/synor-database/src/sql/row.rs b/crates/synor-database/src/sql/row.rs index 8090591..f193728 100644 --- a/crates/synor-database/src/sql/row.rs +++ b/crates/synor-database/src/sql/row.rs @@ -1,6 +1,6 @@ //! Row representation for SQL tables. -use super::types::{SqlError, SqlValue}; +use super::types::SqlValue; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/crates/synor-database/src/vector.rs b/crates/synor-database/src/vector.rs index 86cd8a9..d948198 100644 --- a/crates/synor-database/src/vector.rs +++ b/crates/synor-database/src/vector.rs @@ -311,7 +311,7 @@ impl VectorStore { } /// Gets an index by name. - pub fn get_index(&self, name: &str) -> Option<&VectorIndex> { + pub fn get_index(&self, _name: &str) -> Option<&VectorIndex> { // Simplified - would use Arc in production None } diff --git a/crates/synor-economics/src/oracle/derivatives.rs b/crates/synor-economics/src/oracle/derivatives.rs index 80babfa..42fd57e 100644 --- a/crates/synor-economics/src/oracle/derivatives.rs +++ b/crates/synor-economics/src/oracle/derivatives.rs @@ -271,7 +271,7 @@ impl BlackScholes { let n_d2 = norm_cdf(d2); let n_prime_d1 = norm_pdf(d1); - let (delta, theta_sign) = match contract.option_type { + let (delta, _theta_sign) = match contract.option_type { OptionType::Call => ((-q * t).exp() * n_d1, 1.0), OptionType::Put => ((-q * t).exp() * (n_d1 - 1.0), -1.0), }; diff --git a/crates/synor-hosting/src/compute.rs b/crates/synor-hosting/src/compute.rs index 0fd7b69..2e841d6 100644 --- a/crates/synor-hosting/src/compute.rs +++ b/crates/synor-hosting/src/compute.rs @@ -178,7 +178,7 @@ impl EdgeCompute { pub async fn execute( &self, config: &EdgeFunctionConfig, - request: EdgeRequest, + _request: EdgeRequest, ) -> Result { if !self.enabled { return Err(EdgeError::NotEnabled); @@ -201,7 +201,7 @@ impl EdgeCompute { pub async fn optimize_image( &self, image_data: &[u8], - options: ImageOptimizeOptions, + _options: ImageOptimizeOptions, ) -> Result, EdgeError> { if !self.enabled { return Err(EdgeError::NotEnabled); @@ -219,8 +219,8 @@ impl EdgeCompute { /// Run AI inference at the edge. pub async fn inference( &self, - model: &str, - input: &[u8], + _model: &str, + _input: &[u8], ) -> Result, EdgeError> { if !self.enabled { return Err(EdgeError::NotEnabled); diff --git a/crates/synor-privacy/src/bulletproofs.rs b/crates/synor-privacy/src/bulletproofs.rs index ba03780..1628188 100644 --- a/crates/synor-privacy/src/bulletproofs.rs +++ b/crates/synor-privacy/src/bulletproofs.rs @@ -18,7 +18,6 @@ use alloc::vec::Vec; use curve25519_dalek::{ - constants::RISTRETTO_BASEPOINT_POINT, ristretto::{CompressedRistretto, RistrettoPoint}, scalar::Scalar, }; @@ -148,8 +147,8 @@ impl RangeProof { ))); } - let g = generator_g(); - let h = generator_h(); + let _g = generator_g(); + let _h = generator_h(); // Verify each bit proof for (i, (commit_bytes, proof)) in self.bit_commitments.iter().zip(&self.bit_proofs).enumerate() { @@ -192,7 +191,7 @@ fn prove_bit( commitment: &RistrettoPoint, rng: &mut R, ) -> Result { - let g = generator_g(); + let _g = generator_g(); let h = generator_h(); // OR proof: prove C is commitment to 0 OR C is commitment to 1 diff --git a/crates/synor-privacy/src/confidential.rs b/crates/synor-privacy/src/confidential.rs index f44911b..f25d9b0 100644 --- a/crates/synor-privacy/src/confidential.rs +++ b/crates/synor-privacy/src/confidential.rs @@ -561,12 +561,12 @@ impl ExcessSignature { use curve25519_dalek::ristretto::CompressedRistretto; let g = RISTRETTO_BASEPOINT_POINT; - let h = crate::pedersen::generator_h(); + let _h = crate::pedersen::generator_h(); // Expected excess = sum_inputs - sum_outputs - fee*H // (The fee is a commitment to fee with blinding factor 0) let fee_commitment = PedersenCommitment::from_point(g * Scalar::from(fee)); - let expected_excess = sum_inputs.as_point() - sum_outputs.as_point() - fee_commitment.as_point(); + let _expected_excess = sum_inputs.as_point() - sum_outputs.as_point() - fee_commitment.as_point(); // Check excess pubkey matches let excess_point = CompressedRistretto::from_slice(&self.excess_pubkey) @@ -662,7 +662,7 @@ impl ConfidentialTransactionBuilder { /// Build the transaction pub fn build(self, rng: &mut R) -> Result { // Calculate total inputs and outputs - let total_input: u64 = self.outputs.iter().map(|(_, a)| *a).sum::() + self.fee; + let _total_input: u64 = self.outputs.iter().map(|(_, a)| *a).sum::() + self.fee; // Collect input blindings let input_blindings: Vec = self.inputs.iter() diff --git a/crates/synor-verifier/src/checker.rs b/crates/synor-verifier/src/checker.rs index 43e014e..3510895 100644 --- a/crates/synor-verifier/src/checker.rs +++ b/crates/synor-verifier/src/checker.rs @@ -4,10 +4,10 @@ use serde::{Deserialize, Serialize}; -use crate::ast::{Annotation, Expression, Invariant, Property, PropertyKind}; +use crate::ast::{Annotation, Invariant, Property, PropertyKind}; use crate::error::{VerifierError, VerifierResult}; use crate::prover::{ProofResult, Prover, ProverConfig}; -use crate::symbolic::{SymbolicExecutor, SymbolicState}; +use crate::symbolic::SymbolicExecutor; use crate::{Severity, VerificationContext}; /// Result of checking a property. @@ -241,7 +241,7 @@ impl PropertyChecker { prop: &Property, ) -> VerifierResult { // Check if there exists a path where property holds - let state = self.executor.create_initial_state(ctx)?; + let _state = self.executor.create_initial_state(ctx)?; let satisfiable = self.prover.check_sat(&prop.expr)?; if satisfiable { @@ -265,7 +265,7 @@ impl PropertyChecker { /// Checks reachability (some state is reachable). fn check_reachability( &self, - ctx: &VerificationContext, + _ctx: &VerificationContext, prop: &Property, ) -> VerifierResult { // Check if target state is reachable @@ -292,7 +292,7 @@ impl PropertyChecker { ann: &Annotation, ) -> VerifierResult { // Get function signature - let func = ctx.functions.get(&ann.function).ok_or_else(|| { + let _func = ctx.functions.get(&ann.function).ok_or_else(|| { VerifierError::UnknownFunction(ann.function.clone()) })?; diff --git a/crates/synor-verifier/src/prover.rs b/crates/synor-verifier/src/prover.rs index 0f3a50c..e4be3fc 100644 --- a/crates/synor-verifier/src/prover.rs +++ b/crates/synor-verifier/src/prover.rs @@ -143,7 +143,7 @@ impl Prover { /// Proves or disproves an expression holds in all states. pub fn prove(&self, expr: &Expression, state: &SymbolicState) -> VerifierResult { let start = Instant::now(); - let timeout = Duration::from_millis(self.config.timeout_ms); + let _timeout = Duration::from_millis(self.config.timeout_ms); // Convert expression and state to SMT constraints let constraints = self.smt.encode_state(state)?; diff --git a/crates/synor-verifier/src/smt.rs b/crates/synor-verifier/src/smt.rs index 4bfbcb3..c5b8d0b 100644 --- a/crates/synor-verifier/src/smt.rs +++ b/crates/synor-verifier/src/smt.rs @@ -3,7 +3,7 @@ //! Provides an interface to SMT solvers for constraint solving. use crate::ast::{BinaryOperator, Expression, Literal, QuantifierKind, UnaryOperator}; -use crate::error::{VerifierError, VerifierResult}; +use crate::error::VerifierResult; use crate::symbolic::{SymbolicState, SymbolicValue}; use crate::VarType; diff --git a/sdk/flutter/lib/src/tensor.dart b/sdk/flutter/lib/src/tensor.dart index 82b8b31..cc1ed46 100644 --- a/sdk/flutter/lib/src/tensor.dart +++ b/sdk/flutter/lib/src/tensor.dart @@ -410,7 +410,10 @@ class Tensor { Tensor sigmoid() => map((x) => 1.0 / (1.0 + math.exp(-x))); /// Tanh activation - Tensor tanh() => map(math.tanh); + Tensor tanh() => map((x) { + final exp2x = math.exp(2 * x); + return (exp2x - 1) / (exp2x + 1); + }); /// Softmax (for 1D or last axis of 2D) Tensor softmax() { diff --git a/sdk/flutter/test/types_test.dart b/sdk/flutter/test/types_test.dart index 33225e1..03d7c60 100644 --- a/sdk/flutter/test/types_test.dart +++ b/sdk/flutter/test/types_test.dart @@ -115,7 +115,7 @@ void main() { const config = SynorConfig( apiKey: 'test-key', baseUrl: 'https://custom.api.com', - timeout: const Duration(seconds: 60), + timeout: Duration(seconds: 60), maxRetries: 5, defaultProcessor: ProcessorType.gpu, defaultPrecision: Precision.fp16,