{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":634043200,"defaultBranch":"main","name":"mojo","ownerLogin":"modularml","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-04-28T22:17:24.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/39327063?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1717196575.0","currentOid":""},"activityList":{"items":[{"before":"4b7bfc419c2e3a7ecde66737b49d791dee4ca4e1","after":"c7932b37c24eadeafae5e231adabee3413c5d653","ref":"refs/heads/nightly","pushedAt":"2024-06-09T05:49:32.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[stdlib] Bump compiler version to 2024.6.905","shortMessageHtmlLink":"[stdlib] Bump compiler version to 2024.6.905"}},{"before":"8ea8166a75bd2e862ebc48a616c9951d5b9b2616","after":"4b7bfc419c2e3a7ecde66737b49d791dee4ca4e1","ref":"refs/heads/nightly","pushedAt":"2024-06-09T05:49:09.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[Docs] Fix some broken links.\nAlso fixed an outdated sample & fixed an omission in the Mojo changelog\nreported on Discord.\n\nMODULAR_ORIG_COMMIT_REV_ID: 9f85b1b52a973283e3b6110557c8581212779241","shortMessageHtmlLink":"[Docs] Fix some broken links."}},{"before":"ee208c70d58a36884583bc7884b0b19d09004df6","after":"8ea8166a75bd2e862ebc48a616c9951d5b9b2616","ref":"refs/heads/nightly","pushedAt":"2024-06-09T05:49:03.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[External] [docs] Fix parameter docs and add inferred-only description (#41638)\n\n[External] [docs] Fix parameter docs and add inferred-only description\n\n- Description and fix for new `//` inferred-only syntax\n- Fix for new explicit String conversions\n- Fix for partially bound types with `SIMD` changes\n\nCo-authored-by: Sören Brunk \nCloses modularml/mojo#2991\nMODULAR_ORIG_COMMIT_REV_ID: 5a3a50a992ec166c96101a4823dc88d221a2d505","shortMessageHtmlLink":"[External] [docs] Fix parameter docs and add inferred-only descriptio…"}},{"before":"652485ceb9332885a7537760dcc949bfe8b1e5a0","after":"ee208c70d58a36884583bc7884b0b19d09004df6","ref":"refs/heads/nightly","pushedAt":"2024-06-08T13:50:50.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"JoeLoser","name":"Joe Loser","path":"/JoeLoser","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/6462525?s=80&v=4"},"commit":{"message":"[tools] Bump actions/checkout to v4\n\nSigned-off-by: Scott Brenner ","shortMessageHtmlLink":"[tools] Bump actions/checkout to v4"}},{"before":"f4f384ea42a8a306fc612522bd6d0c9024ee8f73","after":"652485ceb9332885a7537760dcc949bfe8b1e5a0","ref":"refs/heads/nightly","pushedAt":"2024-06-08T05:54:14.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[stdlib] Bump compiler version to 2024.6.805","shortMessageHtmlLink":"[stdlib] Bump compiler version to 2024.6.805"}},{"before":"a016862f56e85d08a8ee5a7c34d570c4b961ba51","after":"f4f384ea42a8a306fc612522bd6d0c9024ee8f73","ref":"refs/heads/nightly","pushedAt":"2024-06-08T05:53:52.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[External] [docs] Fix typo in `changelog-released.md` (#41588)\n\n[External] [docs] Fix typo in `changelog-released.md`\n\nChange \"a major performance issues\" to \"major performance issues\"\n\nCo-authored-by: Brian M Johnson \nCloses modularml/mojo#2978\nMODULAR_ORIG_COMMIT_REV_ID: 0ee459018e9aafdd88a400c75afcc782ed45f543","shortMessageHtmlLink":"[External] [docs] Fix typo in changelog-released.md (#41588)"}},{"before":"03c44075441e106d48c817de3325487463571f61","after":"a016862f56e85d08a8ee5a7c34d570c4b961ba51","ref":"refs/heads/nightly","pushedAt":"2024-06-08T05:53:46.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[External] [docs] fix typo for 24.2 in changelog-released.md (#41592)\n\n[External] [docs] fix typo for 24.2 in changelog-released.md\n\nOpening a new PR on top of nightly instead of main, previous PR:\nhttps://github.com/modularml/mojo/pull/2980\n\nCloses modularml/mojo#2982\n\nMODULAR_ORIG_COMMIT_REV_ID: 74fc96f5af40fcc9c4790ed2ab350b651bb7c71c","shortMessageHtmlLink":"[External] [docs] fix typo for 24.2 in changelog-released.md (#41592)"}},{"before":"441d869e7951c8de7c9b85db0441af0e85b8e3d6","after":"03c44075441e106d48c817de3325487463571f61","ref":"refs/heads/nightly","pushedAt":"2024-06-08T05:53:42.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"Fixes for recent SIMD/DTypePointer changes. Adds test back in but only\nruns one benchmark in CI to avoid excess running time. Also clean up\nformatting, get padding back in line.\n\nMODULAR_ORIG_COMMIT_REV_ID: b73a8570731fbba503381d2e65fa84bfbe5f5467","shortMessageHtmlLink":"Fixes for recent SIMD/DTypePointer changes. Adds test back in but only"}},{"before":"ceaf063df575f3707029d48751b99886131c61ba","after":"441d869e7951c8de7c9b85db0441af0e85b8e3d6","ref":"refs/heads/nightly","pushedAt":"2024-06-07T22:52:26.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"JoeLoser","name":"Joe Loser","path":"/JoeLoser","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/6462525?s=80&v=4"},"commit":{"message":"[CI] Run all unit tests with assertions enabled and disabled, part 2\n\nSigned-off-by: gabrieldemarmiesse ","shortMessageHtmlLink":"[CI] Run all unit tests with assertions enabled and disabled, part 2"}},{"before":"7a6af28f367eacdecd024c600453d0e018783184","after":"ceaf063df575f3707029d48751b99886131c61ba","ref":"refs/heads/nightly","pushedAt":"2024-06-07T15:02:54.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[stdlib] Bump compiler version to 2024.6.714","shortMessageHtmlLink":"[stdlib] Bump compiler version to 2024.6.714"}},{"before":"054f4c14e6dd8d9e40452361827b7d897d51d178","after":"7a6af28f367eacdecd024c600453d0e018783184","ref":"refs/heads/nightly","pushedAt":"2024-06-07T15:02:28.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"Update the changelog release date.\n\nMODULAR_ORIG_COMMIT_REV_ID: cd8a0ab9efdafb704e864f4b29761787fe55407a","shortMessageHtmlLink":"Update the changelog release date."}},{"before":"82b0445a045a5ccc8387044e1b1bb7b64c9a16a4","after":"054f4c14e6dd8d9e40452361827b7d897d51d178","ref":"refs/heads/nightly","pushedAt":"2024-06-07T15:02:20.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[External] [docs] Fix docstring in `swap.mojo` (#41487)\n\n[External] [docs] Fix docstring in `swap.mojo`\n\nThe code says that `T` is constrained to Movable types, so the docstring\nshould also reflect this. It only uses the `^` operator in its body.\n\nCo-authored-by: Brian M Johnson \nCloses modularml/mojo#2969\nMODULAR_ORIG_COMMIT_REV_ID: d8c80105b34292fb8253781e92b3abfaae2db661","shortMessageHtmlLink":"[External] [docs] Fix docstring in swap.mojo (#41487)"}},{"before":"19a5981220b869d2a72fff6546e9104b519edf88","after":"82b0445a045a5ccc8387044e1b1bb7b64c9a16a4","ref":"refs/heads/nightly","pushedAt":"2024-06-07T15:02:14.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"/\n\nMODULAR_ORIG_COMMIT_REV_ID: dc3b4e9e698ec8252cbe61df24616f252018ce51","shortMessageHtmlLink":"/"}},{"before":"9365a00ecd63ae17ac4a705dfc0e64108a9c10c0","after":"8bd1dbdf26c70c634768bfd4c014537f6fdb0fb2","ref":"refs/heads/main","pushedAt":"2024-06-07T05:16:15.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"Update the changelog release date.\n\nMODULAR_ORIG_COMMIT_REV_ID: 6a27aed03a27a3bbf7a7745ccaf1b39728589097","shortMessageHtmlLink":"Update the changelog release date."}},{"before":"ba015500029d37d9d3ffa76161efe63cdf171a28","after":"9365a00ecd63ae17ac4a705dfc0e64108a9c10c0","ref":"refs/heads/main","pushedAt":"2024-06-07T05:16:12.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"New Mojo control flow page\n\nMODULAR_ORIG_COMMIT_REV_ID: 73247a4d84f315ebabeb84ec233d3d1e7fe2d983","shortMessageHtmlLink":"New Mojo control flow page"}},{"before":"56ef6c32414f2c143e4dd91dda08415519b6c2ec","after":"ba015500029d37d9d3ffa76161efe63cdf171a28","ref":"refs/heads/main","pushedAt":"2024-06-07T05:16:09.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"New documentation for the Mojo testing framework\n\nMODULAR_ORIG_COMMIT_REV_ID: a889cd8468637c72abfb76f6e30bde3741faf422","shortMessageHtmlLink":"New documentation for the Mojo testing framework"}},{"before":"52ba4e20b6a1dd6901b0cc30e960400a232d25ac","after":"56ef6c32414f2c143e4dd91dda08415519b6c2ec","ref":"refs/heads/main","pushedAt":"2024-06-07T05:16:05.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[Docs] Mojo 24.4 release changelog updates.\nIt's a changelog. For Mojo. For 24.4.\n\nMODULAR_ORIG_COMMIT_REV_ID: ba2fdcf736b8ea14e15fa761e12ebcda5e4b74d0","shortMessageHtmlLink":"[Docs] Mojo 24.4 release changelog updates."}},{"before":"aaa5a5479a984b7054329a44c67dc1e25aef84e5","after":"52ba4e20b6a1dd6901b0cc30e960400a232d25ac","ref":"refs/heads/main","pushedAt":"2024-06-07T05:16:02.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"Updating Docs to show how the new behavior of linking to libpython at\nruntime works. Also adds a script to find a suitable libpython on the\nuser's machine and prints a command to resolve. Removes workarounds and\nnotes for the previous behaviour.\n\nMODULAR_ORIG_COMMIT_REV_ID: b825d4d2834f4ae1244a936effd82b2de8f67578","shortMessageHtmlLink":"Updating Docs to show how the new behavior of linking to libpython at"}},{"before":"d44d0d26175a1369d46f056f9c14ff041cc0f526","after":"aaa5a5479a984b7054329a44c67dc1e25aef84e5","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:59.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[Docs] Document default arg convention, clean up decorators\n- Updates doc on the `def` function default argument convention. This\ntouches several docs.\n- Remove the reference page for `@unroll` and add `@parameter for` to\nthe `@parameter` page.\n- Update the reference page for `@always-inline(\"nodebug\")` to describe\nintended use.\n\nMODULAR_ORIG_COMMIT_REV_ID: 6805152f0150eaf4c551209b0a8c3e8b1c398455","shortMessageHtmlLink":"[Docs] Document default arg convention, clean up decorators"}},{"before":"7d3fc400fc25f0f02b59675805f1afb02e1f5968","after":"d44d0d26175a1369d46f056f9c14ff041cc0f526","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:55.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[cherrypick][docs] Cherrypick the changelogs for 24.4 (#41426)\n\nAll the changelog edits thus far.\n\nMODULAR_ORIG_COMMIT_REV_ID: 5a72140a3d45a12146e71121c6896c349d9dda52","shortMessageHtmlLink":"[cherrypick][docs] Cherrypick the changelogs for 24.4 (#41426)"}},{"before":"7b21ffc4a040dc3d65eeff7baa1eea49f499e3f7","after":"7d3fc400fc25f0f02b59675805f1afb02e1f5968","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:52.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"Internal commit\n\nMODULAR_ORIG_COMMIT_REV_ID: ea711f042818e6515f12b278d04d38fd68c8c6de","shortMessageHtmlLink":"Internal commit"}},{"before":"ad4083421a276d988781dbfd772d76ed560cc67d","after":"7b21ffc4a040dc3d65eeff7baa1eea49f499e3f7","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:49.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"Python can now initialize using the Python on top of PATH, without\nreferring to the python_lib path in modular.cfg set on install.\nThis will allow you to activate a virtual environment like conda,\ninstall packages, and access them from Mojo without setting\nenvironment variables.\n\nMODULAR_ORIG_COMMIT_REV_ID: e908fdc86a52e5cccb529bc2704c24f686f8c940","shortMessageHtmlLink":"Python can now initialize using the Python on top of PATH, without"}},{"before":"40361c3bd72129e5229fa505d905199940caea17","after":"ad4083421a276d988781dbfd772d76ed560cc67d","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:46.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[Docs] Add page on unsafe pointers.\n\nCovers UnsafePointer and DTypePointer.\n\nMODULAR_ORIG_COMMIT_REV_ID: f70d4f5f61c57bebc8bbe64cc56cf40603b128a0","shortMessageHtmlLink":"[Docs] Add page on unsafe pointers."}},{"before":"c4bca9385dad024fa2bee6831bff393f41cafd2f","after":"40361c3bd72129e5229fa505d905199940caea17","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:42.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[stdlib] Construct `String` from `PythonObject`.\n\nThis makes working with `PythonObject` more user friendly due to\nremoving `Stringable` from `String` constructor.\n\nMODULAR_ORIG_COMMIT_REV_ID: b75eed03c4f73adc7321e5770a24d795551ff4fb","shortMessageHtmlLink":"[stdlib] Construct String from PythonObject."}},{"before":"a8fc02ac941ec9a6ec35821f9ad446f06f5da224","after":"c4bca9385dad024fa2bee6831bff393f41cafd2f","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:39.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[mojo-stdlib] Add an \"empty()\" method to StringRef for convenience.\n\nMODULAR_ORIG_COMMIT_REV_ID: 0148ca35a8303a2037aaf158697388b8f7809c23","shortMessageHtmlLink":"[mojo-stdlib] Add an \"empty()\" method to StringRef for convenience."}},{"before":"6ecabb72acd5d6dd18a7924f98aec53ca8ef3373","after":"a8fc02ac941ec9a6ec35821f9ad446f06f5da224","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:36.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[External] [stdlib] Consolidate bin and hex internal implementation (#40690)\n\n[External] [stdlib] Consolidate bin and hex internal implementation\n\nFixes #2730\n\n- Utilize `_format_int` for for both `bin` and `hex`\n- Support `SIMD` and `Indexer` types for `hex`\n- Move implementations into `format_int` module\n\n---------\n\nCo-authored-by: bgreni <42788181+bgreni@users.noreply.github.com>\nCo-authored-by: Rob Parolin \nCloses modularml/mojo#2790\nMODULAR_ORIG_COMMIT_REV_ID: 0d5c716cb884468c8d3d49ac585115c39f131880","shortMessageHtmlLink":"[External] [stdlib] Consolidate bin and hex internal implementation (…"}},{"before":"0d9df971a269eb1d41e20fc6975400df124f38c9","after":"6ecabb72acd5d6dd18a7924f98aec53ca8ef3373","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:33.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[stdlib] Support dynamic module creation\n\nThis capability allows Mojo code to create inline modules with complex\nbehavior for Python interop. There is no need to rely on discovery of these\nsource files elsewhere on the system. While this still depends on CPython\nlibrary support, it eliminates at least one interaction with the host system.\n\nMODULAR_ORIG_COMMIT_REV_ID: 96c2100388bd6682589373569fca4385b6589e79","shortMessageHtmlLink":"[stdlib] Support dynamic module creation"}},{"before":"d12eb390308e4e1fae10d1c6fd678675ae386f85","after":"0d9df971a269eb1d41e20fc6975400df124f38c9","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:30.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[External] [stdlib] Fix UB in `reversed(Dict.values())` and `reversed(Dict.items())` (#40974)\n\n[External] [stdlib] Fix UB in `reversed(Dict.values())` and\n`reversed(Dict.items())`\n\nFinally found the culprit in the flakyness that plagued us since a few\nweek in the `test_reversed.mojo`.\n\n### The actual bug:\n\nWhen iterating over a list in reverse order, we should start at\n`len(my_list) - 1` not at `len(my_list)`.\nThat triggered an out of bounds access and thus was undefined behavior.\n\n### The effect on our CI\nAs you know, we have been seeing flakyness lately. It was documented a\nnumber of times and always related to `reverse`:\n* https://github.com/modularml/mojo/issues/2866#issuecomment-2135965412\n* https://github.com/modularml/mojo/issues/2369\n\n### Why was it passing sometimes?\nThis is because there were `Optional[...]` in the List. Thus if the flag\nof the `Optional` says that no element is present, it's just skipped\n(the dict doesn't have an entry at this index). So the list of the Dict\nwould often look like this: `[\"a\", \"b\", \"c\", \"d\"] None`\nbut the last `None` is actually memory that we don't have access to.\nSometimes it's then skipped in the iteration making the tests pass.\nSometimes it would cause segfaults because the test dict worked with\nstrings. Sometimes we would get `wrong variant type` since we don't know\nwhat happens to the memory between None check and access.\n\n### Why wasn't it found earlier?\n\nFirst of all, our Dict implementation is too complexe for what it does\nand thus is very good at hiding bugs.\n\nWell we did have `debug_assert` before getting the element of the\n`List`, but this `debug_assert` looked like this in the dict iterator:\n```mojo\n @parameter\n if forward:\n debug_assert(\n self.index < self.src[]._reserved, \"dict iter bounds\"\n )\n else:\n debug_assert(self.index >= 0, \"dict iter bounds\")\n```\nSo one bound was checked when reading in one direction and the other\nbound was checked in the other direction. A better `debug_assert` would\nhave been\n```mojo\ndebug_assert(0 <= self.index < self.src[]._reserved, \"dict iter bounds\")\n```\nWhen I worked on my PR https://github.com/modularml/mojo/pull/2718 the\ncondition `self.index < self.src[]._reserved` didn't trigger anything\nsince it was in the wrong branch, it was never executed.\n\nAlso before, `__get_ref` didn't have any bounds checks, even when\nassertions were enabled.\n\nA recent commit\nhttps://github.com/modularml/mojo/commit/8d0870e1b9e23fc9cf8b30882bb225a421f0fb9b\nadds `unsafe_get()` in List and make `__get_ref` use it. It also adds\n`debug_assert` to `unsafe_get()`, which means that now `__get_ref` has\nbounds checks if run with assertions enabled. This allowed me to catch\nthe out of bounds access when updating\nhttps://github.com/modularml/mojo/pull/2718 making the fail\ndeterministic and debuggable.\n\nSince we have this, the `debug_assert` in `dict.mojo` isn't necessary\nanymore.\n\n### Consequences on ongoing work:\n* This fix have been also added to\nhttps://github.com/modularml/mojo/pull/2718\n* The PR https://github.com/modularml/mojo/pull/2701 that we did with\n@jayzhan211 was actually correct. It was just using\n`reverse(Dict.items())` which was buggy at the time. After the fix is\nmerged, we can re-revert this PR.\n* https://github.com/modularml/mojo/pull/2794 is not necessary anymore\nsince the implementation by @jayzhan211 was correct.\n* The real cause of https://github.com/modularml/mojo/issues/2866 was\nfound, the issue has already been closed though.\n* https://github.com/modularml/mojo/issues/2369 can be closed for good.\n* https://github.com/modularml/mojo/pull/2832 can be closed for good.\n\n### Closing thoughts\n* We really need to run the unit tests with assertions enabled and add\nassertions whenever necessary\n* The dict implementation is a bit too complicated. For example,\n`self._reserved` is the length of the internal list. There is no need to\nstore the length of the list twice. Let's drop this variable and use\n`len(self._entries)` instead. I guess this is a relic of the time when\n`List` wasn't completely flushed out. If had done so, it would have been\novious that we can't do `my_list.__get_ref(len(my_list))`\n* Iterating manually over a list like this is bug-prone. The\nimplementation we have especially is, since\n```mojo\n @parameter\n if forward:\n self.index += 1\n else:\n self.index -= 1\n```\nis done twice in the code, it should only be done once. While there is\nno bug, code duplication and complexity hides bugs.\n* We should iterate over the list with a list iterator, not with a\ncustom-made iterator. This will remove a lot of code in the `dict.mojo`.\n\nCo-authored-by: Gabriel de Marmiesse \nCloses modularml/mojo#2896\nMODULAR_ORIG_COMMIT_REV_ID: b65009dc51f1e3027f91b5b61a5b7003cb022b87","shortMessageHtmlLink":"[External] [stdlib] Fix UB in reversed(Dict.values()) and `reversed…"}},{"before":"ee3f97dafaa01ae3dce70dc5b1b7e28fe7acd951","after":"d12eb390308e4e1fae10d1c6fd678675ae386f85","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:26.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[KGEN] Rename ArgConvention::ByRef to ArgConvention::InOut, NFC. (#41013)\n\nThis aligns the terminology with the modern keyword, we haven't\ncalled it 'byref' for a long time. We may eventually rename\nthis again but for now align these.\n\nMODULAR_ORIG_COMMIT_REV_ID: eccdfc1e3620f1483b2435391610a530d6318037","shortMessageHtmlLink":"[KGEN] Rename ArgConvention::ByRef to ArgConvention::InOut, NFC. (#41…"}},{"before":"6fd70182052cbba744ba410e238fc68fe86269e7","after":"ee3f97dafaa01ae3dce70dc5b1b7e28fe7acd951","ref":"refs/heads/main","pushedAt":"2024-06-07T05:15:23.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"modularbot","name":"modularbot","path":"/modularbot","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/116839051?s=80&v=4"},"commit":{"message":"[mojo-lang] Fix MOCO-757: Transfer ^ of borrowed arg leads to double free (#40892)\n\nMojo used to support transfering out of `let` declarations, which\nwere immutable but owned. We don't have to support this anymore,\nso there is no reason to support transfering from immutable refs.\n\nMODULAR_ORIG_COMMIT_REV_ID: ee2358b31fb300ab0843b53f54eea065b55e0fda","shortMessageHtmlLink":"[mojo-lang] Fix MOCO-757: Transfer ^ of borrowed arg leads to double …"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEYDlkOwA","startCursor":null,"endCursor":null}},"title":"Activity · modularml/mojo"}