Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SparseIO is a Rust library for sparse, out-of-order materialization of large byt
Instead of eagerly copying an entire object from source to destination, SparseIO allows you to fetch only the chunks you ask for. It tracks what is already present for efficient caching, and deduplicates concurrent reads for the same chunk.

<p align="center">
<img width="600px" src="./docs/static/general-read.gif">
<img width="600px" src="./docs/static/general-read.gif" alt="SparseIO animation showing a cache miss, prefetch, and cache hit as sparse chunks materialize.">
</p>

## Core Premise
Expand Down
2 changes: 1 addition & 1 deletion scripts/animations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This directory holds short `manim` scenes used to generate README-friendly anima
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install manim==0.19.0
python3 -m pip install -r requirements.txt
```

`ffmpeg` is also required for GIF output.
Expand Down
12 changes: 11 additions & 1 deletion scripts/animations/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ VENV_DIR="$ANIMATIONS_DIR/.venv"
PYTHON_BIN="$VENV_DIR/bin/python3"
REQUIREMENTS_FILE="$ANIMATIONS_DIR/requirements.txt"

ensure_ffmpeg() {
if ! command -v ffmpeg >/dev/null 2>&1; then
echo "ffmpeg is required to render GIF output" >&2
echo "install ffmpeg and rerun the render script" >&2
exit 1
fi
}

ensure_animation_venv() {
if [[ ! -x "$PYTHON_BIN" ]]; then
echo "creating animation virtualenv at $VENV_DIR" >&2
python3 -m venv "$VENV_DIR"
"$PYTHON_BIN" -m pip install --upgrade pip
"$PYTHON_BIN" -m pip install -r "$REQUIREMENTS_FILE"
fi

"$PYTHON_BIN" -m pip install -r "$REQUIREMENTS_FILE"
}

ensure_ffmpeg
ensure_animation_venv
26 changes: 0 additions & 26 deletions scripts/animations/general-read/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
UP,
Arrow,
Create,
DashedVMobject,
FadeIn,
FadeOut,
FadeTransform,
Expand All @@ -32,9 +31,6 @@
FONT_FAMILY = "Verdana"

FILE_CHUNKS = 6
CHUNK_SIZE_LABEL = "1 chunk"
FILE_SIZE_LABEL = "6 chunks"
PREFETCH_AHEAD_CHUNKS = 2

FRAME_STROKE = "#7F8EA3"
MUTED_TEXT = "#AAB8C8"
Expand All @@ -45,10 +41,8 @@
CACHE_COLOR = "#90BE6D"
SUBREAD_COLOR = "#FFD166"
SUBREAD_SLOT_COLOR = "#B9852A"
STREAM_COLOR = "#B5179E"
MISS_COLOR = "#F94144"
HIT_COLOR = "#6E9B4B"
PREFETCH_COLOR = "#577590"

Text.set_default(font=FONT_FAMILY)

Expand Down Expand Up @@ -438,23 +432,3 @@ def make_slice(self, chunk_rect: Rectangle, center_ratio: float, height_ratio: f
center_y = top[1] + (bottom[1] - top[1]) * center_ratio
slice_rect.move_to([chunk_rect.get_center()[0], center_y, 0])
return slice_rect

def make_prefetch_window(self, cache: FileColumn, start_chunk: int, chunk_span: int) -> DashedVMobject:
start = max(0, min(FILE_CHUNKS - 1, start_chunk))
end = max(start, min(FILE_CHUNKS - 1, start + chunk_span - 1))
top = cache.chunk_rect(start).get_top()
bottom = cache.chunk_rect(end).get_bottom()
window = Rectangle(
width=cache.body.width + 0.18,
height=top[1] - bottom[1],
stroke_color=PREFETCH_COLOR,
stroke_width=2,
)
window.move_to([cache.body.get_center()[0], (top[1] + bottom[1]) / 2, 0])
return DashedVMobject(window, num_dashes=18)

def make_stream_slices(self, cache: FileColumn, start_chunk: int) -> VGroup:
first = self.make_slice(cache.chunk_rect(start_chunk), 0.58, 0.26, STREAM_COLOR)
second = self.make_slice(cache.chunk_rect(start_chunk + 1), 0.42, 0.72, STREAM_COLOR)
third = self.make_slice(cache.chunk_rect(start_chunk + 2), 0.24, 0.24, STREAM_COLOR)
return VGroup(first, second, third)
Loading