Skip to content

Make C and Python FFI tests fail on incorrect numerical results #4

Closed

Description

@LunaStev

Motivation

Meson registers the C and Python examples as FFI tests, but those programs only print numerical results and exit successfully. A wrong addition, mean, or factorial can therefore pass both tests, and the exported dot product is not exercised.

Scope

  • Assert expected addition, factorial, mean, and dot-product results in meaningful C and Python integration coverage.
  • Cover the existing factorial range sentinel and documented null/empty array behavior.
  • Use explicit tolerances where floating-point results require them and make failures exit nonzero with useful diagnostics.
  • Keep each process's RTS lifecycle valid and guarantee cleanup on ordinary failure paths.
  • Preserve readable examples while ensuring Meson runs real result checks.

Completion criteria

meson test -C builddir --print-errorlogs succeeds for the correct library. Controlled incorrect results cause the relevant test to fail; successful output alone is not treated as correctness evidence.

Compatibility

Test existing exported contracts first. New error models and additional foreign APIs belong to the C ABI tracking issue.

Parent roadmap: #1. Start: examples/c/main.c, examples/python/main.py, and meson.build.

Activity

  1. added this to the 1.0.0 milestone on Oct 27, 2026
  2. added
    bugSomething isn't working
    ffiC ABI, GHC RTS lifecycle, ownership, and native integration.
    testingNumerical correctness, regression coverage, and CI.
    priority highCorrectness and API/ABI foundations needed before expansion.
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingffiC ABI, GHC RTS lifecycle, ownership, and native integration.priority highCorrectness and API/ABI foundations needed before expansion.testingNumerical correctness, regression coverage, and CI.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions