translator: an ask that finds an ordered entry counts the specialized entry found as well

Check 47786 at 9c7f3cc9a3: a_kernel_past_the_stage_bound_gets_one_answer_through_either_path and
an_object_filled_past_its_bounds_keeps_only_the_most_recent read counts() (1, 0) and (40, 0)
where they expect a find: the compile that found its ordered entry reused the specialized entry
too, but only the order's count rose. take_ordered now counts both, as take does for an entry.
The partition-check test also asserts counts() == (1, 1): the check makes the entry, the compile
finds it.
This commit is contained in:
Anees Iqbal committed 2026-11-18 12:12:53 -08:00
1 parent a7a51225e6
commit a3dd881c32
2 files changed
+9 -1

No files matched your search

+4 -1
View File
@@ -1341,7 +1341,8 @@ impl Kept {
}
/// The entry of `fd` at `depth` ordered for `key`, both made the most recently used, with
/// what specializing it and what ordering it charged: `None` where either is not held.
/// what specializing it and what ordering it charged, counted found as an entry and as an
/// order: `None` where either is not held.
fn take_ordered(
&mut self,
air_hash: &Hash256,
@@ -1355,6 +1356,8 @@ impl Kept {
let order = entry.ordered.remove(at);
let found = (Arc::clone(&order.ordered), entry.spent, order.spent);
entry.ordered.push(order);
// The ask found the specialized entry too, as `take` counts it.
self.found += 1;
self.orders_found += 1;
Some(found)
}
@@ -398,6 +398,11 @@ fn a_partition_check_and_the_kernels_compile_order_its_entry_once() {
(1, 1),
"the compile finds the entry the check ordered rather than ordering it again ({name})"
);
assert_eq!(
entries.counts(),
(1, 1),
"the check made the specialized entry and the compile found it ({name})"
);
assert_eq!(
work, expected.2,
"the compile is charged the work units of its own unshared compile, the order it found \