)]}'
{"tvix/store/src/nar/seekable.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"c209df45db482d4e941fdada413d8c9090acb766","unresolved":true,"context_lines":[{"line_number":17,"context_line":"use futures::TryStreamExt;"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"#[derive(Debug)]"},{"line_number":20,"context_line":"pub struct BlobRef {"},{"line_number":21,"context_line":"    digest: B3Digest,"},{"line_number":22,"context_line":"    size: u64,"},{"line_number":23,"context_line":"}"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"d46252c6_3bf99901","line":20,"updated":"2024-09-06 12:40:52.000000000","message":"don\u0027t think BlobRef and Data need to be pub, no?\n\nit\u0027s all contained in this file.","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"ba905b2d6a0659eff4fba443248b7d6befa745eb","unresolved":false,"context_lines":[{"line_number":17,"context_line":"use futures::TryStreamExt;"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"#[derive(Debug)]"},{"line_number":20,"context_line":"pub struct BlobRef {"},{"line_number":21,"context_line":"    digest: B3Digest,"},{"line_number":22,"context_line":"    size: u64,"},{"line_number":23,"context_line":"}"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"fa8557e7_7a815cec","line":20,"in_reply_to":"d46252c6_3bf99901","updated":"2024-09-06 13:35:38.000000000","message":"Done","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"c209df45db482d4e941fdada413d8c9090acb766","unresolved":true,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"impl BlobRef {"},{"line_number":26,"context_line":"    fn read_at(\u0026self, offset: u64, buf: \u0026mut [u8]) -\u003e io::Result\u003cusize\u003e {"},{"line_number":27,"context_line":"        todo!()"},{"line_number":28,"context_line":"    }"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"dbdd8392_a8a81aa3","line":27,"updated":"2024-09-06 12:40:52.000000000","message":"todo","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"5e40b5a2fb50f1ab184f8f794b52b5a302b32c81","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":"impl BlobRef {"},{"line_number":26,"context_line":"    fn read_at(\u0026self, offset: u64, buf: \u0026mut [u8]) -\u003e io::Result\u003cusize\u003e {"},{"line_number":27,"context_line":"        todo!()"},{"line_number":28,"context_line":"    }"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"a8f76dae_ee5c4791","line":27,"in_reply_to":"dbdd8392_a8a81aa3","updated":"2024-09-07 12:24:14.000000000","message":"Done","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"c209df45db482d4e941fdada413d8c9090acb766","unresolved":true,"context_lines":[{"line_number":60,"context_line":"    position_index: usize,"},{"line_number":61,"context_line":"}"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"/// Used during construction"},{"line_number":64,"context_line":"fn walk_node("},{"line_number":65,"context_line":"    reader: \u0026mut Reader,"},{"line_number":66,"context_line":"    offset: \u0026mut u64,"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"94e23fe5_cb90a2a3","line":63,"updated":"2024-09-06 12:40:52.000000000","message":"please describe what it does.","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"5e40b5a2fb50f1ab184f8f794b52b5a302b32c81","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    position_index: usize,"},{"line_number":61,"context_line":"}"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"/// Used during construction"},{"line_number":64,"context_line":"fn walk_node("},{"line_number":65,"context_line":"    reader: \u0026mut Reader,"},{"line_number":66,"context_line":"    offset: \u0026mut u64,"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"6a741ecc_17882739","line":63,"in_reply_to":"94e23fe5_cb90a2a3","updated":"2024-09-07 12:24:14.000000000","message":"Done","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"c209df45db482d4e941fdada413d8c9090acb766","unresolved":true,"context_lines":[{"line_number":61,"context_line":"}"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"/// Used during construction"},{"line_number":64,"context_line":"fn walk_node("},{"line_number":65,"context_line":"    reader: \u0026mut Reader,"},{"line_number":66,"context_line":"    offset: \u0026mut u64,"},{"line_number":67,"context_line":"    // MUST be sorted by digest and contain all directories referenced by node"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"0bb16d7e_be9df824","line":64,"updated":"2024-09-06 12:40:52.000000000","message":"can this be moved into the impl, and take a \u0026mut self?","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"ba905b2d6a0659eff4fba443248b7d6befa745eb","unresolved":false,"context_lines":[{"line_number":61,"context_line":"}"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"/// Used during construction"},{"line_number":64,"context_line":"fn walk_node("},{"line_number":65,"context_line":"    reader: \u0026mut Reader,"},{"line_number":66,"context_line":"    offset: \u0026mut u64,"},{"line_number":67,"context_line":"    // MUST be sorted by digest and contain all directories referenced by node"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"04cb465b_6bac1aea","line":64,"in_reply_to":"0bb16d7e_be9df824","updated":"2024-09-06 13:35:38.000000000","message":"Done","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"c209df45db482d4e941fdada413d8c9090acb766","unresolved":true,"context_lines":[{"line_number":71,"context_line":") -\u003e Result\u003c(), RenderError\u003e {"},{"line_number":72,"context_line":"    match node {"},{"line_number":73,"context_line":"        tvix_castore::Node::Directory { digest, .. } \u003d\u003e {"},{"line_number":74,"context_line":"            let directory \u003d directories"},{"line_number":75,"context_line":"                .binary_search_by_key(\u0026digest.as_slice(), |(digest, directory)| \u0026digest.as_slice())"},{"line_number":76,"context_line":"                .map(|pos| directories[pos].clone())"},{"line_number":77,"context_line":"                .unwrap()"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"195bd827_35891484","line":74,"updated":"2024-09-06 12:40:52.000000000","message":"I\u0027d probably express this as a callback function to get a Directory by it\u0027s digest (that\u0027s how we use it in here).","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"29cc6575c830bc92bdd8f02e94390671dedb64d2","unresolved":false,"context_lines":[{"line_number":71,"context_line":") -\u003e Result\u003c(), RenderError\u003e {"},{"line_number":72,"context_line":"    match node {"},{"line_number":73,"context_line":"        tvix_castore::Node::Directory { digest, .. } \u003d\u003e {"},{"line_number":74,"context_line":"            let directory \u003d directories"},{"line_number":75,"context_line":"                .binary_search_by_key(\u0026digest.as_slice(), |(digest, directory)| \u0026digest.as_slice())"},{"line_number":76,"context_line":"                .map(|pos| directories[pos].clone())"},{"line_number":77,"context_line":"                .unwrap()"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"897cf7c9_2fa4c0f5","line":74,"in_reply_to":"195bd827_35891484","updated":"2024-09-22 11:18:15.000000000","message":"Done","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"c209df45db482d4e941fdada413d8c9090acb766","unresolved":true,"context_lines":[{"line_number":125,"context_line":"}"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"impl Reader {"},{"line_number":128,"context_line":"    pub async fn new("},{"line_number":129,"context_line":"        directory_service: impl DirectoryService,"},{"line_number":130,"context_line":"        root_node: Node,"},{"line_number":131,"context_line":"    ) -\u003e Result\u003cSelf, RenderError\u003e {"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"3ff50b9c_da49a43a","line":128,"updated":"2024-09-06 12:40:52.000000000","message":"docstring","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"5e40b5a2fb50f1ab184f8f794b52b5a302b32c81","unresolved":false,"context_lines":[{"line_number":125,"context_line":"}"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"impl Reader {"},{"line_number":128,"context_line":"    pub async fn new("},{"line_number":129,"context_line":"        directory_service: impl DirectoryService,"},{"line_number":130,"context_line":"        root_node: Node,"},{"line_number":131,"context_line":"    ) -\u003e Result\u003cSelf, RenderError\u003e {"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"3e7148ab_c1e4e11e","line":128,"in_reply_to":"3ff50b9c_da49a43a","updated":"2024-09-07 12:24:14.000000000","message":"Done","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"c209df45db482d4e941fdada413d8c9090acb766","unresolved":true,"context_lines":[{"line_number":162,"context_line":"        )?)"},{"line_number":163,"context_line":"    }"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    /// panics if the directory closure is not the closure of the root node"},{"line_number":166,"context_line":"    pub fn new_with_directory_closure("},{"line_number":167,"context_line":"        directory_closure: Option\u003cValidatedDirectoryGraph\u003e,"},{"line_number":168,"context_line":"        root_node: Node,"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"700b4f85_b65ad5a3","line":165,"updated":"2024-09-06 12:40:52.000000000","message":"what is it doing when it\u0027s not panicking?","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"5e40b5a2fb50f1ab184f8f794b52b5a302b32c81","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        )?)"},{"line_number":163,"context_line":"    }"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    /// panics if the directory closure is not the closure of the root node"},{"line_number":166,"context_line":"    pub fn new_with_directory_closure("},{"line_number":167,"context_line":"        directory_closure: Option\u003cValidatedDirectoryGraph\u003e,"},{"line_number":168,"context_line":"        root_node: Node,"}],"source_content_type":"text/x-rustsrc","patch_set":2,"id":"fca4fb74_e125a005","line":165,"in_reply_to":"700b4f85_b65ad5a3","updated":"2024-09-07 12:24:14.000000000","message":"Done","commit_id":"5b42e5a0a05614095f46e1184534ad1cd12ad35a"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"0dcbdabc7e819b119495dbafa6b7d5b5cf2cf1cc","unresolved":true,"context_lines":[{"line_number":216,"context_line":"        self.segments"},{"line_number":217,"context_line":"            .last()"},{"line_number":218,"context_line":"            .map(|\u0026(off, ref data)| off + data.len())"},{"line_number":219,"context_line":"            .unwrap_or_default()"},{"line_number":220,"context_line":"    }"},{"line_number":221,"context_line":"}"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"ade09c4b_19d3a85a","line":219,"updated":"2024-09-06 14:09:42.000000000","message":"We will never have 0 segments, if we do, we have a coding error. Let\u0027s make this an expect(\"no segments found\")","commit_id":"d1856675cbd83ffa99f3818dd418f3354d86d6eb"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"29cc6575c830bc92bdd8f02e94390671dedb64d2","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        self.segments"},{"line_number":217,"context_line":"            .last()"},{"line_number":218,"context_line":"            .map(|\u0026(off, ref data)| off + data.len())"},{"line_number":219,"context_line":"            .unwrap_or_default()"},{"line_number":220,"context_line":"    }"},{"line_number":221,"context_line":"}"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":5,"id":"32eac738_e89a5a96","line":219,"in_reply_to":"ade09c4b_19d3a85a","updated":"2024-09-22 11:18:15.000000000","message":"Done","commit_id":"d1856675cbd83ffa99f3818dd418f3354d86d6eb"},{"author":{"_account_id":1000005,"name":"edef","email":"edef@edef.eu","username":"edef"},"change_message_id":"d416820d4dc719ffbb136148106e0544d0764654","unresolved":true,"context_lines":[{"line_number":335,"context_line":"                let offset_in_segment \u003d usize::try_from(offset_in_segment).unwrap();"},{"line_number":336,"context_line":"                let remaining_data \u003d data.len() - offset_in_segment;"},{"line_number":337,"context_line":"                let read_size \u003d std::cmp::min(remaining_data, buf.remaining());"},{"line_number":338,"context_line":"                buf.put(data.slice(offset_in_segment..offset_in_segment + read_size));"},{"line_number":339,"context_line":"            }"},{"line_number":340,"context_line":"            Data::Blob(BlobRef { .. }) \u003d\u003e {"},{"line_number":341,"context_line":"                futures::ready!(this.current_blob.as_mut().poll(cx))?;"}],"source_content_type":"text/x-rustsrc","patch_set":10,"id":"2346fba3_cd888669","line":338,"range":{"start_line":338,"start_character":29,"end_line":338,"end_character":34},"updated":"2024-09-08 05:37:46.000000000","message":"```suggestion\n                buf.put(\u0026data[offset_in_segment..offset_in_segment + read_size]);\n```\n\nBuf::slice will increment the refcount, to no useful end, since we\u0027ll immediately drop the resulting buffer afterwards.","commit_id":"c0b703422b631100d8078521ef072faa1848af60"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"29cc6575c830bc92bdd8f02e94390671dedb64d2","unresolved":false,"context_lines":[{"line_number":335,"context_line":"                let offset_in_segment \u003d usize::try_from(offset_in_segment).unwrap();"},{"line_number":336,"context_line":"                let remaining_data \u003d data.len() - offset_in_segment;"},{"line_number":337,"context_line":"                let read_size \u003d std::cmp::min(remaining_data, buf.remaining());"},{"line_number":338,"context_line":"                buf.put(data.slice(offset_in_segment..offset_in_segment + read_size));"},{"line_number":339,"context_line":"            }"},{"line_number":340,"context_line":"            Data::Blob(BlobRef { .. }) \u003d\u003e {"},{"line_number":341,"context_line":"                futures::ready!(this.current_blob.as_mut().poll(cx))?;"}],"source_content_type":"text/x-rustsrc","patch_set":10,"id":"a95b0b59_200a6167","line":338,"range":{"start_line":338,"start_character":29,"end_line":338,"end_character":34},"in_reply_to":"2346fba3_cd888669","updated":"2024-09-22 11:18:15.000000000","message":"Done","commit_id":"c0b703422b631100d8078521ef072faa1848af60"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"deb43f05fae3d60d25cf40cc63cdabd065150b65","unresolved":true,"context_lines":[{"line_number":58,"context_line":"/// Used during construction."},{"line_number":59,"context_line":"/// Converts the current buffer (passed as `cur_segment`) into a `Data::Literal` segment and"},{"line_number":60,"context_line":"/// inserts it into `self.segments`."},{"line_number":61,"context_line":"fn flush_segment(segments: \u0026mut Vec\u003c(u64, Data)\u003e, offset: \u0026mut u64, cur_segment: \u0026mut Vec\u003cu8\u003e) {"},{"line_number":62,"context_line":"    let segment_size \u003d cur_segment.len();"},{"line_number":63,"context_line":"    segments.push((*offset, Data::Literal(std::mem::take(cur_segment).into())));"},{"line_number":64,"context_line":"    *offset +\u003d segment_size as u64;"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"02bb8e10_a63a8780","line":61,"updated":"2024-09-23 12:19:48.000000000","message":"I initially was confused why we pass `cur_segment` as `\u0026mut Vec\u003cu8\u003e`, and not as a `\u0026[u8]`.\n\nI assume the std::mem::take taking ownership of the `Vec\u003cu8\u003e` in cur_segment also allocates, so it should be cleaner to just pass a `\u0026[u8]` as cur_segment, and then do a `segments.push(*offset, Data::Literal(Vec::copy_from_slice(cur_segment))`. WDYT?","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"30fb431b9b2b276f263017047f90b895ac589444","unresolved":true,"context_lines":[{"line_number":58,"context_line":"/// Used during construction."},{"line_number":59,"context_line":"/// Converts the current buffer (passed as `cur_segment`) into a `Data::Literal` segment and"},{"line_number":60,"context_line":"/// inserts it into `self.segments`."},{"line_number":61,"context_line":"fn flush_segment(segments: \u0026mut Vec\u003c(u64, Data)\u003e, offset: \u0026mut u64, cur_segment: \u0026mut Vec\u003cu8\u003e) {"},{"line_number":62,"context_line":"    let segment_size \u003d cur_segment.len();"},{"line_number":63,"context_line":"    segments.push((*offset, Data::Literal(std::mem::take(cur_segment).into())));"},{"line_number":64,"context_line":"    *offset +\u003d segment_size as u64;"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"bbb2377d_ee865930","line":61,"in_reply_to":"02bb8e10_a63a8780","updated":"2024-09-23 13:45:11.000000000","message":"The std::mem::take allocates the new empty vec for the next segment, but never copies the data from one vec to another.\nTaking a slice and then doing Vec::copy_from_slice seems like a waste when we already have it in a Vec.\n\nInstead, we could move the std::mem::take out of the flush_segment and pass an owned Vec to flush_segment.","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"49f6d5447181cdaa99188bbe5b9b1599afa9c91d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"/// Used during construction."},{"line_number":59,"context_line":"/// Converts the current buffer (passed as `cur_segment`) into a `Data::Literal` segment and"},{"line_number":60,"context_line":"/// inserts it into `self.segments`."},{"line_number":61,"context_line":"fn flush_segment(segments: \u0026mut Vec\u003c(u64, Data)\u003e, offset: \u0026mut u64, cur_segment: \u0026mut Vec\u003cu8\u003e) {"},{"line_number":62,"context_line":"    let segment_size \u003d cur_segment.len();"},{"line_number":63,"context_line":"    segments.push((*offset, Data::Literal(std::mem::take(cur_segment).into())));"},{"line_number":64,"context_line":"    *offset +\u003d segment_size as u64;"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"3796cd17_eb0d5db9","line":61,"in_reply_to":"516c679f_6329285c","updated":"2024-09-25 13:53:57.000000000","message":"Done","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"d08109434395e76752919b7aaea5856bebd4c178","unresolved":true,"context_lines":[{"line_number":58,"context_line":"/// Used during construction."},{"line_number":59,"context_line":"/// Converts the current buffer (passed as `cur_segment`) into a `Data::Literal` segment and"},{"line_number":60,"context_line":"/// inserts it into `self.segments`."},{"line_number":61,"context_line":"fn flush_segment(segments: \u0026mut Vec\u003c(u64, Data)\u003e, offset: \u0026mut u64, cur_segment: \u0026mut Vec\u003cu8\u003e) {"},{"line_number":62,"context_line":"    let segment_size \u003d cur_segment.len();"},{"line_number":63,"context_line":"    segments.push((*offset, Data::Literal(std::mem::take(cur_segment).into())));"},{"line_number":64,"context_line":"    *offset +\u003d segment_size as u64;"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"516c679f_6329285c","line":61,"in_reply_to":"bbb2377d_ee865930","updated":"2024-09-23 14:09:11.000000000","message":"Agree, that\u0027d also work and make it easier to grasp.","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"deb43f05fae3d60d25cf40cc63cdabd065150b65","unresolved":true,"context_lines":[{"line_number":86,"context_line":"            size,"},{"line_number":87,"context_line":"            executable,"},{"line_number":88,"context_line":"        } \u003d\u003e {"},{"line_number":89,"context_line":"            let (cur_segment, skip) \u003d nar_node"},{"line_number":90,"context_line":"                .file_manual_write(executable, size)"},{"line_number":91,"context_line":"                .map_err(RenderError::NARWriterError)?;"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"c28d682b_d3dd138a","line":89,"range":{"start_line":89,"start_character":17,"end_line":89,"end_character":28},"updated":"2024-09-23 12:19:48.000000000","message":"what about calling this buf_segment? We mostly care about what `file_manual_write` wrote into it so far, so treat it as a buffer of some sort.","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"7171574219dec4abcda2e6ecd3d1b86f01000da4","unresolved":true,"context_lines":[{"line_number":86,"context_line":"            size,"},{"line_number":87,"context_line":"            executable,"},{"line_number":88,"context_line":"        } \u003d\u003e {"},{"line_number":89,"context_line":"            let (cur_segment, skip) \u003d nar_node"},{"line_number":90,"context_line":"                .file_manual_write(executable, size)"},{"line_number":91,"context_line":"                .map_err(RenderError::NARWriterError)?;"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"205b2f12_ac3ed59e","line":89,"range":{"start_line":89,"start_character":17,"end_line":89,"end_character":28},"in_reply_to":"1f551479_5bed1cea","updated":"2024-09-23 14:13:23.000000000","message":"ok, please add a comment somewhere where it makes sense, maybe before the let binding, or as a docstring on one of the methods, explaining how we assemble the segments?","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"a38e4f8becb0ea85602fbce15d1200f7d6838098","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            size,"},{"line_number":87,"context_line":"            executable,"},{"line_number":88,"context_line":"        } \u003d\u003e {"},{"line_number":89,"context_line":"            let (cur_segment, skip) \u003d nar_node"},{"line_number":90,"context_line":"                .file_manual_write(executable, size)"},{"line_number":91,"context_line":"                .map_err(RenderError::NARWriterError)?;"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"8c8cdfe3_b60ef2f8","line":89,"range":{"start_line":89,"start_character":17,"end_line":89,"end_character":28},"in_reply_to":"205b2f12_ac3ed59e","updated":"2024-09-25 15:09:50.000000000","message":"Added to the `new()` function","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"a25f6b261d86d4d3f0fa9f2e2161f4c74567b3da","unresolved":true,"context_lines":[{"line_number":86,"context_line":"            size,"},{"line_number":87,"context_line":"            executable,"},{"line_number":88,"context_line":"        } \u003d\u003e {"},{"line_number":89,"context_line":"            let (cur_segment, skip) \u003d nar_node"},{"line_number":90,"context_line":"                .file_manual_write(executable, size)"},{"line_number":91,"context_line":"                .map_err(RenderError::NARWriterError)?;"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"1f551479_5bed1cea","line":89,"range":{"start_line":89,"start_character":17,"end_line":89,"end_character":28},"in_reply_to":"c28d682b_d3dd138a","updated":"2024-09-23 13:47:58.000000000","message":"cur_segment does not only contain the things written by file_manual_write, but _everything_ up to the beginning of the file contents, including previous directory entries/symlinks.","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"deb43f05fae3d60d25cf40cc63cdabd065150b65","unresolved":true,"context_lines":[{"line_number":93,"context_line":"            // Flush the segment up until the beginning of the blob"},{"line_number":94,"context_line":"            flush_segment(segments, offset, cur_segment);"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"            // Insert the blob segment"},{"line_number":97,"context_line":"            segments.push((*offset, Data::Blob(BlobRef { digest, size })));"},{"line_number":98,"context_line":"            *offset +\u003d size;"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"cf6fb668_9a9da9b5","line":96,"updated":"2024-09-23 12:19:48.000000000","message":"Extend the comment stating we explicitly do not write the contents as the docstring in `file_manual_write` asks us to, but do this in the AsyncRead.","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"a38e4f8becb0ea85602fbce15d1200f7d6838098","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            // Flush the segment up until the beginning of the blob"},{"line_number":94,"context_line":"            flush_segment(segments, offset, cur_segment);"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"            // Insert the blob segment"},{"line_number":97,"context_line":"            segments.push((*offset, Data::Blob(BlobRef { digest, size })));"},{"line_number":98,"context_line":"            *offset +\u003d size;"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"4c54f9d5_607caa96","line":96,"in_reply_to":"cf6fb668_9a9da9b5","updated":"2024-09-25 15:09:50.000000000","message":"Done","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"710755119455f24c7fc1b67dbf2780b0e5025b95","unresolved":true,"context_lines":[{"line_number":135,"context_line":"    ///"},{"line_number":136,"context_line":"    /// This function pre-fetches the directory closure using `get_recursive()` and assembles the"},{"line_number":137,"context_line":"    /// NAR structure, except the file contents which are stored as \u0027holes\u0027 with references to a blob"},{"line_number":138,"context_line":"    /// of a specific Blake3 digest and known size. The AsyncRead implementation will then switch"},{"line_number":139,"context_line":"    /// between serving the precomputed literal segments, and the appropriate blob for the file"},{"line_number":140,"context_line":"    /// contents."},{"line_number":141,"context_line":"    pub async fn new("}],"source_content_type":"text/x-rustsrc","patch_set":24,"id":"b66ee9a9_a7f91044","line":138,"updated":"2024-09-25 18:17:37.000000000","message":"```suggestion\n    /// of a specific BLAKE3 digest and known size. The AsyncRead implementation will then switch\n```","commit_id":"44273ad972a436dfe840e0f1cd4332740928d508"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"87f7a50856196361600076e6133b24936aa6770b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    ///"},{"line_number":136,"context_line":"    /// This function pre-fetches the directory closure using `get_recursive()` and assembles the"},{"line_number":137,"context_line":"    /// NAR structure, except the file contents which are stored as \u0027holes\u0027 with references to a blob"},{"line_number":138,"context_line":"    /// of a specific Blake3 digest and known size. The AsyncRead implementation will then switch"},{"line_number":139,"context_line":"    /// between serving the precomputed literal segments, and the appropriate blob for the file"},{"line_number":140,"context_line":"    /// contents."},{"line_number":141,"context_line":"    pub async fn new("}],"source_content_type":"text/x-rustsrc","patch_set":24,"id":"f812d6c6_f5718341","line":138,"in_reply_to":"b66ee9a9_a7f91044","updated":"2024-09-25 19:07:26.000000000","message":"Fix applied.","commit_id":"44273ad972a436dfe840e0f1cd4332740928d508"}],"tvix/store/src/tests/nar_renderer_seekable.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"deb43f05fae3d60d25cf40cc63cdabd065150b65","unresolved":true,"context_lines":[{"line_number":11,"context_line":"use tvix_castore::directoryservice::DirectoryService;"},{"line_number":12,"context_line":"use tvix_castore::Node;"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"#[rstest]"},{"line_number":15,"context_line":"#[tokio::test]"},{"line_number":16,"context_line":"async fn single_symlink("},{"line_number":17,"context_line":"    blob_service: Arc\u003cdyn BlobService\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"6b3adc29_b7359643","line":14,"updated":"2024-09-23 12:19:48.000000000","message":"We don\u0027t do any actual seeking here, just always \"read_to_end\".\n\nThis needs some more tests actually seeking to interesting positions.","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"},{"author":{"_account_id":1000106,"name":"yuka","email":"yuka@yuka.dev","username":"yuka"},"change_message_id":"49f6d5447181cdaa99188bbe5b9b1599afa9c91d","unresolved":false,"context_lines":[{"line_number":11,"context_line":"use tvix_castore::directoryservice::DirectoryService;"},{"line_number":12,"context_line":"use tvix_castore::Node;"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"#[rstest]"},{"line_number":15,"context_line":"#[tokio::test]"},{"line_number":16,"context_line":"async fn single_symlink("},{"line_number":17,"context_line":"    blob_service: Arc\u003cdyn BlobService\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":16,"id":"0d4ed498_44e2f4e5","line":14,"in_reply_to":"6b3adc29_b7359643","updated":"2024-09-25 13:53:57.000000000","message":"Done","commit_id":"41d004b93b283c6c84ad1b91c91e3071a4eb52d0"}]}
