[mojo] Bring NuMojo up to compat with stdlib version 0.26.2.0.dev2026031005#333
Closed
josiahls wants to merge 8 commits into
Closed
[mojo] Bring NuMojo up to compat with stdlib version 0.26.2.0.dev2026031005#333josiahls wants to merge 8 commits into
josiahls wants to merge 8 commits into
Conversation
27c39e0 to
9e6952d
Compare
a9c6b8d to
e2bde45
Compare
Collaborator
|
Hi @josiahls, the format of the PR seems not very proper. Would you checkout the other PRs and update it?
I noticed that you have changed 24 files, which is not a proper given that @shivasankarka's PRs #331 and #332 are still under review. It is nice to make it smaller PRs very time, or let us know in the Discord that you are planning to make changes across many files. Moveover, if you need to still work on the PR, it might be nice to make it a draft PR. Thank you for your understanding. |
Changed these to is_owned=False. Unclear if some of these should own (?)
Representable is being deprecated in favor of Writable.
Stringable is being deprecated in favor of Writable.
`_get_ptr` is now hidden behind a storage field, and they are provided `unsafe_get` should be attempting the same goal here.
Since we are unifying everything under Writable, if Writable calls String(self) we get a horrible recursive bug.
Changed to explicitly copy the DeviceStorage.
87b131a to
2b6078d
Compare
Contributor
Author
|
Closing, solved by chunked prs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mojo Compatibility Updates for NuMojo
This PR updates NuMojo for compatibility with recent Mojo nightlies and fixes several related issues.
Changes
Mojo Language & API Updates
@parameter if→comptime if: Replaces deprecated@parameter ifwithcomptime ifacross the codebase (formatting, dtype utilities, complex SIMD, etc.).VariadicListis_owned: FixesVariadicListusage whereis_owned=Falsewas needed for correct inference. AffectsNDArrayShape,NDArrayStrides,Item,IndexBuffer, and creation routines (empty,ones,zeros,full,rand)._get_ptr→unsafe_get: Replaces_get_ptrwithunsafe_getforVariant/VariantListaccess inNDArrayandComplexNDArrayslicing, since_get_ptris now hidden behind a storage field.Trait Updates
RepresentableandStringable→Writable: Replaces deprecatedRepresentableandStringabletraits withWritablewhere appropriate. AffectsDevice,ComplexDType,ComplexNDArray,ComplexSIMD,ImaginaryUnit,NumojoError,IndexBuffer,Item,NDArrayShape,NDArrayStrides,NewAxis,Matrix,DataContainer, and storage types.Bug Fixes
Recursive stringification in
NDArrayStrides: Fixes infinite recursion whenwrite_tousedString(self), which re-enteredwrite_to. Switched toself.__str__()in both__repr__andwrite_toto avoid recursion.AcceleratorDataContainercopy semantics: Fixes implicit copy ofDeviceStorageby explicitly copyinghost_storageanddevice_storagein the copy initializer.Dependency Update
>=26.2.0.dev2026031005,<27.