{"record":{"id":"0f3c5011f35d3b2b","repo":"GitoxideLabs/gitoxide","slug":"at-least-one-decompressed-delta-object","errorCode":null,"errorMessage":"at least one decompressed delta object","messagePattern":"at least one decompressed delta object","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gix-pack/src/data/file/decode/entry.rs","lineNumber":453,"sourceCode":"\n        let last_result_size = last_result_size.expect(\"at least one delta chain item\");\n        // uneven chains leave the target buffer after the source buffer\n        // FIXME(Performance) If delta-chains are uneven, we know we will have to copy bytes over here\n        //      Instead we could use a different start buffer, to naturally end up with the result in the\n        //      right one.\n        //      However, this is a bit more complicated than just that - you have to deal with the base\n        //      object, which should also be placed in the second buffer right away. You don't have that\n        //      control/knowledge for out-of-pack bases, so this is a special case to deal with, too.\n        //      Maybe these invariants can be represented in the type system though.\n        if chain_len % 2 == 1 {\n            // this seems inverted, but remember: we swapped the buffers on the last iteration\n            target_buf[..last_result_size].copy_from_slice(&source_buf[..last_result_size]);\n        }\n        debug_assert!(out.len() >= last_result_size);\n        out.truncate(last_result_size);\n\n        let object_kind = object_kind.expect(\"a base object as root of any delta chain that we are here to resolve\");\n        let consumed_input = consumed_input.expect(\"at least one decompressed delta object\");\n        cache.put(\n            self.id,\n            first_entry.data_offset,\n            out.as_slice(),\n            object_kind,\n            consumed_input,\n        );\n        Ok(Outcome {\n            kind: object_kind,\n            // technically depending on the cache, the chain size is not correct as it might\n            // have been cut short by a cache hit. The caller must deactivate the cache to get\n            // actual results\n            num_deltas: chain_len as u32,\n            decompressed_size: first_entry.decompressed_size,\n            compressed_size: consumed_input,\n            object_size: last_result_size as u64,\n        })\n    }","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-pack/src/data/file/decode/entry.rs#L435-L471","documentation":"A `expect()` panic asserting `consumed_input` is present after resolving deltas, so the resolved object can be put into the delta cache together with the number of input bytes it consumed. If the first (base) delta was decompressed, consumed bytes are always recorded; `None` indicates a broken internal state.","triggerScenarios":"Same path as errorIndex 464: `decode_entry` -> `resolve_deltas` finishing with at least one decompressed delta but missing consumption bookkeeping — only via a code defect.","commonSituations":"Unreachable in normal use; observed in gix-pack development or when altering the first-pass decompression loop.","solutions":["Update gix-pack","Avoid patching the first-pass decompress loop without preserving consumed_input assignment","Report upstream with a reproducer if ever hit"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let r = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| pack.decode_entry(id, &mut out, ...)));\nif r.is_err() { eprintln!(\"consumed-input invariant violated\"); }","preventionTips":["Use stock decode paths","Keep gix-pack current","Treat occurrences as library bugs"],"tags":["rust","panic","internal-invariant","gix-pack","delta-resolution"],"backgroundTag":"internal-invariant-violation","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}