)]}'
{"id":"depot~8012","triplet_id":"depot~canon~I738525bad8bc5ede5d8c737f023b14b8f4160612","project":"depot","branch":"canon","attention_set":{},"removed_from_attention_set":{"1000066":{"account":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"last_update":"2023-02-03 10:47:18.000000000","reason":"Change was submitted"},"1000034":{"account":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"last_update":"2023-02-03 10:47:18.000000000","reason":"Change was submitted"},"1000001":{"account":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"last_update":"2023-02-03 10:47:18.000000000","reason":"Change was submitted"},"1000036":{"account":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"last_update":"2023-02-03 10:43:37.000000000","reason":"removed on reply"},"1000010":{"account":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"last_update":"2023-02-03 10:47:18.000000000","reason":"Change was submitted"}},"hashtags":[],"change_id":"I738525bad8bc5ede5d8c737f023b14b8f4160612","subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","status":"MERGED","created":"2023-02-01 22:41:32.000000000","updated":"2023-02-03 10:47:18.000000000","submitted":"2023-02-03 10:47:18.000000000","submitter":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"total_comment_count":0,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"8023","meta_rev_id":"594752f0ee9f18bb6284f9bd53a1e6a7e3ec8c5c","_number":8012,"virtual_id_number":8012,"owner":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"actions":{},"labels":{"Code-Review":{"approved":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"all":[{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"tag":"autogenerated:gerrit:merged","value":2,"date":"2023-02-03 10:47:18.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},{"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":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},{"tag":"autogenerated:gerrit:merged","value":1,"date":"2023-02-03 10:47:18.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":{"all":[{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},{"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":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"all":[{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},{"value":0,"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]}]},"Conformant-Commit-Message":{"approved":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"all":[{"value":0,"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"value":0,"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},{"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"},{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"}],"reviewers":{"REVIEWER":[{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2023-02-01 22:41:43.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":"2023-02-01 22:49:13.000000000","updated_by":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"reviewer":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"state":"REVIEWER"},{"updated":"2023-02-01 22:49:13.000000000","updated_by":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"reviewer":{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},"state":"REVIEWER"},{"updated":"2023-02-01 22:49:13.000000000","updated_by":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"reviewer":{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},"state":"REVIEWER"},{"updated":"2023-02-01 22:49:13.000000000","updated_by":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"reviewer":{"_account_id":1000066,"name":"Adam Joseph","display_name":"amjoseph","email":"adam@westernsemico.com","username":"amjoseph"},"state":"REVIEWER"},{"updated":"2023-02-01 22:53:20.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":"b97076dce1451f8010af1673f8e682d9ff85b5f6","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-01 22:41:32.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"41defca3121ed0d57e78a62f26d63b3b78fcc025","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-01 22:41:43.000000000","message":"Patch Set 1:\n\nStarted build for patchset #1 on: https://buildkite.com/tvl/depot/builds/22130","accounts_in_message":[],"_revision_number":1},{"id":"65f69612f3c0385e1f9f30323c6b70dd929b445f","tag":"autogenerated:gerrit:code-owners:addReviewer","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-01 22:49:13.000000000","message":"\u003cGERRIT_ACCOUNT_1000010\u003e, who was added as reviewer owns the following files:\n* tvix/eval/src/builtins/impure.rs\n* tvix/eval/src/compiler/mod.rs\n* tvix/eval/src/tests/one_offs.rs\n* tvix/eval/src/value/thunk.rs\n* tvix/eval/src/vm.rs\n\n\u003cGERRIT_ACCOUNT_1000034\u003e, who was added as reviewer owns the following files:\n* tvix/eval/src/builtins/impure.rs\n* tvix/eval/src/compiler/mod.rs\n* tvix/eval/src/tests/one_offs.rs\n* tvix/eval/src/value/thunk.rs\n* tvix/eval/src/vm.rs\n\n\u003cGERRIT_ACCOUNT_1000036\u003e, who was added as reviewer owns the following files:\n* tvix/eval/src/builtins/impure.rs\n* tvix/eval/src/compiler/mod.rs\n* tvix/eval/src/tests/one_offs.rs\n* tvix/eval/src/value/thunk.rs\n* tvix/eval/src/vm.rs\n","accounts_in_message":[{"_account_id":1000010,"name":"aspen","email":"root@gws.fyi","username":"aspen"},{"_account_id":1000034,"name":"sterni","email":"sternenseemann@systemli.org","username":"sterni"},{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"}],"_revision_number":1},{"id":"5b0047bf2330663eebe213b593d425d1c3f1db67","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-01 22:53:20.000000000","message":"Patch Set 1: Verified+1\n\nBuild of patchset 1 passed: https://buildkite.com/tvl/depot/builds/22130","accounts_in_message":[],"_revision_number":1},{"id":"7a834e5d51aad01ca2be764a2c9e309b08f07b6b","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-01 22:53:44.000000000","message":"Uploaded patch set 2: Patch Set 1 was rebased.\n\nOutdated Votes:\n* Verified+1 (copy condition: \"(is:ANY AND changekind:NO_CODE_CHANGE) OR changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":2},{"id":"6ca365d1549f413e87f6183c4cc74b9956a6927f","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-01 22:53:45.000000000","message":"Patch Set 2:\n\nStarted build for patchset #2 on: https://buildkite.com/tvl/depot/builds/22131","accounts_in_message":[],"_revision_number":2},{"id":"51542d8178f7bb1f8f678cf37020a3baf728d714","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-01 23:01:01.000000000","message":"Patch Set 2: Verified+1\n\nBuild of patchset 2 passed: https://buildkite.com/tvl/depot/builds/22131","accounts_in_message":[],"_revision_number":2},{"id":"9a92cca02b1c3afb49df119a7271d635447b3404","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-02 09:38:58.000000000","message":"Uploaded patch set 3.\n\nOutdated Votes:\n* Verified+1 (copy condition: \"(is:ANY AND changekind:NO_CODE_CHANGE) OR changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":3},{"id":"b2f01a6d09b136084b79fa9b36812cc2b3a079ae","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 09:39:00.000000000","message":"Patch Set 3:\n\nStarted build for patchset #3 on: https://buildkite.com/tvl/depot/builds/22141","accounts_in_message":[],"_revision_number":3},{"id":"b9d8ea46e2b66bb01ae32868369277c6487cfdc8","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 09:42:26.000000000","message":"Patch Set 3: Verified+1\n\nBuild of patchset 3 passed: https://buildkite.com/tvl/depot/builds/22141","accounts_in_message":[],"_revision_number":3},{"id":"fb161b4ab37aaf9a984eee4db84b9f9c80ae9077","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-02 14:44:02.000000000","message":"Uploaded patch set 4: Patch Set 3 was rebased.\n\nOutdated Votes:\n* Verified+1 (copy condition: \"(is:ANY AND changekind:NO_CODE_CHANGE) OR changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":4},{"id":"055a85bbb370273ade631fc84663e32569f1ef3a","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 14:44:05.000000000","message":"Patch Set 4:\n\nStarted build for patchset #4 on: https://buildkite.com/tvl/depot/builds/22159","accounts_in_message":[],"_revision_number":4},{"id":"949570ed9415b21c5cc21ee083c9f636bb9e85d5","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-02 14:44:15.000000000","message":"Uploaded patch set 5: Patch Set 4 was rebased.","accounts_in_message":[],"_revision_number":5},{"id":"acf88d65db91b0aaa987fed73b11a79d88d8ca62","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 14:44:18.000000000","message":"Patch Set 5:\n\nStarted build for patchset #5 on: https://buildkite.com/tvl/depot/builds/22166","accounts_in_message":[],"_revision_number":5},{"id":"dff9c2fe7f749063daf3efffbd7b27e42bf5299b","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 14:47:33.000000000","message":"Patch Set 4: Verified+1\n\nBuild of patchset 4 passed: https://buildkite.com/tvl/depot/builds/22159","accounts_in_message":[],"_revision_number":4},{"id":"f66da35c401bd68e1e209f7de7bfb75deb38eaed","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 14:48:18.000000000","message":"Patch Set 5: Verified+1\n\nBuild of patchset 5 passed: https://buildkite.com/tvl/depot/builds/22166","accounts_in_message":[],"_revision_number":5},{"id":"56a883b3d1b04ad596ea657fed696a7a91ca5797","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-02 21:01:59.000000000","message":"Uploaded patch set 6: Patch Set 5 was rebased.\n\nOutdated Votes:\n* Verified+1 (copy condition: \"(is:ANY AND changekind:NO_CODE_CHANGE) OR changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":6},{"id":"3fd5aecd61246407ffe39b558c7e2b39e5bf2334","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 21:02:03.000000000","message":"Patch Set 6:\n\nStarted build for patchset #6 on: https://buildkite.com/tvl/depot/builds/22178","accounts_in_message":[],"_revision_number":6},{"id":"aad5dc96dc9ff7daa7bbc4c4061003d43ee22c0d","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 21:04:45.000000000","message":"Patch Set 6: Verified+1\n\nBuild of patchset 6 passed: https://buildkite.com/tvl/depot/builds/22178","accounts_in_message":[],"_revision_number":6},{"id":"c0bbd2644bff522f48bb1bcf740048f70e30be92","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-02 21:38:15.000000000","message":"Uploaded patch set 7: Patch Set 6 was rebased.\n\nOutdated Votes:\n* Verified+1 (copy condition: \"(is:ANY AND changekind:NO_CODE_CHANGE) OR changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":7},{"id":"228f8fde651dac5188669a57575a7549b2936d82","tag":"autogenerated:buildkite~trigger","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 21:38:18.000000000","message":"Patch Set 7:\n\nStarted build for patchset #7 on: https://buildkite.com/tvl/depot/builds/22200","accounts_in_message":[],"_revision_number":7},{"id":"c8c660b4014c8b2d3635be26fbc4cc117eec3307","tag":"autogenerated:buildkite~result","author":{"_account_id":1000014,"name":"BuildkiteCI","username":"buildkite","tags":["SERVICE_USER"]},"date":"2023-02-02 21:40:36.000000000","message":"Patch Set 7: Verified+1\n\nBuild of patchset 7 passed: https://buildkite.com/tvl/depot/builds/22200","accounts_in_message":[],"_revision_number":7},{"id":"64fa51ac9254b6a120ddcd607603fa7540f48f90","tag":"autogenerated:gerrit:newPatchSet","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-02 23:38:18.000000000","message":"Uploaded patch set 8: New patch set was added with same tree, parent tree, and commit message as Patch Set 7.\n\nCopied Votes:\n* Verified+1 (copy condition: \"(is:ANY AND changekind:NO_CODE_CHANGE) OR changekind:NO_CHANGE\")\n","accounts_in_message":[],"_revision_number":8},{"id":"34ec4dba9ab8936c690a4bd63ad3b98dcdd82212","author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"date":"2023-02-03 10:43:37.000000000","message":"Patch Set 8: Code-Review+2\n\nBy voting Code-Review+2 the following files are now code-owner approved by \u003cGERRIT_ACCOUNT_1000036\u003e:\n* tvix/eval/src/builtins/impure.rs\n* tvix/eval/src/compiler/mod.rs\n* tvix/eval/src/tests/one_offs.rs\n* tvix/eval/src/value/thunk.rs\n* tvix/eval/src/vm.rs\n","accounts_in_message":[{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"}],"_revision_number":8},{"id":"594752f0ee9f18bb6284f9bd53a1e6a7e3ec8c5c","tag":"autogenerated:gerrit:merged","author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"date":"2023-02-03 10:47:18.000000000","message":"Change has been successfully rebased and submitted as 3419f63575fdf9c08477967183a0c34ff9433884","accounts_in_message":[],"_revision_number":9}],"current_revision_number":9,"current_revision":"3419f63575fdf9c08477967183a0c34ff9433884","revisions":{"d44dc8b97272ef21de660e18cc9a56a5778a76fe":{"kind":"REWORK","_number":1,"created":"2023-02-01 22:41:32.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/1","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/1","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/1"}}},"commit":{"parents":[{"commit":"8877929a82c7a8a977cfa5fcaedd6862f21cd3b8","subject":"feat(tvix/eval): unthunk empty lists and attribute sets","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d8877929a82c7a8a977cfa5fcaedd6862f21cd3b8"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:36:26.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246), and likely introduces a\nhandful of less complicated new bugs in the process.\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nAs of this commit, this introduces some kind of new thunking issue\nthat becomes apparent when evaluating more involved expressions in\nnixpkgs (e.g. `stdenv`), where some thunks remain unforced. This could\nbe another bug surfacing as a result of this commit, and is not\nsomething I can tackle immediately in this commit.\n\nAs usual, we will try to isolate a test case for that behaviour and\nthen fix it.\n\nAdditionally, this makes eval around 30% faster than before when\nevaluating very small chunks of nixpkgs. It probably has an\nexponentially larger impact, but because of the above we can\u0027t confirm\nthat (yet).\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dd44dc8b97272ef21de660e18cc9a56a5778a76fe"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dd44dc8b97272ef21de660e18cc9a56a5778a76fe"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"8877929a82c7a8a977cfa5fcaedd6862f21cd3b8","is_merged_in_target_branch":false,"change_id":"Ie66cb1b163a544d45d113fd0f866286f230b0188","change_number":7960,"patch_set_number":4,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"c3adfefafadc275575a3ab0301cac48c2345d9ad":{"kind":"TRIVIAL_REBASE","_number":2,"created":"2023-02-01 22:53:44.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/2","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/2","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/2"}}},"commit":{"parents":[{"commit":"dc1e86001c109b58dea733e5cb3648164d1d1dd4","subject":"fix(tvix): add dummy target to attach extra-step to","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003ddc1e86001c109b58dea733e5cb3648164d1d1dd4"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:51:47.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246), and likely introduces a\nhandful of less complicated new bugs in the process.\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nAs of this commit, this introduces some kind of new thunking issue\nthat becomes apparent when evaluating more involved expressions in\nnixpkgs (e.g. `stdenv`), where some thunks remain unforced. This could\nbe another bug surfacing as a result of this commit, and is not\nsomething I can tackle immediately in this commit.\n\nAs usual, we will try to isolate a test case for that behaviour and\nthen fix it.\n\nAdditionally, this makes eval around 30% faster than before when\nevaluating very small chunks of nixpkgs. It probably has an\nexponentially larger impact, but because of the above we can\u0027t confirm\nthat (yet).\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dc3adfefafadc275575a3ab0301cac48c2345d9ad"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003dc3adfefafadc275575a3ab0301cac48c2345d9ad"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"dc1e86001c109b58dea733e5cb3648164d1d1dd4","is_merged_in_target_branch":true,"change_id":"I594a6652e2efe7aa6e35c7cdd84fc3097660614f","change_number":8009,"patch_set_number":3,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"56bf08efd84335e438628dee8e009e05f65ca616":{"kind":"REWORK","_number":3,"created":"2023-02-02 09:38:58.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/3","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/3","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/3"}}},"commit":{"parents":[{"commit":"98ea614c6e9ea9428dc10dde630abf894bd01473","subject":"chore(tvix/eval): elaborate on internal types in Value::type_of","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d98ea614c6e9ea9428dc10dde630abf894bd01473"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-02 09:37:28.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246). Evaluation\nprogresses *much* further after this, leading to several less\ncomplicated bugs likely being uncovered by this\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWith this commit, eval of nixpkgs mostly succeeds (things like stdenv\nevaluate to the same hashes for us and C++ Nix, meaning we now\nconstruct identical derivations without eval breaking).\n\nDue to this we progress much further into nixpkgs, which lets us\nuncover more additional bugs. For example, after this commit we can\nquickly see that cl/7949 introduces some kind of behavioural issue and\nshould not be merged as-is (this was not apparent before).\n\nAdditionally, tvix-eval is now seemingly very fast. When doing\nperformance analysis of a nixpkgs eval, we now mostly see the code\npath for shelling out to C++ Nix to add things to the store in there.\nWe still need those code paths, so we can not (yet) do a performance\nanalysis beyond that.\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d56bf08efd84335e438628dee8e009e05f65ca616"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d56bf08efd84335e438628dee8e009e05f65ca616"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"98ea614c6e9ea9428dc10dde630abf894bd01473","is_merged_in_target_branch":true,"change_id":"Ic43232aa6165ae1c3db7ac2701938e1dfeeb418c","change_number":8013,"patch_set_number":3,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"9d064ff91131da3e07fa9c97ba1c05a59360f905":{"kind":"TRIVIAL_REBASE","_number":4,"created":"2023-02-02 14:44:02.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/4","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/4","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/4 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/4 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/4 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/4"}}},"commit":{"parents":[{"commit":"9b4612da30969191ec38d17cc6c35be75b6e95b3","subject":"refactor(tvix/cli): use Wu-Manber string scanning for drv references","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d9b4612da30969191ec38d17cc6c35be75b6e95b3"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-02 14:43:57.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246). Evaluation\nprogresses *much* further after this, leading to several less\ncomplicated bugs likely being uncovered by this\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWith this commit, eval of nixpkgs mostly succeeds (things like stdenv\nevaluate to the same hashes for us and C++ Nix, meaning we now\nconstruct identical derivations without eval breaking).\n\nDue to this we progress much further into nixpkgs, which lets us\nuncover more additional bugs. For example, after this commit we can\nquickly see that cl/7949 introduces some kind of behavioural issue and\nshould not be merged as-is (this was not apparent before).\n\nAdditionally, tvix-eval is now seemingly very fast. When doing\nperformance analysis of a nixpkgs eval, we now mostly see the code\npath for shelling out to C++ Nix to add things to the store in there.\nWe still need those code paths, so we can not (yet) do a performance\nanalysis beyond that.\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d9d064ff91131da3e07fa9c97ba1c05a59360f905"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d9d064ff91131da3e07fa9c97ba1c05a59360f905"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"9b4612da30969191ec38d17cc6c35be75b6e95b3","is_merged_in_target_branch":false,"change_id":"I08926778e1e5d5a87fc9ac26e0437aed8bbd9eb0","change_number":8017,"patch_set_number":3,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"2030a1e2b92e5674ac498526981de88781603dfd":{"kind":"TRIVIAL_REBASE","_number":5,"created":"2023-02-02 14:44:15.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/5","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/5","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/5 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/5 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/5 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/5"}}},"commit":{"parents":[{"commit":"5c8bee8f12e8c447122f3f82cd56805662994ce2","subject":"feat(tvix/cli): cache imported paths in NixCompatIO","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d5c8bee8f12e8c447122f3f82cd56805662994ce2"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-02 14:44:13.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246). Evaluation\nprogresses *much* further after this, leading to several less\ncomplicated bugs likely being uncovered by this\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWith this commit, eval of nixpkgs mostly succeeds (things like stdenv\nevaluate to the same hashes for us and C++ Nix, meaning we now\nconstruct identical derivations without eval breaking).\n\nDue to this we progress much further into nixpkgs, which lets us\nuncover more additional bugs. For example, after this commit we can\nquickly see that cl/7949 introduces some kind of behavioural issue and\nshould not be merged as-is (this was not apparent before).\n\nAdditionally, tvix-eval is now seemingly very fast. When doing\nperformance analysis of a nixpkgs eval, we now mostly see the code\npath for shelling out to C++ Nix to add things to the store in there.\nWe still need those code paths, so we can not (yet) do a performance\nanalysis beyond that.\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d2030a1e2b92e5674ac498526981de88781603dfd"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d2030a1e2b92e5674ac498526981de88781603dfd"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"5c8bee8f12e8c447122f3f82cd56805662994ce2","is_merged_in_target_branch":false,"change_id":"Ibc062b20d81e97dd3986e734d225a744e1779fe7","change_number":8015,"patch_set_number":4,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"3541c5c20e9299a191176d3ed71f9bbd1a809654":{"kind":"TRIVIAL_REBASE","_number":6,"created":"2023-02-02 21:01:59.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/6","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/6","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/6 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/6 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/6 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/6"}}},"commit":{"parents":[{"commit":"e6235e2932cc76b18fe8cc8acf209c5fe2e8b79f","subject":"feat(tvix/cli): cache imported paths in NixCompatIO","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003de6235e2932cc76b18fe8cc8acf209c5fe2e8b79f"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-02 18:12:31.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246). Evaluation\nprogresses *much* further after this, leading to several less\ncomplicated bugs likely being uncovered by this\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWith this commit, eval of nixpkgs mostly succeeds (things like stdenv\nevaluate to the same hashes for us and C++ Nix, meaning we now\nconstruct identical derivations without eval breaking).\n\nDue to this we progress much further into nixpkgs, which lets us\nuncover more additional bugs. For example, after this commit we can\nquickly see that cl/7949 introduces some kind of behavioural issue and\nshould not be merged as-is (this was not apparent before).\n\nAdditionally, tvix-eval is now seemingly very fast. When doing\nperformance analysis of a nixpkgs eval, we now mostly see the code\npath for shelling out to C++ Nix to add things to the store in there.\nWe still need those code paths, so we can not (yet) do a performance\nanalysis beyond that.\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d3541c5c20e9299a191176d3ed71f9bbd1a809654"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d3541c5c20e9299a191176d3ed71f9bbd1a809654"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"e6235e2932cc76b18fe8cc8acf209c5fe2e8b79f","is_merged_in_target_branch":true,"change_id":"Ibc062b20d81e97dd3986e734d225a744e1779fe7","change_number":8015,"patch_set_number":5,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"10cc14e0dedcdd927a20a228cf24edd4d5f53939":{"kind":"TRIVIAL_REBASE","_number":7,"created":"2023-02-02 21:38:15.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/7","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/7","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/7 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/7 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/7 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/7"}}},"commit":{"parents":[{"commit":"74e7e6627156c16ef6d97db3039600aa258cf280","subject":"fix(tvix/cli): keep tracking full paths in known_paths","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d74e7e6627156c16ef6d97db3039600aa258cf280"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-02 21:38:12.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246). Evaluation\nprogresses *much* further after this, leading to several less\ncomplicated bugs likely being uncovered by this\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWith this commit, eval of nixpkgs mostly succeeds (things like stdenv\nevaluate to the same hashes for us and C++ Nix, meaning we now\nconstruct identical derivations without eval breaking).\n\nDue to this we progress much further into nixpkgs, which lets us\nuncover more additional bugs. For example, after this commit we can\nquickly see that cl/7949 introduces some kind of behavioural issue and\nshould not be merged as-is (this was not apparent before).\n\nAdditionally, tvix-eval is now seemingly very fast. When doing\nperformance analysis of a nixpkgs eval, we now mostly see the code\npath for shelling out to C++ Nix to add things to the store in there.\nWe still need those code paths, so we can not (yet) do a performance\nanalysis beyond that.\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d10cc14e0dedcdd927a20a228cf24edd4d5f53939"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d10cc14e0dedcdd927a20a228cf24edd4d5f53939"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"74e7e6627156c16ef6d97db3039600aa258cf280","is_merged_in_target_branch":false,"change_id":"I037af6e6bbe2b573034d695f8779bee1b56bc125","change_number":8022,"patch_set_number":2,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"09cf2f0e3c52a74cd40a2f78fc1b469e2266351a":{"kind":"NO_CHANGE","_number":8,"created":"2023-02-02 23:38:18.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/8","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/8","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/8 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/8 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/8 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/8"}}},"commit":{"parents":[{"commit":"38e8c2e95931673deb7cb939a05ac9bdaf305340","subject":"fix(tvix/cli): keep tracking full paths in known_paths","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d38e8c2e95931673deb7cb939a05ac9bdaf305340"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-02 23:38:16.000000000","tz":180},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246). Evaluation\nprogresses *much* further after this, leading to several less\ncomplicated bugs likely being uncovered by this\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWith this commit, eval of nixpkgs mostly succeeds (things like stdenv\nevaluate to the same hashes for us and C++ Nix, meaning we now\nconstruct identical derivations without eval breaking).\n\nDue to this we progress much further into nixpkgs, which lets us\nuncover more additional bugs. For example, after this commit we can\nquickly see that cl/7949 introduces some kind of behavioural issue and\nshould not be merged as-is (this was not apparent before).\n\nAdditionally, tvix-eval is now seemingly very fast. When doing\nperformance analysis of a nixpkgs eval, we now mostly see the code\npath for shelling out to C++ Nix to add things to the store in there.\nWe still need those code paths, so we can not (yet) do a performance\nanalysis beyond that.\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d09cf2f0e3c52a74cd40a2f78fc1b469e2266351a"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d09cf2f0e3c52a74cd40a2f78fc1b469e2266351a"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"38e8c2e95931673deb7cb939a05ac9bdaf305340","is_merged_in_target_branch":true,"change_id":"I037af6e6bbe2b573034d695f8779bee1b56bc125","change_number":8022,"patch_set_number":3,"change_status":"MERGED"}],"branch":"refs/heads/canon"},"3419f63575fdf9c08477967183a0c34ff9433884":{"kind":"NO_CODE_CHANGE","_number":9,"created":"2023-02-03 10:47:18.000000000","uploader":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"ref":"refs/changes/12/8012/9","fetch":{"anonymous http":{"url":"https://cl.tvl.fyi/depot","ref":"refs/changes/12/8012/9","commands":{"Checkout":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/9 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/9 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://cl.tvl.fyi/depot refs/changes/12/8012/9 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://cl.tvl.fyi/depot refs/changes/12/8012/9"}}},"commit":{"parents":[{"commit":"38e8c2e95931673deb7cb939a05ac9bdaf305340","subject":"fix(tvix/cli): keep tracking full paths in known_paths","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d38e8c2e95931673deb7cb939a05ac9bdaf305340"}]}],"author":{"name":"Vincent Ambo","email":"mail@tazj.in","date":"2023-02-01 22:29:50.000000000","tz":180},"committer":{"name":"tazjin","email":"tazjin@tvl.su","date":"2023-02-03 10:47:18.000000000","tz":0},"subject":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized","message":"fix(tvix/eval): ensure all evaluated thunks are correctly memoized\n\nThis fixes a very complicated bug (b/246). Evaluation\nprogresses *much* further after this, leading to several less\ncomplicated bugs likely being uncovered by this\n\nWhat was the problem?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nPreviously, when evaluating a thunk, we had a code path that looked\nlike this:\n\n    match *thunk {\n        ThunkRepr::Evaluated(Value::Thunk(ref inner_thunk)) \u003d\u003e {\n            let inner_repr \u003d inner_thunk.0.borrow().clone();\n            drop(thunk);\n            self.0.replace(inner_repr);\n        }\n        /* ... */\n    }\n\nThis code path created a copy of the inner `ThunkRepr` of a nested\nthunk, and moved that copy into the `ThunkRepr` of the parent.\n\nThe effect of this was that the original `ThunkRepr` (unforced!) lived\non in the original thunk, without the memoization of the subsequent\nforcing applying to it.\n\nThis had the result that Tvix would repeatedly evaluate these thunks\nwithout ever memoizing them, if they occured repeatedly as shared\ninner thunks. Most notably, this would *always* occur when\nbuiltins.import was used.\n\nWhat\u0027s the solution?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nI have completely rewritten `Thunk::force_trampoline_self` to make all\nflows that can occur in it explicit. I have also removed the outer\nloop inside of that function, and resorted to more use of trampolining\ninstead.\n\nThe function is now well-commented and it should be possible to read\nit from top-to-bottom and get a general sense of what is going on,\nthough the trampolining itself (which is implemented in the VM) needs\nto be at least partially understood for this.\n\nWhat\u0027s the new problem(s)?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nOne new (known) problem is that we have to construct `Error` instances\nin all error types here, but we do not have spans available in some\nthunk-related situations. Due to b/238 we cannot ask the VM for an\narbitrary span from the callsite leading to the force. This means that\nthere are now code paths where, under certain conditions, causing an\nevaluation error during thunk forcing will panic.\n\nTo fix this we will need to investigate and fix b/238, and/or add a\nspan tracking mechanism to thunks themselves.\n\nWhat other impacts does this have?\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nWith this commit, eval of nixpkgs mostly succeeds (things like stdenv\nevaluate to the same hashes for us and C++ Nix, meaning we now\nconstruct identical derivations without eval breaking).\n\nDue to this we progress much further into nixpkgs, which lets us\nuncover more additional bugs. For example, after this commit we can\nquickly see that cl/7949 introduces some kind of behavioural issue and\nshould not be merged as-is (this was not apparent before).\n\nAdditionally, tvix-eval is now seemingly very fast. When doing\nperformance analysis of a nixpkgs eval, we now mostly see the code\npath for shelling out to C++ Nix to add things to the store in there.\nWe still need those code paths, so we can not (yet) do a performance\nanalysis beyond that.\n\nChange-Id: I738525bad8bc5ede5d8c737f023b14b8f4160612\nReviewed-on: https://cl.tvl.fyi/c/depot/+/8012\nTested-by: BuildkiteCI\nReviewed-by: flokli \u003cflokli@flokli.de\u003e\n","web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d3419f63575fdf9c08477967183a0c34ff9433884"}],"resolve_conflicts_web_links":[{"name":"cgit","tooltip":"Open in GitWeb","url":"https://code.tvl.fyi/commit/?id\u003d3419f63575fdf9c08477967183a0c34ff9433884"}]},"parents_data":[{"branch_name":"refs/heads/canon","commit_id":"38e8c2e95931673deb7cb939a05ac9bdaf305340","is_merged_in_target_branch":true,"change_id":"I037af6e6bbe2b573034d695f8779bee1b56bc125","change_number":8022,"patch_set_number":3,"change_status":"MERGED"}],"branch":"refs/heads/canon"}},"requirements":[],"submit_records":[{"rule_name":"gerrit~PrologRule","status":"CLOSED","labels":[{"label":"Autosubmit","status":"MAY"},{"label":"Conformant-Commit-Message","status":"OK","applied_by":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"}},{"label":"All-Comments-Resolved","status":"OK","applied_by":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"}},{"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":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"}}]},{"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":[]}}]}
