Upstream reproducer
A minimal reproducer plus a failing test is the currency of an upstream bug report and the base of the patch.
One command, one file, one difference
A bug report is a command, an input, an expected output and an actual output. For a pass: mlir-opt --pass-pipeline='<pipeline>' repro.mlir, with the two transcripts. For a compiler: iree-compile repro.mlir --iree-hal-target-backends=<backend> and the failure text. No repository, no build instructions, no “see attached”.
Cut until it disappears
Remove one line at a time and check that the bug survives each cut. When removing one more makes it vanish, you have the boundary, and the boundary is usually the finding. -mlir-print-ir-after-all, or the project’s equivalent, tells you which pass first produces the wrong IR, and that pass is where the report points.
The test comes before the patch
Write the failing test first and run it against the parent commit, so the failure is recorded rather than remembered. In LLVM that is a lit test whose CHECK lines the broken output contradicts. In IREE it is a test in the suite that matches the component. The test is also the executable form of the report: a maintainer can apply it without reading your prose.
Record the rig
The project commit, the build configuration, the target string and the exact expected text. “Latest main” is not a version, and a report against a build with local patches sends the investigation to the wrong commit.
Things that break
A reproducer that needs your whole repository to compile, which converts a report into a support request. A report with no command line, so the maintainer reconstructs the invocation. A test that passes on the broken build because it checks for the absence of a crash rather than for the right output. And a version field that says “main”, which is true for a week.
Sources
- How to submit an LLVM bug reportdocs · LLVM 23
- LLVM Testing Infrastructure Guidedocs · LLVM 23
- How to create a Minimal, Reproducible Exampledocs
A version records the documentation the claim was checked against, not a house pin. Confirm flags with --help on the release you installed.
Check yourself
What does a usable reproducer contain?
When should you stop cutting the reproducer down?
Why run the test against the parent commit?