-
Notifications
You must be signed in to change notification settings - Fork 0
Differential Testing
Simon B.Stirling edited this page Mar 2, 2026
·
1 revision
I use this document as the frozen semantic differential contract for the current bootstrap toolchain.
Contract version: diffsem.v1
For each differential pair in the M64 corpus, I freeze runtime-result equivalence:
- build left fixture to image
- build right fixture to image
- run both images over the same deterministic argument vectors
- require byte-identical
runstdout for every test vector
This contract checks semantic equivalence across canonical fixture variants, including:
- id-renumbering variants
- arg-definition-order variants
- call-lowered vs direct arithmetic/bitwise kernels
- dead-const-generalized variants for compare/control-flow/memory/ABI kernels
I enforce this contract in:
tests/differential_semantics.sh
That harness is integrated into default automation through tests/run.sh and therefore enforced by make test.
-
add.wrapequivalence (valid_add_v7vs id/argdef variants) - direct-vs-call equivalence for
mul.wrap,sub.wrap,and,or,xor,shl,shr -
icmp.eqdead-const generalized equivalence -
icmp.eq + cbrselect dead-const generalized equivalence -
alloca/st/ldandalloca/st/gep/lddead-const generalized equivalence - SysV 6-arg sum dead-const generalized equivalence
- const-return id/dead-const generalized equivalence
- Differential checks for intentionally unsupported guardrail-fallback shapes.
- Exhaustive symbolic equivalence; v1 is deterministic corpus-based runtime differential testing.
- Cross-machine runtime-equivalence guarantees outside the pinned Linux x86-64 bootstrap environment.
- How-To-Write-L0
- Language-Reference
- Instruction-Set
- CLI-and-Compiler-Spec
- Implementable-Spec
- Command-Reference
- Examples-Catalog
- LLM-Quick-Reference
- Opcode-Examples
- LLM-Doc-Index