wren node: untrained targets left out of the prompt, a read beside a held-back set goes on whole

This commit is contained in:
Melvin Strobl
2026-10-25 12:09:37 +01:00
parent e9941b770d
commit 96ba512d40
3 changed files with 31 additions and 4 deletions
+7 -1
View File
@@ -445,11 +445,14 @@ class WrenNode(Node):
threshold = 1.0
if self.pack is not None:
wren = _wren()
# A target the model never learnt is left out: shown, it is a line
# unlike any in training, which shifts the answers on the others.
targets = [
wren.Target(
**t, value=_unset(t) if current.get(p) is None else current[p]
)
for p, t in self.targets.items()
if p not in self.untrained
]
# One BLAS thread answers in about half the time for a model
# this small. Scoped to the call, so numpy elsewhere in the
@@ -470,6 +473,9 @@ class WrenNode(Node):
and (call.value is not None or current.get(call.target) is not None)
for call in calls
)
# A reading answered beside a set that is not written would drop the
# set unsaid, so the whole command goes on instead.
held = not self.cfg.apply and any(call.value is not None for call in calls)
specs = {spec.port: spec for spec in [*self.input_ports, *self.output_ports]}
writes: dict[str, Any] = {}
actions: list[dict[str, Any]] = []
@@ -477,7 +483,7 @@ class WrenNode(Node):
answers: list[str] = []
for call in calls:
spec, unit = specs[call.target], self.targets[call.target]["unit"]
applied = sure if call.value is None else sure and self.cfg.apply
applied = sure and (not held if call.value is None else self.cfg.apply)
if call.value is None:
value = current.get(call.target)
if applied: