Skip to content

[AURON #2158] fix: change const to static in batch_size() to fix OnceCell caching#2159

Open
yew1eb wants to merge 1 commit intoapache:masterfrom
yew1eb:AURON_2158
Open

[AURON #2158] fix: change const to static in batch_size() to fix OnceCell caching#2159
yew1eb wants to merge 1 commit intoapache:masterfrom
yew1eb:AURON_2158

Conversation

@yew1eb
Copy link
Copy Markdown
Contributor

@yew1eb yew1eb commented Apr 3, 2026

Fixes AURON-2158. The const OnceCell was creating a new instance on every call, causing the cache to never hit.

Which issue does this PR close?

Closes #2158

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

How was this patch tested?

@github-actions github-actions bot added the native label Apr 3, 2026
@yew1eb yew1eb changed the title [AURON#2158] fix: change const to static in batch_size() to fix OnceCell caching [AURON #2158] fix: change const to static in batch_size() to fix OnceCell caching Apr 3, 2026
…x OnceCell caching

Fixes AURON-2158. The const OnceCell was creating a new instance on every
call, causing the cache to never hit.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a caching bug in batch_size() where using a const OnceCell resulted in a fresh cell per call, preventing cache hits.

Changes:

  • Replaced const CACHED_BATCH_SIZE: OnceCell<usize> with static CACHED_BATCH_SIZE: OnceCell<usize> in batch_size() so the cached value persists across calls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

batch_size() cache never works due to const OnceCell

2 participants