Repository navigation
test: extend C-vs-MLIR differential parity suite (+21 cases, records the gap boundary) - #875
Merged
Merged
Conversation
…dary) Adds tests/unit/test_backend_parity_extended.py covering categories the existing suite missed: f64/i64/u32 arithmetic, integer div/mod, bitwise and shift operators, comparison operators, capturing closures, mutual recursion, nested struct+array aggregates, effect handlers (direct and value-returning), and for-loop-inside-parallel nesting. 16 exit-code + 3 stdout cases, all verified identical across both backends with the real MLIR toolchain. Also records the current parity boundary explicitly: string runtime helpers (len, concatenation) compile+run on the C backend but the MLIR JIT cannot lower them. test_mlir_known_gap_still_open pins this and fails loudly if MLIR gains support, prompting a promotion + maturity-doc update. Updates docs/project/maturity.md differential-tests row to reflect the ~69 combined cases and the recorded gap. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the "MLIR parity is under-verified" gap: the existing
test_backend_parity.pywas strong (48 cases) but the differential coverage stopped short of several feature categories, and there was no explicit record of where the MLIR backend actually falls short.What this adds
tests/unit/test_backend_parity_extended.py— 21 cases, all verified to agree across the C backend and the MLIR JIT on a machine with the real toolchain (mlir-opt / mlir-translate / clang):len, concatenation) that the C backend compiles and runs but the MLIR JIT cannot lower.The boundary is the point
test_mlir_known_gap_still_openasserts the C backend handles those string cases and the MLIR JIT does not. If MLIR gains support, that test fails loudly — the signal to promote the case into a parity set and update the maturity doc. This turns "MLIR is PARTIAL, somehow" into a pinned, self-maintaining frontier.Honest finding
Probing to build this showed the MLIR backend is more complete than the maturity doc's "PARTIAL" implied: effects (including value-returning ops), f64, i64/u32, bitwise/shift, capturing closures, and loop-in-parallel nesting all reach parity. The genuine remaining gap in these probes was string runtime helpers. The maturity doc's differential-tests row is updated to reflect the ~69 combined cases and the recorded gap.
Combined suite (
test_backend_parity.py+_extended): 69 passed locally. All cases skip when the MLIR toolchain is absent, matching the existingneeds_mlirguard.