fix(scripting): #1092 a returned concrete collection (List<T>, HashSet<T>, ...) is materialised into the same typed array in both runners
ScriptResultMaterializer returned a non-array ICollection as-is (capped by Count only), so in process the host got the List<double> itself while the out-of-process worker, whose wire carries arrays but no collection type, answered "unsupported type" for the same script. Every non-array, non-string sequence now goes through the one materialisation: a collection is held to Scripting:MaxResultElements by its Count before it is copied, then becomes T[] of its IEnumerable<T> element type; an open element type (List<object>, List<List<int>>) or none (ArrayList) is refused like the lazy equivalent. Both runners give double[] for a List<double>. ParityTests.Result_materialisation_and_the_element_cap_agree gains list / at-cap / over-cap / hash set / queue / List<object> / nested-list rows plus a positive control (6 rows + the control fail against the old materializer). ContainmentTests' "unsupported result type" example moves from List<int> (now int[]) to KeyValuePair<int,int>. Behaviour change: a script returning List<object> (or another open element type) now fails the run (Bad + script log) in process too, as the lazy form already did.
This commit is contained in:
@@ -264,7 +264,11 @@ scripted-alarm predicates) runs scripts through the shared `ScriptRunGuard`:
|
||||
caps a returned array / collection) with a failed run (Bad, script log) — not a timeout strike. A lazy
|
||||
sequence whose element type is `object`, an interface or another collection is refused: the host
|
||||
copies and compares a returned array recursively, so an open-slot array can nest or contain itself.
|
||||
Arrays, lists, strings and scalars are unchanged. **Still in-process-only limits** (the boundary is
|
||||
A concrete collection (`List<double>`, `HashSet<string>`, `Queue<long>`, …) gets the same treatment
|
||||
since #1092 — it is held to the cap by its `Count`, then copied into the same typed array
|
||||
(`double[]`, …), and refused for an open element type (`List<object>`) — because the out-of-process
|
||||
worker's wire carries arrays but no collection type (it used to answer `unsupported type` while the
|
||||
in-process runner returned the list itself). Arrays, strings and scalars are unchanged. **Still in-process-only limits** (the boundary is
|
||||
`Scripting:Runner=OutOfProcess`): memory exhaustion inside a run (the sample is after the fact), a
|
||||
non-terminating loop (an orphan thread, then quarantine) and the same two inside an enumerated
|
||||
sequence. See `docs/VirtualTags.md` §"Known resource limits (accepted trade-offs)". The out-of-process
|
||||
|
||||
Reference in New Issue
Block a user