Add autonomous-pipeline primitive for zero-Python hot path
Some checks are pending
GPU Worker CI/CD / test (push) Waiting to run
GPU Worker CI/CD / deploy (push) Blocked by required conditions

This commit is contained in:
giles
2026-02-04 10:02:40 +00:00
parent 6e20d19a23
commit e4349ba501
2 changed files with 119 additions and 0 deletions

36
test_autonomous.sexp Normal file
View File

@@ -0,0 +1,36 @@
;; Autonomous Pipeline Test
;;
;; Uses the autonomous-pipeline primitive which computes ALL parameters
;; on GPU - including sin/cos expressions. Zero Python in the hot path!
(stream "autonomous_test"
:fps 30
:width 1920
:height 1080
:seed 42
;; Load primitives
(require-primitives "streaming_gpu")
(require-primitives "image")
;; Effects pipeline (what effects to apply)
(def effects
[{:op "rotate" :angle 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}])
;; Dynamic expressions (computed on GPU!)
;; These use CUDA syntax: sinf(), cosf(), t (time), frame_num
(def expressions
{:rotate_angle "t * 30.0f"
:ripple_phase "t * 2.0f"
:brightness_factor "0.8f + 0.4f * sinf(t * 2.0f)"})
;; Frame pipeline - creates image and applies autonomous pipeline
(frame
(let [;; Create base gradient (still needs Python for now)
base (image:make-image 1920 1080 [128 100 200])]
;; Apply autonomous pipeline - ALL EFFECTS + ALL MATH ON GPU!
(streaming_gpu:autonomous-pipeline base effects expressions frame-num 30.0))))