oracle-differential

Validates implementations by comparing outputs against a trusted reference implementation.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill oracle-differential-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: oracle-differential
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/oracle-differential
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill oracle-differential-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When you cannot hand-write expected values for every test case, this Skill solves the oracle problem by letting a trusted alternative implementation (reference implementation, legacy version, or another library) decide correctness through output comparison. ## Core Features & Use Cases - Differential Testing Procedure: A five-step workflow covering reference implementation selection, input space alignment, zero-difference assertions, mismatch triage, and parallel-run migration. - Independence and Pitfall Checks: Guidance on avoiding shared-bug traps such as self-loopback round-trips, shared rounding errors, and floating-point comparison flakiness. - Use Case: You optimized a sum function and want confidence it matches the naive version. Use this Skill to run both implementations against wide property-based inputs with fast-check and assert identical outputs before removing the old code. ## Quick Start Use the oracle-differential skill to set up a differential test comparing my optimized implementation against the naive reference version with property-based inputs.

Frequently Asked Questions about oracle-differential

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write tests when I cannot define expected values?

Use differential testing: run the same inputs through a trusted reference implementation and assert the outputs match. Property-based testing libraries like fast-check generate wide input coverage so you do not need hand-written expected values.

What is differential testing in software testing?

Differential testing feeds identical inputs to two implementations and compares their outputs. It is used for optimization validation, legacy migration, and porting, where a reference implementation acts as the correctness oracle.

Can I use my own encode/decode round-trip as a test oracle?

No. Self-loopback round-trips only verify internal consistency, not spec compliance, because both sides can share the same bug. Pin one side to official test vectors or an independent third-party implementation instead.

Why does my differential test fail on floating-point comparisons?

Floating-point results rarely match exactly across implementations due to rounding differences. Switch to tolerance-based comparison or normalize ordering and signed zero, but avoid loosening tolerances so much that real bugs pass.

When should I not use differential testing?

Avoid it when no trusted reference implementation exists, or when both implementations derive from the same codebase and may share the same specification gaps. In those cases agreement does not guarantee correctness.