Skip to content

More CSE handling fixes - #731

Merged
Krzmbrzl merged 3 commits into
ValeevGroup:masterfrom
Krzmbrzl:ext-intface-cse-fixes
Oct 25, 2026
Merged

Krzmbrzl merged 3 commits into
ValeevGroup:masterfrom
Krzmbrzl:ext-intface-cse-fixes

Conversation

@Krzmbrzl

Copy link
Copy Markdown
Collaborator

No description provided.

perform_cse called batches.back() on an empty batch list when given no
expressions. This happens for the persistent part of a replay-optimized
input that has no persistent intermediates. Return "no change" instead,
so the input is aliased through unmodified.
Replacing a whole root expression by a CSE rebuilds the root tree, which
assigns it a new node ID. Dependencies recorded earlier (by the
dependencies step) then refer to IDs that no longer exist, and the
export step fails to find the producer. Restore the original ID on the
rewritten tree.
Template steps may carry a "when" property and are only part of the
expansion if its value is truthy. References marked with a trailing '?'
(in inputs, inherit_options_from and the grouping, merge_inputs and
relative_order options) are dropped if the step they name does not exist
after expansion, and steps left without inputs are dropped along with
them. This allows a single template to cover variants that differ in
additional steps (e.g. a replay-optimized part), instead of defining
those separately.
@Krzmbrzl
Krzmbrzl merged commit 9ef4c25 into ValeevGroup:master Oct 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant