fix: DAG signatures treat i2's NotSet default as no default - #82
Conversation
`DAG.src_name_params` now maps a func node param's `NotSet` default (i2's sentinel) to no default (`util.not_set_to_empty`) before merging and sorting. Without this, once i2mint/i2#88 re-lands, a DAG holding a FuncFactory node would silently reorder its positional params (NotSet params sorted after required ones: `dag(1, 2)` binding to the wrong roots), and merging with a same-named required param would raise. No-op for current signatures. Uses `i2.is_not_set` when available, else falls back on `i2.deco.NotSet`. Refs i2mint/i2#48 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Independent refute-review (sub-agent): no blocker. It is a strict no-op for DAGs without Known limitation, documented rather than fixed here: the fix is at the DAG-signature level. The FuncNodes keep their
|
What
Part of step 2 of the re-land plan in i2mint/i2#48:
meshedtreats i2'sNotSetsentinel, when it appears as a func node param's default, as "no default" while it builds a DAG's signature.meshed.util.not_set_to_empty(param):paramwith no default if its default isNotSet.DAG.src_name_paramsapplies it before merging same-named params and beforesort_params.Why
The independent review of i2mint/dagapp#4 tried meshed with a
NotSet-defaulted node (what a re-landed i2mint/i2#88FuncFactoryshows) and found:DAG([g, h]).sigbecame(z, a=NotSet)instead of(a, z), because params with a default are sorted after required ones.dag(1, 2)would then bind 1 toz.NotSetparam next to a same-named required param raisedValidationError: ... didn't have the same defaultinconservative_parameter_merge, so DAGs that build fine today would stop building.With this PR the DAG signature is exactly what it is today, and a
NotSetroot is required, as it is today.FuncNodesignatures themselves are untouched.No-op against the current i2: no current signature carries
NotSet.i2 compatibility (decision)
Uses
i2.is_not_set(i2 >= 0.1.74, i2mint/i2#91) when available, otherwise falls back oni2.deco.NotSet(present since 2023). The i2 requirement is unchanged.Tests
meshed/tests/test_not_set_defaults.py: the DAG signature and positional call match the plain DAG's, merging with a same-named required param works, aNotSetroot is required, and real defaults are kept. 3 of the 4 tests fail without the fix. There is also a doctest onnot_set_to_empty.Gate
pytest --doctest-modules meshed(py3.12): 175 passed, 1 failed, 1 skipped. Master: 170 passed and the same 1 failure, which is pre-existing:test_hybrid_dagneedsextrude/http2py, not installed here.front72 passed,lookbook132 passed,titbit24,extrude3,dagapp2,allude1.uf(39 failed / 66 passed),guided(1 failed / 1 passed),dotsci(2 collection errors),theremin(4 errors): same pre-existing failures on both.know,raglab-app,smart-cvcould not be tested here (not on this box, orpyaudioneeds system portaudio).🤖 Generated with Claude Code