Skip to content

Floor: pay the shared MultiEntryIndex in preparation, not in an arbitrary claim - #8491

Merged
briansrls merged 1 commit into
mainfrom
session/snappy-wolf-508
Aug 19, 2026
Merged

briansrls merged 1 commit into
mainfrom
session/snappy-wolf-508

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • commit_witness_claim_pair_resolvable (and its two siblings ci_floor_commit_witness_claim_pairs / commit_witness_claim_roster_defects) called build_multi_entry_index directly instead of going through process_shared_index, the existing thread-local shared-index cache every other production call site already uses. Every call re-walked and re-parsed the whole witness corpus, uncached — measured 62.7-83.0s for a single call to commit_witness_claim_pair_resolvable, on a witness with a ~1-5s fast-lane budget. load_sources_for_entry had the same defect.
  • Fixed the same way as Floor: pay the module-path index in preparation, not in an arbitrary claim #8470's module-path-index warm: route the four call sites through process_shared_index, and add an explicit warm call for it during run_required_floor's preparation phase, so the one-time cost is deterministically paid there instead of falling on whichever claim happens to run first.
  • Does not narrow the floor roster - the roster is unchanged; only the index construction is deduplicated/relocated.

Test plan

  • cargo check -p v1-compiler --bin claim_executor (local build) - clean
  • cargo build --release -p v1-compiler --bin claim_executor --bin gunbc (local) - clean, verified real runnable binaries
  • cargo fmt -p v1-compiler --check - clean
  • cargo clippy -p v1-compiler --bin claim_executor (local, informational scope) - 38 pre-existing warnings, none in the lines touched by this diff
  • Ran the specimen witness function (commit_witness_claim_roster_red_control_holds) via gunbc run post-fix - still asserts correctly (RED control on the synthetic stale pair still holds)
  • Empirically verified the cache actually hits across calls in one process: a throwaway .dag file making two calls to commit_witness_claim_pair_resolvable with identical args ran in ~87s total (not ~2x the ~92s single-call cost), confirming the second call served from process_shared_index's cache instead of re-walking the corpus
  • Final grep of build_multi_entry_index( confirms no remaining unfixed production call sites - only the legitimate internal build inside process_shared_index itself and pre-existing #[cfg(test)]-only sites remain

🤖 Generated with Claude Code

…rary claim

commit_witness_claim_pair_resolvable and its two siblings
(ci_floor_commit_witness_claim_pairs, commit_witness_claim_roster_defects)
called build_multi_entry_index directly instead of going through
process_shared_index, the existing thread-local cache every other
production call site already uses. That billed a full corpus walk+parse
against whichever claim ran first — measured 62.7-83.0s for a single
call to commit_witness_claim_pair_resolvable, on a witness with a ~1-5s
budget. load_sources_for_entry had the same defect.

Same fix as #8470's module-path-index warm: route the call sites
through process_shared_index, and warm it explicitly during
run_required_floor's preparation phase so the cost is paid there
instead of falling on an arbitrary claim.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 19, 2026 01:24
@gunbai-bot gunbai-bot Bot changed the title Witness cost class 2: per-claim deterministic authority reconstruction — build_multi_entry_index/build_module_index walk and read every .dag file on EVERY call (specimen: commit_witness_claim_pair_resolvable, 62.7-83.0s for one synthetic pair). Pay it in preparation as #8470 did; do NOT narrow the r Floor: pay the shared MultiEntryIndex in preparation, not in an arbitrary claim Aug 19, 2026
@briansrls
briansrls merged commit db9b990 into main Aug 19, 2026
1 of 2 checks passed
@briansrls
briansrls deleted the session/snappy-wolf-508 branch August 19, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant