Domain: Engineering — Computer Science
Target concept: Build a min-heap

Video generation prompt: Display a horizontal array bar [5,4,3,2,1] on a white background to demonstrate the dynamic process of min-heap sort, with each step of heap adjustment marked in red. After sorting, the bars are arranged in ascending order, and the min-heap structure is displayed synchronously on the right.

Evaluation guide:
(i) Target concept: Visual demonstration of heap sort via synchronized array and heap structure evolution, using a min-heap to repeatedly extract the current minimum and build the sorted output in ascending order from the left.
Minimum mechanism: The right-side panel maintains a min-heap over the elements not yet placed into the sorted output; each round, its root (the current smallest remaining value) is removed by swapping it with the heap's last element, shrinking the heap by one, and sifting the new root down until the min-heap property holds; the removed value is then written into the next empty bar position counting from the left, so the bars fill up in ascending order as extractions proceed; red marks flag exactly the frames where a heap swap-and-sift restores the min-heap property.
(ii)Storyline: Frame 0–1: Static display of [5,4,3,2,1] bars + initial min-heap diagram already built over all five values. Frame 2–3: Red mark appears on the heap panel; its root (1) is swapped with the heap's last element and sifted down to restore the min-heap; the value 1 is written into the leftmost bar slot. Frame 4–5: Red mark appears again; the new root (2) is swapped and sifted in the shrinking heap; 2 is written into the second bar slot from the left. Frame 6–7: The same extraction pattern repeats for 3, then 4. Frame 8–9: Final bars read [1,2,3,4,5] left to right; the heap diagram is empty. All heap-side transitions and bar-fill events are side-by-side, fixed viewpoint, no camera motion; the heap diagram remains anchored to the right region; red marks never overlap idle frames or the completed final state.

Manual:
Experimental Procedure
1. Display the horizontal bar array [5,4,3,2,1] on a white background; build a min-heap over these five values and display it on the right.
2. Repeatedly extract the current minimum from the heap: swap the root with the heap's last element, shrink the heap by one, and sift the new root down until the min-heap property (parent ≤ children) is restored — mark this swap-and-sift step with a red marking.
3. After each extraction, write the removed value into the next empty bar slot counting from the left, so the bars progressively fill in ascending order.
4. Continue until the heap is empty and all five bar positions are filled.
Observation of Experimental Phenomena
- Five bars initially appear in descending height order [5,4,3,2,1].
- Red markings appear transiently only during each heap extraction (swap-and-sift) step.
- Bars fill in from left to right with increasing values as each minimum is extracted.
- The heap diagram on the right shrinks by one node with every extraction and always shows parent ≤ children.
- The final bar array reads [1,2,3,4,5] left to right; the heap diagram is empty.
Summary of Experimental Principles
- Min-heap property: every parent value is ≤ its children.
- Repeatedly extracting the root of a min-heap (swap the root with the heap's last element, shrink, sift-down) always yields the remaining elements in ascending order one at a time, so writing each extracted value into the next left-to-right bar slot builds a fully ascending sorted array.
- Array representation maps heap nodes to indices: for index i, the left child is at 2i+1 and the right child at 2i+2.

Prompt Grounding rubric:
level_1: No horizontal bar array appears; or the array does not contain exactly five bars; or the background is not white; or no red marking ever appears; or no heap-tree panel appears on the right at any point.
level_2: Five bars appear on a white background, but the initial left-to-right order is not [5,4,3,2,1]; or red marks appear without ever lining up with a change in the heap-tree panel; or the heap-tree panel shows the wrong topology (e.g., a node with three children, or a child linked to two different parents); or the bar array and the heap-tree panel are not shown side by side in the same scene.
level_3: Bars start in the order [5,4,3,2,1] on a white background; the heap-tree panel is visible on the right, side by side with the bars, from the start; a red mark appears during at least one heap update step; by the end of the clip the bars read [1,2,3,4,5] left to right.
level_4: Everything required at the 3-point level holds, and additionally a red mark appears during every single heap update step (never zero, never skipped); the heap-tree panel redraws in sync with every one of those marked steps, and no bar position is ever left blank or duplicated once the corresponding value has been written to it.
level_5: Everything required at the 4-point level holds, and additionally every bar keeps the same width and a height proportional to its value throughout; a red mark never appears on an idle frame or on the completed final layout; every heap-tree node's printed value always matches the bar value it corresponds to; the left-to-right correspondence between bar slots and heap-tree nodes stays visually unambiguous across the whole clip.

Scientific and Causal Correctness rubric:
level_1: The bars end up in descending order, or the on-screen heap at some visible frame violates the min-heap rule (a parent shown greater than one of its children), or a red mark appears on a frame where nothing about the heap actually changed.
level_2: The bars trend toward ascending order, but at least one heap update step is invalid: e.g., a value is removed from the root without the remaining heap being re-sifted into a valid min-heap, or a red mark appears on a step where the heap-tree shown does not actually satisfy parent ≤ children afterward.
level_3: Every red-marked step shows a legitimate min-heap extraction: the smallest remaining value sits at the root just before the mark, and the heap-tree shown right after the mark is again a valid min-heap; the value pulled out at each step is written into the next unfilled bar slot counting from the left; the sequence of values written into the bars, read left to right, is strictly increasing.
level_4: Everything required at the 3-point level holds, and additionally each extraction visibly follows the full min-heap removal logic: the root is swapped with the heap's current last node, the heap shrinks by one, and the new root is sifted down exactly as far as needed to restore parent ≤ children; no step skips the sift or leaves an invalid interim heap on screen even briefly.
level_5: Everything required at the 4-point level holds, and additionally no red-marked step ever shows a heap-tree with a parent greater than its child even transiently mid-adjustment; the value written into each bar slot always matches the value that was just extracted from the heap root in that same step; the order in which bar slots fill (left to right) exactly matches the order in which minima are extracted from the heap, with no step out of place.

Spatiotemporal Consistency rubric:
level_1: Bars jump to new positions with no motion between frames; the heap-tree panel appears, vanishes, or reappears abruptly; bars flicker, disappear, or show duplicate copies mid-sequence; the white background changes color or texture; the camera viewpoint shifts or rotates.
level_2: Bars change position or height in sudden jump-cuts rather than a visible motion; the heap-tree redraws with visible strobing or its nodes momentarily overlap each other; red marks blink on and off with no clear connection to a specific frame; the heap-tree panel drifts left or right relative to the bars during the clip.
level_3: Bars move smoothly between positions with no teleporting; the heap-tree panel stays continuously visible and anchored to the right side throughout; red marks appear and disappear cleanly with no lingering fade trail; the bars and the heap-tree panel keep a stable side-by-side arrangement across the whole clip; no bar or heap node visibly warps or distorts.
level_4: Everything required at the 3-point level holds, and additionally each bar's motion path when it is written into its final slot is a direct, consistent path rather than a curved or wandering one; the connecting lines (edges) of the heap-tree stay unbroken and continuously drawn as nodes update; red marks turn on and off at a consistent timing relative to when the corresponding bar or heap-tree change starts and ends.
level_5: Everything required at the 4-point level holds, and additionally the whole clip plays with no visible stutters or dropped frames; each bar slot's final position always lines up with the same column as its corresponding heap extraction event, and this alignment never drifts across the clip; lighting stays even and the heap-tree's lines and bar edges stay crisp and stable throughout, with no flicker or visible discontinuity along any edge.