You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(resolver): cache specializations by (target file, binding tuple) (#63)
Two call sites that resolve to the same parametric sub-circuit with the
same width-binding tuple now share a single specialized ir.Module
instead of producing duplicate bodies. The cache lives for the duration
of one project resolution and is keyed by a flat string
"{target_file_id}@{w0},{w1},..." so std.StringHashMap can carry it
without a custom hasher.
The positional encoding is load-bearing: (4, 2) and (2, 4) for a
<W, S> callee are distinct keys even though their value multisets
match, so a multi-param caller cannot accidentally collapse two
semantically different specializations.
Four tests pin the behavior in place:
* Identical single-param bindings produce one shared module.
* Distinct single-param bindings produce two separate modules.
* Multi-param identical tuples share.
* Multi-param distinct tuples (same values, different positions) do
not share.
Engine bench golden matches; the cache only changes resolver-level
structural sharing, never the topology or simulation result.
0 commit comments