Fix stack overflow judging circled Takes on a Shot with a Board (#127) #129
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!129
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-127-take-stack-overflow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #127
Cause
Judging a circled Take reads its Shot's Board when a Board feeds its slots. The read went
board_images→shot_board→scene_boards→scene_setups, andscene_setupsfills the circled-stale counts by judging every circled Take again. The recursion never ended, soscene_takes(Dailies),scene_setupsandplan_edit_package(Export) all overflowed the stack once a Shot had both a circled Take and a Board.Fix
scene_setupsis split. The newsetups_without_stale_countsreads the Setups and the over-budget counts but leaves out the circled-stale counts.scene_setupscalls it, then fills the counts.scene_boardscallssetups_without_stale_counts, which breaks the cycle. Its doc comment says that anything staleness reaches must call it.scene_takes,reorder_setupsandmark_scene_seenneed only Shot ids and labels, so they call it too. They no longer judge every circled Take only to discard the result.Tests
a_circled_take_on_a_shot_with_a_board_is_judged_like_any_other(tests/staleness.rs) follows both repro orders in the issue: circle a Take and then save a Board, or render after the Board and then circle. It callsscene_takes,scene_setups(circled-stale count 1) andplan_edit_package. Before the fix it overflowed withSTATUS_STACK_OVERFLOW.cargo test --workspace --features studio-core/test-supportpasses.