Skip to content

[VM] Fix cache inconsistency on interner limit overflow - #397

Open
fEst1ck wants to merge 2 commits into
movement-network:move-rebase-e33from
fEst1ck:zekun/port-18884
Open

[VM] Fix cache inconsistency on interner limit overflow#397
fEst1ck wants to merge 2 commits into
movement-network:move-rebase-e33from
fEst1ck:zekun/port-18884

Conversation

@fEst1ck

@fEst1ck fEst1ck commented Jul 15, 2026

Copy link
Copy Markdown

Description

Ports upstream aptos-labs#18884 ([execution] Fix cache flush), making sure ty_tag_cache and struct_name_index_map are always flushed together.

ModuleCacheManager::check_ready used to flush each cache independently when its own interner limit was exceeded. The caches cross-reference each other through interned indices (type tags key on StructNameIndex, the module cache holds struct-name indices), so a partial flush could leave dangling or reused indices. Now exceeding any interner limit flushes all runtime-environment caches and the module cache together.

Also adds a regression test (written independently, not copied from upstream).

How Has This Been Tested?

  • New test test_intern_pool_overflow_flushes_all_caches in code_cache_global_manager.rs: for each of the four interner limits, populates every cache, trips just that limit, and asserts all caches are flushed together. Fails when the fix is reverted, passes with it.
  • cargo test -p aptos-block-executor --lib code_cache_global_manager — 6 passed.

Key Areas to Review

  • The merged flush condition in check_ready (code_cache_global_manager.rs): exceeding any of the four limits must flush everything, since a partial flush is what caused the inconsistency.
  • The test-only accessors added to RuntimeEnvironment/TypeTagCache are gated behind #[cfg(any(test, feature = "testing"))], following the existing *_for_test convention.

Type of Change

  • Bug fix
  • Tests

Which Components or Systems Does This Change Impact?

  • Move/Aptos Virtual Machine

fEst1ck and others added 2 commits July 9, 2026 20:53
Verify that exceeding any interner limit in check_ready flushes all
caches together, since interned indices cross-reference between them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fEst1ck
fEst1ck changed the base branch from m1 to move-rebase-e33 July 15, 2026 16:43
@fEst1ck fEst1ck changed the title fix cache inconsistency on interner limit overflow (port of upstream #18884) [VM] Fix cache inconsistency on interner limit overflow Jul 16, 2026
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.

2 participants