Add exact slot clearing for variable deduplication - #10107
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances FetchResultStore’s variable deduplication table so it can be safely reused across calls by clearing only the slots that were written, and adds regression tests covering reuse, growth+reuse, and exception recovery.
Changes:
- Enable tracked-slot mode for
VariableDedupTableand useAddTrackedsoClear()can clear only previously written slots. - Ensure
VariableDedupTableis disposed whenFetchResultStoreis disposed. - Add tests validating tracked-slot clearing behavior across reuse, growth, and failure scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/HotChocolate/Fusion/src/Fusion.Execution/Execution/Results/FetchResultStore.cs |
Adds tracked-slot clearing to the variable dedup table and disposes it with the store. |
src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Results/FetchResultStoreTests.cs |
Adds regression tests to validate dedup-table reuse, growth+reuse, and healing after exceptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+2514
to
+2516
| public void AddTracked(int hash, int index, int location, int length) | ||
| { | ||
| var bucket = hash & 0x7FFFFFFF & (_bucketCount - 1); |
Comment on lines
+1721
to
+1724
| private static string[] FindCollidingStringValues(string key, int count) | ||
| { | ||
| const int bucketCount = 16; | ||
| var valuesByBucket = new List<string>?[bucketCount]; |
Contributor
Patch coverage100.0% of changed lines covered (79/79)
Project coverage: 53.7% (230725/429537 lines) |
# Conflicts: # src/HotChocolate/Fusion/test/Fusion.Execution.Tests/Execution/Results/FetchResultStoreTests.cs
This was referenced Jul 23, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 1, 2026
This was referenced Aug 11, 2026
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.