Skip to content

Row readers: report failures by where they are caught, and let the JIT call generated readers directly - #274

Merged
electricessence merged 1 commit into
masterfrom
fix/inlinable-row-reader
Dec 1, 2026
Merged

electricessence merged 1 commit into
masterfrom
fix/inlinable-row-reader

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

Generated row readers are no longer marked NoInlining, so the JIT can call them as it calls a hand-written reader (a guarded direct call instead of a plain delegate call).

The mark was there only so a failure could be attributed by looking for the reader's frame on the stack trace. Now every read loop catches around its call of the row reader alone, as the streaming loops and First/Single already did, so what is caught there is the reader's failure by construction:

  • a failure of a generated or runtime row reader is reported with the model and the row, as before;
  • a failure of Read, of adding the row (for example a pool that refuses an array) or of a cancel passes through unchanged, as before;
  • a caller's own selector still passes its exception through unchanged.

A failure is now attributed by where it is caught, not by reading the stack trace, so the answer is the same in trimmed native AOT builds, where a stack trace can carry no method data. The stack-trace check and the documentation of its limits are deleted.

One difference: a generated reader that fails to load (for example, a model assembly changed since the consumer was built) is now reported as a row failure, with the load error inside; before, the load error passed through on its own.

🤖 Generated with Claude Code

…T call generated readers directly

Generated row readers are no longer marked `NoInlining`, so the JIT can call them as it calls a hand-written reader (a guarded direct call instead of a plain delegate call).

The mark was there only so a failure could be attributed by looking for the reader's frame on the stack trace. Now every read loop catches around its call of the row reader alone, as the streaming loops and `First`/`Single` already did, so what is caught there is the reader's failure by construction:

- a failure of a generated or runtime row reader is reported with the model and the row, as before;
- a failure of `Read`, of adding the row (for example a pool that refuses an array) or of a cancel passes through unchanged, as before;
- a caller's own selector still passes its exception through unchanged.

A failure is now attributed by where it is caught, not by reading the stack trace, so the answer is the same in trimmed native AOT builds, where a stack trace can carry no method data. The stack-trace check and the documentation of its limits are deleted.

One difference: a generated reader that fails to load (for example, a model assembly changed since the consumer was built) is now reported as a row failure, with the load error inside; before, the load error passed through on its own.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@electricessence
electricessence merged commit 1c793c5 into master Dec 1, 2026
9 checks passed
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.

1 participant