Skip to content

fix(engine): fault empty async throws - #256

Merged
thomhurst merged 1 commit into
mainfrom
issue-228-empty-valuetask
Aug 24, 2026
Merged

fix(engine): fault empty async throws#256
thomhurst merged 1 commit into
mainfrom
issue-228-empty-valuetask

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • return a faulted ValueTask when an empty shield delegate throws synchronously
  • cover typed, state-passing, Task-returning, outcome, cancellation, sync/async completion, and Retry(0) parity
  • repair the post-merge invocation-semantics test to use the renamed FallbackTo API

Performance

OverheadBenchmarks.Kevlar_Empty, ShortRun, .NET 10.0.11, same machine:

Mean Allocated
main 7.909 ns 0 B
this branch 14.27 ns 0 B

The exception boundary adds 6.36 ns to the empty happy path while preserving its zero-allocation contract. Inline EH was the fastest correct implementation measured; helper and async-state-machine variants measured 15.68 ns and 22.34 ns respectively.

Test plan

  • dotnet build Kevlar.slnx -c Release (0 warnings)
  • Kevlar.Tests (835 passed)
  • Kevlar.IntegrationTests (123 passed)
  • Kevlar.AllocationTests (3 passed)
  • Kevlar.NetStandard.Tests (10 passed)
  • BenchmarkDotNet Dry validation and before/after ShortRun

Closes #228

Preserve ValueTask semantics for empty shields and repair the merged FallbackTo test. Refs #228.
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c35f8925-a09b-416a-ab5c-3ea5b9018586


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thomhurst
thomhurst merged commit 0e93a3e into main Aug 24, 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.

fix(engine): Shield.Empty throws synchronously where non-empty shields fault the ValueTask

1 participant