Open source · MIT · .NET 10
CAUSALIA 2.3.0Deterministic simulation for distributed .NET systemsExplore the toolkit →

Test distributed systems
when everything goes wrong.

Model time, scheduling and infrastructure outcomes in .NET 10. Explore rare orderings, verify business invariants, then replay and minimize the failures you find.

Core package for .NET 10. Add only the adapters your service actually uses.

No service to hostNo license feeKeep real integration tests
simulation.run deterministic
01
Order receivedcontrolled entry point
02
Storage commit succeedsdurable side effect
03
Acknowledgement disappearsinjected ambiguity
04
Retry duplicates the effectinvariant violated · replay captured
Virtual timeReplay tokensFault injectionDeterministic scheduling InvariantsFailure minimizationAzure Service BusTest generation
Causalia in 30 seconds

The bug is not always in the code.
Sometimes it is in the ordering.

A retry arrives after a commit. Two workers save the same version. A process dies between durable steps. Ordinary tests often see one friendly ordering. Causalia explores the unfriendly ones on purpose.

01

State the guarantee

“This payment happens once.” “Only one writer wins.” “Recovery never repeats completed work.”

02

Explore the difficult paths

Control virtual time, scheduling, retries and modeled failure semantics instead of waiting for a race to happen.

03

Keep the exact failure

Capture the replay, fix the code, rerun that same path and keep it in the regression suite.

FOR DEVELOPERS

Turn “it only happens in production” into a test you can run again.

Start from a real symptom, model one boundary, write one invariant and let deterministic exploration find the ordering that breaks it.

  • Replay rare timing failures exactly
  • Advance time without waiting in real time
  • Keep the reproduction as a regression test
Interactive Failure Lab

Change the failure.
Watch the evidence change.

Follow a failure across the business operation, broker settlement and recovery. The timeline is an illustration; the code below shows the real .NET API.

Choose a production symptom
Invariant The order is applied at most once

The durable write succeeds, its acknowledgement is lost, and retry must not repeat the business effect.

DEMO TRACEReady to explore
idle
Inspect a causal stepstep 0 / 4
Select a scenario and run it

Move the slider to inspect each operation and the guarantee it challenges.

Illustrative replay ID · real tokens come from .NET execution—
The complete toolkit

Control the conditions.
Prove the guarantee.

Use the core runtime to explore schedules and virtual time. Add adapters for the boundaries your application actually crosses. Keep the invariant about your business behavior.

CORE ENGINE

Scheduler & virtual time

Run concurrent work under controlled scheduling. Advance timers, deadlines and retries without sleeping in wall time. Express invariants and explore competing executions.

Explore scheduling →
FAULTS

Typed failure plans

Target events and outcomes with typed rules. Model delays, dropped messages, ambiguous commits and rejected settlements without a second fault engine.

See a fault rule →
INFRASTRUCTURE

Messaging & state

Model Storage, EF Core, Dapr, Kafka, RabbitMQ and Azure Service Bus: redelivery, offsets, locks, subscriptions, state and ambiguous acknowledgements.

Choose an adapter →
NETWORK

HTTP, ASP.NET Core & gRPC

Control logical HTTP requests, host behavior, unary calls, deadlines, partitions and retries at application-visible boundaries.

Explore network packages →
ANALYSIS

Replay, minimize & visualize

Capture failing schedules and fault sequences. Reproduce the execution, reduce it to essential decisions and inspect its causal trace.

See reproduction code →
ADOPTION

CLI, analyzers & testing

Inspect existing services, generate compiling test scaffolds, catch nondeterministic APIs, and integrate with your test framework or Reqnroll.

Follow the workflow →
What the models mean

Causalia tests the guarantees you model. A successful Service Bus Complete removes the message even when its acknowledgement is lost; redelivery requires an unsettled lock or rejected settlement. Keep real-provider integration tests for SDK and protocol compatibility.

Causalia + AI coding agents

Give the agent evidence
that does not move underneath it.

An AI coding agent is much more useful when “test failed” means the same execution can be replayed after its change. Causalia can turn nondeterministic debugging into a tighter inspect → reproduce → patch → replay loop.

AGENT LOOPClick a step
STEP 01 · INSPECT

Start with the solution, not with a guessed fix.

Run the Causalia CLI in JSON mode so an agent can work from structured findings: likely boundaries, deterministic seams and risky APIs.

dotnet causalia inspect MyService.slnx --format json
GuardrailInspection is a lead, not proof. The agent should still understand the business invariant before editing production code.
COPY INTO YOUR CODING AGENT

A Causalia-aware debugging prompt

Use this as a starting instruction for an agent working in a .NET solution that can install or already uses Causalia.

When investigating timing, retry, duplicate-delivery, restart, or concurrency risk in this .NET solution:

1. Run "dotnet causalia inspect <solution> --format json" and use the findings as leads, not conclusions.
2. Choose one high-value production boundary and state the business invariant that must hold.
3. Prefer normal .NET seams such as TimeProvider, CancellationToken and narrow dependency interfaces.
4. Run "dotnet causalia generate <solution> --project <service.csproj>", then connect the real handler and replace TODOs.
5. Add a focused deterministic Causalia simulation around that boundary.
6. If a failure is found, preserve the replay token and reduced failure sequence.
7. Make the smallest production fix supported by the evidence.
8. Replay the exact failure, then run broader exploration and the existing test suite.
9. Keep real infrastructure integration tests; do not claim modeled provider semantics prove the real provider.

Do not spread Causalia runtime types through the domain/application layer unless the simulation boundary genuinely requires it.
Full AI agent guide llms.txt ↗
Business value without magic ROI

Make expensive uncertainty
cheaper to investigate.

Causalia does not promise to eliminate incidents. Its value is narrower and more defensible: reduce the engineering drag around failures whose timing is difficult to reproduce, and keep their reproductions after the fix.

01

Shorter reproduction loop

Replace “try it again until it fails” with a controlled scenario and an exact replay path.

02

Regression evidence

Keep the once-rare failure as an executable test instead of only documenting the incident.

03

Safer AI-assisted changes

Give developers and agents a stable pass/fail signal after concurrency or retry logic changes.

DEBUGGING EXPOSURE CALCULATOR

How much engineering time is tied up in hard-to-reproduce incidents?

Move the inputs. This estimates current engineering exposure only — not guaranteed Causalia savings.

How to evaluate business value properly →
Engineering time exposed16 h / month
Estimated cost exposure€1,600 / month
Annualized exposure€19,200 / year
Where it fits

Add a missing testing layer.
Don't replace the ones you trust.

Causalia complements unit, integration and end-to-end tests. Use the tabs to see what each layer is good at.

DETERMINISTIC SIMULATION

Explore difficult orderings cheaply and replay them exactly.

Model the semantics that matter, control time and scheduling, inject ambiguity, then assert domain invariants across many executions.

Speed
Environment realism
Ordering control
Reproducibility
Five-minute start

Inspect, generate, connect, test.

Choose an example: start small, inspect an application, model a provider outcome or reproduce a failure. Generated tests compile; connect your handler and replace domain TODOs.

terminal · adoption CLI
Start without changing production code.

The CLI ranks likely simulation boundaries and points out useful seams such as TimeProvider and propagated cancellation.

Full guide →
Use it where timing is part of correctness

Start from the symptom you already have.

Ecosystem

Build your install command.

Core is always first. Select from the runtime, test integration, network, storage, broker and visualization packages your scenario needs. The CLI is installed as a separate .NET tool.

All commands target 2.3.0. Start with core, then choose the boundaries you need.

Your install
dotnet add package Causalia --version 2.3.0

Start with core and add an adapter only where your test models that boundary.

See every package →
No magic, no mystery

What Causalia is — and what it isn't.

Does Causalia replace integration or end-to-end tests?

No. Causalia verifies the semantics you model under controlled timing and failure conditions. Keep real-provider integration tests for actual databases, brokers, HTTP stacks and infrastructure.

Does production code need to depend on Causalia?

Prefer not to. Use normal .NET seams such as TimeProvider, CancellationToken and narrow storage/messaging/HTTP interfaces, then place simulated adapters in the test project.

What does deterministic mean here?

The simulation controls relevant sources of time and scheduling so a discovered execution can be replayed instead of depending on wall-clock luck.

Can AI coding agents use Causalia?

Yes, when the agent can run commands and tests in the workspace. Structured inspection output plus exact replay gives the agent a more stable debugging loop than repeatedly chasing a flaky failure.

When is Causalia probably the wrong tool?

Simple CRUD with no meaningful concurrency or partial-failure behavior, provider certification, and real performance/load benchmarking are usually better served by ordinary tests and provider-specific tooling.

Does a Causalia trace prove root cause?

No. It is evidence. Failure minimization and analysis can help identify what the reproduction depends on, but the trace should not be treated as an automatic causal claim.

Go deeper when you are ready

Human docs and agent-readable context.

Production will explore edge cases anyway

Choose to explore them first.

Free, open source and MIT licensed.