Skip to content

islpy 2025.2 - 2025.2.3 break doctests with current main #940

@matthiasdiener

Description

@matthiasdiener

With islpy 2025.2 -- 2025.2.3:

$ pytest doc/tutorial.rst
========================================== test session starts ==========================================
platform darwin -- Python 3.11.9, pytest-8.4.0, pluggy-1.6.0
rootdir: /Users/mdiener/Work/emirge/loopy
configfile: pyproject.toml
plugins: github-actions-annotate-failures-0.2.0, anyio-4.9.0, mock-3.14.0, xdist-3.6.1
collected 1 item

doc/tutorial.rst F                                                                                [100%]

=============================================== FAILURES ================================================
________________________________________ [doctest] tutorial.rst _________________________________________
555
556 .. doctest::
557
558     >>> knl = lp.make_kernel(
559     ...     "{ [i]: 0<=i<n }",
560     ...     "a[i] = 0", assumptions="n>=1")
561     >>> knl = lp.split_iname(knl, "i", 16)
562     >>> knl = lp.prioritize_loops(knl, "i_outer,i_inner")
563     >>> knl = lp.set_options(knl, write_code=True)
564     >>> evt, (out,) = knl(queue, a=x_vec_dev)
Differences (unified diff with -expected +actual):
    @@ -1,6 +1,9 @@
     #define lid(N) ((int) get_local_id(N))
    -...
    +#define gid(N) ((int) get_group_id(N))
    +<BLANKLINE>
    +__kernel void __attribute__ ((reqd_work_group_size(1, 1, 1))) loopy_kernel(__global float *__restrict__ a, int const n)
    +{
       for (int i_outer = 0; i_outer <= -1 + (15 + n) / 16; ++i_outer)
    -    for (int i_inner = 0; i_inner <= ((-17 + n + -16 * i_outer >= 0) ? 15 : -1 + n + -16 * i_outer); ++i_inner)
    +    for (int i_inner = 0; i_inner <= ((-16 + n + -16 * i_outer >= 0) ? 15 : -1 + n + -16 * i_outer); ++i_inner)
           a[16 * i_outer + i_inner] = (float) (0.0f);
    -...
    +}

/Users/mdiener/Work/emirge/loopy/doc/tutorial.rst:564: DocTestFailure
======================================== short test summary info ========================================
FAILED doc/tutorial.rst::tutorial.rst
=========================================== 1 failed in 0.81s ===========================================

Note that:

  • The only meaningful change is the change from -17 to -16 inside the kernel. I'm not sure whether this change affects the actual kernel execution.
  • There are multiple doctest errors in this file, but only the first one is shown.

Islpy 2025.1.5 runs these tests fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions