A specimen agreement

Put the comparison rule beside the behavior

During comparison of the old and candidate document-update handlers, run each request against an independently initialized database containing the same document. Compare the response and committed document rows after the call. Each request ID must be a nonempty string; its exact value may differ. All other compared fields must agree exactly. Separately, a request from another tenant must return 403 and leave every stored document row unchanged.

Part of the agreement / Concrete choice
Part of the agreement Concrete choice
Same question May this tenant update document 1, and what response and stored state result?
Shared starting state Document 1 belongs to tenant alpha and has label quarterly.
Failure input Tenant beta requests the label revised.
Expected observation 403 and the original stored row, regardless of which implementation is older.
Observation that refutes the claim Either path changes the row on rejection, or the permitted paired observations differ.
Disagreement authority The fixture’s explicit tenant-isolation rule; the fictional service-owner disposition rejects the faulty candidate. A real project needs its own authorized owner.

Use the complete worksheet. Its initial status is unassessed. Filling in the record prepares a check; it does not run one.

01 / The agreement between the paths

What is differential testing?

The unit of evidence is a paired observation: one shared logical case, two computations and a comparison of the results that matter. The paths might be two functions in one process, two language implementations, a simple executable model and a tuned kernel, or two stores observed at the same logical point.

McKeeman’s original account describes comparing programs on shared tests to expose candidate defects. It also makes an important qualification: different results can both be permitted by the requirements. A useful comparator therefore needs more than a generic equality operator. It needs the meaning of agreement for the pair.1

Five terms to settle before collecting results

Term / Meaning / A question to answer
Term Meaning A question to answer
Paired paths The two computations or independently maintained answers being compared. Does each adapter call the intended implementation, or do both accidentally call the same helper?
Shared basis The logical input, initial state and relevant environment used by both paths. Are these the same account, document version, event prefix, units and configuration?
Observation boundary The outputs and effects included in the claim, and when they are collected. Does “result” include errors, persisted rows, emitted events or only the return value?
Agreement rule Exact equality or a defined relation with permitted variation and justified tolerances. Which difference must make the comparison fail?
Independent oracle An expectation justified separately from the two observed outputs. What would expose the case in which both paths return the same wrong answer?

“Independent” should not imply that the paths cannot share a defect. Two implementations can share a parser, dependency or mistaken interpretation. A model can be simpler and easier to inspect without being infallible.

When the obligation applies

The requirement is that the pair agrees for every eligible shared input during its declared phase. A test campaign produces evidence for the cases it actually exercises, not an observation of that entire universal claim.

Pair / What must be shared / When agreement is required
Pair What must be shared When agreement is required
Reference model and optimized implementation Input domain, arithmetic semantics and the modeled operation. During verification of the implementation against that model; the model can exist only in tests.
Cached aggregate and recount Entity, included records and event watermark or snapshot. At the comparison milestone promised by the consistency contract.
Preview and settlement Quote, selected items, pricing rules, currency, rounding and validity conditions. While the accepted quote remains binding under its stated terms.
Old and candidate implementation Operation, preserved contract, starting state and supported configuration. During the declared compatibility or migration comparison phase.
Replica and origin Object version or an explicitly bounded freshness relationship. Under the selected read-consistency contract, not automatically at every wall-clock instant.

The same idea can cover a long-lived consistency check or a one-time replacement assessment. State the start, end and reactivation conditions. Retiring the old path after an authorized cutover does not require preserving an executable duplicate forever.

A reference model is enough

Suppose a direct model totals integer prices multiplied by quantities. For this illustration, prices and quantities are nonnegative integers and the total must fit the declared integer range. An optimized implementation must produce the same total over that shared domain; out-of-range inputs need their own specified rejection behavior.

For items (250 cents, quantity 2) and (125 cents, quantity 3), the independently calculated expected total is:

250 × 2 + 125 × 3 = 875 cents

An optimized loop that omits the last item would return 500 cents. That is an illustrative failure, not a recorded execution. It gives you an input, a comparison and an independently justified answer without requiring either path to be a separately deployed service. Also test the domain’s boundaries, such as an empty list if the contract allows one.

When equality is not the obligation

An experiment deliberately compares a new pricing policy with an old policy. If the new policy intentionally removes a discount, the two totals are not required to match for affected purchases. Treat that as an authorized contract change, with its own expected outcomes and transition checks.

Likewise, an estimate made before usage is known need not equal a final charge computed from actual usage. It may instead promise a bound, a stated accuracy or an explanation of adjustments. Do not call these different inputs a failure of same-input agreement.

Record the amendment precisely. “The replacement is different” is too broad: unchanged cases may still require parity, and affected consumers may still require compatibility.

Differential testing, regression testing or an independent oracle?

These methods can share a test runner while answering different questions. Choose the claim first.

Method or activity / Main question / What it does not establish by itself
Method or activity Main question What it does not establish by itself
Differential testing Do the paired computations agree on the compared case? That either answer satisfies the intended requirement.
Requirements-based or contract testing Does each result meet an explicit expected behavior? Agreement on all behavior not covered by those expectations.
Regression or golden-result testing Did behavior change from a retained baseline? That the retained baseline was correct or remains the intended contract.
Property-based testing or fuzzing What inputs can challenge a stated property or expose failures? The correct comparison rule. A differential assertion can be the property exercised.
Metamorphic testing Do results for related inputs obey a justified relationship? A same-input comparison between two implementations. It can use just one implementation.
Shadow execution or traffic replay How do paths behave on a copied workload? Comparable state, safe side effects, a meaningful comparator or representative coverage.
Structural coverage, including MC/DC Which implementation structures or condition effects were exercised? Agreement between paths or correctness of their expected results.
Formal equivalence analysis Does a stated relation hold throughout the analyzed model under its assumptions? Behavior outside that model, its assumptions or the analyzed implementation boundary.

A generated-input campaign with a pairwise assertion is both generative testing and differential testing. A retained mismatch replayed after a repair is also a regression test. The names describe different parts of the work, not competing labels for the whole suite.

For a property-based tool example, Hypothesis documents input strategies and shrinking; the engineer still supplies the calls and assertions. Metamorphic testing instead starts from relations between different inputs and their results.6 7

02 / Start with the artifact

Free differential-testing worksheet

Copy this worksheet into an issue, repository document or review record. It is complete selectable text; no download or interactive tool is required. Use one contract record per pair and comparison phase, then one case record per shared input or sequence.

What the comparison contract should include

Field / Decision to record
Field Decision to record
1. Identity and requirement Name the pair, the question it answers, the governing requirement and their revisions.
2. Path identities Record both entrypoints, implementations, source/build identities and the adapters used to invoke them.
3. Comparison phase State when parity applies, how the phase ends, and which changes reopen it.
4. Shared input and domain Specify input representation, units, admissible values, rejection cases and intentional contract differences.
5. Shared state and environment Define equivalent initial state, snapshot or event watermark, configuration, dependencies, clocks and randomness.
6. Observations and capture point List return values, errors, durable state and other effects; state when and how each becomes observable.
7. Agreement relation Choose exact equality or a stated tolerance, including units, bounds and special-value handling.
8. Normalization and authority List each permitted transformation, its validation precondition, rationale and approving authority. Preserve the raw record.
9. Independent expectations Record expected examples, invariants or a separately justified model that can challenge both paths.
10. Cases and controls Include a normal case, a consequential boundary/failure case, a known disagreement and invalid-comparison controls.
11. Harness and readiness Name tools, prerequisites, isolation, resource limits, error classifications and evidence that the intended paths ran.
12. Evidence and disposition Record results, revisions, evidence locations, unresolved work, operational fallback, reviewer and acceptance authority.

A state mapping can be necessary when the paths use different representations. Define how an old integer balance and a new ledger represent the same logical balance; do not require their storage bytes to match. Then verify the mapping and compare the required logical value and effects.

Copyable contract record

PAIR AND REQUIREMENT
Pair name:
Question both paths answer:
Requirement and revision:
Contract owner:

PATHS
Path A entrypoint and revision/build:
Path B entrypoint and revision/build:
Adapter revisions and evidence they call the intended code:

COMPARISON PHASE
Entry condition:
Parity-required cases:
Explicitly amended or out-of-scope cases, with authority:
Exit condition and evidence required to close the phase:
Changes that require renewed comparison:

INPUT DOMAIN
Shared input representation and units:
Valid-input constraints:
Specified rejection cases:
Input corpus identity:

STATE AND ENVIRONMENT
Initial logical state and representation mapping:
Snapshot, object version or event watermark:
Configuration and dependency versions:
Clock, randomness and scheduling controls:

OBSERVATION BOUNDARY
Response fields and error semantics:
Durable state and external effects:
Capture method and completion milestone:
Time limit and what a timeout means:

AGREEMENT RULE
Fields requiring exact equality:
Numeric tolerance, units, derivation and allowed domain:
NaN, infinity, signed-zero, ordering and duplicate rules:

NORMALIZATION
Permitted field/transformation:
Validation required before applying it:
Rationale, approving authority and rule revision:
Raw observations retained at:

INDEPENDENT EXPECTATIONS
Expected normal result and its basis:
Expected failure/boundary result and its basis:
Properties or independent checks that can refute both paths:

CASES AND CONTROLS
Normal case:
Failure or boundary case:
Known-mismatch control:
Invalid-output or failed-harness control:
State-alignment and normalization controls:
Required case identities and campaign completion rule:

HARNESS AND READINESS
Executor:
Tool/runtime versions:
Isolation and side-effect containment:
Execution identity and capture checks:
Readiness blockers:

RESULT AND DECISION
Run identity and evidence references:
Scheduled / executed / validly compared / skipped cases:
Paired-agreement results:
Independent-oracle results:
Unresolved discrepancies and owners:
Which answer may be served while a discrepancy is open:
Reviewer and authorized decision maker:
Acceptance, exception or rejection record:
Rerun or reconsideration trigger:

Initial evidence status: NOT RUN.
Initial decision status: NOT ACCEPTED.

Leave an unresolved decision explicitly open with an owner. Do not replace it with a permissive comparator.

Copyable case record

Copy this record for each normal, boundary, failure or harness-control case.

Case field / Your record
Case field Your record
Case identity and purpose Not recorded
Contract and comparison-rule revision Not recorded
Shared input or sequence; initial state Not recorded
Expected response, effects and independent basis Not recorded
A: raw observation and execution identity Not run
B: raw observation and execution identity Not run
State alignment and capture-point checks Unassessed
Normalized observations and applied rule Not recorded
Paired-agreement result Not run
Independent-oracle result Not run
Evidence location and unresolved discrepancy Not recorded
Owner, disposition and decision authority Not accepted

Keep the contract revision beside these records. A case assessed with an earlier normalization or tolerance rule is not automatically evidence for a revised rule.

03 / A failure you can inspect

Differential-testing example: both handlers reject, one still writes

The worked example reuses the retained API-cutover fixture from the migration companion. Its executions were recorded on 3 October 2026 at 09:30:30 UTC, on Darwin/arm64 with Python 3.14.7 and SQLite 3.53.4. They are archived synthetic teaching results, not a new execution, a customer incident or a Proof product run.8

The fixture has two local Python handlers. Each observation starts with its own freshly initialized SQLite database. One document exists:

{"documents": [[1, "alpha", "quarterly"]]}

The row fields are document ID, owning tenant and label. The contract permits a tenant to update its own document. A request from another tenant must return 403 and leave every document row unchanged. Correlation IDs may differ, but each must be a nonempty string.

Shared inputs and independent expectations

Case / Tenant / Requested label / Expected status / Expected committed rows
Case Tenant Requested label Expected status Expected committed rows
own_tenant alpha revised 200 [[1, "alpha", "revised"]]
other_tenant beta revised 403 [[1, "alpha", "quarterly"]]

These expectations come from the fixture’s authored tenant-isolation rule and cases, not from copying the old handler’s output. The fictional service owner is part of the teaching scenario. A real requirement needs authority from the actual project.

The two cases are independent. The authorized call does not change the database later used for the unauthorized call. There are four initialized databases and four local handler calls: two cases multiplied by two implementations. No network API is invoked.

The ordering defect

The old handler reads the owner and rejects an unauthorized request before writing. The candidate deliberately updates and commits first, then checks ownership.

Path / What happens for tenant beta
Path What happens for tenant beta
Old Read owner alpha; return 403; leave the stored label unchanged.
Candidate Write revised; commit it; read owner alpha; return 403.

Returning an error after the commit does not undo the update. The runner closes the handler’s connection, opens a fresh connection and reads the committed rows. Python’s official SQLite tutorial documents this commit, close and reopen observation pattern; it is not a test of crash recovery or another database engine.5

Exact archived observations for the unauthorized case

Observation / Old handler / Candidate handler
Observation Old handler Candidate handler
Response status 403 403
Response error forbidden forbidden
Request ID old-other_tenant new-other_tenant
Rows read through the fresh connection [[1, "alpha", "quarterly"]] [[1, "alpha", "revised"]]
Authored status/state expectation Met for this case Violated: a rejected request changed another tenant’s row

A response-only test sees the same rejection. The stored-state observation exposes the defect.

Three comparators, three different claims

The permitted comparison first validates both request IDs as nonempty strings. It then removes only response.request_id and compares the entire remaining response and the ordered durable_rows exactly. There is no numerical tolerance.

Comparison over the archived records / Authorized case / Unauthorized case / Interpretation
Comparison over the archived records Authorized case Unauthorized case Interpretation
Raw response plus durable rows Unequal Unequal Different request IDs create a permitted raw difference in both cases.
Validated request-ID normalization; keep durable rows Equal Unequal One valid agreement and one meaningful disagreement.
Discard request ID and all durable rows Equal Equal One false agreement conceals the unauthorized update.

The deliberately dangerous comparator simply drops the fields. It does not itself validate request IDs. All IDs in these archived observations happen to be valid, so that omission does not change the displayed outcomes. It is still not a safe general comparison rule.

The archive’s independent requirement assertions compare status and stored rows with the authored expected values. The paired comparison additionally retains the other response fields. Do not read this as independent validation of every aspect of the response schema or error wording.

What should be corrected?

For this sequential fixture, ownership must be checked before the update can be committed. The intended control flow is:

Read the document owner.
If the requester is not the owner:
    return 403 without changing document rows.
Otherwise:
    update the label;
    commit the authorized update;
    return 200.

This is a proposed correction described from the contract, not a newly executed repair. The retained archive contains only the old and deliberately faulty candidate implementations.

Case to rerun after repair / Expected repaired observation / Evidence status here
Case to rerun after repair Expected repaired observation Evidence status here
Owner updates its document 200; stored label becomes revised. Expected, not recorded for a repaired candidate.
Another tenant attempts the update 403; stored row remains [1, "alpha", "quarterly"]. Expected, not recorded for a repaired candidate.
Paired comparison after permitted normalization Agreement on both selected cases. Expected, not measured after repair.

In a concurrent system, merely moving a read before a write may leave a check/use race. Authorization and mutation must remain consistent under the real storage and concurrency contract. The sequential fixture does not settle that design.

The bounded conclusion

The archived candidate fails one of the two status/state cases. The old handler passes those two cases. The permitted comparator catches the selected defect; removing durable state conceals it.

That is evidence about these cases, implementations and observations. It does not establish complete tenant isolation, missing-document handling, concurrency, rollback, schema compatibility, lock duration, production data volume or cutover readiness. It also does not establish a passing repair.

The migration companion owns the broader cutover discussion: supported readers and writers, deployed versions and deployment-specific evidence. Here the lesson is the comparison boundary. Two identical response codes do not establish agreement on required effects.

Inspect the retained result record · Read the fixture contract · Inspect the handler source

Reproduce the archived teaching contrast

The existing evidence-methods ZIP contains the sources and retained results. Extract it, inspect the README, and use Python 3.9 or later with its standard-library sqlite3 module. No pip packages, network service or Proof binary is needed.

From the extracted evidence-methods directory, choose a new or empty output directory:

python3 run.py --output rerun-results

The runner refuses to overwrite retained evidence. It runs both the bundle’s mutation experiment and the migration experiment, and writes results.json, stdout.txt and SHA256SUMS. Inspect the migration section rather than confusing the mutation counts with this pair.

Expected reproduction outcome: four migration handler calls; the candidate fails one of two requirement cases; the dangerous comparison conceals one failure. Exit zero means the intended teaching contrast occurred, including rejection of the faulty candidate. It does not mean the candidate passed.

A new run records its own environment and time. Keep it separate from the archive. The ZIP checksum and retained digests identify bytes; they are not independent signatures or proof of origin.

Follow the discrepancy through the failure

Narrated presentation of the archived 3 October 2026 teaching example. The proposed repair remains unexecuted. Download the transcript.

Read the video transcript

Differential testing runs the same logical input through two comparable computations and checks their observable results against a declared agreement rule. A disagreement is evidence to investigate. Agreement is not proof that either answer is correct.

Start from the promise. The authored expectation is 403 and unchanged rows for a cross-tenant request. That is the oracle before either output is considered.

Reset the state for each path. Both databases contain document 1, owned by alpha, labeled quarterly. Tenant beta requests revised.

Read the responses. The archive records 403 and forbidden from both handlers. Their nonempty request IDs differ, as permitted.

Read committed state. The old handler leaves quarterly. The candidate leaves revised. The fresh-connection observation makes the side effect visible.

Apply only the authorized normalization. Remove the validated request ID. Retain the stored row. The case still disagrees and the candidate violates the independent status/state expectation.

Keep the repair open until it runs. Correct the write/authorization ordering and rerun the two cases. Unchanged rows after rejection are the expected repaired result, not an observation already present in the archive.

The archived candidate fails one of the two status/state cases. The old handler passes those two cases. The permitted comparator catches the selected defect; removing durable state conceals it. That is evidence about these cases, implementations and observations. It does not establish complete tenant isolation, missing-document handling, concurrency, rollback, schema compatibility, lock duration, production data volume or cutover readiness. It also does not establish a passing repair.

Read the original text walkthrough

This is a text walkthrough of the same archived example, not a video or a new execution.

  1. Start from the promise. The authored expectation is 403 and unchanged rows for a cross-tenant request. That is the oracle before either output is considered.
  2. Reset the state for each path. Both databases contain document 1, owned by alpha, labeled quarterly. Tenant beta requests revised.
  3. Read the responses. The archive records 403 and forbidden from both handlers. Their nonempty request IDs differ, as permitted.
  4. Read committed state. The old handler leaves quarterly. The candidate leaves revised. The fresh-connection observation makes the side effect visible.
  5. Apply only the authorized normalization. Remove the validated request ID. Retain the stored row. The case still disagrees and the candidate violates the independent status/state expectation.
  6. Keep the repair open until it runs. Correct the write/authorization ordering and rerun the two cases. Unchanged rows after rejection are the expected repaired result, not an observation already present in the archive.

04 / The working method

How to build and assess a differential test

Begin with a pair whose result you can explain. Before expanding the corpus, make one normal case, one consequential failure case and the comparator’s own controls work end to end.

1. Establish the contract and comparison phase

Name the question both paths answer, the common domain and the period in which parity is required. Record the requirement revision and who can approve changes to it. Identify intentional differences before treating one path as a replacement.

Define what happens while a discrepancy is unresolved. The policy might stop a cutover, route reads to a designated source, invalidate a cache or suspend settlement. A runtime fallback and the authority to decide correctness are different decisions. “Use the old answer” is not a universal rule.

Retain: the contract, phase, input-domain exclusions, operational fallback and authorized decision owner.

2. Identify the real paths and control their starting state

Record both implementations, builds, adapters, configuration and dependencies. A wrapper should call the code you intend to assess. If both wrappers call the same helper, the test has not challenged the intended pair.

For stateful work, create equivalent isolated starting states or identify a shared snapshot or event prefix. Reset between independent cases. If the requirement concerns a sequence, replay the same sequence from the same baseline and compare at declared milestones.

Do not make alignment a way to hide drift. If the contract requires a cache to reach watermark 3 by a deadline and it cannot, retain that failed prerequisite. If it claims watermark 3 but omitted an event, compare its value against the same prefix and report the disagreement.

Contain external effects. Replaying a payment or notification twice against a live destination is not a harmless way to collect evidence. Use an authorized isolated environment or controlled sinks, and document what that changes about the claim.

Retain: state identities, input mappings, environment details and evidence that the intended entrypoints ran. If the required shared basis cannot be established, the comparison is blocked.

3. Specify observations before normalizing them

Collect raw responses, domain errors, relevant stored state and required external effects. Define how you know execution has reached the observation point. A return from a function may precede an asynchronous write.

List every allowed normalization. Validate the field’s independent requirement before removing its incidental value. A correlation ID may be variable while still being required, well formed and correctly linked across events.

Decide what happens to missing fields, duplicate values, ordering, empty results and unexpected types. Sorting a map’s keys is different from sorting a priority queue. Removing a missing or malformed value can conceal a defect rather than normalize representation.

Retain: raw records, the versioned normalizer, field validations and the reason each ignored difference is permitted.

4. Set the agreement rule and independent expectations

Use exact typed equality where the contract specifies exact discrete values. For numeric approximation, state units, error bounds, allowed range and how the tolerance was justified. Apply the rule separately to every field whose semantics differ.

Add an expected normal result and a failure or boundary result derived from the requirement. Include independent properties when useful. If both implementations share a mistake, pairwise equality alone cannot expose it.2

In the tenant example, both sides must independently satisfy 403 plus unchanged rows. The old output helps locate the difference; it does not define that expectation.

Retain: reviewed expected values, their derivation, tolerance rationale and each oracle’s scope.

5. Challenge the harness before trusting a green result

Use controls that distinguish a working comparison from one that silently drops observations.

Control / Expected observation / If it does not occur
Control Expected observation If it does not occur
Known normal case Both intended paths run, produce usable records and meet the independent expectation. Repair setup or implementation before expanding the campaign.
Deliberate meaningful mismatch in captured data The comparator reports disagreement. The comparator may be ignoring the required field or applying an overbroad tolerance.
Missing or malformed required observation The run cannot become an agreement pass. Fix validation and result classification.
Allowed request-ID variation Valid IDs may differ without hiding other fields. Repair the narrowly scoped normalization.
Empty or invalid request ID Validation fails before that field is discarded. Do not accept the normalization merely because the remaining records match.
State version or watermark mismatch The run is identified as not a valid same-state comparison. Repair alignment; separately investigate whether a freshness obligation failed.

These are controls to implement, not additional archived executions claimed by this article. Keep the deliberately corrupted observation separate from the product output that was actually captured.

Retain: control inputs, expected classifications, actual classifications and comparator revision.

6. Run useful cases and preserve the coverage of the campaign

Start with ordinary accepted inputs, rejected inputs and boundaries that can change the answer. Add transitions such as update, delete, retry and replay where the pair depends on history. Generate or mutate further inputs only within a reviewed domain.

Record scheduled cases, actual invocations, valid comparisons, disagreements, independent-oracle failures, skipped cases and harness failures separately. A campaign with no usable comparisons has not supported agreement, even if its command exits successfully.

A seed helps reproduce input generation. Preserve the concrete input or sequence as well: code, generator versions, runtime, clocks, external responses and scheduling can change the outcome.

Retain: the corpus, seeds, tool versions, executed-case inventory, raw observations and full failure records.

7. Reproduce and classify every material discrepancy

First check the comparison’s validity: input mapping, state alignment, execution identity, observation timing and normalization. Then compare both outcomes with the requirement.

Reduce a large failing input if that helps diagnosis, but preserve the mismatch and its prerequisites. Revalidate the smaller input’s domain and replay it outside the search loop. Compiler-testing research gives a concrete warning: a reduction that introduces undefined behavior can destroy the meaning of the original comparison.2

Keep both the original and reduced cases. A short counterexample that no longer represents the same failure is not a better regression test.

Retain: replay steps, both raw results, the applicable requirement, classification, owner and next action. Do not silently resolve an unexplained mismatch by changing the expected output.

8. Repair, rerun and record the bounded decision

Repair the implementation that violates the contract, or have the authorized owner amend an incorrect or incomplete requirement. A changed normalizer or tolerance also changes the acceptance basis and needs review.

Rerun the reproducer, nearby boundaries, normal controls and affected regression cases. Preserve the failed evidence with the repair. Report what now agrees, what independently satisfies the requirement and what remains untested.

Acceptance must name the evidence and its limits. If code, requirements, state mapping or dependencies change later, assess whether the results remain applicable. Closing one discrepancy is not automatically completion of the comparison phase or permission to deploy.

05 / Choose the rigor the pair needs

Exact equality, tolerances and nondeterminism

The comparison rule decides which defects remain visible. Treat it as part of the requirement, with its own review and tests.

Start with exact semantics

Exact equality is appropriate for a specified Boolean decision, an integer count, a fixed-point amount, an error category or a required stored row. It does not always mean equal serialized bytes.

For JSON-like data, agree on types, missing versus null fields, array order, duplicates and number representation. Two objects can be semantically equal despite different key serialization order. Two ordered arrays can contain the same elements and still represent different behavior.

For money expressed in integer minor units, a one-unit difference is not floating-point noise. Any permitted difference needs a business rule. Do not cast an exact large integer to a floating-point number merely to reuse a convenient tolerance function.

Use numerical tolerance only with an error argument

For finite numeric outputs, one common symmetric rule is:

abs(a - b) <= max(abs_tol, rel_tol * max(abs(a), abs(b)))

Python documents this rule for math.isclose. An absolute tolerance is useful near zero, where a relative-only test is insufficient. The function’s defaults are not a justification for your system’s permissible error.3 4

Suppose a teaching contract allows an absolute difference of 0.001 metres or a relative difference of one part per million, whichever is larger. These are illustrative choices, not a recommendation for a real measurement system.

A, metres / B, metres / Absolute difference / Allowed difference under this rule / Calculated result
A, metres B, metres Absolute difference Allowed difference under this rule Calculated result
1000 1000.0009 0.0009 0.0010000009 Within tolerance
1000 1000.002 0.002 0.001000002 Outside tolerance
0 0.0008 0.0008 0.001 Within tolerance

These are arithmetic examples, not outputs from an executed numerical implementation. A real tolerance must follow from the required accuracy, numerical analysis, measurement uncertainty or another explicit error budget. Explain its valid range and what happens beyond it.

Also specify non-finite values. Python’s isclose does not consider NaN close to anything, and accepts an infinity only against the same infinity.3 Your application may forbid all non-finite results, in which case two matching infinities are still invalid outputs. State whether the sign of zero is observable.

Numerical closeness does not guarantee the same discrete decision. Two close values on opposite sides of an eligibility threshold can authorize different actions. Compare that decision exactly when the requirement demands it.

Control variability without erasing behavior

Source of variation / Useful control / What not to hide
Source of variation Useful control What not to hide
Clock-dependent output Inject a shared time or compare at the same defined instant. Expiry, duration or ordering errors that affect the contract.
Generated identifiers Validate structure and required relationships; map incidental identities if authorized. Missing IDs, duplicates or broken references.
Random choices Record seeds and random inputs where controllable; define the intended observable relation. A changed distribution or decision by discarding the random-dependent output.
Eventual consistency Compare a common event watermark or the promised state after a bounded completion condition. A missed write, false watermark or violated freshness deadline.
Parallel scheduling Compare required event order, effects or invariants under a declared schedule model. Missing events and forbidden interleavings through indiscriminate sorting.
Unordered results Compare an authorized multiset or keyed mapping. Duplicate loss, multiplicity changes or meaningful order.

If two randomized algorithms are only required to have similar distributions, a single same-seed output comparison may be the wrong experiment. A statistical claim needs its own sampling design and decision rule; do not label it exact per-input parity.

Add depth where drift can hide

For a pure transform, test boundaries in input shape and value: empty input, repeated keys, unusual lengths and rejected encodings as applicable. For a maintained total, test the update sequence that can leave it stale: insertion, modification, deletion, retry and rebuild. For preview/settlement, test changes at quote expiry and rounding boundaries.

Run a compact, stable regression corpus on changes. Use broader generated campaigns or representative replay where their cost and risk are justified. Retain discoveries as reviewed cases so the campaign becomes more informative, not just larger.

Set a campaign budget and an explicit stop condition. Time spent without a mismatch describes a search, not the probability that no defect remains. Escalate a consequential discrepancy even when millions of other cases agree.

06 / Agreement needs an independent challenge

Which answer is right when the paths disagree?

First establish that the results are comparable. After that, the applicable requirement and designated authority decide the disposition. Age, speed and majority vote do not automatically confer correctness.

Finding / Interpretation / Next action
Finding Interpretation Next action
Candidate violates the approved contract Replacement regression. Preserve the witness, repair the candidate and rerun affected cases.
Old path violates the approved contract Existing defect exposed or corrected. Keep the evidence; assess callers that rely on the old behavior and plan the transition.
A documented amendment requires a difference Intentional change, not universal parity. Verify the amended behavior and unchanged parity scope separately.
The difference is explicitly permitted Allowed variation. Validate its preconditions and apply the narrow approved comparison rule.
Input or state was not comparable No valid conclusion about same-input agreement from that pair. Repair setup or investigate a failed state/freshness prerequisite; do not count it as a pass.
The contract does not resolve the difference Unresolved intent. Retain both results and obtain a decision from the named owner.
Both paths produce the same wrong answer Pairwise agreement with a shared requirement failure. Fail the independent check and investigate shared assumptions or dependencies.

An operational rule may designate the ledger, leader or accepted quote as the value to serve while an incident is investigated. That is a controlled fallback, not a mathematical guarantee that the designated source cannot be wrong. Record both the serving policy and the evidence authority.

For example, consider an API receiving ?tag=red&tag=blue. One parser retains two values; another keeps only blue. The mismatch is concrete, but the answer depends on whether this API promises a list, rejects repeated keys or applies last-value precedence. Do not remove the repeated key during normalization to settle an unresolved product rule. Record the chosen semantics and assess callers before changing either path.

Keep agreement and correctness in separate columns

Pair agrees? / Independent requirement check / Conclusion
Pair agrees? Independent requirement check Conclusion
Yes Passes Supports the declared behavior for the observed case and basis.
Yes Fails A shared defect or wrong expectation needs investigation; parity is not acceptance.
No One path fails The independent rule identifies the violating path within its scope.
No Both fail Neither path is an acceptable reference for this case. Repair both or resolve the expectation before accepting either.
No Both pass their available checks The requirement may permit both outcomes, or the comparison or oracle may be incomplete. Investigate before choosing a winner.
Either No independent check available The result establishes agreement or disagreement only; correctness remains unresolved.

Use hand-calculated boundary cases, a simpler reviewed model, algebraic invariants or independently grounded requirements as appropriate. A second copy of the same algorithm is not a strong independent oracle. A round-trip property can also miss a shared encoder/decoder error; examine what the property actually constrains.

Finite sampled agreement cannot establish behavior outside the tested inputs, states, configurations and observation boundary. Even exhaustive enumeration of a small model establishes only that model’s result under its assumptions. It cannot supply a missing requirement or demonstrate an unobserved durable effect.

07 / Decide what ready and accepted mean

Differential-testing checklist and result statuses

Separate permission to compare, the observed outcome and the decision to accept the change. Those are different records.

Before execution

  • Confirm the common question and phase. Both paths are required to agree for the selected cases; retain the requirement and phase record. Unresolved intent blocks an acceptance claim.
  • Identify both implementations. Record entrypoints, revisions and adapters; demonstrate that the intended code runs. A shim that substitutes its own copy of the algorithm does not establish that the intended implementation ran.
  • Establish the shared basis. Record matching input, state and relevant environment. A mismatch needs a named disposition, not automatic exclusion.
  • Review observations and equality. Include required state and effects, units, error semantics, tolerances and normalization approvals. A missing required observation blocks the comparison.
  • Run comparator controls. A known difference must fail; invalid records must not pass. Preserve these outcomes with the comparator revision.
  • Contain effects and assign owners. Confirm the safe execution environment, evidence location and discrepancy owner before replaying requests.

Before acceptance

  • Account for every scheduled case. Reconcile executions, usable comparisons, skips and harness failures. No evidence must remain distinguishable from no discrepancy.
  • Inspect both result columns. Review paired agreement and independent requirement checks. Either can reveal work that the other missed.
  • Resolve material differences. Retain the input, raw observations, classification, repair or scoped exception, and the responsible authority.
  • Renew changed evidence. Reassess results after changes to either path, the contract, state mapping, normalizer or environment.
  • Disclose remaining obligations. Name concurrency, recovery, integration or operational work that this campaign did not perform.
  • Record the decision. Acceptance or an exception must identify its evidence, scope, owner and revisit trigger. A successful command is not that decision.

Use statuses that say what happened

Evidence status / Meaning / Required response
Evidence status Meaning Required response
Not run The planned observation does not exist. Prepare and execute the check, or resolve its blocker.
Blocked / invalid comparison The required input, state, execution or capture conditions were not met. Investigate the failed prerequisite; obtain a valid comparison.
Harness error A tool or adapter failed to produce usable evidence. Repair the harness and rerun. Keep the error visible.
Disagrees Valid paired observations violate the declared agreement rule. Classify the difference against the requirement and authority.
Agrees; correctness not established The compared observations agree, but an independent expectation is absent or incomplete. Retain the parity result with that limit; obtain any additional evidence the decision requires.
Agrees, independent check fails Pairwise equality holds, but a specified behavior is violated. Investigate the shared defect or the expectation. Do not accept on parity alone.
Passes the declared case Valid comparison agrees and the case’s required independent checks pass. Retain the basis and complete any remaining campaign and review work.
Stale The basis changed and reuse has not been justified. Assess impact and rerun or record an authorized reuse decision.

Keep decision status separate: not assessed, accepted, rejected or exception approved. An approved exception does not rewrite “disagrees” into “passed.” Record the deviation, risk, duration and recheck trigger.

A product timeout may be a genuine behavioral failure. A harness timeout can also leave the functional result unknown. Preserve where the timeout occurred and assess any explicit deadline obligation separately; do not turn every timeout into either a benign refusal or a proven implementation mismatch.

08 / Avoid evidence you have to reconstruct

Differential-testing mistakes and their consequences

Mistake / What it costs / Correction
Mistake What it costs Correction
Assume the old path is the oracle Known defects become compatibility requirements without review. Judge both outputs against approved intent and assess affected consumers.
Run both paths against mutable shared state The first execution changes the input to the second. Isolate equivalent initial states or replay a controlled shared history.
Compare only successful response bodies Rejection semantics and durable effects can drift unnoticed. Capture the complete required observation boundary, including errors.
Normalize until the report turns green The comparator hides the regression it was meant to expose. Review each transformation and test that consequential differences survive it.
Choose tolerance from the observed mismatch The acceptance criterion follows the defect. Derive a defensible error budget before accepting results.
Count two failures as agreement without checking why Missing dependencies or unrelated errors masquerade as parity. Validate execution and refusal semantics; include independent expectations.
Report only the agreement percentage Skipped, invalid and unexecuted cases disappear. Show denominators and evidence categories, with unresolved work.
Keep only the reduced input or latest green run Diagnosis and review lose the original failure and its context. Retain original observations, reduction history, repair basis and reruns.

Ask one useful question of the comparator: What meaningful difference could it currently erase? In the worked example the answer is an unauthorized committed update. For a queue it might be event order; for a numerical kernel, a threshold-crossing decision hidden inside a broad tolerance.

09 / Keep the evidence attached to the requirement

How Proof fits a differential-testing workflow

Proof’s documented differential tooling has a specific scope. The fixture check and fuzzer execute configured shim commands for a transform. The temporal monitor instead analyzes two supplied event traces. Neither should be described as a universal comparator for arbitrary services or as automatic release approval.9

Compare authored fixtures through configured shims

The differential_conformance check reads proof.fixtures/v1 cases and passes the same language-neutral input to the two shim entries registered under project.checks.differential_conformance.transforms. The corpus location is set by project.checks.differential_conformance.fixtures_dir, defaulting to proof/fixtures.

The configuration has two fixed slots named python and rust. The Python slot identifies an importable function; the Rust slot is a configured command. The latter label does not prove that the command is written in Rust.

The check compares envelopes:

  • Two successful results must have canonical-JSON-equal outputs.
  • Two refusals count as differential agreement.
  • With an authored value or error expectation, each side is also checked against that expectation.
  • An any expectation adds no independent expected-result check.

The two error texts are not compared with each other. With an error expectation, each must match its regular expression. If the contract requires the same error category, retryability or other semantics, make that requirement explicit and ensure the chosen representation and expectations check it.

The CLI reference does not document arbitrary numeric-tolerance options for this check. Do not assume the numerical rules discussed earlier are automatically provided by the command.

Read the verdict and the work actually performed

Documented verdict / What it means
Documented verdict What it means
agree The pair satisfies the shim comparison and any authored expectation for the case.
diverge-cross-impl Exactly one side succeeds, or successful outputs differ.
diverge-from-expected The pair agrees but contradicts an authored value or error expectation.
shim-error A shim did not produce a usable envelope, for example because it failed to start, timed out or returned malformed output.

A shim error takes precedence over the divergence verdicts; a cross-implementation divergence takes precedence over divergence from the expected result. Read the individual observations when diagnosing a case.

There are important boundaries behind a pass:

  • A transform without both complete shim entries is skipped as informational.
  • An empty fixture corpus passes without demonstrating a comparison.
  • Fixtures for inactive or out-of-scope requirements do not run.
  • Only top-level JSON fixture files in the configured directory are read; nested files are ignored.
  • A malformed fixture file fails the check before cases run.
  • The check invokes the shims, not the real services directly. It cannot establish that the adapters call the intended implementation.

There is also a specific refusal trap. The Python driver converts exceptions, including failed imports, into refusal envelopes. If the other side also refuses and the expectation is any, the case can agree even though the intended Python implementation never ran. Use execution controls and meaningful expectations; do not treat the word “agree” as a complete environment check.9

Run the documented commands with their prerequisites

Use an installed Proof CLI and an existing project whose current help matches this workflow. For an authored corpus, first register both shims, make their dependencies available, and ensure that the expected requirement and transform are actually in scope. Run from the project root and check any configured command working directory. Include an expected-success control that reaches each intended implementation, not only cases in which both sides refuse.

proof help differential_conformance
proof audit --check differential_conformance

Inspect the executed cases and verdicts. A green check with zero eligible comparisons is not evidence for your pair. Keep the command, CLI version, project configuration, fixtures and raw shim records together.

For a project that already defines a pure transform named normalize_url and has its seed fixtures and both shims configured:

proof differential fuzz normalize_url --seed 7 --iterations 200

The transform name is illustrative, not a built-in supplied transform. The fuzzer mutates existing fixtures, runs both shims and can shrink a real divergence into a candidate known issue containing a reproducer, both outputs and the seed. Candidates are not automatically promoted; the documented workflow calls for human severity grading and promotion into the curated corpus.9

A seed supports replay of generated inputs. Reproducing results still depends on the implementation, environment and controlled nondeterminism. A shrunk input is not a guarantee of the globally smallest counterexample.

These commands were not executed for this article. The SQLite teaching archive above is not evidence of a Proof CLI run.

Temporal trace comparison is a different claim

proof differential monitor <REQ-ID> evaluates the selected temporal requirement over two supplied proof.traces/v1 traces and compares per-step verdicts. Its PASS requires both traces to satisfy the property and agree at every step. If both violate it identically, the result is FAIL even though no divergent step exists.9

The command runs no shims and does not establish how the traces were produced. An authored-trace flag is self-declared; a differing requirement identifier produces a warning. Inspect provenance and alignment separately. Equal verdicts for one property are not equality of the full traces or every behavior of the implementations.

Keep planning, execution and acceptance distinct

A fixture declares a case and expectation. A run supplies observations. A retained evidence link makes the result discoverable. Acceptance is the designated authority’s decision.

Proof’s Agents and MCP workflow describes connected requirements and evidence as context for coding agents.10 Use that context to preserve why the comparison exists and what a discrepancy means. An agent-generated oracle still needs a defensible basis; a connected result does not make the observation boundary complete.

What belongs in a CI gate?

Require the intended transforms and case identities, valid observations, the declared comparison results and any independent checks your plan calls for. Treat a missing required comparison as unfinished work, even when a tool permits an empty corpus or informational skip.

These are requirements for your gate policy, not additional enforcement claimed for the differential command. Configure the repository to require the relevant job, preserve its reports and control changes to its expectations and exclusions. The teaching runner’s exit zero is unsuitable as a “candidate passed” signal: it deliberately succeeds when the faulty candidate is caught.

10 / Choose what fits the work

Which differential-testing workflow should you use?

Choose by the pair, the state you must control and the observations you must retain. A short function test can be a better fit than a service-level replay system when the obligation concerns one pure computation.

Workflow / Useful when / What your team must supply or verify
Workflow Useful when What your team must supply or verify
Ordinary test runner with a paired assertion Two callable functions, including a test-only reference model and optimized implementation. Separate entrypoints, meaningful cases, independent expectations and a tested comparator.
Property-based generator plus paired assertion The input space has useful structure and hand-selected cases leave gaps. Valid strategies, domain constraints, calls, oracle and replayable reduced failures. Hypothesis is one documented input-generation/shrinking option.6
Stateful integration harness Agreement includes database state, transactions, events or a sequence of operations. Isolated equivalent state, capture milestones, effect observation and relevant failure injection.
Controlled replay or shadow workflow Representative captured workloads expose behavior hard to express as small fixtures. Authorization to use the data, side-effect containment, state alignment, privacy controls and meaningful sampling.
Proof fixture check and differential fuzzing The documented shim/corpus contract fits the transform and requirement workflow. Complete registrations, real-code adapters, appropriate expectations and scrutiny of skipped or invalid work.9
Proof temporal monitor The question is whether two traces satisfy and agree on one temporal property. Credible trace production, alignment and provenance; it does not run the applications.9

How these options were selected

This guide is published by Proof and includes its own tooling. The table compares engineering workflows and documented roles, not measured vendor performance. No comparative benchmark, commercial quotation or qualification assessment is claimed.

Try one representative case through the complete workflow before adopting it broadly: prepare its state, run both paths, capture a known mismatch, reduce or isolate it, and let another engineer reproduce the result. Account for integration work, execution cost, evidence retention and comparator maintenance.

For developers and teams using coding agents

Start with a bounded pair and a requirement that explains which differences matter. Have the agent call the actual implementations, preserve raw observations and add a regression only after the expected result is justified. Keep authority over edits to the contract and comparator explicit.

A reference model should favor clarity. If the optimized routine and the model share the same complicated helper, examine what independence the test really gained.

For QA and verification leads

Review the observation boundary before reviewing the number of cases. Challenge the comparator with a known difference, a malformed record and a failed invocation. Require separate agreement and independent-oracle results, plus an inventory of missing evidence.

For stateful pairs, make sequence coverage concrete. “Update tested” does not say whether the suite exercises deletion, replay, a late event or an interrupted write.

For data, platform and migration teams

Define snapshots, watermarks, permitted lag and the source that may be served during disagreement. Reconcile equivalent logical state rather than assuming that two wall-clock reads saw the same data.

For an actual cutover, use the database/API migration companion for deployment-specific questions. Parity evidence is one input to that decision, alongside recovery, version compatibility, concurrency and operational controls.

For product and requirement owners

Resolve whether the pair promises the same answer or only a relationship between answers. A binding quote, an estimate and a deliberately changed price policy have different obligations. Specify expiry, adjustments and who may approve exceptions before engineering encodes them.

Use the applicable verification plan, assurance process and required tool controls to determine what evidence is acceptable. This guide describes an engineering method. It does not establish compliance, certification, tool qualification or an approved assurance case.

Who this guide is not for

If you have only one path and no executable reference, begin with requirements-based checks or justified properties. If the intended behavior is changing, settle that change before requiring universal parity. If your main question is production migration readiness, output agreement alone is too narrow.

A complete verification strategy may also need security, timing, concurrency, fault recovery and intended-use validation. None becomes unnecessary because a differential corpus is green.

11 / Evidence behind the guide

Primary sources and reproducible artifacts

The external sources support the method and selected comparison mechanisms. The teaching fixture supports the concrete failure story. Product help supports the described CLI behavior. These are different evidence classes.

Start with the original question: what does a difference mean?

McKeeman’s Differential Testing for Software explains why comparing implementations can reveal useful discrepancies and why requirements still matter when their outputs differ. It is a historical compiler-testing paper, not a universal definition of correctness or a certification source.

Read the original paper

Source / What this guide uses it for / Limit
Source What this guide uses it for Limit
1. William M. McKeeman, Differential Testing for Software, Digital Technical Journal 10(1), 1998 Shared-input comparison, requirement-dependent differences and reducing useful failure cases. Historical compiler-focused experience, not evidence about Proof or every modern system.
2. Yang, Chen, Eide and Regehr, Finding and Understanding Bugs in C Compilers, PLDI 2011 Valid comparable inputs, the shared-wrong-answer limitation and preserving meaning during reduction. Compiler research with explicit language and target assumptions; its experiments were not reproduced here.
3. Python: math.isclose The symmetric relative/absolute comparison formula and special-value behavior. Defines a function, not an application’s justified error budget.
4. Christopher Barker, PEP 485 Rationale for approximate equality, absolute tolerance near zero and careful numerical use. Use current library documentation for the actual API; choose tolerances for the specific contract.
5. Python: sqlite3 Explicit commits and closing/reopening a connection to inspect stored data. Does not establish production crash durability, concurrent authorization or another database’s behavior.
6. Hypothesis: strategies reference Generating inputs from strategies and shrinking failing examples. Rolling official documentation; no execution, performance comparison or global-minimum guarantee is claimed.
7. Chen, Cheung and Yiu, Metamorphic Testing: A New Approach for Generating Next Test Cases, HKUST-CS98-01, 1998 Relations between related inputs and outputs, distinct from a same-input paired comparison. The original report was later deposited on arXiv in 2020. Its relations and numerical assumptions must fit the application.
8. Evidence-methods teaching bundle Authored contract, cases, handler and runner source, fictional disposition and the archived four-call migration record. Synthetic local Python/SQLite evidence recorded 3 October 2026. No repaired-candidate run or release approval is included.
9. Proof CLI help: differential and differential_conformance The documented shim/corpus workflow, verdicts, refusal handling, skips, fuzz candidates and trace-monitor boundary. A documentation basis, not a locally executed or version-pinned product measurement. Check the help for the installed CLI before relying on it.
10. Proof: Agents and MCP workflow Connected requirement and evidence context for coding agents, distinct from execution and acceptance. First-party product description, not an independent benchmark or evidence that a particular project is ready.

External sources checked 27 October 2026. Archived observations retain their own recorded environment and date. The expected model, tolerance and additional examples are illustrations, not newly measured application results.

Two more examples / make the shared basis explicit

Agreement beyond an implementation replacement

1. A cached total and a recount need the same event watermark

Consider an illustrative ledger with three ordered amounts in cents:

Event 1: +1000
Event 2:  -250
Event 3:  +400

At watermark 3, an independent sum gives 1000 - 250 + 400 = 1150 cents. The maintained total must equal 1150 if it claims to include exactly those three events.

Comparison / Recount / Cache / Interpretation
Comparison Recount Cache Interpretation
Both represent events through 3 1150 1150 Expected agreement.
Cache claims watermark 3 but missed the debit 1150 1400 Meaningful disagreement of 250 cents.
Cache truthfully represents events through 2 1150 at watermark 3 750 at watermark 2 Different state bases; not a valid same-watermark equality test.

These are calculated illustrative outcomes. The third row may still violate a separate freshness deadline. It must not be mislabeled as a parity pass merely because the comparison was invalid.

For a credible test, capture the ledger prefix and cache watermark together with the value. Exercise the missing debit, then repair and replay it. If the ledger is the authorized reconstruction source, that policy can guide rebuilding the cache; the ledger still needs its own integrity checks. Deletion, duplicate delivery and out-of-order events need further cases.

2. A preview and settlement need one binding quote

Suppose an illustrative quote contains goods worth 2,000 cents, a 200-cent discount and 300-cent shipping. Its explicit teaching rule taxes discounted goods plus shipping at 10%, with integer-cent results for these inputs.

Taxable amount: 2000 - 200 + 300 = 2100 cents
Tax:            2100 × 10% = 210 cents
Total:          2100 + 210 = 2310 cents

Both preview and settlement must return 2,310 cents for that same valid quote. A settlement path that calculates tax before applying the discount would calculate 230 cents of tax and charge 2,330 cents in total. The 20-cent difference is a contract failure, not a tolerance choice.

This is expected arithmetic for an invented pricing rule, not a claim about any jurisdiction’s tax law or a recorded charge. Use the same quote ID, line items, currency, shipping choice, rule revision, rounding policy and validity conditions.

If the user changes the shipping option or the quote expires, the workflow may require a new quote. The old preview is then not an eternal oracle. Verify the amendment or requote behavior separately, and ensure settlement cannot silently charge changed terms while claiming to honor the original quote.

12 / Common questions

Differential-testing questions, answered

Do I need two production implementations?

No. A simple executable model and an optimized implementation can form the pair. The model may exist only in tests. Identify its input domain, assumptions and independent expected cases; calling it “reference” does not establish correctness.

Can two matching outputs both be wrong?

Yes. Both paths can share a defect, dependency or mistaken requirement. Keep independent expected examples or properties alongside the paired comparison. A test that finds both answers equal but contrary to the requirement must remain a failure.

What if the old implementation has a bug?

Use the approved requirement to assess both results. Preserve evidence of the old defect and the corrected behavior, then review any callers that depend on the old result. A compatibility decision can require a transition plan without turning the defect into an automatically correct oracle.

Should error messages match exactly?

Only when exact wording is part of the contract. Often the meaningful observations are error code, category, retryability and absence of unintended effects. Two exceptions with unrelated causes are not automatically equivalent. Proof’s documented shim check counts two refusals as parity without comparing their text, so use appropriate independent expectations and harness controls.

How do I choose a floating-point tolerance?

Start from the permitted error in the output’s units and domain, then justify absolute and relative bounds. Include zero, large magnitudes, special values and decision thresholds. Do not increase the threshold merely to accommodate a failing candidate. Exact monetary units and authorization decisions often need exact comparison instead.

What should I do with an intermittent mismatch?

Keep the raw input, state identities, execution timing, configuration and both observations. Repeat under controlled conditions without deleting the first result. Investigate state drift, clocks, random choices, scheduling and observation timing. A failed replay does not prove that the original discrepancy was harmless.

Does “both refused” count as agreement?

It can under a deliberately coarse comparison rule, but that says little about correctness. Both sides may have rejected invalid input correctly, failed for different reasons or never reached the intended code. Validate the execution and the contract’s error semantics. An expected success that receives two refusals fails its independent oracle.

How many agreeing tests are enough?

There is no universal count. Choose cases and campaign depth from the input domain, state transitions, likely failure modes and consequences. Report the cases actually compared and the assumptions that limit the result. Sampled agreement does not establish all-input equivalence or replace missing integration and recovery evidence.

Can I stop comparing after migration?

Yes, if the agreement obligation was scoped to a comparison phase and its authorized exit conditions are satisfied. Retain useful regression cases and the decision record. Ongoing pairs, such as a maintained total and its recount, need a continuing consistency strategy. A later change to the shared contract or implementation can reopen comparison work.

Does a passing differential check make a release acceptable?

No. The result must refer to the intended candidate, contain meaningful comparisons and satisfy the required independent checks. The project may still require concurrency, recovery, security, performance or deployment evidence. Acceptance and exceptions belong to the designated authority, not to the comparator’s exit code.

Draft change note

Expanded the guide with a selectable comparison worksheet, the archived tenant-isolation failure, controlled normalization, numerical tolerances, independent-oracle checks and current CLI boundaries. Added model/implementation, cache/recount and preview/settlement applications.

The migration companion retains its cutover-specific purpose. The failure observations remain the 3 October 2026 teaching record; the correction is an expected outcome awaiting a repaired run.