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
{{ message }}
Repository navigation
Commit 26d881b
Browse filesBrowse the repository at this point in the historyBrowse files
feat(array): replace extension cast hooks with a session cast registry
Cast rules on `ExtVTable` tied each cast to the dtype that defines it, so
nothing outside the extension type could add or change a cast, and casts
between built-in dtypes were not pluggable at all.
`CastSession` now owns an ordered `CastRules` registry. A `CastRule` binds
a `(source, target)` pair to a `CastFn` that runs over any array, and the
executor consults the rules before every built-in cast, both in
`Cast::execute` and in the fused `CastExecuteAdaptor` kernels. The most
recently registered rule wins, so a rule can add a cast Vortex does not
perform itself or replace a built-in one. `CastSession::default` installs
`TimestampCast`, the unit conversion that used to live on the timestamp
vtable; `CastSession::empty` installs none.
Because the rules live in the session, typing a cast cannot consult them:
`Cast::return_dtype` accepts every pair again and an unsupported cast fails
when it executes. The built-in matrix is kept as `is_builtin_cast` so
`Scalar::cast` and constant folding know which casts need no rule. The
optimizer, which has no session, folds constants and literals with the
built-in casts only; rule-only casts are left in place and reach the rule.
`Scalar::cast` runs built-in casts directly and falls back to the default
session's rules for the rest.
The `ext_wrap` scalar function is no longer needed and is removed.
Refs #8570
Signed-off-by: Claude <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_012GiQdVvEQUshNCyjNFQUQL
0 commit comments