Skip to content

Resolve the active defer usage set of a selection once per request - #188

Open
michaelstaib wants to merge 22 commits into
mst/execution-defer-task-below-nulled-parentfrom
mst/execution-defer-request-sets
Open

michaelstaib wants to merge 22 commits into
mst/execution-defer-task-below-nulled-parentfrom
mst/execution-defer-request-sets

Conversation

@michaelstaib

Copy link
Copy Markdown
Owner

This continues the work to execute a field shared by sibling deferred fragments once. There is no behavior change and no change to what is sent.

This branch merges #187 (interned defer usage sets) because the table is built on the interned sets.

Per-request defer usage set table:

  • A request with incremental parts gets a table on its root operation context. The table maps each selection's interned defer usage set to the set that is active for the request's @defer(if:) values. A disabled usage folds into its nearest enabled parent, duplicates are removed, and a usage nested below another usage of the set is dropped.
  • Each set is resolved once per request. Equal active sets are one instance within the request. Selection sets compiled while the request runs are picked up as well.
  • Reading a resolved set does not lock and does not allocate.

Callers:

  • The resolver task factory decides whether a field is deferred through the table. It still creates one deferred branch per active usage, in the same order as before.
  • The stream page data requirement analysis uses the table and checks each connection child against the branch the connection runs in.

Stacked on #184.

Tests: DeferUsageSetTableTests cover the static, dropped, folded and pruned cases, per-request interning, and sets compiled after the table was created. Two allocation tests check that a list under a disabled or alternating @defer does not allocate per object. Execution.Tests pass on net10.0, the defer and stream tests pass on net8.0, and the cursor pagination and stream page connection suites pass unchanged.

… object does not hold its whole selection set (#117)

* [Execution] Verify the selection row before ResultElement.TryGetProperty answers from the selection set

* Shorten the arrange comments of the result property lookup tests
…lap and cover the other-length and mismatched-kind rejections
…s into mst/execution-defer-disabled-shared-field
Copilot AI balanced review requested due to automatic review settings November 6, 2026 02:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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