[logical] Make the estimate_schedule_retry lit tests pass on macOS instead of skipping them

Open
#5,973 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
66/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
testing

Research direction

Start with PR #5959 and preview/logical/test/lit.cfg.py to see how the system-darwin feature is defined, then read estimate_schedule_retry_max_plus.mlir to see the CHECK lines pinned to full-precision values. Pick one of the three proposed approaches and apply it to all five preview/logical/test/Dialect/Phys/estimate_schedule_retry_*.mlir files, running the logical lit suite locally to confirm the Linux values still match. Done means no UNSUPPORTED: system-darwin line and no libm explanation comment in any of the five headers, with the macOS logical Test job green.

Written by the indexing model from the issue text.

Description

stale-notified
Describe the bug

Five preview/logical lit tests are marked UNSUPPORTED: system-darwin in #5959 because their expected values differ by one ulp on macOS. Make their CHECK lines pass on both Linux and macOS and remove the UNSUPPORTED lines, so macOS runs the same coverage as Linux.

Follow-up requested by @1tnguyen in https://github.com/NVIDIA/cuda-quantum/pull/5959 (review comment on estimate_schedule_retry_max_plus.mlir).

Background

The tests CHECK floating-point results printed to the last digit. Apple's libm differs from glibc by one ulp. For example, it prints 0.43749999999999994 where glibc prints 0.4375.

#5959 skips these tests on macOS with // UNSUPPORTED: system-darwin, using the system-<os> lit feature added in preview/logical/test/lit.cfg.py:

  • preview/logical/test/Dialect/Phys/estimate_schedule_retry_abort-errors.mlir
  • preview/logical/test/Dialect/Phys/estimate_schedule_retry_abort_folded.mlir
  • preview/logical/test/Dialect/Phys/estimate_schedule_retry_call_template_native.mlir
  • preview/logical/test/Dialect/Phys/estimate_schedule_retry_max_plus.mlir
  • preview/logical/test/Dialect/Phys/estimate_schedule_retry_native.mlir

The escalation and retry logic these tests exercise runs on macOS wheels, and the macOS job currently skips the tests that check it.

Proposed work

Pick one approach and apply it to all five tests:

  1. Loosen the CHECK lines so they match both spellings, for example with a FileCheck regex such as {{0\.4375(0*|[0-9]*)}}, or CHECK-SAME on the prefix.
  2. Add a macOS-specific prefix with // RUN: ... --check-prefixes=CHECK,DARWIN, and put the platform-specific values behind system-darwin / system-linux guards.
  3. Change the test fixtures so the printed values are exactly representable, such as powers of two, and need no per-platform handling.

Option 3 is the most robust, since it removes the libm dependency. Option 1 is the smallest change.

Acceptance criteria
  • None of the five tests has UNSUPPORTED: system-darwin.
  • They pass in the macOS logical Test job and still pass on Linux.
  • The comment explaining the libm difference is removed from the test headers.
Notes
  • The system-darwin / system-linux features can stay in lit.cfg.py for tests that are platform-specific for other reasons, such as native_liveness_write_failure.mlir.
Dominant language
C++
Stars
1.2k
Forks
508
Avg merge
1d 19h
Merged PRs (30d)
100

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/cuda-quantum

All issues in NVIDIA/cuda-quantum

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.