Files
shinyobjectz b589826e7c RM1-RM10: halcyon r109's sequence from killed at 24-25 GB to a 7.8 GB peak (footprint 5.5 GB), the look within run-to-run noise
- RM1: materials' maps and Solari's traced meshes on the GPU only (RAEA_KEEP_CPU_ASSETS=1: the control)
- RM2: a sequence's first 3D engine let go before a second opens
- RM5: JS solids deduplicated by expression, their Manifolds in a two-generation cache (192 MB each); solid.free
- RM6: a map whose picture changes by frame is one part and one material, its picture swapped as frames show it
  (raea-sys-material swapped.rs): the pool's 96 water maps were 96 meshes and 186 textures
- RM7: Manifold shapes welded into indexed meshes (4.65 corners a vertex in halcyon; RAEA_NO_WELD=1: the control);
  a held frame settles to the same picture, boiling 0.30% against 0.38%
- the shape text kept out of the store and the Edit (the engine spawns from the program's rows)
- RM8: a BufferMesh of 64 KB or more kept on disk by its content (buffer:@NAME, raea's caches/buffers):
  shape text 274 MB -> 11.8 MB
- RM9: material maps as BC7 with their mips (intel_tex_2), cached by content in raea's caches/maps, any size
  resampled to whole blocks (RAEA_NO_BC=1: the control): GPU images 733 MB -> 282 MB
- RM10: raea-sys-contact's solids as bytes, a count and u16 surface points: 1.27 GB -> 0.37 GB mid-render
- memtally names the biggest GPU images; RAEA_MEM_MARKS prints the program's text by column and shape call
- tools/memprobe: memseq, heapwho/heapseq (malloc stack logging, holders.py), abenv/abseq/steadyab (A/B on one binary)

docs/render-memory.feature has each step's numbers and gates.
2026-11-29 16:02:31 -08:00

30 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# abseq.sh OUT SHOT BIN_A BIN_B: shot SHOT as a sequence from each binary (one at a time), then each 8th frame's
# difference (% of pixels off by more than 2 levels and by more than 16, mean), A's and B's peak footprint; the frames
# removed after.
set -uo pipefail
out=$1; shot=$2; a=$3; b=$4; mkdir -p "$out"
cd ~/Documents/raea/raea/projects/halcyon-motel
for side in a b; do
bin=$a; [ "$side" = b ] && bin=$b
RAEA_MEM_MARKS=1 "$bin" render compositions/reel.tsx --composition "shot-$shot" -o "$out/$side/" >"$out/$side.log" 2>&1 &
pid=$!; peak=0
while kill -0 "$pid" 2>/dev/null; do
mb=$(footprint -p "$pid" -f bytes 2>/dev/null | awk '/Footprint:/ { for (i = 1; i <= NF; i++) if ($i == "Footprint:") print int($(i + 1) / 1048576) }')
[ -n "$mb" ] && [ "$mb" -gt "$peak" ] && peak=$mb
sleep 2
done
wait "$pid"; echo "$side exit $? peak ${peak} MB $(grep -c '' <(ls "$out/$side" 2>/dev/null)) files"
done
"${PY:-python3}" -I - "$out" <<'E'
import sys, os, numpy as np
from PIL import Image
o = sys.argv[1]
fs = sorted(f for f in os.listdir(f"{o}/a") if f.startswith("frame-") and os.path.exists(f"{o}/b/{f}"))
for f in fs[::8]:
x = np.asarray(Image.open(f"{o}/a/{f}").convert("RGB")).astype(int); y = np.asarray(Image.open(f"{o}/b/{f}").convert("RGB")).astype(int)
d = np.abs(x - y).max(2)
print(f"{f} px>2 {100*(d>2).mean():.3f}% px>16 {100*(d>16).mean():.4f}% mean {np.abs(x-y).mean():.3f}")
E
for side in a b; do d="$out/$side"; mkdir -p "$out/keep-$side"; for f in 00000 00048 00088; do cp "$d/frame-$f.png" "$out/keep-$side/" 2>/dev/null; done; rm -rf "${d:?}"; done