Skip to content

core/ops/array: implement set_symbols on DynSlice and Topk#2344

Merged
kali merged 1 commit into
mainfrom
feat/set-symbols-dyn-slice-topk
Jun 4, 2026
Merged

core/ops/array: implement set_symbols on DynSlice and Topk#2344
kali merged 1 commit into
mainfrom
feat/set-symbols-dyn-slice-topk

Conversation

@JulienBalianSonos
Copy link
Copy Markdown
Collaborator

Summary

DynSlice and Topk each carry a TDim field (len and fallback_k respectively) that needs to ride the chunk-symbol substitution that pulse mode performs (STREAM → S · pulse). Without a set_symbols impl on these ops, the default trait method clones the op verbatim and the TDim field stays referring to the old symbol, leaving the post-substitution model inconsistent.

This commit hand-rolls set_symbols on both ops, following the existing Slice / Tile pattern: build a fresh op with substitute_all(subs)? applied to the TDim fields, then wire_node it into the target.

Scope

Standalone, no behavior change for models that don't go through pulse-mode substitution. Extracted from the broader Scan body fact management work (#2337) so it can land independently.

Test

All existing tract-core (245) tests pass.

@kali kali merged commit 249812d into main Jun 4, 2026
56 checks passed
@kali kali deleted the feat/set-symbols-dyn-slice-topk branch June 4, 2026 14:28
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.

2 participants