code-yeongyu / code-yeongyu/c11-compiler-zig-omo

[Sisyphus] phase-3 / verify / Wave F — Differential testing (csmith / yarpgen-equivalent in Zig)

Open
#32 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Scope
Build a Zig-native random C11 program generator (csmith / yarpgen equivalent) and run differential testing between `zcc` and `gcc`.

## Deliverables
- `phase3/src/csmith_zig.zig` — random C11 program generator with no external dependencies:
- Generates valid C11 programs with random expressions, statements, declarations.
- Avoids undefined behavior (no uninit reads, no signed overflow, no invalid pointer ops).
- Configurable complexity (statements, functions, depth).
- `phase3/scripts/differential-test.sh` — script that:
1. Generates N=1000 random programs.
2. Compiles each with `zcc` and `gcc`.
3. Runs both binaries with the same seed/input.
4. Compares stdout, stderr, exit code.
5. Any mismatch is saved as a bug report (source + both binaries + outputs).

## Success Criteria
1. N=1000 random programs compile with both `zcc` and `gcc`.
2. Zero mismatches in observable behavior (stdout, stderr, exit code).
3. Generator runs in under 10 minutes total in CI.
4. Any mismatch is automatically saved and reported.

## Dependencies
- Phase 2 Wave 10 (full driver) must be complete.
- Phase 2 Wave 4 (sema) must be robust enough to reject invalid generated programs gracefully.

## Suggested Role Assignment
`differential-tester`

## Test Corpus Expectations
- N=1000 random programs, differentially tested.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.