Article View: linux.kernel.git
Article #4260Re: [PATCH] delta-islands: revisit trees with new delta marks
From: Derrick Stolee
Date: Wed, 02 Dec 2026 19:53
Date: Wed, 02 Dec 2026 19:53
126 lines
16576 bytes
16576 bytes
On 12/2/2026 2:14 PM, Elijah Newren wrote:
> On Mon, Nov 30, 2026 at 11:25 AM Derrick Stolee via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> From: Derrick Stolee <stolee@gmail.com>
>>
>> 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 <dstolee@microsoft.com>
>
> 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
Technical Details
Message-ID:
<6bcf9997-068e-45f3-b737-9df430671de1@gmail.com>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-76897-linux-kernel-git=dewy.ruReferences:
<pull.2343.git.1796066735611.gitgitgadget@gmail.com> <CABPp-BEzyAq6a=uq9-sOsAXFYjHdrga99+QauGxbkkTnOjLaGw@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-76897-linux-kernel-git=dewy.ru
From: stolee@gmail.com (Derrick Stolee)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] delta-islands: revisit trees with new delta marks
Date: Wed, 2 Dec 2026 14:53:01 -0500
Organization: Usenet Network
Message-ID: <6bcf9997-068e-45f3-b737-9df430671de1@gmail.com>
References: <pull.2343.git.1796066735611.gitgitgadget@gmail.com>
<CABPp-BEzyAq6a=uq9-sOsAXFYjHdrga99+QauGxbkkTnOjLaGw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2045867"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:AYOMJCFBRPlYGj5HWO5QSlTKGvc= sha256:iwURjG6sD4bc3PMrPhLBJeGSW33ThVfzWd34WS/ozoU=
sha1:jYDmrJTTtXC1TbPXlNNlyKQYA/U= sha256:BTS8P9Ww+jUjXrMD1GtdEY8Sah/yCaNrP1JTd7XvHmo=
Content-Language: en-US
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id C796C117710; Wed, 2 Dec 2026 22:53:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id Ob7pqYTYfiq7;
Wed, 2 Dec 2026 22:53:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76897-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 795341176F8; Wed, 2 Dec 2026 22:53:07 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 43AA52B8DC; Wed, 2 Dec 2026 19:53:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796241185;
b=LWxdNCLaRb6TEEOLsocL5nhA7W2mPEgAOuyXHyZAlwWmeErpCc/+hwmk/zN5yL9iOLki
YVoffB112vPy7Ux5W3FzxNSYQNfXx/wo+/i1+MrEqqX/IsrToCcq0nWAw3+WqqLsc7YSS
vlieJqr+SBSkgYgGWajqkY+R/+XPbXfcSQ8Rlp0k5bOWtNqEQ81ZiLxAyPS7NxDwt+RkE
pu1ntUCyhjGk/QKHfHo/dJkONafIXze5FHy7d8T9m8K3tImYv/YFmFIX5kFXSABNGUKfC
KqHThs3tl5A192AwSPWD2E0nEDFlfczvjbdUp5+9nqM0RCULVrKLZ5ms5z0O4IxkAnQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796241185;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
Content-Type:Content-Transfer-Encoding;
bh=srVfe+Xe2tlDv4MSlBuhJLM0Vc2pEOdNgHgbXQNyrSU=;
b=BXVNWtRI3TmuZG6CROc1gLbXDPZ9IZYezGiyytJbUH+3VVdHR1AbJR9T7dB+5UPJT3Hr
IfnqeL2s3rqWFEoz2Vvav9U8d5DPPcyOewTByxXgrU1XXXH26ntq3h35N6cY1mGSgME0k
cVP1lMvWX5kdzVA6aJJtJdsEWfI94qHo3eqP5A56eNvYm0IOfdEDRES/Q0ijZaIhW1vGw
9l+SnyMM5GGcV5h8i5v3GhCWVwGjBkpM5zUdiFQSHgbnpVh3yGJtsSD+KktUOb5tD+Uyl
LjDbnBHvg9FootK3Oy8n6CRLrVVAAajCIvLsLDjpI2mYWMFUP7VgWNauXr2l7f9/hyw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=vdX0fnLG;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 17639606A32C;
Wed, 2 Dec 2026 19:53:05 +0000 (UTC)
X-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
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.45
X-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==
X-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==
X-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
X-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 <git@vger.kernel.org>; Wed, 2 Dec 2026 19:53:03 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D77E6606A336
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-921d253bb28so1356806d6.1
for <git@vger.kernel.org>; Wed, 02 Dec 2026 11:53:03 -0800 (PST)
X-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)
X-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)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: git@vger.kernel.org, gitster@pobox.com, peff@peff.net, ttaylorr@openai.com
X-In-Reply-To: <CABPp-BEzyAq6a=uq9-sOsAXFYjHdrga99+QauGxbkkTnOjLaGw@mail.gmail.com>