Skip to content
Closed
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
12 changes: 12 additions & 0 deletions src/v1/stage0/src/cli_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12336,11 +12336,23 @@ where
/// the second compile is a hit by construction, so a test that ran both arms warm would compare a
/// value with itself and be green whatever the cache served -- the change-detector shape §5
/// rejects. Clearing the slot makes the cold arm genuinely re-derive from disk.
///
/// THE BUILT-ROOTS LEDGER IS PART OF THE SAME STATE and is cleared with the slots. The ledger
/// records which roots this thread's slots have held so that an EVICTION followed by a rebuild
/// refuses (`SharedIndexRebuiltAfterEviction`). A reset is not an eviction: it declares a fresh
/// thread history, so the next build is the first of that history, not a second parse of a pool
/// someone still owns. Clearing the slots while keeping the ledger made every reset-then-rebuild
/// of the same roots refuse -- this oracle's own cold-then-warm arms included.
#[cfg(test)]
pub(crate) fn reset_process_shared_index_for_test() {
PROCESS_RESOLVE_INDEX.with(|s| {
*s.borrow_mut() = [None, None];
});
entry_resolve::PROCESS_RESOLVE_INDEX_BUILT.with(|b| {
for built in b.borrow_mut().iter_mut() {
built.clear();
}
});
PROCESS_RESOLVE_STORE.with(|s| s.borrow_mut().clear());
}

Expand Down
2 changes: 1 addition & 1 deletion src/v1/stage0/src/cli_run/entry_resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ thread_local! {
/// Every roots key each slot has built on this thread. A run's roots are fixed (above), so a
/// key built a second time is an evicted index being rebuilt: the same pool indexed twice.
#[allow(clippy::type_complexity)]
static PROCESS_RESOLVE_INDEX_BUILT: RefCell<[BTreeSet<String>; 2]> =
pub(crate) static PROCESS_RESOLVE_INDEX_BUILT: RefCell<[BTreeSet<String>; 2]> =
const { RefCell::new([BTreeSet::new(), BTreeSet::new()]) };

// While loading the materialization-provider authority, cross-process disk hits
Expand Down