Shared task
Changed `__len__` of rank-0 arrays to 1 (was 0)
PR #15017 ↗ · sympy/sympy · · merged Aug 7, 2018 · +7 −3 · base 6810dee42694
what a new run launched now would send
`len` of rank-0 arrays returns 0 `sympy.tensor.array.NDimArray.__len__` always returns zero for rank-0 arrays (scalars). I believe the correct value should be one, which is the number of elements of the iterator and the observed behaviour in numpy. ```python >>> import sympy >>> a = sympy.Array(3) >>> len(a) 0 >>> len(list(a)) 1 ``` In numpy we have the following: ```python >>> import numpy >>> numpy.asarray(1).size 1 ``` This was tested in sympy 1.2-rc1 running in Python 3.6.6 `len` of rank-0 arrays returns 0 `sympy.tensor.array.NDimArray.__len__` always returns zero for rank-0 arrays (scalars). I believe the correct value should be one, which is the number of elements of the iterator and the observed behaviour in numpy. ```python >>> import sympy >>> a = sympy.Array(3) >>> len(a) 0 >>> len(list(a)) 1 ``` In numpy we have the following: ```python >>> import numpy >>> numpy.asarray(1).size 1 ``` This was tested in sympy 1.2-rc1 running in Python 3.6.6 Work only inside this repository checkout. Make the code change the task describes, keeping the diff focused — no drive-by refactors. When you are done, leave your changes committed or in the working tree; they are collected automatically. Stay on this snapshot checkout (`task/ycb_sympy_pr15017`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan. Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
| Run | Model | Verdict |
|---|---|---|
| Aug 21, 12:31 UTC · completed | composer-2.5 | FAIL |
| Aug 21, 12:31 UTC · completed | grok-4.6 | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6-low |
Powered by YourCodingBench — benchmark coding models on your own repo's commits. sign in
| Aug 21, 12:31 UTC · completed | grok-4.6-medium | PASS |
| Aug 21, 12:31 UTC · completed | grok-4.6-xhigh | PASS |
Binary verdicts from the pinned judge (D27). Full attempt detail — candidate diff, transcript, timings — lives on each run page's score matrix.