@@ -412,20 +412,14 @@ where
412
412
// in rev 1 but not in rev 2.
413
413
VerifyResult :: changed ( )
414
414
}
415
- QueryOrigin :: FixpointInitial => {
416
- let is_provisional = old_memo. may_be_provisional ( ) ;
417
-
418
- // If the value is from the same revision but is still provisional, consider it changed
419
- // because we're now in a new iteration.
420
- if shallow_update_possible && is_provisional {
421
- return VerifyResult :: Changed ( CycleHeads :: initial ( database_key_index) ) ;
422
- }
423
-
424
- VerifyResult :: Unchanged (
425
- InputAccumulatedValues :: Empty ,
426
- CycleHeads :: initial ( database_key_index) ,
427
- )
428
- }
415
+ // Return `Unchanged` similar to the initial value that we insert
416
+ // when we hit the cycle. Any dependencies accessed when creating the fixpoint initial
417
+ // are tracked by the outer query. Nothing should have changed assuming that the
418
+ // fixpoint initial function is deterministic.
419
+ QueryOrigin :: FixpointInitial => VerifyResult :: Unchanged (
420
+ InputAccumulatedValues :: Empty ,
421
+ CycleHeads :: initial ( database_key_index) ,
422
+ ) ,
429
423
QueryOrigin :: DerivedUntracked ( _) => {
430
424
// Untracked inputs? Have to assume that it changed.
431
425
VerifyResult :: changed ( )
@@ -458,8 +452,11 @@ where
458
452
last_verified_at,
459
453
!cycle_heads. is_empty ( ) ,
460
454
) {
461
- VerifyResult :: Changed ( _) => {
462
- break ' cycle VerifyResult :: Changed ( cycle_heads)
455
+ VerifyResult :: Changed ( heads) => {
456
+ // Carry over the heads from the inner query to avoid
457
+ // backdating the outer query.
458
+ cycle_heads. extend ( & heads) ;
459
+ break ' cycle VerifyResult :: Changed ( cycle_heads) ;
463
460
}
464
461
VerifyResult :: Unchanged ( input_accumulated, cycles) => {
465
462
cycle_heads. extend ( & cycles) ;
0 commit comments