Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/nightly' into make-list-size-p…
Browse files Browse the repository at this point in the history
…rivate
  • Loading branch information
martinvuyk committed Dec 4, 2024
2 parents d0c697e + 9702f27 commit 6e070d8
Show file tree
Hide file tree
Showing 263 changed files with 28,516 additions and 18,765 deletions.
63 changes: 60 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,64 @@ By making a contribution to this project, I certify that:
this project or the open source license(s) involved.
```

### Review time SLA
### Guidelines for Review Time

The team commits to reviewing submitted pull requests within a week of
submission.
1. Pull Request (PR) Review Timeline

- Initial Review:
- Maintainers will provide an initial review or feedback within 3 weeks of
the PR submission. At times, it may be significantly quicker, but it
depends on a variety of factors.
- Subsequent Reviews:
- Once a contributor addresses feedback, maintainers will review updates as
soon as they can, typically within 5 business days.

1. Issue Triage Timeline

- New Issues:
- Maintainers will label and acknowledge new issues within 10 days of the
issue submission.

1. Proposals

- Proposals take more time for the team to review, discuss, and make sure this
is in line with the overall strategy and vision for the standard library.
These will get discussed in the team's weekly design meetings internally and
feedback will be communicated back on the relevant proposal. As a team, we'll
ensure these get reviewed and discussed within 6 weeks of submission.

#### Exceptions

While we strive our best to adhere to these timelines, there may be occasional
delays due any of the following:

- High volume of contributions.
- Maintainers' availability (e.g. holidays, team events).
- Complex issues or PRs requiring extended discussion (these may get deferred to
the team's weekly design discussion meetings).

Note that just because a pull request has been reviewed does not necessarily
mean it will be able to merged internally immediately. This could be due to a
variety of reasons, such as:

- Mojo compiler bugs. These take time to find a minimal reproducer, file an
issue with the compiler team, and then get prioritized and fixed.
- Internal bugs that get exposed due to a changeset.
- Massive refactorings due to an external changeset. These also take time to
fix - remember, we have the largest Mojo codebase in the world internally.

If delays occur, we'll provide status updates in the relevant thread (pull
request or GitHub issue). Please bare with us as Mojo is an early language.
We look forward to working together with you in making Mojo better for everyone!

#### How You Can Help

To ensure quicker reviews:

- **Ensure your PR is small and focused.** See the [pull request size section](#about-pull-request-sizes)
for more info.
- Write a good commit message/PR summary outlining the motivation and describing
the changes. In the near future, we'll provide a pull request template to
clarify this further.
- Use descriptive titles and comments for clarity.
- Code-review other contributor pull requests and help each other.
4 changes: 2 additions & 2 deletions docs/changelog-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -6088,7 +6088,7 @@ busy this week.
- 📢 The `__clone__` method for copying a value is now named `__copy__` to
better follow Python term of art.

- 📢 The `__copy__` method now takes its self argument as a "borrowed" value,
- 📢 The `__copy__` method now takes its self argument as a "read" value,
instead of taking it by reference. This makes it easier to write, works for
`@register_passable` types, and exposes more optimization opportunities to
the early optimizer and dataflow analysis passes.
Expand Down Expand Up @@ -6153,7 +6153,7 @@ busy this week.
Note that `@register_passable` types must use the later style.

- 📢 The default argument convention is now the `borrowed` convention. A
"borrowed" argument is passed like a C++ `const&` so it doesn't need to
"read" argument is passed like a C++ `const&` so it doesn't need to
invoke the copy constructor (aka the `__clone__` method) when passing a value
to the function. There are two differences from C++ `const&`:

Expand Down
44 changes: 43 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ what we publish.
The consequence of this is that the old hack is no longer needed for these
cases!

- Various improvements to origin handling and syntax have landed, including
support for the ternary operator and allowing multiple arguments in a `ref`
specifier (which are implicitly unions). This enables expression of simple
algorithms cleanly:

```mojo
fn my_min[T: Comparable](ref a: T, ref b: T) -> ref [a, b] T:
return a if a < b else b
```

It is also nice that `my_min` automatically and implicitly propagates the
mutability of its arguments, so things like `my_min(str1, str2) += "foo"` is
valid.

- The `UnsafePointer` type now has an `origin` parameter that can be used when
the `UnsafePointer` is known to point to a value with a known origin. This
origin is propagated through the `ptr[]` indirection operation.
Expand Down Expand Up @@ -121,7 +135,7 @@ what we publish.
var l = List[Int](1, 2, 3, 4, 5)
shuffle(l)
```

- The `Dict.__getitem__` method now returns a reference instead of a copy of
the value (or raises). This improves the performance of common code that
uses `Dict` by allowing borrows from the `Dict` elements.
Expand Down Expand Up @@ -280,6 +294,12 @@ what we publish.

### 🦋 Changed

- The `inout` and `borrowed` argument conventions have been renamed to the `mut`
and `read` argument conventions (respectively). These verbs reflect
declaratively what the callee can do to the argument value passed into the
caller, without tying in the requirement for the programmer to know about
advanced features like references.

- The argument convention for `__init__` methods has been changed from `inout`
to `out`, reflecting that an `__init__` method initializes its `self` without
reading from it. This also enables spelling the type of an initializer
Expand Down Expand Up @@ -533,6 +553,19 @@ what we publish.

- `Arc` has been renamed to `ArcPointer`, for consistency with `OwnedPointer`.

- `UnsafePointer` parameters (other than the type) are now keyword-only.

- Inferred-only parameters may now be explicitly bound with keywords, enabling
some important patterns in the standard library:

```mojo
struct StringSlice[is_mutable: Bool, //, origin: Origin[is_mutable]]: ...
alias ImmStringSlice = StringSlice[is_mutable=False]
# This auto-parameterizes on the origin, but constrains it to being an
# immutable slice instead of a potentially mutable one.
fn take_imm_slice(a: ImmStringSlice): ...
```

### ❌ Removed

- The `UnsafePointer.bitcast` overload for `DType` has been removed. Wrap your
Expand Down Expand Up @@ -564,6 +597,15 @@ what we publish.
- [Issue #3710](https://github.com/modularml/mojo/issues/3710) - Mojo frees
memory while reference to it is still in use.

- [Issue #3805](https://github.com/modularml/mojo/issues/3805) - Crash When
Initializing !llvm.ptr.

- [Issue #3816](https://github.com/modularml/mojo/issues/3816) - Ternary
if-operator doesn't propagate origin information.

- [Issue #3815](https://github.com/modularml/mojo/issues/3815) -
[BUG] Mutability not preserved when taking the union of two origins.

- The VS Code extension now auto-updates its private copy of the MAX SDK.

- The variadic initializer for `SIMD` now works in parameter expressions.
Expand Down
Loading

0 comments on commit 6e070d8

Please sign in to comment.