Files
rose-ash/artdag/l1/test_fused_pipeline.sexp
giles 1a74d811f7
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m33s
Incorporate art-dag-mono repo into artdag/ subfolder
Merges full history from art-dag/mono.git into the monorepo
under the artdag/ directory. Contains: core (DAG engine),
l1 (Celery rendering server), l2 (ActivityPub registry),
common (shared templates/middleware), client (CLI), test (e2e).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

git-subtree-dir: artdag
git-subtree-mainline: 1a179de547
git-subtree-split: 4c2e716558
2026-02-27 09:07:23 +00:00

45 lines
1.4 KiB
Common Lisp

;; Test Fused Pipeline - Should be much faster than interpreted
;;
;; This uses the fused-pipeline primitive which compiles all effects
;; into a single CUDA kernel instead of interpreting them one by one.
(stream "fused_pipeline_test"
:fps 30
:width 1920
:height 1080
:seed 42
;; Load primitives
(require-primitives "streaming_gpu")
(require-primitives "image")
(require-primitives "math")
;; Define the effects pipeline (compiled to single CUDA kernel)
;; Each effect is a map with :op and effect-specific parameters
(def effects-pipeline
[{:op "rotate" :angle 0}
{:op "zoom" :amount 1.0}
{:op "hue_shift" :degrees 30}
{:op "ripple" :amplitude 15 :frequency 10 :decay 2 :phase 0 :center_x 960 :center_y 540}
{:op "brightness" :factor 1.0}])
;; Frame pipeline
(frame
(let [;; Create a gradient 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)
;; Dynamic parameters (change per frame)
angle (* t 30)
zoom (+ 1.0 (* 0.2 (math:sin (* t 0.5))))
phase (* t 2)]
;; Apply fused pipeline - all effects in ONE CUDA kernel!
(streaming_gpu:fused-pipeline base effects-pipeline
:rotate_angle angle
:zoom_amount zoom
:ripple_phase phase))))