Skip to content

Add executable loop-return and integer-division oracles and correct the rounded-division documentation - #31

Draft
Leitwolf11 wants to merge 8 commits into
mainfrom
test/execution-oracles
Draft

Leitwolf11 wants to merge 8 commits into
mainfrom
test/execution-oracles

Conversation

@Leitwolf11

Copy link
Copy Markdown
Contributor

What changed

More of the language is executed through CorePrep, Xpp, Xmm and LLVM with both native optimizer settings and compared
with independently computed values:

  • return from inside a for body, from a while nested in a for body, and from a do/while body;
  • rounded division //: the specification examples and every sign combination of small operands;
  • remainder % for every sign combination.

All of these already behaved correctly. There is no implementation change.

Documentation correction

// was described as floor division in four IR headers, the Haskell Core model and two documents; one document
claimed mathematical floor semantics for negative operands. The specification, the three Haskell constant evaluators
and the LLVM backend all round to the nearest integer with exact halves away from zero (7 // 2 is 4, 1 // 2 is
1). The descriptions now match. The FloorDivide enumerator keeps its historical name.

Verification

  • go run ./helpers/cmd/develop test: all 21 native suites passed (Windows); the new cases add 3 loop tests and
    5184 arithmetic assertions.
  • verify-docs, Haskell Core build and clang-format: PASS.

macOS and Linux were not run locally.

Leitwolf11 and others added 8 commits October 2, 2026 04:37
…he rounded-division documentation

Execute more of the language through CorePrep, Xpp, Xmm and LLVM with both
native optimizer settings and compare with values computed independently:

- return from inside a for body, from a while nested in a for body, and
  from a do/while body before its trailing test;
- rounded division: the specification examples and every sign combination
  of small operands against a formula written without the compiler's own;
- remainder for every sign combination.

All of these already behaved correctly; no implementation changes.

The rounded division operator was described as floor division in four IR
headers, the Haskell Core model and two documents, one of which claimed
mathematical floor semantics for negative operands. The specification, the
three Haskell constant evaluators and the LLVM backend all round to the
nearest integer with exact halves away from zero, so 7 // 2 is 4 and 1 // 2
is 1. The descriptions now say so; the FloorDivide enumerator keeps its
historical name.
Keeps both new LLVM backend test files in the suite: the arithmetic
execution tests from this branch and the conditional execution tests from
main.
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