ManimCommunity / ManimCommunity/manim

ManimCE 0.19.0 - caching issue

Open
#4,160 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior
Rendering the scene below twice with caching enabled results in a false placement of one object at the end.
(follow-up of https://discord.com/channels/581738731934056449/1337379695628521513/1337379695628521513 )

## Expected behavior
The second (and subsequent) rendering of the scene should result in the same output as the first rendering.

## How to reproduce the issue
Code for reproducing the problem

```py
class Sin2(Scene):
def construct(self):
ax = Axes(x_range=(-2, 2, 1), y_range=(-2, 2, 1), x_length=6)
trigo_circle = Circle(radius=1.5)
self.add(ax, trigo_circle, Dot(color=RED).shift(1.5*RIGHT))

theta = ValueTracker(0)

neg_point = always_redraw(
lambda: Dot(
trigo_circle.point_at_angle(-theta.get_value()),
color=YELLOW
)
)

neg_arc = always_redraw(
lambda: Arc(radius=1.4, angle=-(theta.get_value() % TAU), stroke_width=2,
color=YELLOW
)
)

pos_neg = always_redraw(
lambda: Tex(
"$e^{-i \\theta}$",
color=YELLOW
).move_to(0.6*neg_point.get_center())
)

self.add(pos_neg, neg_point, neg_arc)

self.play(theta.animate(run_time=5).set_value(TAU))

self.play(theta.animate(run_time=2).set_value(TAU+2.4))

self.wait()
```

## Additional media files
Images/GIFs

### Result of the first rendering

https://github.com/user-attachments/assets/d0648c4b-ab4e-4e6f-b446-32bb3ffaff7a

### Result of the second rendering

https://github.com/user-attachments/assets/5ae17f30-cb0f-4df7-ab44-75667ff72cc7

## System specifications

System Details

- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Windows 10
- Python version (`python/py/python3 --version`): 3.13.0

Contributor guide

Open the contributing guide

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.

Research direction

Start with the supplied Sin2 reproduction on Windows 10 with Python 3.13.0, rendering it twice with caching enabled and comparing the outputs. Trace the caching and rendering entry points responsible for the second run; done means repeated renders match the first output and the regression is covered by a test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.