From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796241184; b=dRTx9DqmV5ina4wTNzsP9onwm4QxPWcUt2w+H9xuQ9Z00/NNqpOx2MCyMQ0IomvTqFiD 7xxN/dcxQbwqiy4f/cjDhTl/MhRJq308QDKyZQC338VLNAmOfQALFxfaENdIQM5GgZmpo SeL2qwOqDf00nlQ8wucfZPsxEbTnDzAq4qio42H0COQwk+pDXx4t/xplHAxH5xEh3EK1G 8zSMu0IrTxtGUP+iBVEYTOzEY+jMmG4hZV3HWX/XiDRk+Ug+BAQj7veKAHhXGYl0Mpis6 jfXWFoQaqjdRyBV3UrJHtnfvB3eI4nTNfVZsX60h+CzhFKuh5s4AISEQ2oudXSsKFiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796241184; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=srVfe+Xe2tlDv4MSlBuhJLM0Vc2pEOdNgHgbXQNyrSU=; b=xYRsubpvFNgyKCZ7MbcSDDemWyHZ4Gosst9wArH9z42D2EPUO+ZY43PJXrKoWR2Dj6dz NdCak57GenpA9LvIlVC05Uw4MWAEBAPeOl/Z4DK1itEzBoyfSfSZAZcZXYCA/zwZeUdD5 r3qZjou2dwMQgiUEUB2W6w65a09dExqp7frCcAob/kUx+54Otndoofoe8n/9oLs+tC0Zh inG1VfiwSHRGJlhRvVAqD9wuyfjrHuU0ty1rWf83BphrSstqXyTK4L91ej59OBxe49ikb VEj5octfThwTodUmO3MJwFx+9FnTzghdn98p8pl/ufbCtaqXnQY+K1u7+A1dOGZ4iEA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=vdX0fnLG; arc=none smtp.remote-ip=209.85.219.45 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D77E6606A336 for ; Wed, 2 Dec 2026 19:53:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D77E6606A336 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=vdX0fnLG Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-921d253bb28so1356806d6.1 for ; Wed, 02 Dec 2026 11:53:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796241183; x=1796845983; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=srVfe+Xe2tlDv4MSlBuhJLM0Vc2pEOdNgHgbXQNyrSU=; b=vdX0fnLGd1+/dQVOcTQzvbQeG+kaNZLwx5ut9GDASCxe4kN40JJFxfIniu4pRelqdN gK7BFvmt7NYnsKfx5Ut1hOf7FhaLJeaFSJnGBc3zXtV5Mt1xwZu3y7s7B8Yk+QJ0M7lT LWCzpfqQv8fgCKWMLkmBASxemxYTYgPlKNfxJQ2CIf/bIBLJ15EcPIE7tg3ltCJakZX0 EUXLCfUkGMKzvGxvZ+nS1kCYJo3M1HGkLIkq43wmpTn4rjmRvzMX/GZ8qElJys+Xd7dp o6X8ACgcMYpicwhKa+daf4i1oNxAPmZrBfyz6QiM30Q+FS2uL/ovtEYZSexFE63iN6Kl H25w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796241183; x=1796845983; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=srVfe+Xe2tlDv4MSlBuhJLM0Vc2pEOdNgHgbXQNyrSU=; b=1/JTzW875/oNPEJFR7cTFUTGspQ31S3lLUCfH4Eqsebu6AL4nlrYVUJx2X2RIdAIik nAt+aCx5K0FYq0fDxME/iNS/uUQyCPH8WMHU9I91MxmSD41gatrhkqINplpcBrBNwgHI BJXF6gA/sVixKjZpS/dCK9AuG/DGSVZgpb7iNzTEBbcOALYZ82YJpqJxS14ODGv2+U22 ZzM85DI1QH0T9vdfch77Is1yarAs2B2yMd2KOpDDLSxgGy6jYrGf5tnFQjnuUrz14Ors wlK4/vO/AoMr4PjMp+EUhDKXGEzbgDMV9fAtNIa4Q4jWqkoityzuHWOboiNzjKlNVGk/ KwfA== X-Gm-Message-State: APuU4Z9EqUigRYlQZQ5033bVZy65t1wfwUTSO+Ba1ONw3tuCx4H1DgaV cJyibvRHms3eT+ue3DjXdF27YQlj8L/OkYqkKKg3a0wBDnEDEEE04P0B X-Gm-Gg: AZFdTZe+0ruwVwTDjchqNHKxecM/Tf2ZciP6EW6En+2fg4ERlfeQg99b38vh2yWeSpy jtTthxBvTMDWx8hMjFko/+FuRh47+jqOTr1i+y5z9S1fgJPYChvGSxKqC9bzYgvUNvkNSkej/qe 3q+DW+Cfw5F5xsE8QoYRNEAK6f41CohYzVjYpAEuZksnHvwxEaPxwhf+LeCl9HqOFLvI5ylpHv/ hBPtq34MJLaSXQm4pRoAiLBr9LrDWrBO0xJqit3Kh9Gjp6nI9lnQH/3PKA+M5FnD+eeFWYw/J10 KFwP8Y7G4Qy5ZKpuWh9wfhQmdeXNAjhNP/6Mqfu9GnShOJN8v+v+fZhx4Y384LHbNWqQoRUP9qz ktHoEzY/FvxVNGznFwK+0TTxiC3DoBi2vUBX6flQy9VD8FQ94qJdhJrUfBujPwxkP5RRXe9y560 1nEUh7GFQPoewO+9pskyMLGi/tNiw8tExshcM30be7HV4x4RVaOPgKXzwjhyOdVIsARiq/uC6Kl +5mAGNuXaAqglhNOFLhRFmDlbMoS2nm6rcY265FIHdtDXZ/gN6LSuCGYXnrPDbIPWesfvTDbV0L zEvznI4k7Eb1Jb/qMaQpuIVBj8be8Wp9mawnc0MAJQQsudU+vI57ab3HtRn5z2ZpGMdm094TJFT Hj8DtpIQbzPtg8+pT+jUQ7AYV9tq9uhbo1UsY8GGKRfFxEHz8gPUfhTkgkWGSE353hxW7YsJt7V PKUOUOQLbp8dWoauA9KGHWdv4E+7VFnGq3632Zc80bTALvBbqgv3w9DQ== X-Received: by 2002:a05:6214:495:b0:921:2fb5:2fe6 with SMTP id 6a1803df08f44-92134a861d9mr804764696d6.34.1796241182807; Wed, 02 Dec 2026 11:53:02 -0800 (PST) Received: from [192.168.1.109] ([136.61.86.144]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921349f6959sm357627156d6.31.2026.12.02.11.53.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 11:53:02 -0800 (PST) Message-ID: <6bcf9997-068e-45f3-b737-9df430671de1@gmail.com> Date: Wed, 2 Dec 2026 14:53:01 -0500 X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] delta-islands: revisit trees with new delta marks To: Elijah Newren , Derrick Stolee via GitGitGadget Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net, ttaylorr@openai.com References: Content-Language: en-US From: Derrick Stolee In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 12/2/2026 2:14 PM, Elijah Newren wrote: > On Mon, Nov 30, 2026 at 11:25 AM Derrick Stolee via GitGitGadget > wrote: >> >> From: Derrick Stolee >> >> When exploring the object graph to group objects into delta-islands, >> some trees and blobs can be visited from one path and then revisited >> later from another. If those two visits come from objects with different >> delta marks, then the final mark of the visited object should be the >> union of those marks. Instead, some cases only have the first marks as >> we don't reprocess objects marked with SEEN. This gets worse for objects >> recursively reachable from that object. ... >> It's possible that a true integration of delta islands with path-walk >> would help here, having the path-walk API compute the delta island marks >> as we traverse objects in path-based groups. Such an implementation >> would need to allow for objects to be readded to groups when their delta >> marks are updated while avoiding multiple emissions of the object from >> the API. Such a large rework of the delta island computation is avoided >> for now, as we can reproduce the error with the existing implementation. > > I had difficulty discerning the impact and motivation of the bug you > are trying to fix, possibly because I only know a little about delta > islands. There is one paragraph that states it ("unwanted > cross-island deltas"), but it reads as history rather than motivation, > so I missed it at first. Would it make sense to include the > motivation near the top of the commit message? I asked AI, and it > told me... > > ``` > Delta islands ensure that an object is only stored as a delta against > a base that is reachable from every island containing the object, so > that serving any one fork can reuse the on-disk delta instead of > breaking it and searching for a new one on the fly. > > However, island marks can be incomplete. resolve_tree_islands() > propagates each tree's marks to its children once, in order of the > depth at which the tree was first seen. A tree shared at different > depths (e.g. seen at a/b/ and at x/y/z/) can therefore have its marks > propagated before a parent from another island adds to them, and the > late-arriving marks never reach the trees and blobs below it. An > object missing marks looks like it belongs to fewer islands, so it can > be deltified against a base that some of its islands cannot reach, > reintroducing the expensive delta-breaking that islands exist to > prevent. When the base is the one missing marks, valid deltas are > instead rejected, making packs larger. > ``` The base motivation of using delta islands is about avoiding delta expansion and recompression during clones and fetches. By grouping certain tip commits into "reachability categories" (say, refs for each fork in a network) we can avoid having delta bases outside of a typical clone in that "category". I think [1] is still the best description of this mechanism. [1] https://blog.github.com/open-source/git/counting-objects/#the-performance-fix There might also be interesting cases where we say that a "trunk" ref is a certain category and other branches are still reachable but a different island. That could present improvements for --single-branch clones. >> Assisted-by: GPT-6.1 Sol >> Signed-off-by: Derrick Stolee > > I think Signed-off-by is supposed to match the committer; you've used > two different email addresses. I noticed this in my submission and have prepared a version already with the fix. I created this in the wrong local directory that had the wrong email configured. Will fix in v2. >> -static void set_island_marks(struct object *obj, struct island_bitmap *marks) >> +static int set_island_marks(struct object *obj, struct island_bitmap *marks) >> { >> struct island_bitmap *b; >> khiter_t pos; >> @@ -172,19 +173,23 @@ static void set_island_marks(struct object *obj, struct island_bitmap *marks) >> */ >> marks->refcount++; >> kh_value(island_marks, pos) = marks; >> - return; >> + return 1; >> } >> >> + b = kh_value(island_marks, pos); >> + if (island_bitmap_is_subset(marks, b)) >> + return 0; >> + >> /* >> * We do have it. Make sure we split any copy-on-write before >> * updating. >> */ >> - b = kh_value(island_marks, pos); >> if (b->refcount > 1) { >> b->refcount--; >> b = kh_value(island_marks, pos) = island_bitmap_new(b); >> } >> island_bitmap_or(b, marks); >> + return 1; >> } > > You're now returning whether obj's marks changed. Is it worth adding > a comment above the function mentioning the meaning of the return > value? A doc-comment would be good now that this has a nonzero (non-error) return value. >> if (progress) >> - progress_state = start_progress(r, _("Propagating island marks"), nr); >> + progress_state = start_progress(r, _("Propagating island marks"), 0); > > We've changed from showing a percentage of completion to just a count > of trees processed. Since trees can be reprocessed, there's no > reasonable total we can give, so this seems like a reasonable change. > I'm curious if it's worth calling this out in the commit message. It probably is. Can do. > Looks good. Thanks for the review! -Stolee