Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use accumulated::Accumulated;
use accumulated::AnyAccumulated;

use crate::{
cycle::CycleRecoveryStrategy,
function::VerifyResult,
ingredient::{fmt_index, Ingredient, Jar},
plumbing::IngredientIndices,
Expand Down Expand Up @@ -118,10 +117,6 @@ impl<A: Accumulator> Ingredient for IngredientImpl<A> {
true
}

fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
CycleRecoveryStrategy::Panic
}

fn origin(&self, _db: &dyn Database, _key_index: crate::Id) -> Option<QueryOrigin> {
None
}
Expand Down
15 changes: 4 additions & 11 deletions src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub trait Configuration: Any {
/// (and, if so, how).
const CYCLE_STRATEGY: CycleRecoveryStrategy;

/// Invokes after a new result `new_value`` has been computed for which an older memoized value
/// Invokes after a new result `new_value` has been computed for which an older memoized value
/// existed `old_value`, or in fixpoint iteration. Returns true if the new value is equal to
/// the older one.
///
Expand Down Expand Up @@ -243,12 +243,9 @@ where
/// True if the input `input` contains a memo that cites itself as a cycle head.
/// This indicates an intermediate value for a cycle that has not yet reached a fixed point.
fn is_provisional_cycle_head<'db>(&'db self, db: &'db dyn Database, input: Id) -> bool {
self.get_memo_from_table_for(
db.zalsa(),
input,
self.memo_ingredient_index(db.zalsa(), input),
)
.is_some_and(|memo| memo.cycle_heads().contains(&self.database_key_index(input)))
let zalsa = db.zalsa();
self.get_memo_from_table_for(zalsa, input, self.memo_ingredient_index(zalsa, input))
.is_some_and(|memo| memo.cycle_heads().contains(&self.database_key_index(input)))
}

/// Attempts to claim `key_index`, returning `false` if a cycle occurs.
Expand All @@ -265,10 +262,6 @@ where
}
}

fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
C::CYCLE_STRATEGY
}

fn origin(&self, db: &dyn Database, key: Id) -> Option<QueryOrigin> {
self.origin(db.zalsa(), key)
}
Expand Down
6 changes: 0 additions & 6 deletions src/ingredient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::{

use crate::{
accumulator::accumulated_map::{AccumulatedMap, InputAccumulatedValues},
cycle::CycleRecoveryStrategy,
function::VerifyResult,
plumbing::IngredientIndices,
table::Table,
Expand Down Expand Up @@ -117,11 +116,6 @@ pub trait Ingredient: Any + std::fmt::Debug + Send + Sync {
/// Returns the [`IngredientIndex`] of this ingredient.
fn ingredient_index(&self) -> IngredientIndex;

/// If this ingredient is a participant in a cycle, what is its cycle recovery strategy?
/// (Really only relevant to [`crate::function::FunctionIngredient`],
/// since only function ingredients push themselves onto the active query stack.)
fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy;

/// Returns true if `reset_for_new_revision` should be called when new revisions start.
/// Invoked once when ingredient is added and not after that.
fn requires_reset_for_new_revision(&self) -> bool {
Expand Down
5 changes: 0 additions & 5 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub mod singleton;
use input_field::FieldIngredientImpl;

use crate::{
cycle::CycleRecoveryStrategy,
function::VerifyResult,
id::{AsId, FromIdWithDb},
ingredient::{fmt_index, Ingredient},
Expand Down Expand Up @@ -233,10 +232,6 @@ impl<C: Configuration> Ingredient for IngredientImpl<C> {
true
}

fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
CycleRecoveryStrategy::Panic
}

fn origin(&self, _db: &dyn Database, _key_index: Id) -> Option<QueryOrigin> {
None
}
Expand Down
5 changes: 0 additions & 5 deletions src/input/input_field.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::cycle::CycleRecoveryStrategy;
use crate::function::VerifyResult;
use crate::ingredient::{fmt_index, Ingredient};
use crate::input::Configuration;
Expand Down Expand Up @@ -46,10 +45,6 @@ where
self.index
}

fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
CycleRecoveryStrategy::Panic
}

unsafe fn maybe_changed_after(
&self,
db: &dyn Database,
Expand Down
4 changes: 0 additions & 4 deletions src/interned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ where
true
}

fn cycle_recovery_strategy(&self) -> crate::cycle::CycleRecoveryStrategy {
crate::cycle::CycleRecoveryStrategy::Panic
}

fn origin(&self, _db: &dyn Database, _key_index: crate::Id) -> Option<QueryOrigin> {
None
}
Expand Down
5 changes: 0 additions & 5 deletions src/tracked_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crossbeam_queue::SegQueue;
use tracked_field::FieldIngredientImpl;

use crate::{
cycle::CycleRecoveryStrategy,
function::VerifyResult,
ingredient::{fmt_index, Ingredient, Jar},
key::{DatabaseKeyIndex, InputDependencyIndex},
Expand Down Expand Up @@ -753,10 +752,6 @@ where
true
}

fn cycle_recovery_strategy(&self) -> CycleRecoveryStrategy {
crate::cycle::CycleRecoveryStrategy::Panic
}

fn origin(&self, _db: &dyn Database, _key_index: crate::Id) -> Option<QueryOrigin> {
None
}
Expand Down
4 changes: 0 additions & 4 deletions src/tracked_struct/tracked_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ where
self.ingredient_index
}

fn cycle_recovery_strategy(&self) -> crate::cycle::CycleRecoveryStrategy {
crate::cycle::CycleRecoveryStrategy::Panic
}

unsafe fn maybe_changed_after<'db>(
&'db self,
db: &'db dyn Database,
Expand Down