Files
celery/test_interpreted_vs_fused.sexp
2026-02-04 09:55:22 +00:00

38 lines
1.1 KiB
Common Lisp

;; Test: Interpreted vs Fused Pipeline Comparison
;;
;; This simulates a typical effects pipeline using the INTERPRETED approach
;; (calling primitives one by one through Python).
(stream "interpreted_pipeline_test"
:fps 30
:width 1920
:height 1080
:seed 42
;; Load primitives
(require-primitives "streaming_gpu")
(require-primitives "geometry_gpu")
(require-primitives "color_ops")
(require-primitives "image")
(require-primitives "math")
;; Frame pipeline - INTERPRETED approach (one primitive call at a time)
(frame
(let [;; Create base image
r (+ 0.5 (* 0.5 (math:sin (* t 1))))
g (+ 0.5 (* 0.5 (math:sin (* t 1.3))))
b (+ 0.5 (* 0.5 (math:sin (* t 1.7))))
color [(* r 255) (* g 255) (* b 255)]
base (image:make-image 1920 1080 color)
;; Apply effects one by one (INTERPRETED - slow)
angle (* t 30)
rotated (geometry_gpu:rotate base angle)
hued (color_ops:hue-shift rotated 30)
brightness (+ 0.8 (* 0.4 (math:sin (* t 2))))
bright (color_ops:brightness hued brightness)]
bright)))