Skip to content

Add an xunit compile-back gate over the fixture green set#610

Merged
richlander merged 1 commit into
mainfrom
feature/decompiler-compile-back-gate
Jun 18, 2026
Merged

Add an xunit compile-back gate over the fixture green set#610
richlander merged 1 commit into
mainfrom
feature/decompiler-compile-back-gate

Conversation

@richlander

Copy link
Copy Markdown
Owner

What

Promotes the compile-back oracle (decompile → recompile → compare IL) from a
console-only harness mode into a durable CI regression gate.

Why

Compile-back is the only rail that verifies semantic fidelity — that decompiled
C#, recompiled, produces the same IL. A body that parses, binds, and reads
plausibly but recompiles to a different opcode stream changed the program, the
worst failure class, invisible to --compile-check and --grade-source. Until
now it only ran when someone manually invoked --compile-back; nothing stopped a
regression from landing.

How

  • CompileBack.Evaluate: a non-printing, structured-result entry point that
    shares all of the skeleton-emission and opcode-comparison machinery with the
    existing console Run, so the two paths cannot drift. Run is untouched.
  • The test project links the single CompileBack.cs source file (rather than
    a project reference on the harness Exe, which would pull in a second entry point)
    and adds the Roslyn package it needs.
  • CompileBackGateTests asserts two properties over CfgSampleClass:

KnownDiffs is the open docket and shrinks as fixes land. StaleFieldRead stays a
tracked defect (#605).

Verification

  • Both gate tests green on current main.
  • Full ILInspector.Decompiler.Tests suite green (428 passing).

Part of the compile-back oracle docket (#604). Related: #605.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

The compile-back oracle (decompile -> recompile -> compare IL) only ran as
a console exploration mode in the harness. Wire it into CI as a durable
regression guard.

Expose CompileBack.Evaluate: a non-printing, structured-result entry point
that shares all of the skeleton-emission and opcode-comparison machinery
with the existing console Run, so the two paths cannot drift. The test
project links the single CompileBack.cs source file (rather than taking a
project reference on the harness Exe, which would pull in a second entry
point) and adds the Roslyn package it needs.

CompileBackGateTests asserts two properties over CfgSampleClass:
- no method newly recompiles to a different opcode stream beyond the
  documented KnownDiffs docket (catches a fix in one method silently
  degrading another);
- previously-fixed methods (CheckedAdd #604, UnsignedShift #606, Shadowed
  #607) stay opcode-exact.

Shrink KnownDiffs as docket entries are fixed; StaleFieldRead remains a
tracked defect (issue #605).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@richlander richlander merged commit 0999128 into main Jun 18, 2026
10 checks passed
@richlander richlander deleted the feature/decompiler-compile-back-gate branch June 18, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant