M8.1: expressions keep working on long-lived threads — boa leaves values on its VM stack when an exception unwinds through call frames (every pending host request does), so after tens to hundreds of evaluations that read layers or effects every expression on the thread failed with "maximum stack size"; a run that hits the limit now gets a fresh context and is retried once (regression test: 6000 host-reading evaluations on one thread)

This commit is contained in:
bflatastic
2026-10-04 00:19:22 +07:00
parent 9fb375e4b0
commit 244cee4687
2 changed files with 37 additions and 3 deletions
+13
View File
@@ -1131,3 +1131,16 @@ fn project_and_time_globals() {
assert_close!(f.num("thisLayer.marker.key(1).protectedRegion ? 1 : 0", 0.0), 1.0);
assert_eq!(f.text("thisComp.layer(\"A\").marker.key(1).cuePointName + thisComp.layer(\"A\").marker.key(1).parameters.k", 0.0), "gov");
}
#[test]
fn thousands_of_host_reads_on_one_thread_keep_working() {
// Every pending host request unwinds through call frames, which leaks boa stack slots; the
// runtime replaces a context that fills up instead of failing every later expression.
let f = fx();
for i in 0..2000 {
let t = (i % 20) as f64 * 0.05;
assert_eq!(f.num("effect(\"Slider Control\")(\"Slider\")", t), 42.0, "evaluation {i}");
assert!(close(f.num("thisComp.layer(\"A\").transform.rotation.valueAtTime(1)", t), 90.0), "evaluation {i}");
assert_eq!(f.num("function a() { return effect(1)(1); } function b() { return a(); } b() + 1", t), 43.0, "evaluation {i}");
}
}