Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Allow hashable axis names in shape checks - #142

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/shapecheck-hashable-axis-names
Open

Allow hashable axis names in shape checks#142
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/shapecheck-hashable-axis-names

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Penzai named arrays support arbitrary hashable axis names, including TmpPosAxisMarker for temporary positional-axis bindings. check_structure still asserted that named-axis keys captured through an unpacked **var(...) binding were strings, both when inlining a solved mapping and when re-associating the final match result.

Remove those string-only assertions while preserving the existing matching logic.

Regression coverage includes repeated unpacked named-axis variables with a TmpPosAxisMarker and the Linear reproduction from issue #132.

Closes #132

Penzai named arrays support arbitrary hashable axis names, including TmpPosAxisMarker for temporary positional-axis bindings. check_structure still asserted that named-axis keys captured through an unpacked **var(...) binding were strings, both when inlining a solved mapping and when re-associating the final match result.

Remove those string-only assertions while preserving the existing matching logic.

Regression coverage includes repeated unpacked named-axis variables with a TmpPosAxisMarker and the Linear reproduction from issue google-deepmind#132.

Closes google-deepmind#132
@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 15, 2026 16:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: pz.chk.check_structure erroneously requires all named array axes to be strings.

1 participant