Skip to content

chore: EXC-2087: Use HeapBytes in caches#6445

Merged
berestovskyy merged 4 commits intomasterfrom
andriy/exc-2087-lru-cache
Sep 2, 2025
Merged

chore: EXC-2087: Use HeapBytes in caches#6445
berestovskyy merged 4 commits intomasterfrom
andriy/exc-2087-lru-cache

Conversation

@berestovskyy
Copy link
Copy Markdown
Contributor

@berestovskyy berestovskyy commented Aug 26, 2025

This PR derives the HeapBytes trait for Query, and Compilation caches. The MemoryDiskBytes trait is renamed to DiskBytes.

The PR also includes a future-proof guard for Query Cache data structures (see total_bytes_future_proof_guard()).

@github-actions github-actions Bot added the chore label Aug 26, 2025
@berestovskyy berestovskyy force-pushed the andriy/exc-2087-lru-cache branch 4 times, most recently from 26ba794 to 4ab7648 Compare August 28, 2025 06:00
@berestovskyy berestovskyy marked this pull request as ready for review August 28, 2025 07:52
@berestovskyy berestovskyy requested review from a team as code owners August 28, 2025 07:52
@berestovskyy berestovskyy changed the title chore: EXC-2087: use DeterministicHeapBytes in caches chore: EXC-2087: Use DeterministicHeapBytes in caches Aug 28, 2025
Copy link
Copy Markdown
Contributor

@kpop-dfinity kpop-dfinity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consensus owned changes LGTM

@berestovskyy berestovskyy requested a review from a team as a code owner August 28, 2025 11:51
@github-actions github-actions Bot added the @idx label Aug 28, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Aug 28, 2025
As an example, the escaping is fixed in this PR:
#6445
@berestovskyy berestovskyy force-pushed the andriy/exc-2087-lru-cache branch from 908fcd9 to b876978 Compare August 29, 2025 07:14
@berestovskyy berestovskyy marked this pull request as draft August 29, 2025 07:15
@berestovskyy berestovskyy marked this pull request as ready for review August 29, 2025 07:15
Comment thread rs/embedders/src/compilation_cache.rs
Comment thread rs/execution_environment/src/query_handler/query_cache.rs Outdated
Comment thread packages/ic-deterministic-heap-bytes/src/lib.rs Outdated
Comment thread rs/embedders/src/compilation_cache.rs Outdated
Copy link
Copy Markdown
Contributor

@mraszyk mraszyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@berestovskyy berestovskyy requested a review from a team as a code owner September 1, 2025 20:02
This PR derives the `DeterministicHeapBytes` trait for all types
used in the LRU, Query, and Compilation caches. The `MemoryDiskBytes`
trait is renamed to `DiskBytes`.

The PR also includes a future-proof guard for Query Cache
data structures (see `total_bytes_future_proof_guard()`).
1. Rename crates from `ic-deterministic-heap-bytes` to `ic-heap-bytes`.
2. Add `HeapBytes` trait and derive.
3. Use `HeapBytes` in `QueryCache` and `CompilationCache`.
4. Simplify traits to just one function: `[deterministic_]heap_bytes()`.
5. Add more tests.
Comment thread packages/ic-error-types/BUILD.bazel Outdated
@berestovskyy berestovskyy force-pushed the andriy/exc-2087-lru-cache branch from 1d8a15f to 32afa14 Compare September 2, 2025 07:56
@berestovskyy berestovskyy added this pull request to the merge queue Sep 2, 2025
@berestovskyy berestovskyy removed this pull request from the merge queue due to a manual request Sep 2, 2025
@berestovskyy berestovskyy changed the title chore: EXC-2087: Use DeterministicHeapBytes in caches chore: EXC-2087: Use HeapBytes in caches Sep 2, 2025
@berestovskyy berestovskyy added this pull request to the merge queue Sep 2, 2025
Merged via the queue into master with commit 04affba Sep 2, 2025
30 checks passed
@berestovskyy berestovskyy deleted the andriy/exc-2087-lru-cache branch September 2, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants