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
It seems like an alias in a SIMD[DType.uint8, 32] will cause the interpreter to crash on my machine.
Steps to reproduce
fnis_ascii_punctuation(c: Int) -> Bool:
letc32=SIMD[DType.uint8, 32].splat(c)
# replace alias with let and this works correctlyaliasmask=SIMD[DType.uint8, 32](
ord("!"),
ord('"'),
ord("#"),
ord("$"),
ord("%"),
ord("&"),
ord("'"),
ord("("),
ord(")"),
ord("*"),
ord("+"),
ord(","),
ord("-"),
ord("."),
ord("/"),
ord(":"),
ord(";"),
ord("<"),
ord("="),
ord(">"),
ord("?"),
ord("@"),
ord("["),
ord("\\"),
ord("]"),
ord("^"),
ord("_"),
ord("`"),
ord("{"),
ord("|"),
ord("}"),
ord("~"),
)
return (c32 == mask).reduce_or()
fnmain():
print(is_ascii_punctuation(ord("a")))
outputs
/Users/ec2-user/actions-runner/_work/modular/modular/Kernels/mojo/builtin/_startup.mojo:76:1: error: no viable expansions found
/Users/ec2-user/actions-runner/_work/modular/modular/Kernels/mojo/builtin/_startup.mojo:76:1: note: call expansion failed - no concrete specializations
/Users/ec2-user/actions-runner/_work/modular/modular/Kernels/mojo/builtin/_startup.mojo:11:1: note: no viable expansions found
/Users/ec2-user/actions-runner/_work/modular/modular/Kernels/mojo/builtin/_startup.mojo:23:14: note: call expansion failed - no concrete specializations
/Users/$USER/dev/mojo/main.mojo:40:1: note: no viable expansions found
fn main():
^
/Users/$USER/dev/mojo/main.mojo:41:31: note: call expansion failed - no concrete specializations
print(is_ascii_punctuation(ord("a")))
^
/Users/$USER/dev/mojo/main.mojo:2:1: note: no viable expansions found
fn is_ascii_punctuation(c: Int) -> Bool:
^
/Users/$USER/dev/mojo/main.mojo:4:5: note: failed to evaluate 'apply'
alias mask = SIMD[DType.uint8, 32](
^
/Users/ec2-user/actions-runner/_work/modular/modular/Kernels/mojo/builtin/string.mojo:33:1: note: interpreter is out of memory!
mojo: error: failed to run the pass manager
System information
- What OS did you do install Mojo on ? MacOS 14
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 0.6.1 (876ded2e)
- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.3.1 (589ce200)
The text was updated successfully, but these errors were encountered:
I think the bug comes from calling ord on many different strings during compile. Splitting the alias into two SIMD of length 16 still reproduces the bug. The bug disappears by calling ord to get all the Ints outside of the alias declaration.
Bug description
It seems like an alias in a
SIMD[DType.uint8, 32]
will cause the interpreter to crash on my machine.Steps to reproduce
outputs
System information
The text was updated successfully, but these errors were encountered: