@@ -81,13 +81,24 @@ where
81
81
if revisions. cycle_heads . contains ( & database_key_index) {
82
82
if let Some ( last_provisional) = opt_last_provisional {
83
83
if let Some ( provisional_value) = & last_provisional. value {
84
+ tracing:: debug!(
85
+ "{database_key_index:?}: execute: \
86
+ I am a cycle head, comparing last provisional value \
87
+ {provisional_value:#?} with new value {new_value:#?}"
88
+ ) ;
84
89
// If the new result is equal to the last provisional result, the cycle has
85
90
// converged and we are done.
86
91
if !C :: values_equal ( & new_value, provisional_value) {
92
+ tracing:: debug!(
93
+ "{database_key_index:?}: execute: not converged, calling cycle_fn"
94
+ ) ;
87
95
// We are in a cycle that hasn't converged; ask the user's
88
96
// cycle-recovery function what to do:
89
97
match C :: recover_from_cycle ( db, & new_value, iteration_count) {
90
98
crate :: CycleRecoveryAction :: Iterate => {
99
+ tracing:: debug!(
100
+ "{database_key_index:?}: execute: iterate again"
101
+ ) ;
91
102
iteration_count += 1 ;
92
103
revisions. cycle_ignore = false ;
93
104
opt_last_provisional = Some ( self . insert_memo (
98
109
continue ;
99
110
}
100
111
crate :: CycleRecoveryAction :: Fallback ( fallback_value) => {
112
+ tracing:: debug!(
113
+ "{database_key_index:?}: execute: fall back to {fallback_value:#?}"
114
+ ) ;
101
115
new_value = fallback_value;
102
116
}
103
117
}
@@ -106,7 +120,7 @@ where
106
120
}
107
121
// This is no longer a provisional result, it's our final result, so remove ourself
108
122
// from the cycle heads, and iterate one last time to remove ourself from all other
109
- // results in the cycle as well.
123
+ // results in the cycle as well and turn them into usable cached results .
110
124
revisions. cycle_heads . remove ( & database_key_index) ;
111
125
revisions. cycle_ignore = false ;
112
126
self . insert_memo (
@@ -116,6 +130,9 @@ where
116
130
) ;
117
131
continue ;
118
132
}
133
+
134
+ tracing:: debug!( "{database_key_index:?}: execute: result.revisions = {revisions:#?}" ) ;
135
+
119
136
return self . insert_memo (
120
137
zalsa,
121
138
id,
0 commit comments