)]}'
{"id":"depot~7097","triplet_id":"depot~canon~I34bb5821628eb97e426bdb880b02e2097402adb7","project":"depot","branch":"canon","attention_set":{},"removed_from_attention_set":{"1000034":{"account":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"last_update":"2022-10-27 21:36:01.000000000","reason":"Change was submitted"},"1000066":{"account":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"last_update":"2022-10-27 21:33:22.000000000","reason":"\u003cGERRIT_ACCOUNT_1000066\u003e replied on the change","reason_account":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"}},"1000001":{"account":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"last_update":"2022-10-27 12:42:53.000000000","reason":"\u003cGERRIT_ACCOUNT_1000001\u003e replied on the change","reason_account":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"}}},"hashtags":[],"change_id":"I34bb5821628eb97e426bdb880b02e2097402adb7","subject":"feat(tvix/eval): builtins.import without RefCell","status":"MERGED","created":"2022-10-26 12:32:23.000000000","updated":"2022-10-27 21:36:01.000000000","submitted":"2022-10-27 21:36:01.000000000","submitter":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"total_comment_count":4,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"7097","meta_rev_id":"fa608bc48c946d873ecbcc79b5a72114e1be1e44","_number":7097,"virtual_id_number":7097,"owner":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"actions":{},"labels":{"Code-Review":{"approved":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"all":[{"value":0,"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},{"tag":"autogenerated:gerrit:merged","value":2,"date":"2022-10-27 21:36:01.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0},"Verified":{"approved":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2022-10-27 21:36:01.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]}],"values":{"-1":"Fails"," 0":"No score","+1":"Verified"},"description":"","default_value":0},"Autosubmit":{"approved":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"all":[{"tag":"autogenerated:gerrit:merged","value":1,"date":"2022-10-27 21:36:01.000000000","_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]}],"values":{" 0":"Submit manually","+1":"Submit automatically"},"description":"","default_value":0,"optional":true},"All-Comments-Resolved":{"approved":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"all":[{"value":0,"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]}]},"Conformant-Commit-Message":{"approved":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"all":[{"value":0,"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]}]}},"removable_reviewers":[{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"}],"reviewers":{"REVIEWER":[{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2022-10-26 12:32:24.000000000","updated_by":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"state":"CC"},{"updated":"2022-10-26 12:33:30.000000000","updated_by":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"reviewer":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"state":"REVIEWER"},{"updated":"2022-10-26 12:33:30.000000000","updated_by":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"reviewer":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"state":"REVIEWER"},{"updated":"2022-10-26 12:34:33.000000000","updated_by":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"state":"REVIEWER"}],"messages":[{"id":"bddbec9c35ea911d7964f19f2d42c7c2b9ac6c98","tag":"autogenerated:gerrit:newWipPatchSet","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 12:32:23.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"d63e5a5a9a0b8c80a11b651b5c93eb212e88d2e0","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 12:32:24.000000000","message":"Patch Set 1:\n\nStarted build for patchset #1 on: https://buildkite.com/tvl/depot/builds/17899","accounts_in_message":[],"_revision_number":1},{"id":"55a1791e6bd6c71c967dca30f764c5f8a6916a19","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 12:33:30.000000000","message":"Patch Set 1: Autosubmit+1\n\nThis change is ready for review.","accounts_in_message":[],"_revision_number":1},{"id":"a673bc74615d1ad4965aa832083e8636744a0c49","tag":"autogenerated:gerrit:code-owners:addReviewer","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 12:33:30.000000000","message":"\u003cGERRIT_ACCOUNT_1000034\u003e, who was added as reviewer owns the following files:\n* tvix/eval/src/builtins/impure.rs\n* tvix/eval/src/builtins/mod.rs\n* tvix/eval/src/compiler/bindings.rs\n* tvix/eval/src/compiler/mod.rs\n* tvix/eval/src/eval.rs\n\n\u003cGERRIT_ACCOUNT_1000001\u003e, who was added as reviewer owns the following files:\n* tvix/eval/src/builtins/impure.rs\n* tvix/eval/src/builtins/mod.rs\n* tvix/eval/src/compiler/bindings.rs\n* tvix/eval/src/compiler/mod.rs\n* tvix/eval/src/eval.rs\n","accounts_in_message":[{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"}],"_revision_number":1},{"id":"23e41d1652cafc0e24e77176bb8ab3678d6a157d","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 12:34:33.000000000","message":"Patch Set 1: Verified-1\n\nBuild of patchset 1 failed: https://buildkite.com/tvl/depot/builds/17899","accounts_in_message":[],"_revision_number":1},{"id":"9c59cb3e3b10189b548084bca1ed2e9f3664b065","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 12:40:54.000000000","message":"Uploaded patch set 2.","accounts_in_message":[],"_revision_number":2},{"id":"12405eaddae805097ed45f92d49eeb486ce29d9b","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 12:40:55.000000000","message":"Patch Set 2:\n\nStarted build for patchset #2 on: https://buildkite.com/tvl/depot/builds/17902","accounts_in_message":[],"_revision_number":2},{"id":"6eb6aba72514b2fd05858d39a186dd5a39d7fda9","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 12:43:01.000000000","message":"Patch Set 2: Verified+1\n\nBuild of patchset 2 passed: https://buildkite.com/tvl/depot/builds/17902","accounts_in_message":[],"_revision_number":2},{"id":"31662699aae92443ae75dcef4e3f6ed71c61ceb4","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 12:43:11.000000000","message":"Uploaded patch set 3: Commit message was updated.","accounts_in_message":[],"_revision_number":3},{"id":"3f20e263ec58c1915667c2e650a78a7f2d5ab6f4","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 12:58:29.000000000","message":"Uploaded patch set 4.","accounts_in_message":[],"_revision_number":4},{"id":"6fd85b5f921b0a122cffb81b735a8e2634abc1f3","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 12:58:30.000000000","message":"Patch Set 4:\n\nStarted build for patchset #4 on: https://buildkite.com/tvl/depot/builds/17903","accounts_in_message":[],"_revision_number":4},{"id":"ddabbff96522c5d9432fad4ac0499fecdad24d44","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 12:59:55.000000000","message":"Uploaded patch set 5.","accounts_in_message":[],"_revision_number":5},{"id":"c5d702b00740606d8a7f4b987e14a4a394bdb3ca","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 12:59:56.000000000","message":"Patch Set 5:\n\nStarted build for patchset #5 on: https://buildkite.com/tvl/depot/builds/17904","accounts_in_message":[],"_revision_number":5},{"id":"c49c1453216431b9e5d2d8fc993af92b7b876810","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 13:00:37.000000000","message":"Patch Set 4: Verified+1\n\nBuild of patchset 4 passed: https://buildkite.com/tvl/depot/builds/17903","accounts_in_message":[],"_revision_number":4},{"id":"acdcbb6676683f7eddd452b8ce3e0ad05c6ffa78","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 13:02:01.000000000","message":"Patch Set 5: Verified+1\n\nBuild of patchset 5 passed: https://buildkite.com/tvl/depot/builds/17904","accounts_in_message":[],"_revision_number":5},{"id":"815ce46fad45328a8fe434a131fa56d6d37d249c","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 19:54:08.000000000","message":"Uploaded patch set 6.","accounts_in_message":[],"_revision_number":6},{"id":"d7a2f2e9e6a31a145072f1beaae5eeecce4b20f0","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 19:54:08.000000000","message":"Patch Set 6:\n\nStarted build for patchset #6 on: https://buildkite.com/tvl/depot/builds/17919","accounts_in_message":[],"_revision_number":6},{"id":"49c63ea6866a854ee6d0d5ce915f90dcee5f7aa6","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-26 19:54:39.000000000","message":"Patch Set 6: Autosubmit+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":6},{"id":"ac45e48e54172040a57d9d9ab7d17f93b9bbb3a4","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2022-10-26 19:56:29.000000000","message":"Patch Set 6: Verified+1\n\nBuild of patchset 6 passed: https://buildkite.com/tvl/depot/builds/17919","accounts_in_message":[],"_revision_number":6},{"id":"07d7ead8a699d9531476b0953165a05861d17b56","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2022-10-27 12:42:53.000000000","message":"Patch Set 6: Code-Review+2\n\n(2 comments)\n\nBy voting Code-Review+2 the following files are now code-owner approved by \u003cGERRIT_ACCOUNT_1000001\u003e:\n* corp/tvixbolt/src/main.rs\n* tvix/eval/src/builtins/impure.rs\n* tvix/eval/src/builtins/mod.rs\n* tvix/eval/src/compiler/mod.rs\n* tvix/eval/src/eval.rs\n* tvix/eval/src/lib.rs\n","accounts_in_message":[{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"}],"_revision_number":6},{"id":"e0f1407f73547b3edcbb6dcfe56eba917493e708","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-27 21:13:44.000000000","message":"Uploaded patch set 7: Commit message was updated.","accounts_in_message":[],"_revision_number":7},{"id":"4f15e9bf3f80eecbadfb33ef9b1b676bc0c35ac9","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-27 21:33:22.000000000","message":"Patch Set 6: Autosubmit+1\n\n(1 comment)","accounts_in_message":[],"_revision_number":6},{"id":"fa608bc48c946d873ecbcc79b5a72114e1be1e44","tag":"autogenerated:gerrit:merged","author":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"date":"2022-10-27 21:36:01.000000000","message":"Change has been successfully rebased and submitted as 8616f13a71e3fc186e01bdb4ada60503f233be99\n\n6 is the latest approved patch-set.\nNo files were changed between the latest approved patch-set and the submitted one.\n","accounts_in_message":[],"_revision_number":8}],"current_revision_number":8,"current_revision":"8616f13a71e3fc186e01bdb4ada60503f233be99","revisions":{"e2e430c0f74b04653c9251396dffc0296a1a81bc":{"kind":"REWORK","_number":1,"created":"2022-10-26 12:32:23.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/1","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/1","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/1"}}},"commit":{"parents":[{"commit":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","subject":"feat(tvix/eval): administer antidote for poison","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:24:44.000000000","tz":-420},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 implemented builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003de2e430c0f74b04653c9251396dffc0296a1a81bc"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003de2e430c0f74b04653c9251396dffc0296a1a81bc"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","is_merged_in_target_branch":false,"change_id":"Ib3309a47a7b31fa5bf10466bade0d876b76ae462","change_number":7089,"patch_set_number":1,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"9f882dbeac57be1a25bc50c5816703b8ec166acd":{"kind":"REWORK","_number":2,"created":"2022-10-26 12:40:54.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/2","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/2","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/2"}}},"commit":{"parents":[{"commit":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","subject":"feat(tvix/eval): administer antidote for poison","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:35:19.000000000","tz":-420},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 implemented builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d9f882dbeac57be1a25bc50c5816703b8ec166acd"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d9f882dbeac57be1a25bc50c5816703b8ec166acd"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","is_merged_in_target_branch":false,"change_id":"Ib3309a47a7b31fa5bf10466bade0d876b76ae462","change_number":7089,"patch_set_number":1,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"5823cf96ceb4094f5c868267a089a021a1d7ef12":{"kind":"NO_CODE_CHANGE","_number":3,"created":"2022-10-26 12:43:11.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/3","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/3","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/3"}}},"commit":{"parents":[{"commit":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","subject":"feat(tvix/eval): administer antidote for poison","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:36:31.000000000","tz":-420},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 added support for builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d5823cf96ceb4094f5c868267a089a021a1d7ef12"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d5823cf96ceb4094f5c868267a089a021a1d7ef12"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","is_merged_in_target_branch":false,"change_id":"Ib3309a47a7b31fa5bf10466bade0d876b76ae462","change_number":7089,"patch_set_number":1,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"c06d959e6d8e37214052e52e9cb05181b04c7c53":{"kind":"REWORK","_number":4,"created":"2022-10-26 12:58:29.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/4","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/4","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/4 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/4 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/4 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/4"}}},"commit":{"parents":[{"commit":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","subject":"feat(tvix/eval): administer antidote for poison","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:52:53.000000000","tz":-420},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 added support for builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dc06d959e6d8e37214052e52e9cb05181b04c7c53"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dc06d959e6d8e37214052e52e9cb05181b04c7c53"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","is_merged_in_target_branch":false,"change_id":"Ib3309a47a7b31fa5bf10466bade0d876b76ae462","change_number":7089,"patch_set_number":1,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"d94859919b3755e08f5e165b4353d0e6937085ec":{"kind":"REWORK","_number":5,"created":"2022-10-26 12:59:55.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/5","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/5","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/5 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/5 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/5 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/5"}}},"commit":{"parents":[{"commit":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","subject":"feat(tvix/eval): administer antidote for poison","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:54:17.000000000","tz":-420},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 added support for builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dd94859919b3755e08f5e165b4353d0e6937085ec"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dd94859919b3755e08f5e165b4353d0e6937085ec"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"4d6479e506dc1ccd17cda19c7f03ce12aa46e5c4","is_merged_in_target_branch":false,"change_id":"Ib3309a47a7b31fa5bf10466bade0d876b76ae462","change_number":7089,"patch_set_number":1,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"0425cb6d87c2236c5599192cc08c64325640e8be":{"kind":"REWORK","_number":6,"created":"2022-10-26 19:54:08.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/6","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/6","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/6 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/6 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/6 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/6"}}},"commit":{"parents":[{"commit":"43844188773eff9dca3c0278ad66c8dc2ecfcffe","subject":"docs(tvix/eval): StackIdx, LocalIdx UpvalueIdx","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d43844188773eff9dca3c0278ad66c8dc2ecfcffe"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 19:48:31.000000000","tz":-420},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 added support for builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d0425cb6d87c2236c5599192cc08c64325640e8be"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d0425cb6d87c2236c5599192cc08c64325640e8be"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"43844188773eff9dca3c0278ad66c8dc2ecfcffe","is_merged_in_target_branch":true,"change_id":"Ib932b1b0679734c15001e8c5c95a08293fa016b4","change_number":7017,"patch_set_number":5,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"bf9bf3d2962cdd046692f22192029e052e74ad5e":{"kind":"NO_CODE_CHANGE","_number":7,"created":"2022-10-27 21:13:44.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/7","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/7","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/7 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/7 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/7 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/7"}}},"commit":{"parents":[{"commit":"43844188773eff9dca3c0278ad66c8dc2ecfcffe","subject":"docs(tvix/eval): StackIdx, LocalIdx UpvalueIdx","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d43844188773eff9dca3c0278ad66c8dc2ecfcffe"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-27 21:07:35.000000000","tz":-420},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 added support for builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.  At VM runtime (once opcodes\nstart executing) everything is the same as before this CL, except\nthat the Rc\u003cRefCell\u003c\u003e\u003e introduced by CL/6867 is turned into an\nrc::Weak\u003c\u003e.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dbf9bf3d2962cdd046692f22192029e052e74ad5e"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dbf9bf3d2962cdd046692f22192029e052e74ad5e"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"43844188773eff9dca3c0278ad66c8dc2ecfcffe","is_merged_in_target_branch":true,"change_id":"Ib932b1b0679734c15001e8c5c95a08293fa016b4","change_number":7017,"patch_set_number":5,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"8616f13a71e3fc186e01bdb4ada60503f233be99":{"kind":"REWORK","_number":8,"created":"2022-10-27 21:36:01.000000000","uploader":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"ref":"refs/changes/97/7097/8","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/97/7097/8","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/8 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/8 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/97/7097/8 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/97/7097/8"}}},"commit":{"parents":[{"commit":"79ef6ee283182873090534d8d559dcde7ed3ebb4","subject":"chore(ops/pipelines/depot/protoCheck): include name in label","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d79ef6ee283182873090534d8d559dcde7ed3ebb4"}]}],"author":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-26 12:16:04.000000000","tz":-420},"committer":{"name":"Adam Joseph","email":"adam@westernsemico.com","date":"2022-10-27 21:36:01.000000000","tz":0},"subject":"feat(tvix/eval): builtins.import without RefCell","message":"feat(tvix/eval): builtins.import without RefCell\n\nCL/6867 added support for builtins.import, which required a cyclic\nreference import-\u003eglobals-\u003ebuiltins-\u003eimport.  This was implemented\nusing a RefCell, which makes it possible to mutate the builtins\nduring evaluation.  The commit message for CL/6867 expressed a\ndesire to eliminate this possibility:\n\n  This opens up a potentially dangerous footgun in which we could\n  mutate the builtins at runtime leading to different compiler\n  invocations seeing different builtins, so it\u0027d be nice to have\n  some kind of \"finalised\" status for them or some such, but I\u0027m not\n  sure how to represent that atm.\n\nThis CL replaces the RefCell with Rc::new_cyclic(), making the\nglobals/builtins immutable once again.  At VM runtime (once opcodes\nstart executing) everything is the same as before this CL, except\nthat the Rc\u003cRefCell\u003c\u003e\u003e introduced by CL/6867 is turned into an\nrc::Weak\u003c\u003e.\n\nThe function passed to Rc::new_cyclic works very similarly to\noverlays in nixpkgs: a function takes its own result as an argument.\nHowever instead of laziness \"breaking the cycle\", Rust\u0027s\nRc::new_cyclic() instead uses an rc::Weak.  This is done to prevent\nmemory leaks rather than divergence.\n\nThis CL also resolves the following TODO from CL/6867:\n\n  // TODO: encapsulate this import weirdness in builtins\n\nThe main disadvantage of this CL is the fact that the VM now must\nensure that it holds a strong reference to the globals while a\nprogram is executing; failure to do so will cause a panic when the\nweak reference in the builtins is upgrade()d.\n\nIn theory it should be possible to create strong reference cycles\nthe same way Rc::new_cyclic() creates weak cycles, but these cycles\nwould cause a permanent memory leak -- without either an rc::Weak or\nRefCell there is no way to break the cycle.  At some point we will\nhave to implement some form of cycle collection; whatever library we\nchoose for that purpose is likely to provide an \"immutable strong\nreference cycle\" primitive similar to Rc::new_cyclic(), and we\nshould be able to simply drop it in.\n\nSigned-off-by: Adam Joseph \u003cadam@westernsemico.com\u003e\nChange-Id: I34bb5821628eb97e426bdb880b02e2097402adb7\nReviewed-on: https://cl.tvl.fyi/c/depot/+/7097\nTested-by: BuildkiteCI\nReviewed-by: tazjin \u003ctazjin@tvl.su\u003e\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d8616f13a71e3fc186e01bdb4ada60503f233be99"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d8616f13a71e3fc186e01bdb4ada60503f233be99"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"79ef6ee283182873090534d8d559dcde7ed3ebb4","is_merged_in_target_branch":true,"change_id":"I2010bd6e4600e9f1dd6e6af40e81ecbbb72c20d0","change_number":7054,"patch_set_number":5,"change_status":"MERGED"}],"branch":"refs/heads/canon","description":"Rebase"}},"requirements":[],"submit_records":[{"rule_name":"gerrit~PrologRule","status":"CLOSED","labels":[{"label":"Autosubmit","status":"MAY"},{"label":"Conformant-Commit-Message","status":"OK","applied_by":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"}},{"label":"All-Comments-Resolved","status":"OK","applied_by":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"}},{"label":"Verified","status":"OK","applied_by":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]}},{"label":"Code-Review","status":"OK","applied_by":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"}}]},{"rule_name":"Code-Owners","status":"CLOSED"}],"submit_requirements":[{"name":"All-Comments-Resolved","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:All-Comments-Resolved\u003dgerrit~PrologRule","fulfilled":true,"status":"PASS","passing_atoms":["label:All-Comments-Resolved\u003dgerrit~PrologRule"],"failing_atoms":[]}},{"name":"Verified","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Verified\u003dgerrit~PrologRule","fulfilled":true,"status":"PASS","passing_atoms":["label:Verified\u003dgerrit~PrologRule"],"failing_atoms":[]}},{"name":"Code-Owners","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"rule:Code-Owners","fulfilled":true,"status":"PASS","passing_atoms":["Code-Owners"],"failing_atoms":[]}},{"name":"Conformant-Commit-Message","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Conformant-Commit-Message\u003dgerrit~PrologRule","fulfilled":true,"status":"PASS","passing_atoms":["label:Conformant-Commit-Message\u003dgerrit~PrologRule"],"failing_atoms":[]}},{"name":"Code-Review","status":"SATISFIED","is_legacy":true,"submittability_expression_result":{"expression":"label:Code-Review\u003dgerrit~PrologRule","fulfilled":true,"status":"PASS","passing_atoms":["label:Code-Review\u003dgerrit~PrologRule"],"failing_atoms":[]}}]}
