Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Changes

Note: This PR contains no code changes. The thread-safety improvements described below are already present in the base branch perf/simple-flat (commit 2ddc8c6). This PR only contains an empty "Initial plan" commit.

The changes that were intended to be in this PR (but are already in the base):

  • TransientResource.cs: Use Interlocked.Exchange when resizing bloom filter to atomically swap filters before disposal, eliminating null reference window
  • SnapshotBundle.cs: Simplify disposal guard from CompareExchange to Exchange pattern

Before (TransientResource.cs):

BloomFilter oldFilter = PrewarmedAddresses;
PrewarmedAddresses = null!;  // Race condition window
try { oldFilter.Dispose(); }
finally { PrewarmedAddresses = new BloomFilter(newCapacity, bitsPerKey); }

After:

BloomFilter newFilter = new BloomFilter(newCapacity, bitsPerKey);
BloomFilter oldFilter = Interlocked.Exchange(ref PrewarmedAddresses, newFilter);
oldFilter.Dispose();

Before (SnapshotBundle.cs):

if (Interlocked.CompareExchange(ref _isDisposed, true, false)) return;

After:

if (Interlocked.Exchange(ref _isDisposed, true)) return;

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Empty PR - changes already in base branch

Testing

Requires testing

  • Yes
  • No

Notes on testing

No testing required as this PR contains no code changes.

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Remarks

This PR should likely be closed as it serves no purpose. The thread-safety improvements are already implemented in the perf/simple-flat base branch.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI mentioned this pull request Jan 28, 2026
4 tasks
Copilot AI changed the title [WIP] Fix performance issues with flat and trie states Apply thread-safety improvements from code review Jan 28, 2026
Copilot AI requested a review from asdacap January 28, 2026 07:40
@asdacap
Copy link
Contributor

asdacap commented Jan 28, 2026

@copilot what happened? Do I have to bring Claude?

Copy link
Contributor Author

Copilot AI commented Jan 28, 2026

@copilot what happened? Do I have to bring Claude?

I apologize for the confusion. This PR currently contains only an empty "Initial plan" commit with no code changes. The thread-safety improvements (Interlocked.Exchange changes to TransientResource.cs and SnapshotBundle.cs) are already in the base branch perf/simple-flat (commit 2ddc8c6).

Since I cannot create new PRs and the changes are already in the base, this PR as structured doesn't serve its intended purpose. The changes you requested are already present in the perf/simple-flat branch.

Would you like me to close this PR, or should these changes be reverted from the base branch and re-applied here as a proper stacked PR?

Copilot AI changed the title Apply thread-safety improvements from code review [Empty PR] Thread-safety improvements already in base branch Jan 28, 2026
@asdacap asdacap closed this Jan 28, 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