sourceextensions/blender/demos/matmul-steps.xtl

1⍝│ Blender, 6: a matrix product a step at a time, arrays to video. C = A 2⍝│ x B for X_eTaL-gpu's matmul demo ([3 4] x [4 2], by its Accel 3⍝│ library): A on the left wall, B on the ceiling, C on the back wall. 4⍝│ Item by item, a row of A and a column of B light up, their four 5⍝│ products appear in the cube between them and fly into C's item, 6⍝│ which shows their sum; then all six at once, as a GPU works them out, 7⍝│ one work-item each. Every place, color and time is an array worked 8⍝│ out in X_eTaL (demos/Matmul.xtl); Video.xtl writes them into the script 9⍝│ Blender runs. Explained step by step in docs/literate/matmul.org. 10⍝│ Run: just demo blender matmul-steps (a few minutes: 466 frames) 11 12"bl:" u̲se< "Blender" 13"bp:" u̲se< "Bpy" 14"vd:" u̲se< "Video" 15"mm:" u̲se< "Matmul" 16 17⍝ five stills (the document's pictures), then every frame as the video 18script ← ((1920, 1080) ᵐᵐs̲teps 0) c̲at ((0.8 2.6 3.9 8.5 13.0, "matmul-steps") ᵛᵈs̲tills 0) c̲at (ᵛᵈr̲ender "matmul-steps.mp4") c̲at ᵛᵈreport 19_ ← "work/explain/run.py" ᵇˡw̲rite! ᵇᵖlauncher 20_ ← "work/explain/matmul-steps.py" ᵇˡw̲rite! script 21"rendering five stills and 15.5 seconds (466 frames) with Blender (EEVEE) ..." 22r ← "work/explain/run.py" ᵇˡr̲un! "work/explain/matmul-steps.py work/explain/out" 23"the run, and the error lines in Blender's log:" 24lines ← (n̲ot r = f̲irst "\n") p̲artition r 25d̲isclose 1 s̲elect lines 26d̲isclose 2 s̲elect lines 27"what Blender made:" 28ᵇˡr̲ead "work/explain/out/report.txt"