ManimCommunity / ManimCommunity/manim

`test_force_window_opengl_render_with_format` fails on m2 based mac

Open
#3,444 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

When running pytest on a the clean version of the repo, one of the tests fail on macOS running on an apple chip.

## Expected behavior

The tests should all pass as they do on my x86 machine running linux.

## How to reproduce the issue

```bash
git clone git@github.com:ManimCommunity/manim.git
cd manim
poetry install
pytest
```

## Additional media files

Images/GIFs

## Logs
Terminal output

```
(1282 durations < 0.005s hidden. Use -vv to show these durations.)
======================================================================== short test summary info =========================================================================
FAILED tests/test_scene_rendering/opengl/test_opengl_renderer.py::test_force_window_opengl_render_with_format - AttributeError: 'CocoaAlternateEventLoop' object has no at
tribute 'platform_event_loop'
======================================== 1 failed, 669 passed, 2 skipped, 6 xfailed, 2 xpassed, 427 warnings in 103.25s (0:01:43) ========================================
```

## System specifications

System Details

- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): `macOS 14.1`
- RAM: `24 GB`
- Python version (`python/py/python3 --version`): `3.11.6`
- Installed modules (provide output from `pip list`):
```
Package Version Editable project location
----------------------------- --------- ---------------------------------
alabaster 0.7.13
astor 0.8.1
astroid 2.15.8
attrs 23.1.0
Babel 2.13.1
beautifulsoup4 4.12.2
black 23.10.1
certifi 2023.7.22
cffi 1.16.0
cfgv 3.4.0
charset-normalizer 3.3.2
click 8.1.7
click-default-group 1.2.4
cloup 2.1.2
commonmark 0.9.1
contourpy 1.1.1
coverage 7.3.2
cryptography 41.0.5
cycler 0.12.1
Cython 3.0.5
data-science-types 0.2.23
decorator 5.1.1
Deprecated 1.2.14
dill 0.3.7
distlib 0.3.7
docutils 0.17.1
execnet 2.0.2
filelock 3.13.1
flake8 3.9.2
flake8-bugbear 21.11.29
flake8-builtins 1.5.3
flake8-comprehensions 3.14.0
flake8-docstrings 1.7.0
flake8-plugin-utils 1.3.3
flake8-pytest-style 1.7.2
flake8-rst-docstrings 0.2.7
flake8-simplify 0.14.6
fonttools 4.44.0
furo 2022.9.29
gitdb 4.0.11
GitPython 3.1.40
glcontext 2.5.0
identify 2.5.31
idna 3.4
imagesize 1.4.1
iniconfig 2.0.0
isort 5.12.0
isosurfaces 0.1.0
Jinja2 3.1.2
kiwisolver 1.4.5
lazy-object-proxy 1.9.0
manim 0.17.3 /Users/saveliyyusufov/repos/manim
ManimPango 0.5.0
mapbox-earcut 1.0.1
markdown-it-py 2.2.0
MarkupSafe 2.1.3
matplotlib 3.7.3
mccabe 0.6.1
mdit-py-plugins 0.3.5
mdurl 0.1.2
moderngl 5.8.2
moderngl-window 2.4.4
multipledispatch 1.0.0
mypy-extensions 1.0.0
myst-parser 0.17.2
networkx 3.1
nodeenv 1.8.0
numpy 1.26.1
packaging 23.2
pathspec 0.11.2
Pillow 9.5.0
pip 23.3.1
platformdirs 3.11.0
pluggy 1.3.0
pre-commit 2.21.0
psutil 5.9.6
psutil-wheels 5.8.0
py 1.11.0
pycairo 1.25.1
pycodestyle 2.7.0
pycparser 2.21
pydocstyle 6.3.0
pydub 0.25.1
pyflakes 2.3.1
PyGithub 1.59.1
pyglet 2.0.9
Pygments 2.16.1
PyJWT 2.8.0
pylint 2.17.7
PyNaCl 1.5.0
pyobjc-core 10.0
pyobjc-framework-Cocoa 10.0
pyparsing 3.1.1
pyrr 0.10.3
pytest 7.4.3
pytest-cov 3.0.0
pytest-forked 1.6.0
pytest-xdist 2.5.0
python-dateutil 2.8.2
PyYAML 6.0.1
recommonmark 0.7.1
requests 2.31.0
restructuredtext-lint 1.4.0
rich 13.6.0
scipy 1.11.3
screeninfo 0.8.1
setuptools 68.2.2
setuptools-scm 8.0.4
six 1.16.0
skia-pathops 0.7.4
smmap 5.0.1
snowballstemmer 2.2.0
soupsieve 2.5
Sphinx 4.5.0
sphinx-basic-ng 1.0.0b2
sphinx-copybutton 0.4.0
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-programoutput 0.17
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
sphinxext-opengraph 0.8.2
srt 3.5.3
svgelements 1.9.6
tomlkit 0.12.2
tqdm 4.66.1
types-decorator 0.1.7
types-docutils 0.20.0.3
types-Pillow 9.5.0.6
types-protobuf 3.20.4.6
types-Pygments 2.16.0.0
types-requests 2.31.0.10
types-setuptools 57.4.18
typing_extensions 4.8.0
urllib3 2.0.7
virtualenv 20.24.6
watchdog 3.0.0
wrapt 1.15.0
```

LaTeX details

+ LaTeX distribution (e.g. TeX Live 2020): `mactex`
+ Installed LaTeX packages:
```
This makes the comment too long. I can figure out an alternative way to list it if needed.
```

## Additional comments

This issue seems to be handled for ARM64 (I assume for linux based machines) via:
```py
@pytest.mark.skipif(
platform.processor() == "aarch64", reason="Fails on Linux-ARM runners"
)
...
```

A quick solution would be to detect the apple chips as well, which come up as `'arm'`:
```py
>>> import platform
>>> platform.processor()
'arm'
>>>
```

I'm happy to create a PR with this hotfix, or I can seek out another solution. Please let me know if you need any additional information.

Thank you!

Contributor guide

Open the contributing guide

Research direction

Start with tests/test_scene_rendering/opengl/test_opengl_renderer.py and run the failing test, test_force_window_opengl_render_with_format, on macOS Apple silicon. Inspect the existing platform.processor() skip for aarch64 and determine how the reported CocoaAlternateEventLoop failure should be handled. Done means the test passes on Apple silicon without regressing Linux or x86 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.