allow reuse of cached provisional memos within the same cycle iteration (#786)

* test for caching provisional values

* add iteration-count to cycle heads

* CycleHeads insert/extend checks iteration count match

* update iteration count in cycle heads

* all tests passing

* remove debug prints

* just walk active query stack once

* switch to tracking active cycle iterations on ZalsaLocal

* Revert "switch to tracking active cycle iterations on ZalsaLocal"

This reverts commit 4ea3d850b53a449dda7af7ceb4cc565d3a64001c.

* Revert "just walk active query stack once"

This reverts commit 2d7948612be3f411c7787829ff2db74e3a575f0c.

* make ActiveQuery::iteration_count private with accessor

* iterate active query stack in reverse

* use tracing::trace! in hot path

* try a cold annotation on validate_same_iteration

* Revert "try a cold annotation on validate_same_iteration"

This reverts commit 49ceb84bb7.
This commit is contained in:
Carl Meyer 2025-04-03 08:10:50 -07:00 committed by GitHub
parent 395b29d08a
commit 296a8c78da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 180 additions and 51 deletions

View file

@ -123,6 +123,9 @@ where
if iteration_count > MAX_ITERATIONS {
panic!("{database_key_index:?}: execute: too many cycle iterations");
}
revisions
.cycle_heads
.update_iteration_count(database_key_index, iteration_count);
opt_last_provisional = Some(self.insert_memo(
zalsa,
id,
@ -130,7 +133,9 @@ where
memo_ingredient_index,
));
active_query = db.zalsa_local().push_query(database_key_index);
active_query = db
.zalsa_local()
.push_query(database_key_index, iteration_count);
continue;
}